OpenWalnut  1.5.0dev
WSubdivisionValidator.h
1 //---------------------------------------------------------------------------
2 //
3 // Project: OpenWalnut ( http://www.openwalnut.org )
4 //
5 // Copyright 2013 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
6 // For more information see http://www.openwalnut.org/copying
7 //
8 // This file is part of OpenWalnut.
9 //
10 // OpenWalnut is free software: you can redistribute it and/or modify
11 // it under the terms of the GNU Lesser General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // OpenWalnut is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public License
21 // along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
22 //
23 //---------------------------------------------------------------------------
24 
25 #ifndef WSUBDIVISIONVALIDATOR_H_
26 #define WSUBDIVISIONVALIDATOR_H_
27 
28 #include <cstring>
29 #include <memory>
30 
31 #include "structure/WVertexFactory.h"
32 
33 
34 namespace butterfly
35 {
36 /**
37  * Class that validates the Butterfly subdivision. It contains preprocessing and validation during subdivision.
38  */
40 {
41 public:
42  /**
43  * Creates the Butterfly subdivision validation instance.
44  */
46  /**
47  * Destroys the Butterfly subdivision validation instance.
48  */
49  virtual ~WSubdivisionValidator();
50 
51  /**
52  * Assign analyzable triangle mesh.
53  * \author schwarzkopf
54  * \param processedMesh Triangle mesh that should be processed.
55  * \param vertexFactory Vertex factory for Triangle mesh examination.
56  */
57  void setTriangleMesh( std::shared_ptr< WTriangleMesh > processedMesh, WVertexFactory* vertexFactory );
58 
59  /**
60  * Generating statistical information of the triangle mesh. The data is stored in the vertex factory.
61  * Currently it's the maximal neighbor distance and sum of all distances.
62  * \author schwarzkopf
63  */
65 
66  /**
67  * Joins Vertices where a triangle side is smaller than the longest one multiplied by a factor.
68  * \author schwarzkopf
69  * \param inputMesh Input mesh to process and put out
70  * \return Processed triangle mesh.
71  */
72  std::shared_ptr< WTriangleMesh > joinNarrowVertices(
73  std::shared_ptr< WTriangleMesh > inputMesh ); //TODO(schwarzkopf): setting param should be done over setTriangleMesh
74 
75  /**
76  * Searchs for all triangles which has two angles below a preset value. Found values will be rotate
77  * by one step with the triangle connected by these low angle points. The rotation is done over these
78  * For vertices. No application if the final state would also have invalid angles.
79  * \author schwarzkopf
80  * \param inputMesh Input mesh to process and put out
81  * \return Processed triangle mesh.
82  */
83  std::shared_ptr< WTriangleMesh > flipTrianglesAtLowAngles(
84  std::shared_ptr< WTriangleMesh > inputMesh ); //TODO(schwarzkopf): setting param should be done over setTriangleMesh
85 
86  /**
87  * Corrects Coordinates if they are determined to be invalid using validation settings.
88  * Currently this function only calculates the mean between the proposed Butterfly calculated value
89  * and the mean between the two vertices. The weight is used comparing the current smallest angle
90  * compared to the minimal allowed. It is applied if the interpolated line cuts a triangle with an
91  * angle at this side below the set up angle.
92  * \author schwarzkopf
93  * \param vertID1 First vertex of the interpolated line.
94  * \param vertID2 Second vertex of the interpolated line.
95  * \param interpolatedVertex The interpolated vertex between the two vertices.
96  * \return Corrected coordinate value.
97  */
98  osg::Vec3 getValidatedSubdivision( size_t vertID1, size_t vertID2, osg::Vec3 interpolatedVertex );
99 
100  /**
101  * Get the minimal triangle angle at the two vertices searching all triangles connected to that
102  * points.
103  * \author schwarzkopf
104  * \param vertID1 First connected vertex to triangles.
105  * \param vertID2 Second connected vertex to triangles.
106  * \param maxInTriangle Taking the bigger of both angles for minimum angle search.
107  * \return Minimal angle of all triangles searched at the two vertices.
108  */
109  float getMinTrianglesAngle( size_t vertID1, size_t vertID2, bool maxInTriangle );
110 
111 
112 
113  /**
114  * This function checks a subdivided line between two vertices for correctness.
115  * In order to check all functions with he name "isValid*" below are executed.
116  * If one of them returns false then a line should not be subdivided.
117  * \author schwarzkopf.
118  * \param vertID1 First connecting vertex.
119  * \param vertID2 Second connecting vertex.
120  * \param newVert New interpolated point that should be checked.
121  * \return Validity of a subdivision.
122  */
123  bool isValidSubdivision( size_t vertID1, size_t vertID2, osg::Vec3 newVert );
124 
125  /**
126  * Subdivision is valid if the subdivided line is at least as long as the longest line to a
127  * neighbor multiplied by a set up factor.
128  * \author schwarzkopf.
129  * \param vertID1 First vertex of the subdivided line.
130  * \param vertID2 Second vertex of a subdivided line.
131  * \param lengthC Line length between the two points to be checked.
132  * \return Line is long enough in comparison to all lines of neighbors.
133  */
134  bool isValidMinAmountOfMax( size_t vertID1, size_t vertID2, float lengthC );
135 
136  /**
137  * Subdivision is valid if the subdivided line is at least as long as the average line to a
138  * neighbor multiplied by a set up factor.
139  * \author schwarzkopf.
140  * \param vertID1 First vertex of the subdivided line.
141  * \param vertID2 Second vertex of a subdivided line.
142  * \param lengthC Line length between the two points to be checked.
143  * \return Line is long enough in comparison to the average line of neighbors.
144  */
145  bool isValidMinAmountOfAverage( size_t vertID1, size_t vertID2, float lengthC );
146 
147  /**
148  * Checks whether both angles at the subdivided line ends are at least as big as a defined
149  * minimal value. The regarded triangle consists of the two subdivided line end points
150  * and the new vertex..
151  * \author schwarzkopf
152  * \param lengthA Line length from the new point to the first line end point.
153  * \param lengthB Line length from the new point to the second line end point.
154  * \param lengthC Line length between the two subdivided line end points.
155  * \return Validity of the minimal allowed angle.
156  */
157  bool isValidMinTransformationAngle( float lengthA, float lengthB, float lengthC );
158 
159  /**
160  * Checks whether both angles at the subdivided line ends are not bigger than a defined
161  * maximal value. The regarded triangle consists of the two subdivided line end points
162  * and the new vertex..
163  * \author schwarzkopf
164  * \param lengthA Line length from the new point to the first line end point.
165  * \param lengthB Line length from the new point to the second line end point.
166  * \param lengthC Line length between the two subdivided line end points.
167  * \return Validity of the minimal allowed angle.
168  */
169  bool isValidMaxTransformationAngle( float lengthA, float lengthB, float lengthC );
170 
171  /**
172  * Regards the lengths from the new subdivided new vertex. Returns whether the distance to
173  * one subdivided line end to the distance of from the new point to the other line end
174  * not more than by a set up factor..
175  * \author schwarzkopf
176  * \param lengthA Length from the subdivided line new vertex to the first line end.
177  * \param lengthB Length from the subdivided line new vertex to the second line end.
178  * \return Validity of the maximal allowed difference.
179  */
180  bool isValidMinLengthsQuotient( float lengthA, float lengthB );
181 
182  /**
183  * Checks whether a subdividable line length is not longer than a set up length setting.
184  * \param lengthC Subdividable line length to examine..
185  * \author schwarzkopf
186  * \return Line is at least as long as the minimum set uplength.
187  */
188  bool isValidMinSubdividedLineLength( float lengthC );
189 
190  /**
191  * Checks whether .the angle between the subdividable line and any other line of all
192  * neighbor triangles not exceeds the set up angle. Vertices aren't invalidated if the
193  * connected line is shorter than the ratio ov the subdivided line length.
194  * \param vertID1 First vertex of the subdividable line
195  * \param vertID2 Second vertex of the subdividable line
196  * \param lengthC Precalculated scalar distance between the two vertices.
197  * \return Subdivision is valid or not.
198  */
199  bool isValidMaxNeighbourTriangleAngle( size_t vertID1, size_t vertID2, float lengthC );
200 
201  /**
202  * Sets up the angle setting which both angles at the subdivided line ends should be at
203  * least as big as this value. The regarded triangle consists of the two subdivided
204  * line end points and the new vertex..
205  * \author schwarzkopf
206  * \param minTransformationAngle Min angle which both line ends should exceed.
207  */
208  void setMinTransformationAngle( float minTransformationAngle );
209 
210  /**
211  * Sets up the angle setting which both angles at the subdivided line ends should be not
212  * bigger than this value. The regarded triangle consists of the two subdivided
213  * line end points and the new vertex..
214  * \author schwarzkopf
215  * \param maxTransformationAngle Max angle which both line ends should not exceed.
216  */
217  void setMaxTransformationAngle( float maxTransformationAngle );
218 
219  /**
220  * Sets the maximum factor which the following lines should differ to show a valid
221  * subdivision. Both lines are measured from the new subdivided point and end at the
222  * ends of the subdivided line end..
223  * \author schwarzkopf
224  * \param minLenghtsQuotient Maximal allowed difference factor. The smaller the value
225  * the bigger is the allowed difference.
226  */
227  void setMinLenghtsQuotient( float minLenghtsQuotient );
228 
229  /**
230  * Sets the factor for multiplying the maximal distance to a neighbour within the Butterfly
231  * stencil. Lines are not subdivided being smaller than this distance multiplied by it.
232  * \author schwarzkopf.
233  * \author schwarzkopf
234  * \param minAmountOfMax Factor to determine whether the line is subdividable.
235  */
236  void setMinAmountOfMax( float minAmountOfMax );
237 
238  /**
239  * Sets the factor for multiplying the average distance to a neighbour within the Butterfly
240  * stencil. Lines are not subdivided being smaller than the average distance multiplied by it.
241  * \author schwarzkopf.
242  * \author schwarzkopf
243  * \param minAmountOfAverage Factor to determine whether the line is subdividable.
244  */
245  void setMinAmountOfAverage( float minAmountOfAverage );
246 
247  /**
248  * Gets the minimal subdividable line length. Lines of smaller distance than this are not
249  * subdivided..
250  * \author schwarzkopf
251  * \return Minimal subdidvidable line length
252  */
254 
255  /**
256  * Sets the minimal subdividable line length. Lines of smaller distance than this are not
257  * subdivided..
258  * \author schwarzkopf
259  * \param minSubdividedLineLength Minimal subdidvidable line length.
260  */
261  void setMinSubdividedLineLength( float minSubdividedLineLength );
262 
263  /**
264  * Gets the factor where the minimal subdivided line length is multiplied by in each
265  * Subdivision iteration step.
266  * \return The factor which multiplies the mimimal subdividable line length each
267  * Iteration step.
268  */
270 
271  /**
272  * Sets the factor where the minimal subdivided line length is multiplied by in each
273  * Subdivision iteration step.
274  * \author schwarzkopf
275  * \param minSubdividedLineLengthMultiplierPerIteration The factor which multiplies the
276  * mimimal subdividable line length
277  * each Iteration step.
278  */
279  void setMinSubdividedLineLengthMultiplierPerIteration( float minSubdividedLineLengthMultiplierPerIteration );
280 
281  /**
282  * Sets the Minimal allowed angle between two Subdivided line ends. If the two points have
283  * a triangle where the angle is at least in one triangle cutting that vertices amaller than
284  * this so the coordinates will be interpolated between the mean of the two neighbors and
285  * its Butterfly subdivision used one, weighted using the minimal transformation angle.
286  * \author schwarzkopf
287  * \param minNeighbourTriangleAngle Minimal allowed angle between two Subdivided line ends.
288  */
289  void setMinMeighbourTriangleAngle( float minNeighbourTriangleAngle );
290 
291  /**
292  * Sets settings of the further feature:
293  * A subdivision is marked as invalid if the angle between any neighbor triangle
294  * line is above that angle.
295  * \author schwarzkopf
296  * \param maxNeighbourTriangleAngle Maximal neighbour triangle angle not to mark a
297  * subdivision as invalid.
298  * \param maxNeighbourTriangleAngleLengthRatio Subdivision isn't marked as invalid if the
299  * neighbor line at the too high angle is shorter
300  * in comparison to the subdividable line than
301  * by this ratio.
302  */
303  void setMaxNeighbourTriangleAngle( float maxNeighbourTriangleAngle,
304  float maxNeighbourTriangleAngleLengthRatio );
305 
306  /**
307  * Sets the Factor for comparison to the maximal length of a triangle. Lines smaller than this
308  * force a joint of the corresponding two vertices. The triangle falls finally away.
309  * \author schwarzkopf
310  * \param maxAmountOfMaxForVertexJoin The factor of the smallest line end in comparison
311  * to the longest one within a triangle.
312  */
313  void setMaxAmountOfMaxForVertexJoin( float maxAmountOfMaxForVertexJoin );
314 
315  /**
316  * Sets the Minimal allowed angle which fits in both vertices at a subdividable line end.
317  * An existing triangle where both angles fit in forces it to rotate it with the other triangle
318  * connected with that vertices araund the four vertices of that two triangles. There is no
319  * application if the final state would be also invalid..
320  * \author schwarzkopf
321  * \param maxNeighbourTriangleAngleTriangleFlip The minimal angle at the two subdividable line
322  * ends thaf force the rotation.
323  */
324  void setMaxNeighbourTriangleAngleTriangleFlip( float maxNeighbourTriangleAngleTriangleFlip );
325 
326  /**
327  * The law of cosines. It returns the angle at point A. Exchange of lengthB and lengthC has
328  * no bad result effect..
329  * \author schwarzkopf
330  * \param lengthA The length of the triangle at the opposite to the point A
331  * \param lengthB The length of the triangle at the opposite to the point B
332  * \param lengthC The length of the triangle at the opposite to the point C
333  * \return The angle at the side A.
334  */
335  static float getAlphaLawOfCosines( float lengthA, float lengthB, float lengthC );
336 
337  /**
338  * Subdivides the triangle at three vertex IDs regarding the not subdividable new vertices
339  * at lines between some vertices at the triangle. There's no interpolation but putting
340  * triangles at existing and calculated vertices..
341  * \author schwarzkopf
342  * \param vertID0 First vertex ID of the triangle.
343  * \param vertID1 Second vertex ID of the triangle.
344  * \param vertID2 Third vertex ID of the triangle.
345  */
346  void subdivideTriangle( size_t vertID0, size_t vertID1, size_t vertID2 );
347 
348 private:
349  /**
350  * Subdivides a triangle with one valid subdividable new vertex: Vertices should be rotated so that
351  * the subdividable point lies between vertex ID 0 and vertex ID 1. There's no interpolation but
352  * putting triangles at existing and calculated vertices..
353  * \author schwarzkopf
354  * \param vertID0 First vertex ID of the triangle.
355  * \param vertID1 Second vertex ID of the triangle.
356  * \param vertID2 Third vertex ID of the triangle.
357  * \param new0_1id Subdivided Vertex ID between vertID0 and vertID1
358  */
359  void subdivideTriangleValidSum1( size_t vertID0, size_t vertID1, size_t vertID2, size_t new0_1id );
360 
361  /**
362  * Subdivides a triangle with two valid subdividable new vertices: Vertices should be rotated so that
363  * the not subdividable point lies between vertex ID 1 and vertex ID 2. There's no interpolation
364  * but putting triangles at existing and calculated vertices..
365  * \author schwarzkopf
366  * \param vertID0 First vertex ID of the triangle.
367  * \param vertID1 Second vertex ID of the triangle.
368  * \param vertID2 Third vertex ID of the triangle.
369  * \param new0_1id Subdivided Vertex ID between vertID0 and vertID1
370  * \param new0_2id Subdivided Vertex ID between vertID0 and vertID2
371  */
372  void subdivideTriangleValidSum2( size_t vertID0, size_t vertID1, size_t vertID2, size_t new0_1id, size_t new0_2id );
373 
374  /**
375  * Subdivides a triangle with all valid subdividable new vertices. There's no interpolation but
376  * putting triangles at existing and calculated vertices..
377  * \author schwarzkopf
378  * \param vertID0 First vertex ID of the triangle.
379  * \param vertID1 Second vertex ID of the triangle.
380  * \param vertID2 Third vertex ID of the triangle.
381  * \param new0_1id Subdivided Vertex ID between vertID0 and vertID1
382  * \param new0_2id Subdivided Vertex ID between vertID0 and vertID2
383  * \param new1_2id Subdivided Vertex ID between vertID1 and vertID2
384  */
385  void subdivideTriangleValidSum3( size_t vertID0, size_t vertID1, size_t vertID2, size_t new0_1id, size_t new0_2id, size_t new1_2id );
386 
387  /**
388  * Associated triangle mesh for validation instances.
389  */
390  std::shared_ptr< WTriangleMesh > m_processedMesh;
391 
392  /**
393  * Associated analysis data of the the triangle mesh to be validated.
394  */
396 
397  /**
398  * Angle setting which both angles at the subdivided line ends should be at
399  * least as big as this value. The regarded triangle consists of the two subdivided
400  * line end points and the new vertex.
401  */
403 
404  /**
405  * Angle setting which both angles at the subdivided line ends should be not
406  * bigger than this value. The regarded triangle consists of the two subdivided
407  * line end points and the new vertex.
408  */
410 
411  /**
412  * Maximum factor which the following lines should differ to show a valid
413  * subdivision. Both lines are measured from the new subdivided point and end at the
414  * ends of the subdivided line end.
415  */
417 
418  /**
419  * Factor for multiplying the maximal distance to a neighbour within the Butterfly
420  * stencil. Lines are not subdivided being smaller than this distance multiplied by it.
421  */
423 
424  /**
425  * Factor for multiplying the average distance to a neighbour within the Butterfly
426  * stencil. Lines are not subdivided being smaller than the average distance multiplied by it.
427  */
429 
430  /**
431  * The minimal subdividable line length. Lines of smaller distance than this are not
432  * subdivided.
433  */
435 
436  /**
437  * The factor where the minimal subdivided line length is multiplied by in each
438  * Subdivision iteration step.
439  */
441 
442  /**
443  * The Minimal allowed angle between two Subdivided line ends. If the two points have
444  * a triangle where the angle is at least in one triangle cutting that vertices amaller than
445  * this so the coordinates will be interpolated between the mean of the two neighbors and
446  * its Butterfly subdivision used one, weighted using the minimal transformation angle.
447  */
449 
450  /**
451  * A subdivision is marked as invalid if the angle between any neighbor triangle line
452  * is above that angle.
453  */
455 
456  /**
457  * This settings extends m_maxNeighbourTriangleAngle;
458  * If the line length is smaller than the subdividable line by this ratio, then it won't
459  * be marked as invalid.
460  */
462 
463  /**
464  * The Factor for comparison to the maximal length of a triangle. Lines smaller than this
465  * force a joint of the corresponding two vertices. The triangle falls finally away.
466  */
468 
469  /**
470  * The Minimal allowed angle which fits in both vertices at a subdividable line end.
471  * An existing triangle where both angles fit in forces it to rotate it with the other triangle
472  * connected with that vertices araund the four vertices of that two triangles. There is no
473  * application if the final state would be also invalid.
474  */
476 };
477 
478 } //namespace butterfly
479 #endif // WSUBDIVISIONVALIDATOR_H
Class that validates the Butterfly subdivision.
bool isValidMinAmountOfMax(size_t vertID1, size_t vertID2, float lengthC)
Subdivision is valid if the subdivided line is at least as long as the longest line to a neighbor mul...
bool isValidSubdivision(size_t vertID1, size_t vertID2, osg::Vec3 newVert)
This function checks a subdivided line between two vertices for correctness.
bool isValidMinLengthsQuotient(float lengthA, float lengthB)
Regards the lengths from the new subdivided new vertex.
std::shared_ptr< WTriangleMesh > m_processedMesh
Associated triangle mesh for validation instances.
float m_maxAmountOfMaxForVertexJoin
The Factor for comparison to the maximal length of a triangle.
float m_minLenghtsQuotient
Maximum factor which the following lines should differ to show a valid subdivision.
void setMinMeighbourTriangleAngle(float minNeighbourTriangleAngle)
Sets the Minimal allowed angle between two Subdivided line ends.
float getMinSubdividedLineLengthMultiplierPerIteration()
Gets the factor where the minimal subdivided line length is multiplied by in each Subdivision iterati...
void setMinSubdividedLineLength(float minSubdividedLineLength)
Sets the minimal subdividable line length.
osg::Vec3 getValidatedSubdivision(size_t vertID1, size_t vertID2, osg::Vec3 interpolatedVertex)
Corrects Coordinates if they are determined to be invalid using validation settings.
void subdivideTriangle(size_t vertID0, size_t vertID1, size_t vertID2)
Subdivides the triangle at three vertex IDs regarding the not subdividable new vertices at lines betw...
void setMinTransformationAngle(float minTransformationAngle)
Sets up the angle setting which both angles at the subdivided line ends should be at least as big as ...
void setMinAmountOfMax(float minAmountOfMax)
Sets the factor for multiplying the maximal distance to a neighbour within the Butterfly stencil.
std::shared_ptr< WTriangleMesh > joinNarrowVertices(std::shared_ptr< WTriangleMesh > inputMesh)
Joins Vertices where a triangle side is smaller than the longest one multiplied by a factor.
float m_minSubdividedLineLength
The minimal subdividable line length.
void subdivideTriangleValidSum2(size_t vertID0, size_t vertID1, size_t vertID2, size_t new0_1id, size_t new0_2id)
Subdivides a triangle with two valid subdividable new vertices: Vertices should be rotated so that th...
void setMinAmountOfAverage(float minAmountOfAverage)
Sets the factor for multiplying the average distance to a neighbour within the Butterfly stencil.
bool isValidMaxTransformationAngle(float lengthA, float lengthB, float lengthC)
Checks whether both angles at the subdivided line ends are not bigger than a defined maximal value.
void setMaxNeighbourTriangleAngle(float maxNeighbourTriangleAngle, float maxNeighbourTriangleAngleLengthRatio)
Sets settings of the further feature: A subdivision is marked as invalid if the angle between any nei...
void setMinLenghtsQuotient(float minLenghtsQuotient)
Sets the maximum factor which the following lines should differ to show a valid subdivision.
std::shared_ptr< WTriangleMesh > flipTrianglesAtLowAngles(std::shared_ptr< WTriangleMesh > inputMesh)
Searchs for all triangles which has two angles below a preset value.
WVertexFactory * m_vertexFactory
Associated analysis data of the the triangle mesh to be validated.
void subdivideTriangleValidSum1(size_t vertID0, size_t vertID1, size_t vertID2, size_t new0_1id)
Subdivides a triangle with one valid subdividable new vertex: Vertices should be rotated so that the ...
float m_maxNeighbourTriangleAngleLengthRatio
This settings extends m_maxNeighbourTriangleAngle; If the line length is smaller than the subdividabl...
float m_minSubdividedLineLengthMultiplierPerIteration
The factor where the minimal subdivided line length is multiplied by in each Subdivision iteration st...
WSubdivisionValidator()
Creates the Butterfly subdivision validation instance.
void setMinSubdividedLineLengthMultiplierPerIteration(float minSubdividedLineLengthMultiplierPerIteration)
Sets the factor where the minimal subdivided line length is multiplied by in each Subdivision iterati...
float getMinSubdividedLineLength()
Gets the minimal subdividable line length.
void generateStatisticalInformation()
Generating statistical information of the triangle mesh.
float m_maxNeighbourTriangleAngleTriangleFlip
The Minimal allowed angle which fits in both vertices at a subdividable line end.
void setTriangleMesh(std::shared_ptr< WTriangleMesh > processedMesh, WVertexFactory *vertexFactory)
Assign analyzable triangle mesh.
bool isValidMinAmountOfAverage(size_t vertID1, size_t vertID2, float lengthC)
Subdivision is valid if the subdivided line is at least as long as the average line to a neighbor mul...
float m_minAmountOfAverage
Factor for multiplying the average distance to a neighbour within the Butterfly stencil.
void setMaxNeighbourTriangleAngleTriangleFlip(float maxNeighbourTriangleAngleTriangleFlip)
Sets the Minimal allowed angle which fits in both vertices at a subdividable line end.
static float getAlphaLawOfCosines(float lengthA, float lengthB, float lengthC)
The law of cosines.
float m_maxNeighbourTriangleAngle
A subdivision is marked as invalid if the angle between any neighbor triangle line is above that angl...
void setMaxTransformationAngle(float maxTransformationAngle)
Sets up the angle setting which both angles at the subdivided line ends should be not bigger than thi...
float m_minAmountOfMax
Factor for multiplying the maximal distance to a neighbour within the Butterfly stencil.
float getMinTrianglesAngle(size_t vertID1, size_t vertID2, bool maxInTriangle)
Get the minimal triangle angle at the two vertices searching all triangles connected to that points.
bool isValidMinSubdividedLineLength(float lengthC)
Checks whether a subdividable line length is not longer than a set up length setting.
virtual ~WSubdivisionValidator()
Destroys the Butterfly subdivision validation instance.
float m_maxTransformationAngle
Angle setting which both angles at the subdivided line ends should be not bigger than this value.
void setMaxAmountOfMaxForVertexJoin(float maxAmountOfMaxForVertexJoin)
Sets the Factor for comparison to the maximal length of a triangle.
bool isValidMaxNeighbourTriangleAngle(size_t vertID1, size_t vertID2, float lengthC)
Checks whether .the angle between the subdividable line and any other line of all neighbor triangles ...
float m_minNeighbourTriangleAngle
The Minimal allowed angle between two Subdivided line ends.
float m_minTransformationAngle
Angle setting which both angles at the subdivided line ends should be at least as big as this value.
bool isValidMinTransformationAngle(float lengthA, float lengthB, float lengthC)
Checks whether both angles at the subdivided line ends are at least as big as a defined minimal value...
void subdivideTriangleValidSum3(size_t vertID0, size_t vertID1, size_t vertID2, size_t new0_1id, size_t new0_2id, size_t new1_2id)
Subdivides a triangle with all valid subdividable new vertices.
Class that manages all vertex properties.