25 #ifndef WSUBDIVISIONVALIDATOR_H_
26 #define WSUBDIVISIONVALIDATOR_H_
31 #include "structure/WVertexFactory.h"
73 std::shared_ptr< WTriangleMesh > inputMesh );
84 std::shared_ptr< WTriangleMesh > inputMesh );
304 float maxNeighbourTriangleAngleLengthRatio );
385 void subdivideTriangleValidSum3(
size_t vertID0,
size_t vertID1,
size_t vertID2,
size_t new0_1id,
size_t new0_2id,
size_t new1_2id );
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.