22 #ifndef __DG_CONVEXHULL_4D__
23 #define __DG_CONVEXHULL_4D__
25 #include "dCoreStdafx.h"
31 #include "dQuaternion.h"
67 dFloat64 Evalue (
const dBigVector& point)
const;
77 dInt32 GetMark()
const {
return m_mark; }
78 void SetMark(dInt32 mark) { m_mark = mark; }
81 void Init (
const dConvexHull4dVector*
const points, dInt32 v0, dInt32 v1, dInt32 v2, dInt32 v3);
84 dgTetrahedrumFace m_faces[4];
99 D_CORE_API
dConvexHull4d(
const dFloat64*
const vertexCloud, dInt32 strideInBytes, dInt32 count, dFloat64 distTol);
102 dInt32 GetVertexCount()
const;
103 dInt32 GetVertexIndex(dInt32 i)
const;
110 void Save (
const char*
const filename)
const;
115 void BuildHull (
const dFloat64*
const vertexCloud, dInt32 strideInBytes, dInt32 count, dFloat64 distTol);
117 virtual dInt32 AddVertex (
const dBigVector& vertex);
118 virtual dInt32 InitVertexArray(
dConvexHull4dVector*
const points,
const dFloat64*
const vertexCloud, dInt32 strideInBytes, dInt32 count,
void*
const memoryPool, dInt32 maxMemSize);
120 virtual dListNode* AddFace (dInt32 i0, dInt32 i1, dInt32 i2, dInt32 i3);
121 virtual void DeleteFace (dListNode*
const node);
123 dListNode* FindFacingNode(
const dBigVector& vertex);
129 void LinkSibling (dListNode* node0, dListNode* node1)
const;
154 inline dInt32 dConvexHull4d::IncMark ()
160 inline dInt32 dConvexHull4d::GetVertexCount()
const
165 inline dInt32 dConvexHull4d::GetVertexIndex(dInt32 index)
const
167 dAssert (index >= 0);
168 dAssert (index < m_count);
169 return m_points[index].m_index;
173 inline const dBigVector& dConvexHull4d::GetVertex(dInt32 index)
const
175 dAssert (index >= 0);
176 dAssert (index < m_count);
177 return m_points[index];
187 return tetra->GetTetraVolume (&m_points[0]);