@@ -52,17 +52,35 @@ class QHHalfEdgeStructure {
5252 using VerticesPair = Pair<uint32, uint32>;
5353 using EdgeVertices = Pair<const Vertex*, const Vertex*>;
5454
55- // / Edge
55+ // Struct Edge
56+ /* *
57+ * An half-edge
58+ */
5659 struct Edge {
5760
58- Vertex* startVertex; // Vertex at the beginning of the edge
59- Vertex* endVertex; // Vertex at the end of the edge
60- Face* face; // Adjacent face of the edge
61- Edge* previousEdge; // Previous edge in the linked-list of edges
62- Edge* nextEdge; // Next edge in the linked-list of edges
63- Edge* previousFaceEdge; // Previous edge around the face of the edge
64- Edge* nextFaceEdge; // Next edge around the face of the edge
65- Edge* twinEdge; // Twin edge
61+ // / Vertex at the beginning of the edge
62+ Vertex* startVertex;
63+
64+ // / Vertex at the end of the edge
65+ Vertex* endVertex;
66+
67+ // / Adjacent face of the edge
68+ Face* face;
69+
70+ // / Previous edge in the linked-list of edges
71+ Edge* previousEdge;
72+
73+ // / Next edge in the linked-list of edges
74+ Edge* nextEdge;
75+
76+ // / Previous edge around the face of the edge
77+ Edge* previousFaceEdge;
78+
79+ // / Next edge around the face of the edge
80+ Edge* nextFaceEdge;
81+
82+ // / Twin edge
83+ Edge* twinEdge;
6684
6785 Edge (Vertex* startVertex, Vertex* endVertex, Face* face)
6886 :startVertex(startVertex), endVertex(endVertex), face(face), previousEdge(nullptr ), nextEdge(nullptr ),
@@ -88,29 +106,45 @@ class QHHalfEdgeStructure {
88106 }
89107 };
90108
91- // / Face
109+ // Struct Face
110+ /* *
111+ * A face
112+ */
92113 struct Face {
93114
115+ // / Pointer to the next face
94116 Face* nextFace;
117+
118+ // / Pointer to the previous face
95119 Face* previousFace;
96- Edge* edge; // One half-edge of the face
120+
121+ // / One half-edge of the face
122+ Edge* edge;
123+
124+ // / Face normal
97125 Vector3 normal;
98- Vector3 centroid; // Center of the face (average of the face vertices)
99- decimal area; // Area of the face
100- Array<uint32> conflictPoints; // Array with some remaining points visible from this face that need to be processed
126+
127+ // / Center of the face (average of the face vertices)
128+ Vector3 centroid;
129+
130+ // / Area of the face
131+ decimal area;
132+
133+ // / Array with some remaining points visible from this face that need to be processed
134+ Array<uint32> conflictPoints;
101135
102136 // / Constructor
103137 Face (MemoryAllocator& allocator)
104138 : nextFace(nullptr ), previousFace(nullptr ), edge(nullptr ), normal(0 , 0 , 0 ), area(0 ), conflictPoints(allocator, 8 ) {
105139
106140 }
107141
108- // Return a vertex of the face
142+ // / Return a vertex of the face
109143 const Vertex* getVertex () const {
110144 return edge->startVertex ;
111145 }
112146
113- // Recalculate the face centroid and normal to better fit its new vertices (using Newell method)
147+ // / Recalculate the face centroid and normal to better fit its new vertices (using Newell method)
114148 void recalculateFace (const Array<Vector3>& points) {
115149
116150 centroid.setToZero ();
@@ -144,7 +178,7 @@ class QHHalfEdgeStructure {
144178 area = normalLength * decimal (0.5 );
145179 }
146180
147- // Return a string with the vertices of the face
181+ // / Return a string with the vertices of the face
148182 std::string verticesString () const {
149183
150184 std::string verticesString = " (" ;
@@ -167,13 +201,13 @@ class QHHalfEdgeStructure {
167201 return verticesString;
168202 }
169203
170- // Return true if the face is a triangle
204+ // / Return true if the face is a triangle
171205 bool isTriangle () {
172206
173207 return edge->nextFaceEdge ->nextFaceEdge ->nextFaceEdge == edge;
174208 }
175209
176- // Return true if the face structure is valid (for debugging purpose)
210+ // / Return true if the face structure is valid (for debugging purpose)
177211 bool isValid () {
178212 bool isValid = true ;
179213
@@ -198,12 +232,19 @@ class QHHalfEdgeStructure {
198232
199233 };
200234
201- // / Vertex
235+ // Struct Vertex
236+ /* *
237+ * A vertex
238+ */
202239 struct Vertex {
203240
204- uint32 externalIndex; // Index of the vertex point in the user vertex array
241+ // / Index of the vertex point in the user vertex array
242+ uint32 externalIndex;
205243
244+ // / Pointer to the previous vertex
206245 Vertex* previousVertex;
246+
247+ // / Pointer to the next vertex
207248 Vertex* nextVertex;
208249
209250 // / Constructor
0 commit comments