/****************************************************************** * * * Nest version 2 - 3D Wasp Nest Simulator * * Copyright (C) 1997 Sylvain GUERIN * * LIASC, ENST Bretagne & Santa Fe Institute * * * ****************************************************************** E-mail: Sylvain.Guerin@enst-bretagne.fr or: Sylvain Guerin 13 rue des Monts Lorgeaux, 51460 L'EPINE, FRANCE ****************************************************************** This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ****************************************************************** Name : MainInt.h Component : main interface Fonctionality : contains specifications refering to the main interface ******************************************************************/ #ifndef __MainInterface_H #define __MainInterface_H #include "graphical.h" #include "algo.h" #include "simu.h" #include "ViewInt.h" #include "EditInt.h" #include "EvalInt.h" #include "NetInt.h" #include "GenInt.h" #include "TitleInt.h" #include "config.h" #include "genetic.h" #include "file.h" /* ces classes sont utilisees dans la declaration de la classe MainInterface, alors on les met ici */ class GeneticSimulation; class GeneticInterface; class DeferedSimuList; extern FileDatas* fileDatas; /* et c'est parti pour la declaration */ class MainInterface : public Interface { public: /* constructeur et destructeur */ MainInterface (int x0, int y0); virtual ~MainInterface (); /* la methode qui permet la gestion de l'interface */ void manageWindow (); /* la methode pour gerer les simu genetiques meme quand il ne se passe rien */ void manageGeneticAlarm (); /* le rafraichissement automatique ? */ void refresh (); /* des methodes internes utiles */ void manageOptions (); void manageNet (); void manageGenetic (); void manageLoadOpen (); void manageLoadClose (unsigned int res); void manageDialogBoxClose (unsigned int res); void manageSave (); void manageLoadStep (); void manageClean (); void manageEdit (); void manageCreate (); void manageSimulation (); ViewInterface* openNewViewInterface (int simulationIndex); void manageView (); void manageEvaluate (); void manageSimuParameters (); int manageExit (); /* toutes les donnees a stocker */ Net* net; ArrayContent* simulationsContent; Simulation* simulations[maxSimulations]; unsigned int simulationsNb; int editedArchSize; /* taille de l'architecture */ double editedNoiseRate; /* tolerance au bruit */ int editedIterationsNumber; /* nombre d'iterations */ int editedMaxCells; /* nombre max de briques */ Enumeration editedShowConstructionEnum; /* visualisation "temps reel" */ int editedShowCellsSteps; /* pas d'affichage */ Enumeration editedAutoLearning; /* auto learning ? */ int editedAllowedFails; /* nombres d'echecs autorises */ GeneticInterface* geneticInterface; GeneticSimulation* geneticSimulation; int geneticSimulationSet; NetInterface* netInterface; int netInterfaceDisplayed; int geneticRunning; char currentPath[256]; int timeOut; DeferedSimuList* deferedSimuList; Boolean geneticEdition; protected: Enumeration fitnessTypeEnum; Enumeration simulationTypeEnum; Enumeration randomGenerationTypeEnum; Enumeration fileFormatEnum; Enumeration archMustBeSavedEnum; Enumeration previewMustBeSavedEnum; Enumeration mustBeCompressedEnum; /* les objets graphiques de la fenetre */ ViewInterface* viewInterface[maxViewInterfaces]; int viewSimulationIndex[maxViewInterfaces]; /* index de simu visualisee, -1 si libre */ EditInterface* editInterface[maxEditInterfaces]; int editSimulationIndex[maxEditInterfaces]; /* index de simu editee, -1 si libre */ EvalInterface* evalInterface[maxEvalInterfaces]; int evalSimulationIndex[maxEditInterfaces]; /* index de simu evaluee, -1 si libre */ TitleInterface* titleInterface; int isTitleInterfaceDisplayed; FileSelector* fileSelector; int isFileSelectorInterfaceDisplayed; Button* exitButton; Button* configButton; Button* netButton; Button* geneticButton; Button* infosButton; RoundPanel* dialogPanel; TextWidget* dialogText1; TextWidget* dialogText2; TextWidget* dialogText3; TextWidget* dialogText4; TextWidget* dialogText5; TextWidget* dialogText6; Button* loadButton; Button* saveButton; Button* loadStepButton; Button* cleanButton; Button* editButton; Button* createButton; Button* simulationButton; Button* viewButton; Button* evaluateButton; Button* parametersButton; TextWidget* simulationsArrayTitle; ArrayWindow* simulationsArray; /* fenetre de previsualisation de la simulation */ GraphicWindow* previewWindow; /* Pixmap representant l'icone en couleurs */ Pixmap waspPixmap; int showLoadedPreviews; char scrollText[6][80]; int viewInterfacesDisplayedNumber; int editInterfacesDisplayedNumber; int evalInterfacesDisplayedNumber; int geneticInterfaceDisplayed; void displayNewText (char* aText); /* void getCurrentPath (); */ void loadNewFile (char* pathName, char* fileName); void manageNotSaved (); int returnSimuType (char* aPathName, char* aFileName, int* isCompressed, FileFormat* aFileFormat); /* return 0 when cubic, return 1 when hexa, -1 when wrong format, -2 when reading error, and set flag isCompressed */ void displayPreview (const int i); void loadPixmap (); }; #endif