Files Classes Functions Hierarchy
#include <graphmisc.h>
Public Member Functions | |
| void | radiusset (doublec radius) |
| template<typename T > | |
| gobjMyCircleDraw (point3< T > const ¢er_, gobjMyCircle const &cir_) | |
| Pass in a center point and a sampled circle. | |
| template<typename T > | |
| gobjMyCircleDraw (point2< T > const ¢er_, gobjMyCircle const &cir_) | |
| Pass in a center point and a sampled circle. | |
| template<typename T > | |
| gobjMyCircleDraw (doublec radius, point3< T > const ¢er_, gobjMyCircle const &cir_) | |
| Pass in a center point and a sampled circle. | |
| template<typename T > | |
| gobjMyCircleDraw (doublec radius, point3< T > const ¢er_, point3< T > const &axis_, gobjMyCircle const &cir_) | |
| Pass in a center point, an axis which the circle is draw about and a sampled circle. | |
| void | draw () |
| Draw a 2D circle in 3D space. | |
Public Attributes | |
| double | scalex |
| Multiplier of the x component of the circle cir. | |
| double | scaley |
| Multiplier of the y component of the circle cir. | |
| point3< double > | center |
| Translate to center before drawing. | |
| point3< double > | axis |
| The circles normal, by default is the z-axis. | |
| gobjMyCircle const & | cir |
| Many drawings can share a common circle as a reference. | |
Definition at line 693 of file graphmisc.h.
| gobjMyCircleDraw::gobjMyCircleDraw | ( | point3< T > const & | center_, | |
| gobjMyCircle const & | cir_ | |||
| ) | [inline] |
| gobjMyCircleDraw::gobjMyCircleDraw | ( | point2< T > const & | center_, | |
| gobjMyCircle const & | cir_ | |||
| ) | [inline] |
| gobjMyCircleDraw::gobjMyCircleDraw | ( | doublec | radius, | |
| point3< T > const & | center_, | |||
| gobjMyCircle const & | cir_ | |||
| ) | [inline] |
| void gobjMyCircleDraw::draw | ( | ) | [virtual] |
Draw a 2D circle in 3D space.
Implements gobj.
Definition at line 365 of file graphmisc.cpp.
References axis, center, cir, point3< T >::distance(), point3< T >::dot(), crossproduct::evalxyz(), GOBJDEBUGCODE, gobjMyCircle::N, gobjMyCircle::ptx, gobjMyCircle::pty, scalex, scaley, point3< T >::x, point3< T >::y, and point3< T >::z.
Referenced by display(), and graphicsImmediateDeferredTest::display01().
00366 { 00367 GOBJDEBUGCODE 00368 uintc const N(cir.N); 00369 float * const ptx(cir.ptx); 00370 float * const pty(cir.pty); 00371 00372 glPushMatrix(); 00373 00374 glTranslatef(center.x,center.y,center.z); 00375 00376 if (axis!=zaxis) 00377 { 00378 assert(axis!=point3<double>(0,0,0)); 00379 00380 point3<double> N; 00381 crossproduct::evalxyz(N,zaxis,axis); 00382 00383 double angle = acos( axis.dot(zaxis) / axis.distance() ); 00384 angle *= 180.0/PI; 00385 glRotated(angle,N.x,N.y,N.z); 00386 } 00387 00388 //glBegin(GL_LINE_LOOP); 00389 glBegin(GL_LINE); 00390 00391 if ( (scalex==1.0)&&(scaley==1.0)) 00392 { 00393 for (uint i=0; i<N-1; ++i) 00394 { 00395 glVertex2f(ptx[i],pty[i]); 00396 glVertex2f(ptx[i+1],pty[i+1]); 00397 } 00398 } 00399 else 00400 { 00401 for (uint i=0; i<N-1; ++i) 00402 { 00403 glVertex2f(ptx[i]*scalex,pty[i]*scaley); 00404 glVertex2f(ptx[i+1]*scalex,pty[i+1]*scaley); 00405 } 00406 } 00407 //glVertex2f(ptx[i]*radius,pty[i]*radius); 00408 00409 glEnd(); 00410 00411 glPopMatrix(); 00412 }
| void gobjMyCircleDraw::radiusset | ( | doublec | radius | ) | [inline] |
Definition at line 712 of file graphmisc.h.
References scalex, and scaley.
Referenced by diskinttest::update02(), and diskinttest::update03lineline().
| point3<double> gobjMyCircleDraw::axis |
The circles normal, by default is the z-axis.
Definition at line 707 of file graphmisc.h.
Referenced by draw(), diskinttest::update01(), diskinttest::update02(), and diskinttest::update03lineline().
| point3<double> gobjMyCircleDraw::center |
Translate to center before drawing.
Definition at line 704 of file graphmisc.h.
Referenced by draw(), diskinttest::update01(), diskinttest::update02(), and diskinttest::update03lineline().
Many drawings can share a common circle as a reference.
Definition at line 710 of file graphmisc.h.
Referenced by draw().
| double gobjMyCircleDraw::scalex |
Multiplier of the x component of the circle cir.
Definition at line 699 of file graphmisc.h.
Referenced by draw(), and radiusset().
| double gobjMyCircleDraw::scaley |
Multiplier of the y component of the circle cir.
Definition at line 701 of file graphmisc.h.
Referenced by draw(), and radiusset().
1.5.8