proj home

Files   Classes   Functions   Hierarchy  

myRotate Class Reference

Rotate. More...

#include <graphmisc.h>

Inheritance diagram for myRotate:
Collaboration diagram for myRotate:

List of all members.

Public Member Functions

 myRotate (point3< double > const &axis_)
void draw ()
 Draw the object.

Public Attributes

point3< double > axis

Static Public Attributes

static point3< double > const zaxis


Detailed Description

Rotate.

Definition at line 49 of file graphmisc.h.


Constructor & Destructor Documentation

myRotate::myRotate ( point3< double > const &  axis_  )  [inline]

Definition at line 55 of file graphmisc.h.

00056     : axis(axis_) {}


Member Function Documentation

void myRotate::draw (  )  [inline, virtual]

Draw the object.

Implements gobj.

Definition at line 60 of file graphmisc.h.

References axis, point3< T >::distance(), point3< T >::dot(), crossproduct::evalxyz(), GOBJDEBUGCODE, point3< T >::x, point3< T >::y, point3< T >::z, and zaxis.

00061   {
00062     GOBJDEBUGCODE
00063     if (axis!=zaxis)
00064     {
00065       assert(axis!=point3<double>(0,0,0));
00066 
00067       point3<double> N;
00068       crossproduct::evalxyz(N,zaxis,axis);
00069 
00070       double angle = acos( axis.dot(zaxis) / axis.distance() );
00071       angle *= 180.0/PI;
00072       glRotated(angle,N.x,N.y,N.z);
00073     }
00074   }


Member Data Documentation

Definition at line 53 of file graphmisc.h.

Referenced by draw().

point3< double > const myRotate::zaxis [static]

Definition at line 58 of file graphmisc.h.

Referenced by draw().


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

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