Files Classes Functions Hierarchy
#include <vispointxml.h>
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 |
| gobjQuadric * | sphere01 |
| Main point geometry representation. | |
Definition at line 15 of file vispointxml.h.
| vispointxml::vispointxml | ( | ) |
Definition at line 4 of file vispointxml.cpp.
References defaultsettings().
00005 : sphere01(0) 00006 { 00007 defaultsettings(); 00008 }
| 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 }
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] |
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 }
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().
1.5.8