proj home

Files   Classes   Functions   Hierarchy  

regionD2tessdisplaypoints< TS, Indx > Class Template Reference

Display the point and region indexes. More...

#include <regionD2tessdisplay.h>

Inheritance diagram for regionD2tessdisplaypoints< TS, Indx >:
Collaboration diagram for regionD2tessdisplaypoints< TS, Indx >:

List of all members.

Public Member Functions

 regionD2tessdisplaypoints (gobjContainer &gr_, TS &tess_)
 The graphics output and first link.
void draw ()
 Write the graphics as gobj objects.

Public Attributes

gobjContainergr
 Unprocessed graphics.
TS & tess
 The tesselation.
point3< float > pointcolor
 The color of the displayed points index.
point3< float > regioncolor
 The color of the polytopes index.
bool displaypoints
 Turn on or off the points index display.
bool displayregions
 Turn on or off the regions index display.


Detailed Description

template<typename TS, typename Indx>
class regionD2tessdisplaypoints< TS, Indx >

Display the point and region indexes.

Definition at line 45 of file regionD2tessdisplay.h.


Constructor & Destructor Documentation

template<typename TS , typename Indx >
regionD2tessdisplaypoints< TS, Indx >::regionD2tessdisplaypoints ( gobjContainer gr_,
TS &  tess_ 
) [inline]

The graphics output and first link.

Definition at line 82 of file regionD2tessdisplay.h.

00086   : gr(gr_), tess(tess_) 
00087 { 
00088   pointcolor=point3<float>(0.0,1.0,0.0);
00089   regioncolor=point3<float>(1.0,0.0,0.0);
00090   displaypoints=true;
00091   displayregions=true;
00092 }


Member Function Documentation

template<typename TS , typename Indx >
void regionD2tessdisplaypoints< TS, Indx >::draw (  )  [inline, virtual]

Write the graphics as gobj objects.

Implements gobj.

Definition at line 95 of file regionD2tessdisplay.h.

References regionD2tessdisplaypoints< TS, Indx >::displaypoints, regionD2tessdisplaypoints< TS, Indx >::displayregions, regionD2tessdisplaypoints< TS, Indx >::gr, regionD2tessdisplaypoints< TS, Indx >::pointcolor, gobjContainer::push(), regionD2tessdisplaypoints< TS, Indx >::regioncolor, pnlinkiter< Indx >::reset(), regionD2tessdisplaypoints< TS, Indx >::tess, point2< T >::x, and point2< T >::y.

Referenced by regionD2linkedtest::test02(), and regionD2linkedtest::test03().

00096 {
00097   if (displaypoints)
00098   {
00099     gr.push( new gobjglColor3f(pointcolor) );
00100     gr.push( new pointsdisplay2D< point2<double> >(gr,tess.pts,false,true));
00101   }
00102 
00103   if (displayregions)
00104   {
00105     vector< point2<float> > vicenter;
00106     for (Indx i=0; i<tess.vi.size(); ++i)
00107     {
00108       if (tess.vi[i].isnull())
00109       {
00110         vicenter.push_back( point2<float>() );
00111         continue;
00112       }
00113 
00114       uint count=0;
00115       point2<float> c(0.0,0.0);
00116       pnlinkiter<Indx> iter(tess.vi[i].start);
00117       iter.reset();
00118       do
00119       {
00120         c.x += tess.pts[iter->plink].x;
00121         c.y += tess.pts[iter->plink].y;
00122         ++count;
00123         ++iter;
00124       } while (!iter);
00125 
00126       assert(count!=0);
00127       c /= (double)count;
00128       vicenter.push_back(c);
00129     }
00130 
00131     gr.push( new gobjglColor3f(regioncolor) );
00132     gr.push( new pointsdisplay2D< point2<float> >(gr,vicenter,false,true));
00133   }
00134 }


Member Data Documentation

template<typename TS, typename Indx>
bool regionD2tessdisplaypoints< TS, Indx >::displaypoints

Turn on or off the points index display.

Definition at line 60 of file regionD2tessdisplay.h.

Referenced by regionD2tessdisplaypoints< TS, Indx >::draw().

template<typename TS, typename Indx>
bool regionD2tessdisplaypoints< TS, Indx >::displayregions

Turn on or off the regions index display.

Definition at line 63 of file regionD2tessdisplay.h.

Referenced by regionD2tessdisplaypoints< TS, Indx >::draw().

template<typename TS, typename Indx>
gobjContainer& regionD2tessdisplaypoints< TS, Indx >::gr

Unprocessed graphics.

Definition at line 50 of file regionD2tessdisplay.h.

Referenced by regionD2tessdisplaypoints< TS, Indx >::draw().

template<typename TS, typename Indx>
point3<float> regionD2tessdisplaypoints< TS, Indx >::pointcolor

The color of the displayed points index.

Definition at line 55 of file regionD2tessdisplay.h.

Referenced by regionD2tessdisplaypoints< TS, Indx >::draw().

template<typename TS, typename Indx>
point3<float> regionD2tessdisplaypoints< TS, Indx >::regioncolor

The color of the polytopes index.

Definition at line 57 of file regionD2tessdisplay.h.

Referenced by regionD2tessdisplaypoints< TS, Indx >::draw().

template<typename TS, typename Indx>
TS& regionD2tessdisplaypoints< TS, Indx >::tess

The tesselation.

Definition at line 52 of file regionD2tessdisplay.h.

Referenced by regionD2tessdisplaypoints< TS, Indx >::draw().


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

Generated on Fri Mar 4 00:50:12 2011 for Chelton Evans Source by  doxygen 1.5.8