Plane.h

Go to the documentation of this file.
00001 #ifndef PLANE_H_
00002 #define PLANE_H_
00003 
00004 #include <memory>
00005 
00006 #include "Vector.h"
00007 
00018 class Plane {
00019         public:
00023                 Plane(const Vector<>& aPoint, const Vector<>& aV1, const Vector<>& aV2);
00024 
00028                 Plane(const Vector<>& aPoint, const Vector<>& aNormal);
00029 
00033                 bool contains(const Vector<>& aPoint) const;
00034 
00038                 Vector<> normal() const {
00039                         return mNormal;
00040                 }
00041 
00042                 enum PointClassification {
00043                         PLANE_FRONT,    
00044                         PLANE_COINCIDE, 
00045                         PLANE_BACK      
00046                 };
00047 
00051                 PointClassification classify(const Vector<>& aPoint) const;
00052 
00059                 std::auto_ptr< Vector<> > intersect(const Vector<>& point, const Vector<>& dir) const;
00060 
00061                 Plane& operator+=(const Vector<>& v) {
00062                         mPoint += v;
00063                         calcNP();
00064                         return *this;
00065                 }
00066 
00067 
00068         private:
00069                 Vector<> mPoint;
00070                 Vector<> mNormal;
00071 
00072                 void calcNP();
00073 
00077                 float mNTimesP;
00078 };
00079 
00080 
00081 #endif

Generated on Mon Dec 19 00:13:20 2005 for Visualization by  doxygen 1.4.5