45#ifndef LASS_GUARDIAN_OF_INCLUSION_PRIM_IMPL_PLANE_3D_CARTESIAN_INL
46#define LASS_GUARDIAN_OF_INCLUSION_PRIM_IMPL_PLANE_3D_CARTESIAN_INL
62template<
typename T,
class NP>
76template<
typename T,
class NP>
78 const TPoint& iPointU,
79 const TPoint& iPointV)
83 NP::normalizeAndScale(normal_, d_);
92template<
typename T,
class NP>
94 const TVector& iDirectionU,
95 const TVector& iDirectionV)
98 NP::normalizeAndScale(normal_, d_);
107template<
typename T,
class NP>
110 d_(-dot(iNormal, iSupport.position()))
112 NP::normalizeAndScale(normal_, d_);
121template<
typename T,
class NP>
126 NP::normalizeAndScale(normal_, d_);
133template<
typename T,
class NP>
136 return TPoint(-d_ * normal_);
143template<
typename T,
class NP>
147 NP::normalize(oDirectionU);
148 NP::normalize(oDirectionV);
155template<
typename T,
class NP>
168template<
typename T,
class NP>
181template<
typename T,
class NP>
183 TVector& oReciprocalV)
const
195template<
typename T,
class NP>
208template<
typename T,
class NP>
219template<
typename T,
class NP>
220void Plane3DCartesian<T, NP>::getCartesian(TVector& oNormal, TReference oD)
const
228template<
typename T,
class NP>
229const typename Plane3DCartesian<T, NP>::TVector& Plane3DCartesian<T, NP>::normal()
const
236template<
typename T,
class NP>
237const typename Plane3DCartesian<T, NP>::TParam Plane3DCartesian<T, NP>::d()
const
246template<
typename T,
class NP>
247const typename Plane3DCartesian<T, NP>::TValue
250 return dot(iPoint.position(), normal_) + d_;
257template<
typename T,
class NP>
258const typename Plane3DCartesian<T, NP>::TValue
261 const TValue a = dot(iPoint.position(), normal_);
262 return num::almostEqual(a, -d_, iRelativeTolerance) ? TNumTraits::zero : (a + d_);
270template<
typename T,
class NP>
271const typename Plane3DCartesian<T, NP>::TVector
274 return normal_ * NP::divideBySquaredNorm(
equation(iPoint), normal_);
283template<
typename T,
class NP>
284const typename Plane3DCartesian<T, NP>::TVector
287 return normal_ * NP::divideBySquaredNorm(dot(normal_, iVector), normal_);
294template<
typename T,
class NP>
295const typename Plane3DCartesian<T, NP>::TPoint
298 return iPoint -
reject(iPoint);
305template<
typename T,
class NP>
306const typename Plane3DCartesian<T, NP>::TVector
309 return iVector -
reject(iVector);
316template<
typename T,
class NP>
317const typename Plane3DCartesian<T, NP>::TPoint
320 return iPoint - 2 *
reject(iPoint);
327template<
typename T,
class NP>
328const typename Plane3DCartesian<T, NP>::TVector
331 return iVector - 2 *
reject(iVector);
338template<
typename T,
class NP>
339const typename Plane3DCartesian<T, NP>::TPoint
342 return point(TIndex(iU, iV));
349template<
typename T,
class NP>
350const typename Plane3DCartesian<T, NP>::TPoint
363template<
typename T,
class NP>
364const typename Plane3DCartesian<T, NP>::TUV
370 const TVector relative = iPoint -
support();
376template <
typename T,
class NP>
377void Plane3DCartesian<T, NP>::flip()
387template<
typename T,
class NP>
390 return !normal_.isZero();
406template<
typename T,
class NP>
409 LASS_ENFORCE(ioOStream) <<
"{N=" << iPlane.normal() <<
", d=" << iPlane.d() <<
"}";
implementation of plane 3d with a cartesian equation
const TPoint point(TParam iU, TParam iV) const
return point by filling in the parametric equation: P(u, v) = S + u * U + v * V
const TValue equation(const TPoint &iPoint) const
Return value of point in equation.
void getDirections(TVector &oDirectionU, TVector &oDirectionV) const
return U and V direction vectors
const TVector directionV() const
return V direction vector.
bool isValid() const
return true if plane is a valid plane (no normal or direction vectors that are zero).
const TVector reciprocalV() const
return reciprocal for V direction vector.
const TVector directionU() const
return U direction vector.
const TVector reject(const TPoint &iPoint) const
return the vector that, if added to the PROJECTION of iPoint, you get iPoint again.
const TPoint reflect(const TPoint &iPoint) const
reflect a point orthogonally into the plane.
Plane3DCartesian()
initializes to an invalid state.
const TPoint support() const
return support point.
const TUV uv(const TPoint &iPoint) const
return UV pair of parameters
const TPoint project(const TPoint &iPoint) const
project a point orthogonally onto the plane
const TVector reciprocalU() const
return reciprocal for U direction vector.
void getReciprocals(TVector &oReciprocalU, TVector &oReciprocalV) const
return reciprocal vectors for U and V direction vectors
implementation details of lass::prim
set of geometrical primitives
Library for Assembled Shared Sources.
static void generateReciprocal(const Vector3D< T > &iDirU, const Vector3D< T > &iDirV, Vector3D< T > &oReciprocalDirU, Vector3D< T > &oReciprocalDirV)
generate reciprocal direction vectors Ur and Vr given directions U and V.
static void generateDirections(const Vector3D< T > &iNormal, Vector3D< T > &oDirU, Vector3D< T > &oDirV)
Generate directions vectors U and V of parametric equation P = S + x*U + y*V, based on the normal vec...
static void generateCartesian(const Point3D< T > &iSupport, const Vector3D< T > &iDirU, const Vector3D< T > &iDirV, Vector3D< T > &oNormal, T &oD)
Generate cartesian equation out of parametric equation.