proj home

Files   Classes   Functions   Hierarchy  

d3tessdraw Class Reference

Draw a simplex mesh including visual options. More...

#include <d3tessdraw.h>

Inheritance diagram for d3tessdraw:
Collaboration diagram for d3tessdraw:

List of all members.

Public Types

enum  {
  points = 0, simplexes = 1, multicolor = 2, voronoi = 3,
  winding = 0, grid = 1, cp = 2, surface = 3,
  circle = 4, circles = 5, voronoip = 6
}

Public Member Functions

 d3tessdraw (d3tess &tess_)
 The options of configuring what things to display are through the gobjSwichContianer's after this class is constructed.
void draw ()
 Draws and iterates over all the tetrahedrons.
void meshupdate ()
 When the mesh changes the scene graph is recalculated.

Public Attributes

d3tesstess
gobjContainer gdynamic
gobjContainerSwitch graphicsDeffered
 The gobj's write new gobj's when draw() is called.
gobjContainerSwitch graphicsImmediate
 draw() writes standard OpenGL or immediately evaluated openGL calls.


Detailed Description

Draw a simplex mesh including visual options.

For drawing the mesh, mesh surface, current state and the mesh winding can be displayed.

Example
#include <d3tessdraw.h>

mesh = new d3tess(N);
d3tessdraw *meshdraw = new d3tessdraw(*mesh);

meshdraw->graphicsDeffered.vi[d3tessdraw::multicolor]->isdrawn = true;
meshdraw->graphicsDeffered.vi[d3tessdraw::points]->isdrawn = true;
meshdraw->graphicsDeffered.vi[d3tessdraw::simplexes]->isdrawn = true;

meshdraw->meshupdate();

Definition at line 30 of file d3tessdraw.h.


Member Enumeration Documentation

anonymous enum

Enumerator:
points  Deffered.
simplexes 
multicolor 
voronoi 
winding  Immediate.
grid 
cp 
surface 
circle 
circles 
voronoip 

Definition at line 39 of file d3tessdraw.h.

00040   { 
00042     points=0,         // Number the points.
00043     simplexes=1,      // Number the triangles.
00044     multicolor=2,     // Randomly color the tessellation.
00045     voronoi=3,        // Voronoi Diagram.
00047     winding=0,        // Draw each simplices winding.
00048     grid=1,           // Draw the mesh.
00049     cp=2,             // Draw the cp.
00050     surface=3,        // Draw the surface.
00051     circle=4,         // Draw a circle through three point of cp.
00052     circles=5,        // Draw circles through all simplices.
00053     voronoip=6        // Draws voronoi polygons at base.
00054   };


Constructor & Destructor Documentation

d3tessdraw::d3tessdraw ( d3tess tess_  ) 

The options of configuring what things to display are through the gobjSwichContianer's after this class is constructed.

Definition at line 717 of file d3tessdraw.cpp.

References graphicsDeffered, graphicsImmediate, meshupdate(), gobjContainerSwitch::push(), and tess.

00718   : tess(tess_), gdynamic(true), graphicsDeffered(true),
00719     graphicsImmediate(true)
00720 {
00721   //gobjContainer::global->push_back(&gdynamic);
00722 
00723   graphicsDeffered.push(new writepointsobj(tess));
00724   graphicsDeffered.push(new writesimplicesobj(tess));
00725   graphicsDeffered.push(new writemulticolorobj(tess));
00726   graphicsDeffered.push(new writevoronoidiagramobj(tess));
00727 
00728   graphicsImmediate.push(new writewindingobj(tess));
00729   graphicsImmediate.push(new writegridobj(tess));
00730   graphicsImmediate.push(new writecpobj(tess));
00731   graphicsImmediate.push(new writesurfaceobj(tess));
00732   graphicsImmediate.push(new writecpcircleobj(tess));
00733   graphicsImmediate.push(new writecirclesobj(tess));
00734   graphicsImmediate.push(new writecpvoronoiobj(tess));
00735 
00736   glDisable(GL_DEPTH_TEST);
00737   glEnable(GL_BLEND);
00738   glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
00739 
00740   meshupdate();
00741 }


Member Function Documentation

void d3tessdraw::draw (  )  [virtual]

Draws and iterates over all the tetrahedrons.

Implements gobj.

Definition at line 744 of file d3tessdraw.cpp.

References gobjContainer::draw(), gobjContainerSwitch::draw(), gdynamic, and graphicsImmediate.

Referenced by display(), and d3meshpartitiondraw::draw().

00745 {
00746   
00747   glPushAttrib(GL_CURRENT_BIT);
00748   glPushAttrib(GL_LIGHTING_BIT);
00749 
00750   graphicsImmediate.draw();
00751   gdynamic.draw();
00752 
00753   glPopAttrib();
00754   glPopAttrib();
00755 }

void d3tessdraw::meshupdate (  ) 

When the mesh changes the scene graph is recalculated.

Definition at line 698 of file d3tessdraw.cpp.

References gobjContainerSwitch::draw(), gdynamic, gobj::global, graphicsDeffered, gobjContainer::nuke(), and gobjContainer::set().

Referenced by d3meshpartitiondraw::d3meshpartitiondraw(), d3tessdraw(), displaymenu(), keyboard(), main(), mainmenu(), d3meshpartitiondraw::rotate(), searchexp01(), test01obj< P, PD >::test01obj(), timmingexperiment00(), and d3meshpartitiondraw::translate().

00699 {
00700   gdynamic.nuke();
00701 
00702   assert(gobjContainer::global!=0);
00703   // Save the current global graphics stream.
00704   gobjContainer & g(*gobjContainer::global);
00705 
00706   // Make this the new graphics stream.
00707   gdynamic.set();
00708 
00709   // Writes all the graphics to gobjContainer::global
00710   graphicsDeffered.draw();  
00711 
00712   // Restore global graphics stream.
00713   g.set();
00714 }


Member Data Documentation

Definition at line 37 of file d3tessdraw.h.

Referenced by draw(), and meshupdate().

The gobj's write new gobj's when draw() is called.

ie write to gobjContainer::global

Definition at line 58 of file d3tessdraw.h.

Referenced by d3meshpartitiondraw::d3meshpartitiondraw(), d3tessdraw(), displaymenu(), main(), meshupdate(), and test01obj< P, PD >::test01obj().

draw() writes standard OpenGL or immediately evaluated openGL calls.

Definition at line 61 of file d3tessdraw.h.

Referenced by d3tessdraw(), displaymenu(), draw(), and main().


The documentation for this class was generated from the following files:

Generated on Fri Mar 4 00:49:54 2011 for Chelton Evans Source by  doxygen 1.5.8