proj home

Files   Classes   Functions   Hierarchy  

pointsdisplay3D< T > Class Template Reference

Draw and number the points. More...

#include <pointsdisplay.h>

Inheritance diagram for pointsdisplay3D< T >:
Collaboration diagram for pointsdisplay3D< T >:

List of all members.

Public Member Functions

 pointsdisplay3D (gobjContainer &gX, vector< T > const &pt, boolc drawpoints=true, boolc numberthepoints=true, boolc countfrom1=true)
 Turn on and off drawing and numbering.
 pointsdisplay3D (vector< T > const &pt, boolc drawpoints=true, boolc numberthepoints=true)
 Write to the global graphics stream.
void draw ()
 Dummy.

Public Attributes

gobjQuadricgq
 Access or vary properties, eg gq->radius.


Detailed Description

template<typename T>
class pointsdisplay3D< T >

Draw and number the points.

On construction the geometry is written into a gobj container. The class keeps a reference to the quadric object made.

Example
  typedef point3<double> pt3;
  vector< pt3 > v;
  ... - fill v
  pointsdisplay3D<pt3> dp(xGraphics,v);

Definition at line 34 of file pointsdisplay.h.


Constructor & Destructor Documentation

template<typename T >
pointsdisplay3D< T >::pointsdisplay3D ( gobjContainer gX,
vector< T > const &  pt,
boolc  drawpoints = true,
boolc  numberthepoints = true,
boolc  countfrom1 = true 
) [inline]

Turn on and off drawing and numbering.

Definition at line 121 of file pointsdisplay.h.

References gobjContainer::push().

00128   : gq(0)
00129 {
00130   uintc n(pt.size());
00131   vector<string> count;
00132 
00133   uint i0=0;
00134   if (countfrom1)
00135     i0=1;
00136 
00137   if (numberthepoints)
00138   {
00139     for (uint i=i0; i<n; ++i)
00140     {
00141       stringstream s;
00142       s << i;
00143       gX.push
00144       ( 
00145         new gobjMyBitmapCharacter
00146         (
00147           s.str(), 
00148           point3<float>(pt[i].x,pt[i].y,pt[i].z)
00149         )
00150       );
00151     }
00152   }
00153 
00154   if (drawpoints==false)
00155     return;
00156     
00157   gq = new gobjQuadric();
00158   gq->radius=.002;
00159   gX.push( gq );
00160 
00161   for (uint i=i0; i<n; ++i)
00162     gX.push( new gobjMySphereDraw(pt[i].x,pt[i].y,pt[i].z,gq) );
00163 }

template<typename T>
pointsdisplay3D< T >::pointsdisplay3D ( vector< T > const &  pt,
boolc  drawpoints = true,
boolc  numberthepoints = true 
) [inline]

Write to the global graphics stream.

Definition at line 53 of file pointsdisplay.h.

References gobj::global, and pointsdisplay3D< T >::pointsdisplay3D().

Referenced by pointsdisplay3D< T >::pointsdisplay3D().

00057     { *this=pointsdisplay3D(*gobj::global,pt,drawpoints,numberthepoints); };


Member Function Documentation

template<typename T>
void pointsdisplay3D< T >::draw (  )  [inline, virtual]

Dummy.

Implements gobj.

Definition at line 60 of file pointsdisplay.h.

References GOBJDEBUGCODE.

00060 { GOBJDEBUGCODE }


Member Data Documentation

template<typename T>
gobjQuadric* pointsdisplay3D< T >::gq

Access or vary properties, eg gq->radius.

Definition at line 39 of file pointsdisplay.h.


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

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