proj home

Files   Classes   Functions   Hierarchy  

vispointxml Class Reference

Options to point3. More...

#include <vispointxml.h>

Inheritance diagram for vispointxml:
Collaboration diagram for vispointxml:

List of all members.

Public Member Functions

void handlecommand (bool &matches, viscmd &c)
 Possibly run the command.
stringc id () const
 Command name.
void defaultsettings ()
void piaddpoint (bool &res, stringc &s)
 Interpret string expecting three numbers.
 vispointxml ()

Public Attributes

pt3 color
 Default point color.
bool colorrandom
 Randomly color points.
bool pointdisplay
gobjQuadricsphere01
 Main point geometry representation.


Detailed Description

Options to point3.

Definition at line 15 of file vispointxml.h.


Constructor & Destructor Documentation

vispointxml::vispointxml (  ) 

Definition at line 4 of file vispointxml.cpp.

References defaultsettings().

00005   : sphere01(0)
00006 {
00007   defaultsettings();
00008 }


Member Function Documentation

void vispointxml::defaultsettings (  ) 

Definition at line 10 of file vispointxml.cpp.

References color, colorrandom, gobjQuadric::loops, pointdisplay, gobjQuadric::radius, visoperator::set(), gobjQuadric::slices, sphere01, and visoperator::ve.

Referenced by vispointxml().

00011 {
00012   colorrandom=false;
00013   pointdisplay=false;
00014   color=pt3(1.0,0.0,1.0);
00015 
00016   if (sphere01==0)
00017   {
00018     sphere01 = new gobjQuadric();
00019 
00020     sphere01->radius = 0.05;
00021     sphere01->slices = 30;
00022     sphere01->loops = 7;
00023   }    
00024 
00025   visoperator::set(*this);
00026 
00027   assert(ve!=0);
00028 }

void vispointxml::handlecommand ( bool matches,
viscmd c 
) [virtual]

Possibly run the command.

Implements visoperator.

Definition at line 61 of file vispointxml.cpp.

References viscmd::arg, color, colorrandom, viscmd::command, randomgenerator::domain(), commandline::mapvar(), pointdisplay, point3< T >::serializeInverse(), viscmd::valid, visoperator::ve, and visoperator::vp.

00062 {
00063   assert(ve!=0);
00064   assert(vp!=0);
00065   assert(this==vp);
00066 
00067   matches=false;
00068   if (c.command != this->id())
00069     return;
00070   matches=true;
00071 
00072   bool res=true;
00073   commandline cmd(c.arg);
00074 
00075   cmd.mapvar(pointdisplay,"display");
00076   cmd.mapvar(colorrandom,"colorrandom");
00077 
00078   string colorrgb;
00079   cmd.mapvar(colorrgb,"colorrgb");
00080   if (colorrgb.empty()==false)
00081   {
00082     pt3 p;
00083     p.serializeInverse(colorrgb);
00084     p /= 255.0;
00085     if (randomgenerator::domain(p))
00086       color=p;
00087     else
00088       res=false;
00089   }
00090 
00091   c.valid=res; 
00092 }

stringc vispointxml::id (  )  const [inline, virtual]

Command name.

Implements visoperator.

Definition at line 34 of file vispointxml.h.

00035     { return string("pointxml"); }

void vispointxml::piaddpoint ( bool res,
stringc s 
)

Interpret string expecting three numbers.

Definition at line 31 of file vispointxml.cpp.

References color, colorrandom, gobjpush, visenv::pi, pointdisplay, point3< T >::serializeInverse(), sphere01, and visoperator::ve.

Referenced by vispoint3::handlecommand(), and vispoint2::handlecommand().

00032 {
00033 //cout << SHOW(s) << endl;
00034   pt3 p;
00035   p.serializeInverse(s);
00036 //cout << SHOW(p) << endl;
00037   res=true;
00038   assert(ve);
00039   ve->pi.push_back(p);
00040 //pointdisplay=true;
00041   if (pointdisplay)
00042   {
00043     if (colorrandom==false)
00044     {
00045       gobjpush( new gobjglColor3d(color) );
00046     }
00047     else
00048     {
00049       gobjpush( new gobjglColor3d(randompoint<>().makepoint3()) );
00050     }
00051     
00052     //gobjpush( new gobjglColor3f(1.0,0.0,0.0) );
00053     gobjpush
00054     ( 
00055       new gobjMySphereDraw(p,sphere01)
00056 //      new gobjMySphereDraw(p.x,p.y,p.z,sphere01)
00057     );
00058   }
00059 }


Member Data Documentation

Default point color.

Definition at line 22 of file vispointxml.h.

Referenced by defaultsettings(), handlecommand(), and piaddpoint().

Randomly color points.

Definition at line 25 of file vispointxml.h.

Referenced by defaultsettings(), handlecommand(), and piaddpoint().

Definition at line 28 of file vispointxml.h.

Referenced by defaultsettings(), handlecommand(), and piaddpoint().

Main point geometry representation.

Definition at line 31 of file vispointxml.h.

Referenced by defaultsettings(), and piaddpoint().


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

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