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

Timestep.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 #ifndef IS_TIMESTEP_DEF_SIG
00019 #define IS_TIMESTEP_DEF_SIG 1
00020 
00030 using namespace std;
00031 #include <GL/gl.h>
00032 #include <GL/glu.h>
00033 #include <map>
00034 #include <vector>
00035 #include "Coordinate.h"
00036 #include "PointAverage.h"
00037 #include "Midpoint.h"
00038 //convenience typedefs
00039 typedef vector<Coordinate>::iterator CoordIter;
00040 
00041 typedef pair<CoordIter, CoordIter> CoordIterPair;
00042 
00043 
00044 
00046 typedef pair<unsigned int, unsigned int> chunk_delim;
00047 
00049 
00054 class Timestep
00055 {
00056  private:
00057   vector < GLdouble > vertexarray; 
00058   vector < GLfloat > pointcolor;   
00059   vector < GLfloat > chunkcolor;   
00060   vector < GLfloat > linecolor;    
00061   vector < GLfloat > randomcolor;  
00062   vector < Coordinate > points;    
00063   vector < Midpoint > midpoints;   
00064   map <unsigned int, pair <unsigned int, unsigned int> > chunkmap; 
00065   double radius;                   
00066   unsigned int step;  
00067  public:
00069 
00070   Timestep()
00071     {
00072       radius=1.0;
00073     }
00074   Timestep  & operator=(const Timestep & obj)
00075     {
00076       radius=obj.radius;
00077       vertexarray= obj.vertexarray;
00078       pointcolor=obj.pointcolor; 
00079       chunkcolor=obj.chunkcolor; 
00080       linecolor=obj.linecolor;  
00081       randomcolor=obj.randomcolor;
00082       points=obj.points;        
00083       midpoints=obj.midpoints;  
00084       return *this;
00085     }
00086 
00087   void calc_and_move();
00088   void display_wire(unsigned int);
00089   void display_point(unsigned int);
00090   void draw_polygons(GLdouble ScreenWidth, GLdouble ScreenHeight, unsigned int colormap,GLdouble aspect_ratio,GLdouble scale,GLdouble xtri,GLdouble ytri,GLdouble ztri,GLdouble xtran,GLdouble ytran,GLdouble ztran,unsigned int fillpoly, bool showlabel, bool showlength, bool opaque, bool pointmode,int chunk);
00091   void showlabels();
00092   void showlengths();
00093   bool loadfile(const char *filename, GLfloat * tetcolor,unsigned int step, unsigned int chunk);
00094 
00096   void dump()
00097     {
00098       for_each(points.begin(),points.end(),mem_fun_ref(&Coordinate::dump));
00099     } 
00101   vector <Coordinate> get_points()
00102     {
00103       return points;
00104     }
00106   void set_random_color(vector <Coordinate> randompoints);
00107 
00108   void display(unsigned int cmap,bool wire,bool pointmode, unsigned int fillpoly, int chunk);
00109   
00110 };
00111 
00112 
00113 #endif

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