proj home

Files   Classes   Functions   Hierarchy  

plotpolar Class Reference

#include <plotpolar.h>

Inheritance diagram for plotpolar:
Collaboration diagram for plotpolar:

List of all members.

Public Member Functions

void adddatapointsinPolarDegrees (vector< point2< double > > const &p)
 Insert the data points in (length,degrees) form.
void adddatapointsinPolarRadians (vector< point2< double > > const &p)
 Insert the data points in (length,radians) form.
void addpoints (uintc r, uintc g, uintc b)
 To display the points this adds the points to the graphics container.
void addcrosses (uintc r, uintc g, uintc b, doublec crosshairlength)
 Adds points as crosses to the graphics container.


Detailed Description

Definition at line 15 of file plotpolar.h.


Member Function Documentation

void plotpolar::addcrosses ( uintc  r,
uintc  g,
uintc  b,
doublec  crosshairlength 
)

Adds points as crosses to the graphics container.

Definition at line 79 of file plotpolar.cpp.

References pts, gobjContainer::push(), point2< T >::x, and point2< T >::y.

Referenced by plotpolartest::test01().

00085 {
00086   gobjContainer * c = new gobjContainer();
00087 
00088   c->push( new gobjglPushAttrib(GL_CURRENT_BIT) );
00089   c->push( new gobjglPushAttrib(GL_LIGHTING_BIT) );
00090   c->push( new gobjglDisable(GL_LIGHTING) );
00091 
00092   c->push( new gobjglColor3ub(r,g,b) );
00093 
00094   uintc sz = pts.size();
00095 
00096   doublec h = crosshairlength / 2.0;
00097  
00098   c->push( new gobjglBegin(GL_LINES) );
00099   for (uint i=0; i<sz; ++i)
00100   {
00101     point2<double> const & x(pts[i]);
00102     c->push( new gobjglVertex2f(x.x,x.y+h) );
00103     c->push( new gobjglVertex2f(x.x,x.y-h) );
00104     c->push( new gobjglVertex2f(x.x+h,x.y) );
00105     c->push( new gobjglVertex2f(x.x-h,x.y) );
00106   }
00107 
00108   c->push(new gobjglEnd());
00109 
00110   c->push( new gobjglPopAttrib() );
00111   c->push( new gobjglPopAttrib() );
00112 
00113   push(c);
00114 }

void plotpolar::adddatapointsinPolarDegrees ( vector< point2< double > > const &  p  ) 

Insert the data points in (length,degrees) form.

Definition at line 26 of file plotpolar.cpp.

References pts, point2< T >::x, and point2< T >::y.

00029 {
00030   pts.clear();
00031 
00032   double t;
00033   uintc sz = p.size();
00034   for (uint i=0; i<sz; ++i)
00035   {
00036     point2<double> const & z(p[i]);
00037     // Convert degrees to polar coordinates.
00038     t = z.y * PI / 180.0;
00039     // Convert polar to cartesian coordinates.
00040     pts.push_back( point2<double>(z.x*cos(t), z.x*sin(t)) );
00041   }
00042 }

void plotpolar::adddatapointsinPolarRadians ( vector< point2< double > > const &  p  ) 

Insert the data points in (length,radians) form.

Definition at line 9 of file plotpolar.cpp.

References pts, point2< T >::x, and point2< T >::y.

Referenced by plotpolartest::test01().

00012 {
00013   pts.clear();
00014 
00015   uintc sz = p.size();
00016   for (uint i=0; i<sz; ++i)
00017   {
00018     point2<double> const & z(p[i]);
00019     // Convert the polar coordinates to cartesian coordinates.
00020     pts.push_back( point2<double>(z.x*cos(z.y), z.x*sin(z.y)) );
00021   }
00022 }

void plotpolar::addpoints ( uintc  r,
uintc  g,
uintc  b 
)

To display the points this adds the points to the graphics container.

Definition at line 47 of file plotpolar.cpp.

References pts, and gobjContainer::push().

00052 {
00053   gobjContainer * c = new gobjContainer();
00054 
00055   c->push( new gobjglPushAttrib(GL_CURRENT_BIT) );
00056   c->push( new gobjglPushAttrib(GL_LIGHTING_BIT) );
00057   c->push( new gobjglDisable(GL_LIGHTING) );
00058 
00059   c->push( new gobjglColor3ub(r,g,b) );
00060 
00061 
00062   uintc sz = pts.size();
00063  
00064   c->push( new gobjglBegin(GL_POINTS) );
00065   for (uint i=0; i<sz; ++i)
00066   {
00067     c->push( new gobjglVertex2f(pts[i]) );
00068   }
00069 
00070   c->push(new gobjglEnd());
00071 
00072   c->push( new gobjglPopAttrib() );
00073   c->push( new gobjglPopAttrib() );
00074 
00075   push(c);
00076 }


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

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