OpenWalnut
1.5.0dev
|
Class that validates the Butterfly subdivision. More...
#include <WSubdivisionValidator.h>
Public Member Functions | |
WSubdivisionValidator () | |
Creates the Butterfly subdivision validation instance. More... | |
virtual | ~WSubdivisionValidator () |
Destroys the Butterfly subdivision validation instance. More... | |
void | setTriangleMesh (std::shared_ptr< WTriangleMesh > processedMesh, WVertexFactory *vertexFactory) |
Assign analyzable triangle mesh. More... | |
void | generateStatisticalInformation () |
Generating statistical information of the triangle mesh. More... | |
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. More... | |
std::shared_ptr< WTriangleMesh > | flipTrianglesAtLowAngles (std::shared_ptr< WTriangleMesh > inputMesh) |
Searchs for all triangles which has two angles below a preset value. More... | |
osg::Vec3 | getValidatedSubdivision (size_t vertID1, size_t vertID2, osg::Vec3 interpolatedVertex) |
Corrects Coordinates if they are determined to be invalid using validation settings. More... | |
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. More... | |
bool | isValidSubdivision (size_t vertID1, size_t vertID2, osg::Vec3 newVert) |
This function checks a subdivided line between two vertices for correctness. More... | |
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 multiplied by a set up factor. More... | |
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 multiplied by a set up factor. More... | |
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. More... | |
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. More... | |
bool | isValidMinLengthsQuotient (float lengthA, float lengthB) |
Regards the lengths from the new subdivided new vertex. More... | |
bool | isValidMinSubdividedLineLength (float lengthC) |
Checks whether a subdividable line length is not longer than a set up length setting. More... | |
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 not exceeds the set up angle. More... | |
void | setMinTransformationAngle (float minTransformationAngle) |
Sets up the angle setting which both angles at the subdivided line ends should be at least as big as this value. More... | |
void | setMaxTransformationAngle (float maxTransformationAngle) |
Sets up the angle setting which both angles at the subdivided line ends should be not bigger than this value. More... | |
void | setMinLenghtsQuotient (float minLenghtsQuotient) |
Sets the maximum factor which the following lines should differ to show a valid subdivision. More... | |
void | setMinAmountOfMax (float minAmountOfMax) |
Sets the factor for multiplying the maximal distance to a neighbour within the Butterfly stencil. More... | |
void | setMinAmountOfAverage (float minAmountOfAverage) |
Sets the factor for multiplying the average distance to a neighbour within the Butterfly stencil. More... | |
float | getMinSubdividedLineLength () |
Gets the minimal subdividable line length. More... | |
void | setMinSubdividedLineLength (float minSubdividedLineLength) |
Sets the minimal subdividable line length. More... | |
float | getMinSubdividedLineLengthMultiplierPerIteration () |
Gets the factor where the minimal subdivided line length is multiplied by in each Subdivision iteration step. More... | |
void | setMinSubdividedLineLengthMultiplierPerIteration (float minSubdividedLineLengthMultiplierPerIteration) |
Sets the factor where the minimal subdivided line length is multiplied by in each Subdivision iteration step. More... | |
void | setMinMeighbourTriangleAngle (float minNeighbourTriangleAngle) |
Sets the Minimal allowed angle between two Subdivided line ends. More... | |
void | setMaxNeighbourTriangleAngle (float maxNeighbourTriangleAngle, float maxNeighbourTriangleAngleLengthRatio) |
Sets settings of the further feature: A subdivision is marked as invalid if the angle between any neighbor triangle line is above that angle. More... | |
void | setMaxAmountOfMaxForVertexJoin (float maxAmountOfMaxForVertexJoin) |
Sets the Factor for comparison to the maximal length of a triangle. More... | |
void | setMaxNeighbourTriangleAngleTriangleFlip (float maxNeighbourTriangleAngleTriangleFlip) |
Sets the Minimal allowed angle which fits in both vertices at a subdividable line end. More... | |
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 between some vertices at the triangle. More... | |
Static Public Member Functions | |
static float | getAlphaLawOfCosines (float lengthA, float lengthB, float lengthC) |
The law of cosines. More... | |
Private Member Functions | |
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 subdividable point lies between vertex ID 0 and vertex ID 1. More... | |
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 the not subdividable point lies between vertex ID 1 and vertex ID 2. More... | |
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. More... | |
Private Attributes | |
std::shared_ptr< WTriangleMesh > | m_processedMesh |
Associated triangle mesh for validation instances. More... | |
WVertexFactory * | m_vertexFactory |
Associated analysis data of the the triangle mesh to be validated. More... | |
float | m_minTransformationAngle |
Angle setting which both angles at the subdivided line ends should be at least as big as this value. More... | |
float | m_maxTransformationAngle |
Angle setting which both angles at the subdivided line ends should be not bigger than this value. More... | |
float | m_minLenghtsQuotient |
Maximum factor which the following lines should differ to show a valid subdivision. More... | |
float | m_minAmountOfMax |
Factor for multiplying the maximal distance to a neighbour within the Butterfly stencil. More... | |
float | m_minAmountOfAverage |
Factor for multiplying the average distance to a neighbour within the Butterfly stencil. More... | |
float | m_minSubdividedLineLength |
The minimal subdividable line length. More... | |
float | m_minSubdividedLineLengthMultiplierPerIteration |
The factor where the minimal subdivided line length is multiplied by in each Subdivision iteration step. More... | |
float | m_minNeighbourTriangleAngle |
The Minimal allowed angle between two Subdivided line ends. More... | |
float | m_maxNeighbourTriangleAngle |
A subdivision is marked as invalid if the angle between any neighbor triangle line is above that angle. More... | |
float | m_maxNeighbourTriangleAngleLengthRatio |
This settings extends m_maxNeighbourTriangleAngle; If the line length is smaller than the subdividable line by this ratio, then it won't be marked as invalid. More... | |
float | m_maxAmountOfMaxForVertexJoin |
The Factor for comparison to the maximal length of a triangle. More... | |
float | m_maxNeighbourTriangleAngleTriangleFlip |
The Minimal allowed angle which fits in both vertices at a subdividable line end. More... | |
Class that validates the Butterfly subdivision.
It contains preprocessing and validation during subdivision.
Definition at line 39 of file WSubdivisionValidator.h.
butterfly::WSubdivisionValidator::WSubdivisionValidator | ( | ) |
Creates the Butterfly subdivision validation instance.
Definition at line 34 of file WSubdivisionValidator.cpp.
References m_maxAmountOfMaxForVertexJoin, m_maxNeighbourTriangleAngle, m_maxNeighbourTriangleAngleLengthRatio, m_maxNeighbourTriangleAngleTriangleFlip, m_maxTransformationAngle, m_minAmountOfAverage, m_minAmountOfMax, m_minLenghtsQuotient, m_minNeighbourTriangleAngle, m_minSubdividedLineLength, m_minSubdividedLineLengthMultiplierPerIteration, m_minTransformationAngle, m_processedMesh, and m_vertexFactory.
|
virtual |
Destroys the Butterfly subdivision validation instance.
Definition at line 52 of file WSubdivisionValidator.cpp.
std::shared_ptr< WTriangleMesh > butterfly::WSubdivisionValidator::flipTrianglesAtLowAngles | ( | std::shared_ptr< WTriangleMesh > | inputMesh | ) |
Searchs for all triangles which has two angles below a preset value.
Found values will be rotate by one step with the triangle connected by these low angle points. The rotation is done over these For vertices. No application if the final state would also have invalid angles.
inputMesh | Input mesh to process and put out |
Definition at line 161 of file WSubdivisionValidator.cpp.
References WVertexProperty::attachTriangle(), WVertexProperty::detachTriangle(), butterfly::WVertexFactory::get3rdVertexID(), getAlphaLawOfCosines(), butterfly::WVertexFactory::getAttachedTriangleIDs(), butterfly::WVertexFactory::getDistance(), getMinTrianglesAngle(), butterfly::WVertexFactory::getProperty(), m_maxNeighbourTriangleAngleTriangleFlip, m_processedMesh, and m_vertexFactory.
Referenced by butterfly::WButterflyFactory::applyMeshPreprocessing().
void butterfly::WSubdivisionValidator::generateStatisticalInformation | ( | ) |
Generating statistical information of the triangle mesh.
The data is stored in the vertex factory. Currently it's the maximal neighbor distance and sum of all distances.
Definition at line 62 of file WSubdivisionValidator.cpp.
References butterfly::WVertexFactory::getDistance(), butterfly::WVertexFactory::getProperty(), WVertexProperty::getValence(), butterfly::WVertexFactory::getVertexCount(), m_processedMesh, and m_vertexFactory.
Referenced by butterfly::WButterflyFactory::examineVertexNeighborhood().
|
static |
The law of cosines.
a^2=b^2+c^2-2bc cos alpha
It returns the angle at point A. Exchange of lengthB and lengthC has no bad result effect..
lengthA | The length of the triangle at the opposite to the point A |
lengthB | The length of the triangle at the opposite to the point B |
lengthC | The length of the triangle at the opposite to the point C |
Definition at line 424 of file WSubdivisionValidator.cpp.
Referenced by flipTrianglesAtLowAngles(), getMinTrianglesAngle(), isValidMaxNeighbourTriangleAngle(), isValidMaxTransformationAngle(), and isValidMinTransformationAngle().
float butterfly::WSubdivisionValidator::getMinSubdividedLineLength | ( | ) |
Gets the minimal subdividable line length.
Lines of smaller distance than this are not subdivided..
Definition at line 456 of file WSubdivisionValidator.cpp.
References m_minSubdividedLineLength.
Referenced by butterfly::WButterflyFactory::getSubdividedMesh().
float butterfly::WSubdivisionValidator::getMinSubdividedLineLengthMultiplierPerIteration | ( | ) |
Gets the factor where the minimal subdivided line length is multiplied by in each Subdivision iteration step.
Definition at line 464 of file WSubdivisionValidator.cpp.
References m_minSubdividedLineLengthMultiplierPerIteration.
Referenced by butterfly::WButterflyFactory::getSubdividedMesh().
float butterfly::WSubdivisionValidator::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.
vertID1 | First connected vertex to triangles. |
vertID2 | Second connected vertex to triangles. |
maxInTriangle | Taking the bigger of both angles for minimum angle search. |
Definition at line 394 of file WSubdivisionValidator.cpp.
References butterfly::WVertexFactory::get3rdVertexID(), getAlphaLawOfCosines(), butterfly::WVertexFactory::getAttachedTriangleIDs(), butterfly::WVertexFactory::getDistance(), m_processedMesh, and m_vertexFactory.
Referenced by flipTrianglesAtLowAngles(), and getValidatedSubdivision().
osg::Vec3 butterfly::WSubdivisionValidator::getValidatedSubdivision | ( | size_t | vertID1, |
size_t | vertID2, | ||
osg::Vec3 | interpolatedVertex | ||
) |
Corrects Coordinates if they are determined to be invalid using validation settings.
Currently this function only calculates the mean between the proposed Butterfly calculated value and the mean between the two vertices. The weight is used comparing the current smallest angle compared to the minimal allowed. It is applied if the interpolated line cuts a triangle with an angle at this side below the set up angle.
vertID1 | First vertex of the interpolated line. |
vertID2 | Second vertex of the interpolated line. |
interpolatedVertex | The interpolated vertex between the two vertices. |
Definition at line 255 of file WSubdivisionValidator.cpp.
References butterfly::WVertexFactory::add(), getMinTrianglesAngle(), m_minNeighbourTriangleAngle, and m_processedMesh.
Referenced by butterfly::WButterflyFactory::interpolateNewVerticesRange().
bool butterfly::WSubdivisionValidator::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 not exceeds the set up angle.
Vertices aren't invalidated if the connected line is shorter than the ratio ov the subdivided line length.
vertID1 | First vertex of the subdividable line |
vertID2 | Second vertex of the subdividable line |
lengthC | Precalculated scalar distance between the two vertices. |
Definition at line 366 of file WSubdivisionValidator.cpp.
References butterfly::WVertexFactory::get3rdVertexID(), getAlphaLawOfCosines(), butterfly::WVertexFactory::getAttachedTriangleIDs(), butterfly::WVertexFactory::getDistance(), m_maxNeighbourTriangleAngle, m_maxNeighbourTriangleAngleLengthRatio, m_processedMesh, and m_vertexFactory.
Referenced by isValidSubdivision().
bool butterfly::WSubdivisionValidator::isValidMaxTransformationAngle | ( | float | lengthA, |
float | lengthB, | ||
float | lengthC | ||
) |
Checks whether both angles at the subdivided line ends are not bigger than a defined maximal value.
The regarded triangle consists of the two subdivided line end points and the new vertex..
lengthA | Line length from the new point to the first line end point. |
lengthB | Line length from the new point to the second line end point. |
lengthC | Line length between the two subdivided line end points. |
Definition at line 339 of file WSubdivisionValidator.cpp.
References getAlphaLawOfCosines(), and m_maxTransformationAngle.
Referenced by isValidSubdivision().
bool butterfly::WSubdivisionValidator::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 multiplied by a set up factor.
vertID1 | First vertex of the subdivided line. |
vertID2 | Second vertex of a subdivided line. |
lengthC | Line length between the two points to be checked. |
Definition at line 312 of file WSubdivisionValidator.cpp.
References butterfly::WVertexFactory::getProperty(), WVertexProperty::getSumNeighbourDistance(), WVertexProperty::getValence(), m_minAmountOfAverage, and m_vertexFactory.
Referenced by isValidSubdivision().
bool butterfly::WSubdivisionValidator::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 multiplied by a set up factor.
vertID1 | First vertex of the subdivided line. |
vertID2 | Second vertex of a subdivided line. |
lengthC | Line length between the two points to be checked. |
Definition at line 303 of file WSubdivisionValidator.cpp.
References WVertexProperty::getMaxNeighbourDistance(), butterfly::WVertexFactory::getProperty(), m_minAmountOfMax, and m_vertexFactory.
Referenced by isValidSubdivision().
bool butterfly::WSubdivisionValidator::isValidMinLengthsQuotient | ( | float | lengthA, |
float | lengthB | ||
) |
Regards the lengths from the new subdivided new vertex.
Returns whether the distance to one subdivided line end to the distance of from the new point to the other line end not more than by a set up factor..
lengthA | Length from the subdivided line new vertex to the first line end. |
lengthB | Length from the subdivided line new vertex to the second line end. |
Definition at line 352 of file WSubdivisionValidator.cpp.
References m_minLenghtsQuotient.
Referenced by isValidSubdivision().
bool butterfly::WSubdivisionValidator::isValidMinSubdividedLineLength | ( | float | lengthC | ) |
Checks whether a subdividable line length is not longer than a set up length setting.
lengthC | Subdividable line length to examine.. |
Definition at line 359 of file WSubdivisionValidator.cpp.
References m_minSubdividedLineLength.
Referenced by isValidSubdivision().
bool butterfly::WSubdivisionValidator::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.
The regarded triangle consists of the two subdivided line end points and the new vertex..
lengthA | Line length from the new point to the first line end point. |
lengthB | Line length from the new point to the second line end point. |
lengthC | Line length between the two subdivided line end points. |
Definition at line 326 of file WSubdivisionValidator.cpp.
References getAlphaLawOfCosines(), and m_minTransformationAngle.
Referenced by isValidSubdivision().
bool butterfly::WSubdivisionValidator::isValidSubdivision | ( | size_t | vertID1, |
size_t | vertID2, | ||
osg::Vec3 | newVert | ||
) |
This function checks a subdivided line between two vertices for correctness.
In order to check all functions with he name "isValid*" below are executed. If one of them returns false then a line should not be subdivided.
vertID1 | First connecting vertex. |
vertID2 | Second connecting vertex. |
newVert | New interpolated point that should be checked. |
Definition at line 270 of file WSubdivisionValidator.cpp.
References butterfly::WVertexFactory::getDistance(), isValidMaxNeighbourTriangleAngle(), isValidMaxTransformationAngle(), isValidMinAmountOfAverage(), isValidMinAmountOfMax(), isValidMinLengthsQuotient(), isValidMinSubdividedLineLength(), isValidMinTransformationAngle(), and m_processedMesh.
Referenced by butterfly::WButterflyFactory::interpolateNewVerticesRange().
std::shared_ptr< WTriangleMesh > butterfly::WSubdivisionValidator::joinNarrowVertices | ( | std::shared_ptr< WTriangleMesh > | inputMesh | ) |
Joins Vertices where a triangle side is smaller than the longest one multiplied by a factor.
inputMesh | Input mesh to process and put out |
Definition at line 85 of file WSubdivisionValidator.cpp.
References butterfly::WVertexFactory::add(), WVertexProperty::attachTriangle(), WVertexProperty::detachTriangle(), WVertexProperty::getAttachedTriangles(), butterfly::WVertexFactory::getDistance(), butterfly::WVertexFactory::getProperty(), m_maxAmountOfMaxForVertexJoin, and m_vertexFactory.
Referenced by butterfly::WButterflyFactory::applyMeshPreprocessing().
void butterfly::WSubdivisionValidator::setMaxAmountOfMaxForVertexJoin | ( | float | maxAmountOfMaxForVertexJoin | ) |
Sets the Factor for comparison to the maximal length of a triangle.
Lines smaller than this force a joint of the corresponding two vertices. The triangle falls finally away.
maxAmountOfMaxForVertexJoin | The factor of the smallest line end in comparison to the longest one within a triangle. |
Definition at line 483 of file WSubdivisionValidator.cpp.
References m_maxAmountOfMaxForVertexJoin.
Referenced by WMButterfly::moduleMain().
void butterfly::WSubdivisionValidator::setMaxNeighbourTriangleAngle | ( | float | maxNeighbourTriangleAngle, |
float | maxNeighbourTriangleAngleLengthRatio | ||
) |
Sets settings of the further feature: A subdivision is marked as invalid if the angle between any neighbor triangle line is above that angle.
maxNeighbourTriangleAngle | Maximal neighbour triangle angle not to mark a subdivision as invalid. |
maxNeighbourTriangleAngleLengthRatio | Subdivision isn't marked as invalid if the neighbor line at the too high angle is shorter in comparison to the subdividable line than by this ratio. |
Definition at line 477 of file WSubdivisionValidator.cpp.
References m_maxNeighbourTriangleAngle, and m_maxNeighbourTriangleAngleLengthRatio.
Referenced by WMButterfly::moduleMain().
void butterfly::WSubdivisionValidator::setMaxNeighbourTriangleAngleTriangleFlip | ( | float | maxNeighbourTriangleAngleTriangleFlip | ) |
Sets the Minimal allowed angle which fits in both vertices at a subdividable line end.
An existing triangle where both angles fit in forces it to rotate it with the other triangle connected with that vertices araund the four vertices of that two triangles. There is no application if the final state would be also invalid..
maxNeighbourTriangleAngleTriangleFlip | The minimal angle at the two subdividable line ends thaf force the rotation. |
Definition at line 487 of file WSubdivisionValidator.cpp.
References m_maxNeighbourTriangleAngleTriangleFlip.
Referenced by WMButterfly::moduleMain().
void butterfly::WSubdivisionValidator::setMaxTransformationAngle | ( | float | maxTransformationAngle | ) |
Sets up the angle setting which both angles at the subdivided line ends should be not bigger than this value.
The regarded triangle consists of the two subdivided line end points and the new vertex..
maxTransformationAngle | Max angle which both line ends should not exceed. |
Definition at line 440 of file WSubdivisionValidator.cpp.
References m_maxTransformationAngle.
Referenced by WMButterfly::moduleMain().
void butterfly::WSubdivisionValidator::setMinAmountOfAverage | ( | float | minAmountOfAverage | ) |
Sets the factor for multiplying the average distance to a neighbour within the Butterfly stencil.
Lines are not subdivided being smaller than the average distance multiplied by it.
minAmountOfAverage | Factor to determine whether the line is subdividable. |
Definition at line 452 of file WSubdivisionValidator.cpp.
References m_minAmountOfAverage.
Referenced by WMButterfly::moduleMain().
void butterfly::WSubdivisionValidator::setMinAmountOfMax | ( | float | minAmountOfMax | ) |
Sets the factor for multiplying the maximal distance to a neighbour within the Butterfly stencil.
Lines are not subdivided being smaller than this distance multiplied by it.
minAmountOfMax | Factor to determine whether the line is subdividable. |
Definition at line 448 of file WSubdivisionValidator.cpp.
References m_minAmountOfMax.
Referenced by WMButterfly::moduleMain().
void butterfly::WSubdivisionValidator::setMinLenghtsQuotient | ( | float | minLenghtsQuotient | ) |
Sets the maximum factor which the following lines should differ to show a valid subdivision.
Both lines are measured from the new subdivided point and end at the ends of the subdivided line end..
minLenghtsQuotient | Maximal allowed difference factor. The smaller the value the bigger is the allowed difference. |
Definition at line 444 of file WSubdivisionValidator.cpp.
References m_minLenghtsQuotient.
Referenced by WMButterfly::moduleMain().
void butterfly::WSubdivisionValidator::setMinMeighbourTriangleAngle | ( | float | minNeighbourTriangleAngle | ) |
Sets the Minimal allowed angle between two Subdivided line ends.
If the two points have a triangle where the angle is at least in one triangle cutting that vertices amaller than this so the coordinates will be interpolated between the mean of the two neighbors and its Butterfly subdivision used one, weighted using the minimal transformation angle.
minNeighbourTriangleAngle | Minimal allowed angle between two Subdivided line ends. |
Definition at line 473 of file WSubdivisionValidator.cpp.
References m_minNeighbourTriangleAngle.
Referenced by WMButterfly::moduleMain().
void butterfly::WSubdivisionValidator::setMinSubdividedLineLength | ( | float | minSubdividedLineLength | ) |
Sets the minimal subdividable line length.
Lines of smaller distance than this are not subdivided..
minSubdividedLineLength | Minimal subdidvidable line length. |
Definition at line 460 of file WSubdivisionValidator.cpp.
References m_minSubdividedLineLength.
Referenced by butterfly::WButterflyFactory::getSubdividedMesh(), and WMButterfly::moduleMain().
void butterfly::WSubdivisionValidator::setMinSubdividedLineLengthMultiplierPerIteration | ( | float | minSubdividedLineLengthMultiplierPerIteration | ) |
Sets the factor where the minimal subdivided line length is multiplied by in each Subdivision iteration step.
minSubdividedLineLengthMultiplierPerIteration | The factor which multiplies the mimimal subdividable line length each Iteration step. |
Definition at line 468 of file WSubdivisionValidator.cpp.
References m_minSubdividedLineLengthMultiplierPerIteration.
Referenced by WMButterfly::moduleMain().
void butterfly::WSubdivisionValidator::setMinTransformationAngle | ( | float | minTransformationAngle | ) |
Sets up the angle setting which both angles at the subdivided line ends should be at least as big as this value.
The regarded triangle consists of the two subdivided line end points and the new vertex..
minTransformationAngle | Min angle which both line ends should exceed. |
Definition at line 436 of file WSubdivisionValidator.cpp.
References m_minTransformationAngle.
Referenced by WMButterfly::moduleMain().
void butterfly::WSubdivisionValidator::setTriangleMesh | ( | std::shared_ptr< WTriangleMesh > | processedMesh, |
WVertexFactory * | vertexFactory | ||
) |
Assign analyzable triangle mesh.
processedMesh | Triangle mesh that should be processed. |
vertexFactory | Vertex factory for Triangle mesh examination. |
Definition at line 57 of file WSubdivisionValidator.cpp.
References m_processedMesh, and m_vertexFactory.
Referenced by butterfly::WButterflyFactory::applyMeshPreprocessing(), and butterfly::WButterflyFactory::examineVertexNeighborhood().
void butterfly::WSubdivisionValidator::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 between some vertices at the triangle.
There's no interpolation but putting triangles at existing and calculated vertices..
vertID0 | First vertex ID of the triangle. |
vertID1 | Second vertex ID of the triangle. |
vertID2 | Third vertex ID of the triangle. |
Definition at line 491 of file WSubdivisionValidator.cpp.
References butterfly::WNewVertex::getNewVertexID(), butterfly::WVertexFactory::getNewVertexProperty(), butterfly::WNewVertex::isValid(), m_processedMesh, m_vertexFactory, subdivideTriangleValidSum1(), subdivideTriangleValidSum2(), and subdivideTriangleValidSum3().
Referenced by butterfly::WButterflyFactory::addInterpolatedContent().
|
private |
Subdivides a triangle with one valid subdividable new vertex: Vertices should be rotated so that the subdividable point lies between vertex ID 0 and vertex ID 1.
There's no interpolation but putting triangles at existing and calculated vertices..
vertID0 | First vertex ID of the triangle. |
vertID1 | Second vertex ID of the triangle. |
vertID2 | Third vertex ID of the triangle. |
new0_1id | Subdivided Vertex ID between vertID0 and vertID1 |
Definition at line 539 of file WSubdivisionValidator.cpp.
References m_processedMesh.
Referenced by subdivideTriangle().
|
private |
Subdivides a triangle with two valid subdividable new vertices: Vertices should be rotated so that the not subdividable point lies between vertex ID 1 and vertex ID 2.
There's no interpolation but putting triangles at existing and calculated vertices..
vertID0 | First vertex ID of the triangle. |
vertID1 | Second vertex ID of the triangle. |
vertID2 | Third vertex ID of the triangle. |
new0_1id | Subdivided Vertex ID between vertID0 and vertID1 |
new0_2id | Subdivided Vertex ID between vertID0 and vertID2 |
Definition at line 544 of file WSubdivisionValidator.cpp.
References butterfly::WVertexFactory::getDistance(), and m_processedMesh.
Referenced by subdivideTriangle().
|
private |
Subdivides a triangle with all valid subdividable new vertices.
There's no interpolation but putting triangles at existing and calculated vertices..
vertID0 | First vertex ID of the triangle. |
vertID1 | Second vertex ID of the triangle. |
vertID2 | Third vertex ID of the triangle. |
new0_1id | Subdivided Vertex ID between vertID0 and vertID1 |
new0_2id | Subdivided Vertex ID between vertID0 and vertID2 |
new1_2id | Subdivided Vertex ID between vertID1 and vertID2 |
Definition at line 561 of file WSubdivisionValidator.cpp.
References m_processedMesh.
Referenced by subdivideTriangle().
|
private |
The Factor for comparison to the maximal length of a triangle.
Lines smaller than this force a joint of the corresponding two vertices. The triangle falls finally away.
Definition at line 467 of file WSubdivisionValidator.h.
Referenced by joinNarrowVertices(), setMaxAmountOfMaxForVertexJoin(), and WSubdivisionValidator().
|
private |
A subdivision is marked as invalid if the angle between any neighbor triangle line is above that angle.
Definition at line 454 of file WSubdivisionValidator.h.
Referenced by isValidMaxNeighbourTriangleAngle(), setMaxNeighbourTriangleAngle(), and WSubdivisionValidator().
|
private |
This settings extends m_maxNeighbourTriangleAngle; If the line length is smaller than the subdividable line by this ratio, then it won't be marked as invalid.
Definition at line 461 of file WSubdivisionValidator.h.
Referenced by isValidMaxNeighbourTriangleAngle(), setMaxNeighbourTriangleAngle(), and WSubdivisionValidator().
|
private |
The Minimal allowed angle which fits in both vertices at a subdividable line end.
An existing triangle where both angles fit in forces it to rotate it with the other triangle connected with that vertices araund the four vertices of that two triangles. There is no application if the final state would be also invalid.
Definition at line 475 of file WSubdivisionValidator.h.
Referenced by flipTrianglesAtLowAngles(), setMaxNeighbourTriangleAngleTriangleFlip(), and WSubdivisionValidator().
|
private |
Angle setting which both angles at the subdivided line ends should be not bigger than this value.
The regarded triangle consists of the two subdivided line end points and the new vertex.
Definition at line 409 of file WSubdivisionValidator.h.
Referenced by isValidMaxTransformationAngle(), setMaxTransformationAngle(), and WSubdivisionValidator().
|
private |
Factor for multiplying the average distance to a neighbour within the Butterfly stencil.
Lines are not subdivided being smaller than the average distance multiplied by it.
Definition at line 428 of file WSubdivisionValidator.h.
Referenced by isValidMinAmountOfAverage(), setMinAmountOfAverage(), and WSubdivisionValidator().
|
private |
Factor for multiplying the maximal distance to a neighbour within the Butterfly stencil.
Lines are not subdivided being smaller than this distance multiplied by it.
Definition at line 422 of file WSubdivisionValidator.h.
Referenced by isValidMinAmountOfMax(), setMinAmountOfMax(), and WSubdivisionValidator().
|
private |
Maximum factor which the following lines should differ to show a valid subdivision.
Both lines are measured from the new subdivided point and end at the ends of the subdivided line end.
Definition at line 416 of file WSubdivisionValidator.h.
Referenced by isValidMinLengthsQuotient(), setMinLenghtsQuotient(), and WSubdivisionValidator().
|
private |
The Minimal allowed angle between two Subdivided line ends.
If the two points have a triangle where the angle is at least in one triangle cutting that vertices amaller than this so the coordinates will be interpolated between the mean of the two neighbors and its Butterfly subdivision used one, weighted using the minimal transformation angle.
Definition at line 448 of file WSubdivisionValidator.h.
Referenced by getValidatedSubdivision(), setMinMeighbourTriangleAngle(), and WSubdivisionValidator().
|
private |
The minimal subdividable line length.
Lines of smaller distance than this are not subdivided.
Definition at line 434 of file WSubdivisionValidator.h.
Referenced by getMinSubdividedLineLength(), isValidMinSubdividedLineLength(), setMinSubdividedLineLength(), and WSubdivisionValidator().
|
private |
The factor where the minimal subdivided line length is multiplied by in each Subdivision iteration step.
Definition at line 440 of file WSubdivisionValidator.h.
Referenced by getMinSubdividedLineLengthMultiplierPerIteration(), setMinSubdividedLineLengthMultiplierPerIteration(), and WSubdivisionValidator().
|
private |
Angle setting which both angles at the subdivided line ends should be at least as big as this value.
The regarded triangle consists of the two subdivided line end points and the new vertex.
Definition at line 402 of file WSubdivisionValidator.h.
Referenced by isValidMinTransformationAngle(), setMinTransformationAngle(), and WSubdivisionValidator().
|
private |
Associated triangle mesh for validation instances.
Definition at line 390 of file WSubdivisionValidator.h.
Referenced by flipTrianglesAtLowAngles(), generateStatisticalInformation(), getMinTrianglesAngle(), getValidatedSubdivision(), isValidMaxNeighbourTriangleAngle(), isValidSubdivision(), setTriangleMesh(), subdivideTriangle(), subdivideTriangleValidSum1(), subdivideTriangleValidSum2(), subdivideTriangleValidSum3(), and WSubdivisionValidator().
|
private |
Associated analysis data of the the triangle mesh to be validated.
Definition at line 395 of file WSubdivisionValidator.h.
Referenced by flipTrianglesAtLowAngles(), generateStatisticalInformation(), getMinTrianglesAngle(), isValidMaxNeighbourTriangleAngle(), isValidMinAmountOfAverage(), isValidMinAmountOfMax(), joinNarrowVertices(), setTriangleMesh(), subdivideTriangle(), and WSubdivisionValidator().