Main Page   Namespace List   Compound List   File List   Compound Members   File Members  

Controller.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2003 Eric Bohm
00003  *
00004  *This program is free software; you can redistribute it and/or modify
00005  *it under the terms of the GNU General Public License as published by
00006  *the Free Software Foundation version 2 of the License.
00007  * 
00008  *This program is distributed in the hope that it will be useful, but
00009  *WITHOUT ANY WARRANTY; without even the implied warranty of
00010  *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011  *General Public License for more details.
00012  * 
00013  *You should have received a copy of the GNU General Public License along
00014  *with this program; if not, write to the Free Software Foundation, Inc.,
00015  *675 Mass Ave, Cambridge, MA 02139, USA.
00016  *
00017  */
00018 
00019 #ifndef IS_CONTROL_DEF_SIG
00020 #define IS_CONTROL_DEF_SIG 1
00021 
00025 using namespace std;
00026 #include "View.h"
00027 
00028 
00029 
00031 
00034 void menucallback(int x);
00035 void bcallback(muiObject *obj, enum muiReturnValue r);
00036 void chunkcallback(muiObject *obj, enum muiReturnValue r);
00037 void nochunkcallback(muiObject *obj, enum muiReturnValue r);
00038 
00039 void timecallback(muiObject *obj, enum muiReturnValue r);
00040 
00041 class Controller
00042 {
00043  private:
00044   int window;     
00045   muiObject *fill; 
00046   muiObject *colormap;  
00047   muiObject *showlabel;         
00048   muiObject *showlength;                
00049   muiObject *emphasis;                  
00050   muiObject *pointmode;         
00051   muiObject *nextstep;        
00052   muiObject *prevstep;        
00053   muiObject *stepentry;        
00054   muiObject *chunkentry;        
00055   muiObject *animate;        
00056   muiObject *reverseanimate;        
00057   muiObject *faster;        
00058   muiObject *slower;        
00059   muiObject *quit;        
00060   muiObject *timestep_label;        
00061   muiObject *selnochunk;        
00062   muiObject *selchunk;        
00063   muiObject *chunkbox_label;        
00064 
00065   muiObject *seltimebox_label;        
00066   muiObject *seltime;        
00067 
00068 
00069   int menu;        
00070  public:
00071   char timestring[80];  
00072   muiObject *timestep_number;        
00073   muiObject *chunkbox;        
00074   muiObject *seltimebox;        
00075 
00076   Controller () 
00077     {
00078     }
00079   
00080   Controller(int iwindow): window(iwindow)
00081     {
00082       // create the control window
00083       // initialize and bind the buttons
00084       muiNewUIList(window);
00085       snprintf(timestring,80,"%d",0);
00086       timestep_label=muiNewLabel(150,500,"Timestep");
00087       timestep_number=muiNewLabel(230,500,timestring);
00088       
00089 
00090       chunkbox_label=muiNewLabel(10,100,"Choose Chunk");
00091       chunkbox = muiNewTextbox(10, 100, 70);
00092       muiSetActive(chunkbox, 1);
00093 
00094       selchunk=muiNewRadioButton(120,70);
00095       muiLoadButton(selchunk,"Select Chunk");
00096       muiSetID(selchunk,'#');
00097       muiSetCallback(selchunk, chunkcallback);      
00098 
00099       selnochunk=muiNewRadioButton(120,40);
00100       muiLoadButton(selnochunk,"All Chunks");
00101       muiSetID(selchunk,'#');
00102       muiSetCallback(selnochunk, nochunkcallback);      
00103       muiLinkButtons(selchunk,selnochunk);
00104       muiSetActive(selnochunk,1);
00105 
00106       seltimebox_label=muiNewLabel(10,170,"Choose Time");
00107       seltimebox = muiNewTextbox(10, 100,140);
00108       muiSetActive(seltimebox, 1);
00109 
00110       seltime=muiNewButton(120,220,140,170);
00111       muiLoadButton(seltime,"Select Time");
00112       muiSetID(seltime,'f');
00113       muiSetCallback(seltime, timecallback);      
00114 
00115 
00116       fill=muiNewButton(10,200,210,235);
00117       muiLoadButton(fill,"Solid or Edge");
00118       muiSetID(fill,'f');
00119       muiSetCallback(fill, bcallback);      
00120 
00121 
00122       colormap=muiNewButton(10,200,240,265);
00123       muiLoadButton(colormap,"Colormap");
00124       muiSetID(colormap,'c');
00125       muiSetCallback(colormap, bcallback);      
00126 
00127       showlabel=muiNewButton(10,200,270,295);
00128       muiLoadButton(showlabel,"Show Vertex Label");
00129       muiSetID(showlabel,'l');
00130       muiSetCallback(showlabel, bcallback);      
00131 
00132       showlength=muiNewButton(10,200,300,325);
00133       muiLoadButton(showlength,"Show Edge Length");
00134       muiSetID(showlength,'e');
00135       muiSetCallback(showlength, bcallback);      
00136 
00137       emphasis=muiNewButton(10,200,330,355);      
00138       muiLoadButton(emphasis,"Emphasize edges");
00139       muiSetID(emphasis,'o');
00140       muiSetCallback(emphasis, bcallback);      
00141 
00142       pointmode=muiNewButton(10,200,360,385);
00143       muiLoadButton(pointmode,"Vertex only mode");
00144       muiSetID(pointmode,'v');
00145       muiSetCallback(pointmode, bcallback);      
00146 
00147       nextstep=muiNewButton(10,200,400,425);
00148       muiSetID(nextstep,'n');
00149       muiLoadButton(nextstep,"Next Time Step");
00150       muiSetCallback(nextstep, bcallback);      
00151 
00152       prevstep=muiNewButton(10,200,430,455);
00153       muiSetID(prevstep,'p');
00154       muiLoadButton(prevstep,"Prev Time Step");
00155       muiSetCallback(prevstep, bcallback);      
00156       
00157       animate=muiNewButton(240,350,400,425);
00158       muiLoadButton(animate,"Animate");
00159       muiSetID(animate,'a');
00160       muiSetCallback(animate, bcallback);      
00161 
00162       reverseanimate=muiNewButton(240,350,430,455);
00163       muiLoadButton(reverseanimate,"Reverse Animate");
00164       muiSetID(reverseanimate,'A');
00165       muiSetCallback(reverseanimate, bcallback);      
00166 
00167       quit=muiNewButton(10,50,10,40);
00168       muiLoadButton(quit,"Quit");
00169       muiSetID(quit,'q');
00170       muiSetCallback(quit, bcallback);      
00171 
00172       muiAttachUIList(1);
00173     }
00174   
00175   
00176 };
00177 
00178 
00179 #endif  //header wrap

Generated on Wed Oct 29 10:01:52 2003 for Tetraviewer by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002