proj home

Files   Classes   Functions   Hierarchy  

halfspaceD2draw.h

Go to the documentation of this file.
00001 #ifndef HALFSPACED2DRAW_H
00002 #define HALFSPACED2DRAW_H
00003 
00004 #include <halfspaceD2.h>
00005 #include <gobj.h>
00006 #include <point.h>
00007 
00008 #include <d2partitiondraw.h>
00009 
00010 typedef point2<double> pt2;
00011 typedef point3<double> pt3;
00012 
00013 
00014 class halfspaceD2draw : public gobj
00015 {
00016 public:
00017 
00018   halfspaceD2< pt3, double > & h;
00019 
00020   halfspaceD2draw( halfspaceD2< pt3, double > & _h)
00021     : h(_h) { alphacalculate(); }
00022 
00023   double alpha;
00024 
00025   template< typename U>
00026   void translate( U const & x)
00027   {
00028     h.p0.x += x.x;
00029     h.p0.y += x.y;
00030     h.p1.x += x.x;
00031     h.p1.y += x.y;
00032 
00033     h.normalcalculate();
00034   }
00035 
00036   void alphacalculate()
00037   {
00038     pt2 z;
00039     z.x = h.p1.x - h.p0.x;
00040     z.y = h.p1.y - h.p0.y;
00041     alpha = atan(z.y/z.x);
00042   }
00043 
00044   void rotate(double const theta);
00045 
00046   void draw();
00047 
00048 };
00049 
00050 
00051 #endif
00052 
00053 

Generated on Fri Mar 4 00:49:26 2011 for Chelton Evans Source by  doxygen 1.5.8