plane_3d_parametric.h
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
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059 #ifndef LASS_GUARDIAN_OF_INCLUSION_PRIM_IMPL_PLANE_3D_PARAMETRIC_H
00060 #define LASS_GUARDIAN_OF_INCLUSION_PRIM_IMPL_PLANE_3D_PARAMETRIC_H
00061
00062 #include "../prim_common.h"
00063
00064 namespace lass
00065 {
00066 namespace prim
00067 {
00068 namespace impl
00069 {
00070
00071 template <typename T, class NormalizingPolicy = Normalized>
00072 class Plane3DParametric
00073 {
00074 public:
00075
00076 typedef NormalizingPolicy TNormalizingPolicy;
00077
00078 typedef Point3D<T> TPoint;
00079 typedef typename TPoint::TVector TVector;
00080 typedef Point2D<T> TUV;
00081
00082 typedef typename TPoint::TValue TValue;
00083 typedef typename TPoint::TParam TParam;
00084 typedef typename TPoint::TReference TReference;
00085 typedef typename TPoint::TConstReference TConstReference;
00086 typedef typename TPoint::TNumTraits TNumTraits;
00087
00088 enum { dimension = TPoint::dimension };
00089
00090 Plane3DParametric();
00091 Plane3DParametric(const TPoint& iSupport, const TPoint& iPointU, const TPoint& iPointV);
00092 Plane3DParametric(const TPoint& iSupport, const TVector& iDirectionU, const TVector& iDirectionV);
00093 Plane3DParametric(const TVector& iNormal, const TPoint& iSupport);
00094 Plane3DParametric(const TVector& iNormal, TParam iD);
00095
00096 const TPoint& support() const;
00097 void getDirections(TVector& oDirectionU, TVector& oDirectionV) const;
00098 const TVector& directionU() const;
00099 const TVector& directionV() const;
00100
00101 void getReciprocals(TVector& oReciprocalU, TVector& oReciprocalV) const;
00102 const TVector reciprocalU() const;
00103 const TVector reciprocalV() const;
00104
00105 void getCartesian(TVector& oNormal, TReference oD) const;
00106 const TVector normal() const;
00107 const TValue d() const;
00108
00109 const TValue equation(const TPoint& iPoint) const;
00110 const TValue equation(const TPoint& iPoint, TParam iRelativeTolerance) const;
00111
00112 const TVector reject(const TPoint& iPoint) const;
00113 const TVector reject(const TVector& iVector) const;
00114 const TPoint project(const TPoint& iPoint) const;
00115 const TVector project(const TVector& iVector) const;
00116 const TPoint reflect(const TPoint& iPoint) const;
00117 const TVector reflect(const TVector& iVector) const;
00118
00119 const TPoint point(TParam iU, TParam iV) const;
00120 const TPoint point(const TUV& iUV) const;
00121 const TUV uv(const TPoint& iPoint) const;
00122
00123 void flip();
00124 const bool isValid() const;
00125
00126 private:
00127
00128 TPoint support_;
00129 TVector directionU_;
00130 TVector directionV_;
00131 };
00132
00133
00134
00135 }
00136
00137 }
00138
00139 }
00140
00141 #include "plane_3d_parametric.inl"
00142
00143 #endif
00144
00145