Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef PLANE_H
00028 #define PLANE_H
00029
00030 #include "QGpCoreToolsDLLExport.h"
00031 #include "Point.h"
00032 #include "Translations.h"
00033 #include "Global.h"
00034
00035 namespace QGpCoreTools {
00036
00037 class QGPCORETOOLS_EXPORT Plane
00038 {
00039 TRANSLATIONS("Plane");
00040 public:
00041 Plane() {_d=0.0;}
00042 Plane(const Point& normal, const Point& reference);
00043 Plane(const Plane& o);
00044
00045 void setReference(int index, const Point& p) {ASSERT(index<3); _references[index]=p;}
00046
00047 void setZ(int index, double z) {ASSERT(index<3); _references[index].setZ(z);}
00048
00049 bool setNormalVector();
00050 void setNormalVectorXY();
00051
00052 inline double z(const Point& at);
00053 private:
00054 inline double d();
00055
00056 Point _references[3];
00057 Point _directionalVector[2];
00058 Point _normalVector;
00059 double _d;
00060 };
00061
00062 double Plane::z(const Point& at)
00063 {
00064 TRACE;
00065 return (_d-_normalVector.x()*at.x()-_normalVector.y()*at.y())/_normalVector.z();
00066 }
00067
00068 }
00069
00070 #endif // PLANE_H