Wm4IntrLine3Box3.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 #ifndef WM4INTRLINE3BOX3_H
00018 #define WM4INTRLINE3BOX3_H
00019
00020 #include "Wm4FoundationLIB.h"
00021 #include "Wm4Intersector.h"
00022 #include "Wm4Line3.h"
00023 #include "Wm4Box3.h"
00024
00025 namespace Wm4
00026 {
00027
00028 template <class Real>
00029 class WM4_FOUNDATION_ITEM IntrLine3Box3
00030 : public Intersector<Real,Vector3<Real> >
00031 {
00032 public:
00033 IntrLine3Box3 (const Line3<Real>& rkLine, const Box3<Real>& rkBox);
00034
00035
00036 const Line3<Real>& GetLine () const;
00037 const Box3<Real>& GetBox () const;
00038
00039
00040 virtual bool Test ();
00041 virtual bool Find ();
00042
00043
00044 int GetQuantity () const;
00045 const Vector3<Real>& GetPoint (int i) const;
00046
00047 private:
00048 using Intersector<Real,Vector3<Real> >::IT_EMPTY;
00049 using Intersector<Real,Vector3<Real> >::IT_POINT;
00050 using Intersector<Real,Vector3<Real> >::IT_SEGMENT;
00051 using Intersector<Real,Vector3<Real> >::m_iIntersectionType;
00052
00053 static bool Clip (Real fDenom, Real fNumer, Real& rfT0, Real& rfT1);
00054
00055
00056 const Line3<Real>& m_rkLine;
00057 const Box3<Real>& m_rkBox;
00058
00059
00060 int m_iQuantity;
00061 Vector3<Real> m_akPoint[2];
00062
00063
00064 public:
00065 static bool DoClipping (Real fT0, Real fT1, const Vector3<Real>& rkOrigin,
00066 const Vector3<Real>& rkDirection, const Box3<Real>& rkBox,
00067 bool bSolid, int& riQuantity, Vector3<Real> akPoint[2],
00068 int& riIntrType);
00069 };
00070
00071 typedef IntrLine3Box3<float> IntrLine3Box3f;
00072 typedef IntrLine3Box3<double> IntrLine3Box3d;
00073
00074 }
00075
00076 #endif