| |
|
|
| |
| |
| |
| |
| |
| |
| |
|
|
| #ifndef WM4CONVEXHULL2_H |
| #define WM4CONVEXHULL2_H |
|
|
| #include "Wm4FoundationLIB.h" |
| #include "Wm4ConvexHull1.h" |
| #include "Wm4Query2.h" |
|
|
| namespace Wm4 |
| { |
|
|
| template <class Real> |
| class WM4_FOUNDATION_ITEM ConvexHull2 : public ConvexHull<Real> |
| { |
| public: |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| ConvexHull2 (int iVertexQuantity, Vector2<Real>* akVertex, Real fEpsilon, |
| bool bOwner, Query::Type eQueryType); |
| virtual ~ConvexHull2 (); |
|
|
| |
| |
| const Vector2<Real>& GetLineOrigin () const; |
| const Vector2<Real>& GetLineDirection () const; |
| ConvexHull1<Real>* GetConvexHull1 () const; |
|
|
| private: |
| using ConvexHull<Real>::m_eQueryType; |
| using ConvexHull<Real>::m_iVertexQuantity; |
| using ConvexHull<Real>::m_iDimension; |
| using ConvexHull<Real>::m_iSimplexQuantity; |
| using ConvexHull<Real>::m_aiIndex; |
| using ConvexHull<Real>::m_fEpsilon; |
| using ConvexHull<Real>::m_bOwner; |
|
|
| class WM4_FOUNDATION_ITEM Edge |
| { |
| public: |
| Edge (int iV0, int iV1); |
|
|
| int GetSign (int i, const Query2<Real>* pkQuery); |
|
|
| void Insert (Edge* pkAdj0, Edge* pkAdj1); |
| void DeleteSelf (); |
| void DeleteAll (); |
|
|
| void GetIndices (int& riHQuantity, int*& raiHIndex); |
|
|
| int V[2]; |
| Edge* A[2]; |
| int Sign; |
| int Time; |
| }; |
|
|
| |
| ConvexHull2 (const char* acFilename); |
| bool Load (const char* acFilename); |
| bool Save (const char* acFilename) const; |
|
|
| bool Update (Edge*& rpkHull, int i); |
|
|
| |
| Vector2<Real>* m_akVertex; |
|
|
| |
| Vector2<Real>* m_akSVertex; |
| Query2<Real>* m_pkQuery; |
|
|
| |
| Vector2<Real> m_kLineOrigin, m_kLineDirection; |
| }; |
|
|
| typedef ConvexHull2<float> ConvexHull2f; |
| typedef ConvexHull2<double> ConvexHull2d; |
|
|
| } |
|
|
| #endif |
|
|