return active edge list while they are not stored
This commit is contained in:
		| @@ -106,7 +106,11 @@ public: | ||||
|  | ||||
| 	// Get the list of vertices in this convex hull. | ||||
| 	const qhList<qhVertex>& GetVertexList() const; | ||||
| 	 | ||||
|  | ||||
| 	// Get the list of half-edges in this convex hull. | ||||
| 	// Return the number of edges. | ||||
| 	u32 GetEdgeList(qhHalfEdge** edges, u32 edgeCapacity) const; | ||||
|  | ||||
| 	// Get the list of faces in this convex hull. | ||||
| 	const qhList<qhFace>& GetFaceList() const; | ||||
|  | ||||
|   | ||||
| @@ -52,6 +52,27 @@ inline const qhList<qhFace>& qhHull::GetFaceList() const | ||||
| 	return m_faceList; | ||||
| } | ||||
|  | ||||
| inline u32 qhHull::GetEdgeList(qhHalfEdge** edges, u32 edgeCapacity) const | ||||
| { | ||||
| 	u32 edgeCount = 0; | ||||
| 	for (qhFace* f = m_faceList.head; f; f = f->next) | ||||
| 	{ | ||||
| 		qhHalfEdge* edge = f->edge; | ||||
| 		do | ||||
| 		{ | ||||
| 			if (edgeCount == edgeCapacity) | ||||
| 			{ | ||||
| 				return edgeCount; | ||||
| 			} | ||||
|  | ||||
| 			edges[edgeCount++] = edge; | ||||
| 			 | ||||
| 			edge = edge->next; | ||||
| 		} while (edge != f->edge); | ||||
| 	} | ||||
| 	return edgeCount; | ||||
| } | ||||
|  | ||||
| inline u32 qhHull::GetIterations() const | ||||
| { | ||||
| 	return m_iterations; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user