00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
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 
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