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

Timestep Class Reference

Timestep contains the loaded Tetrahedrons and the state of all flags. More...

#include <Timestep.h>

List of all members.

Public Methods

 Timestep ()
 constructor. More...

Timestep & operator= (const Timestep &obj)
void calc_and_move ()
 determine the center of all the tetrahedrons. More...

void display_wire (unsigned int)
void display_point (unsigned int)
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)
 draw all the polygons. More...

void showlabels ()
 show coordinate labels. More...

void showlengths ()
 show edge lengths at the midpoint of each edge. More...

bool loadfile (const char *filename, GLfloat *tetcolor, unsigned int step, unsigned int chunk)
 load a tetrahedron data file. More...

void dump ()
 dump the points. More...

vector< Coordinateget_points ()
 yeild up copy of our points. More...

void set_random_color (vector< Coordinate > randompoints)
 set the randomvector points to the color values in randompoints. More...

void display (unsigned int cmap, bool wire, bool pointmode, unsigned int fillpoly, int chunk)
 display the tetrahedrons using the cmap color scheme with wireframe. More...


Private Attributes

vector< GLdouble > vertexarray
vector< GLfloat > pointcolor
 the drawarray. More...

vector< GLfloat > chunkcolor
 point color array. More...

vector< GLfloat > linecolor
 chunk color array r,g,b +i. More...

vector< GLfloat > randomcolor
 wire line color array. More...

vector< Coordinatepoints
 random color array. More...

vector< Midpointmidpoints
 array of unique coordinates. More...

map< unsigned int, pair< unsigned
int, unsigned int > > 
chunkmap
 array of unique edge midpoints. More...

double radius
 map of chunk offsets and lengths in the drawarray. More...

unsigned int step
 max dimension of the tetras. More...


Detailed Description

Timestep contains the loaded Tetrahedrons and the state of all flags.

Does all the actual work of loading and displaying the tetrahedrons.

Definition at line 54 of file Timestep.h.


Constructor & Destructor Documentation

Timestep::Timestep   [inline]
 

constructor.

Definition at line 70 of file Timestep.h.

References radius.


Member Function Documentation

void Timestep::calc_and_move  
 

determine the center of all the tetrahedrons.

calculates the center for use as a translation and rotation point. calculates the width of all tetras in x,y,z to set the view. moves all points to new origin center.

These two operations are combined in one function to avoid carrying around the otherwise useless max,min, etc variables

Definition at line 283 of file Timestep.C.

References Midpoint::get_mx, Midpoint::get_my, Midpoint::get_mz, Coordinate::get_x, Coordinate::get_y, Coordinate::get_z, midpoints, points, radius, Midpoint::set_mx, Midpoint::set_my, Midpoint::set_mz, Coordinate::unsafe_set, and vertexarray.

void Timestep::display unsigned int    cmap,
bool    wire,
bool    pointmode,
unsigned int    fillpoly,
int    chunk
 

display the tetrahedrons using the cmap color scheme with wireframe.

draws the polygons assuming fill, then draw a line poly over it. can interact oddly with non fill mode. cmap must be 0,1,2

Definition at line 343 of file Timestep.C.

References chunkcolor, chunkmap, linecolor, pointcolor, randomcolor, and vertexarray.

Referenced by draw_polygons.

void Timestep::display_point unsigned    int
 

void Timestep::display_wire unsigned    int
 

void Timestep::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    wire,
bool    pointmode,
int    chunk
 

draw all the polygons.

do any necessary rotatation and scaling draw all the polygons enact any changes such as opaque, point view, fill, and colormap cycle translate so tet center will be at origin. perform rotation, scale draw move camera for viewability

Definition at line 59 of file Timestep.C.

References display, radius, showlabels, showlengths, and step.

void Timestep::dump   [inline]
 

dump the points.

Definition at line 96 of file Timestep.h.

References Coordinate::dump, and points.

vector<Coordinate> Timestep::get_points   [inline]
 

yeild up copy of our points.

Definition at line 101 of file Timestep.h.

References points.

bool Timestep::loadfile const char *    filename,
GLfloat *    tetcolor,
unsigned int    timestep,
unsigned int    chunk
 

load a tetrahedron data file.

Filename is the (path included) string of the file to load. Format of the filename should be baseChunknum.Timestamp where Chunknum and Timestamp are integers. E.g dbg_msh1.1. Loading multiple chunks at one timestep is best done with shell wildcards. Such as: dbg_msh[0-9]*.1 or even just dbg_msh* if you want access to all chunks and timestamps.

Tetcolor is a glfloat[3] with the colors of the chunk this file represents.

datafile layout is x y z r g b x y z r g b ... x y z r g b foo c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 ... c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 where x y z are double, r g b are float c1-c12 are integers ... means as many lines of the preceding format as you like. x,y,z are the coordinates of the vertex and r,g,b is its color c1-12 are integer indexical references to the preceding vertices counting from 0

Definition at line 176 of file Timestep.C.

References chunkcolor, chunkmap, Coordinate::get_b, Coordinate::get_g, Coordinate::get_r, Coordinate::get_x, Coordinate::get_y, Coordinate::get_z, linecolor, midpoints, pointcolor, points, step, and vertexarray.

Timestep& Timestep::operator= const Timestep &    obj [inline]
 

Definition at line 74 of file Timestep.h.

References chunkcolor, linecolor, midpoints, pointcolor, points, radius, randomcolor, and vertexarray.

void Timestep::set_random_color vector< Coordinate   randompoints
 

set the randomvector points to the color values in randompoints.

Definition at line 440 of file Timestep.C.

References CoordIterPair, Coordinate::edump, randomcolor, and vertexarray.

void Timestep::showlabels  
 

show coordinate labels.

shows the label "id x, y, z" each point using Outputstring3 on label

Definition at line 429 of file Timestep.C.

References OutputString3, and points.

Referenced by draw_polygons.

void Timestep::showlengths  
 

show edge lengths at the midpoint of each edge.

shows the length of each edge using Outputstring3 on the midpoint length label vector

Definition at line 416 of file Timestep.C.

References midpoints, and OutputString3.

Referenced by draw_polygons.


Member Data Documentation

vector< GLfloat > Timestep::chunkcolor [private]
 

point color array.

Definition at line 59 of file Timestep.h.

Referenced by display, loadfile, and operator=.

map<unsigned int, pair <unsigned int, unsigned int> > Timestep::chunkmap [private]
 

array of unique edge midpoints.

Definition at line 64 of file Timestep.h.

Referenced by display, and loadfile.

vector< GLfloat > Timestep::linecolor [private]
 

chunk color array r,g,b +i.

Definition at line 60 of file Timestep.h.

Referenced by display, loadfile, and operator=.

vector< Midpoint > Timestep::midpoints [private]
 

array of unique coordinates.

Definition at line 63 of file Timestep.h.

Referenced by calc_and_move, loadfile, operator=, and showlengths.

vector< GLfloat > Timestep::pointcolor [private]
 

the drawarray.

Definition at line 58 of file Timestep.h.

Referenced by display, loadfile, and operator=.

vector< Coordinate > Timestep::points [private]
 

random color array.

Definition at line 62 of file Timestep.h.

Referenced by calc_and_move, dump, get_points, loadfile, operator=, and showlabels.

double Timestep::radius [private]
 

map of chunk offsets and lengths in the drawarray.

Definition at line 65 of file Timestep.h.

Referenced by calc_and_move, draw_polygons, operator=, and Timestep.

vector< GLfloat > Timestep::randomcolor [private]
 

wire line color array.

Definition at line 61 of file Timestep.h.

Referenced by display, operator=, and set_random_color.

unsigned int Timestep::step [private]
 

max dimension of the tetras.

Definition at line 66 of file Timestep.h.

Referenced by draw_polygons, and loadfile.

vector< GLdouble > Timestep::vertexarray [private]
 

Definition at line 57 of file Timestep.h.

Referenced by calc_and_move, display, loadfile, operator=, and set_random_color.


The documentation for this class was generated from the following files:
Generated on Wed Oct 29 10:01:53 2003 for Tetraviewer by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002