OpenWalnut  1.5.0dev
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
butterfly::WSubdivisionValidator Class Reference

Class that validates the Butterfly subdivision. More...

#include <WSubdivisionValidator.h>

+ Collaboration diagram for butterfly::WSubdivisionValidator:

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< WTriangleMeshjoinNarrowVertices (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< WTriangleMeshflipTrianglesAtLowAngles (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< WTriangleMeshm_processedMesh
 Associated triangle mesh for validation instances. More...
 
WVertexFactorym_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...
 

Detailed Description

Class that validates the Butterfly subdivision.

It contains preprocessing and validation during subdivision.

Definition at line 39 of file WSubdivisionValidator.h.

Constructor & Destructor Documentation

◆ WSubdivisionValidator()

butterfly::WSubdivisionValidator::WSubdivisionValidator ( )

◆ ~WSubdivisionValidator()

butterfly::WSubdivisionValidator::~WSubdivisionValidator ( )
virtual

Destroys the Butterfly subdivision validation instance.

Definition at line 52 of file WSubdivisionValidator.cpp.

Member Function Documentation

◆ flipTrianglesAtLowAngles()

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.

Author
schwarzkopf
Parameters
inputMeshInput mesh to process and put out
Returns
Processed triangle mesh.

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ generateStatisticalInformation()

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.

Author
schwarzkopf

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAlphaLawOfCosines()

float butterfly::WSubdivisionValidator::getAlphaLawOfCosines ( float  lengthA,
float  lengthB,
float  lengthC 
)
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..

Author
schwarzkopf
Parameters
lengthAThe length of the triangle at the opposite to the point A
lengthBThe length of the triangle at the opposite to the point B
lengthCThe length of the triangle at the opposite to the point C
Returns
The angle at the side A.

Definition at line 424 of file WSubdivisionValidator.cpp.

Referenced by flipTrianglesAtLowAngles(), getMinTrianglesAngle(), isValidMaxNeighbourTriangleAngle(), isValidMaxTransformationAngle(), and isValidMinTransformationAngle().

+ Here is the caller graph for this function:

◆ getMinSubdividedLineLength()

float butterfly::WSubdivisionValidator::getMinSubdividedLineLength ( )

Gets the minimal subdividable line length.

Lines of smaller distance than this are not subdivided..

Author
schwarzkopf
Returns
Minimal subdidvidable line length

Definition at line 456 of file WSubdivisionValidator.cpp.

References m_minSubdividedLineLength.

Referenced by butterfly::WButterflyFactory::getSubdividedMesh().

+ Here is the caller graph for this function:

◆ getMinSubdividedLineLengthMultiplierPerIteration()

float butterfly::WSubdivisionValidator::getMinSubdividedLineLengthMultiplierPerIteration ( )

Gets the factor where the minimal subdivided line length is multiplied by in each Subdivision iteration step.

Returns
The factor which multiplies the mimimal subdividable line length each Iteration step.

Definition at line 464 of file WSubdivisionValidator.cpp.

References m_minSubdividedLineLengthMultiplierPerIteration.

Referenced by butterfly::WButterflyFactory::getSubdividedMesh().

+ Here is the caller graph for this function:

◆ getMinTrianglesAngle()

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.

Author
schwarzkopf
Parameters
vertID1First connected vertex to triangles.
vertID2Second connected vertex to triangles.
maxInTriangleTaking the bigger of both angles for minimum angle search.
Returns
Minimal angle of all triangles searched at the two vertices.

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ 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.

Author
schwarzkopf
Parameters
vertID1First vertex of the interpolated line.
vertID2Second vertex of the interpolated line.
interpolatedVertexThe interpolated vertex between the two vertices.
Returns
Corrected coordinate value.

Definition at line 255 of file WSubdivisionValidator.cpp.

References butterfly::WVertexFactory::add(), getMinTrianglesAngle(), m_minNeighbourTriangleAngle, and m_processedMesh.

Referenced by butterfly::WButterflyFactory::interpolateNewVerticesRange().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isValidMaxNeighbourTriangleAngle()

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.

Parameters
vertID1First vertex of the subdividable line
vertID2Second vertex of the subdividable line
lengthCPrecalculated scalar distance between the two vertices.
Returns
Subdivision is valid or not.

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isValidMaxTransformationAngle()

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..

Author
schwarzkopf
Parameters
lengthALine length from the new point to the first line end point.
lengthBLine length from the new point to the second line end point.
lengthCLine length between the two subdivided line end points.
Returns
Validity of the minimal allowed angle.

Definition at line 339 of file WSubdivisionValidator.cpp.

References getAlphaLawOfCosines(), and m_maxTransformationAngle.

Referenced by isValidSubdivision().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isValidMinAmountOfAverage()

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.

Author
schwarzkopf.
Parameters
vertID1First vertex of the subdivided line.
vertID2Second vertex of a subdivided line.
lengthCLine length between the two points to be checked.
Returns
Line is long enough in comparison to the average line of neighbors.

Definition at line 312 of file WSubdivisionValidator.cpp.

References butterfly::WVertexFactory::getProperty(), WVertexProperty::getSumNeighbourDistance(), WVertexProperty::getValence(), m_minAmountOfAverage, and m_vertexFactory.

Referenced by isValidSubdivision().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isValidMinAmountOfMax()

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.

Author
schwarzkopf.
Parameters
vertID1First vertex of the subdivided line.
vertID2Second vertex of a subdivided line.
lengthCLine length between the two points to be checked.
Returns
Line is long enough in comparison to all lines of neighbors.

Definition at line 303 of file WSubdivisionValidator.cpp.

References WVertexProperty::getMaxNeighbourDistance(), butterfly::WVertexFactory::getProperty(), m_minAmountOfMax, and m_vertexFactory.

Referenced by isValidSubdivision().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isValidMinLengthsQuotient()

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..

Author
schwarzkopf
Parameters
lengthALength from the subdivided line new vertex to the first line end.
lengthBLength from the subdivided line new vertex to the second line end.
Returns
Validity of the maximal allowed difference.

Definition at line 352 of file WSubdivisionValidator.cpp.

References m_minLenghtsQuotient.

Referenced by isValidSubdivision().

+ Here is the caller graph for this function:

◆ isValidMinSubdividedLineLength()

bool butterfly::WSubdivisionValidator::isValidMinSubdividedLineLength ( float  lengthC)

Checks whether a subdividable line length is not longer than a set up length setting.

Parameters
lengthCSubdividable line length to examine..
Author
schwarzkopf
Returns
Line is at least as long as the minimum set uplength.

Definition at line 359 of file WSubdivisionValidator.cpp.

References m_minSubdividedLineLength.

Referenced by isValidSubdivision().

+ Here is the caller graph for this function:

◆ isValidMinTransformationAngle()

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..

Author
schwarzkopf
Parameters
lengthALine length from the new point to the first line end point.
lengthBLine length from the new point to the second line end point.
lengthCLine length between the two subdivided line end points.
Returns
Validity of the minimal allowed angle.

Definition at line 326 of file WSubdivisionValidator.cpp.

References getAlphaLawOfCosines(), and m_minTransformationAngle.

Referenced by isValidSubdivision().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ 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.

Author
schwarzkopf.
Parameters
vertID1First connecting vertex.
vertID2Second connecting vertex.
newVertNew interpolated point that should be checked.
Returns
Validity of a subdivision.

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ joinNarrowVertices()

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.

Author
schwarzkopf
Parameters
inputMeshInput mesh to process and put out
Returns
Processed triangle mesh.

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setMaxAmountOfMaxForVertexJoin()

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.

Author
schwarzkopf
Parameters
maxAmountOfMaxForVertexJoinThe 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().

+ Here is the caller graph for this function:

◆ setMaxNeighbourTriangleAngle()

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.

Author
schwarzkopf
Parameters
maxNeighbourTriangleAngleMaximal neighbour triangle angle not to mark a subdivision as invalid.
maxNeighbourTriangleAngleLengthRatioSubdivision 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().

+ Here is the caller graph for this function:

◆ setMaxNeighbourTriangleAngleTriangleFlip()

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..

Author
schwarzkopf
Parameters
maxNeighbourTriangleAngleTriangleFlipThe 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().

+ Here is the caller graph for this function:

◆ setMaxTransformationAngle()

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..

Author
schwarzkopf
Parameters
maxTransformationAngleMax angle which both line ends should not exceed.

Definition at line 440 of file WSubdivisionValidator.cpp.

References m_maxTransformationAngle.

Referenced by WMButterfly::moduleMain().

+ Here is the caller graph for this function:

◆ setMinAmountOfAverage()

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.

Author
schwarzkopf.
schwarzkopf
Parameters
minAmountOfAverageFactor to determine whether the line is subdividable.

Definition at line 452 of file WSubdivisionValidator.cpp.

References m_minAmountOfAverage.

Referenced by WMButterfly::moduleMain().

+ Here is the caller graph for this function:

◆ setMinAmountOfMax()

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.

Author
schwarzkopf.
schwarzkopf
Parameters
minAmountOfMaxFactor to determine whether the line is subdividable.

Definition at line 448 of file WSubdivisionValidator.cpp.

References m_minAmountOfMax.

Referenced by WMButterfly::moduleMain().

+ Here is the caller graph for this function:

◆ setMinLenghtsQuotient()

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..

Author
schwarzkopf
Parameters
minLenghtsQuotientMaximal 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().

+ Here is the caller graph for this function:

◆ setMinMeighbourTriangleAngle()

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.

Author
schwarzkopf
Parameters
minNeighbourTriangleAngleMinimal allowed angle between two Subdivided line ends.

Definition at line 473 of file WSubdivisionValidator.cpp.

References m_minNeighbourTriangleAngle.

Referenced by WMButterfly::moduleMain().

+ Here is the caller graph for this function:

◆ setMinSubdividedLineLength()

void butterfly::WSubdivisionValidator::setMinSubdividedLineLength ( float  minSubdividedLineLength)

Sets the minimal subdividable line length.

Lines of smaller distance than this are not subdivided..

Author
schwarzkopf
Parameters
minSubdividedLineLengthMinimal subdidvidable line length.

Definition at line 460 of file WSubdivisionValidator.cpp.

References m_minSubdividedLineLength.

Referenced by butterfly::WButterflyFactory::getSubdividedMesh(), and WMButterfly::moduleMain().

+ Here is the caller graph for this function:

◆ setMinSubdividedLineLengthMultiplierPerIteration()

void butterfly::WSubdivisionValidator::setMinSubdividedLineLengthMultiplierPerIteration ( float  minSubdividedLineLengthMultiplierPerIteration)

Sets the factor where the minimal subdivided line length is multiplied by in each Subdivision iteration step.

Author
schwarzkopf
Parameters
minSubdividedLineLengthMultiplierPerIterationThe 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().

+ Here is the caller graph for this function:

◆ setMinTransformationAngle()

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..

Author
schwarzkopf
Parameters
minTransformationAngleMin angle which both line ends should exceed.

Definition at line 436 of file WSubdivisionValidator.cpp.

References m_minTransformationAngle.

Referenced by WMButterfly::moduleMain().

+ Here is the caller graph for this function:

◆ setTriangleMesh()

void butterfly::WSubdivisionValidator::setTriangleMesh ( std::shared_ptr< WTriangleMesh processedMesh,
WVertexFactory vertexFactory 
)

Assign analyzable triangle mesh.

Author
schwarzkopf
Parameters
processedMeshTriangle mesh that should be processed.
vertexFactoryVertex 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().

+ Here is the caller graph for this function:

◆ subdivideTriangle()

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..

Author
schwarzkopf
Parameters
vertID0First vertex ID of the triangle.
vertID1Second vertex ID of the triangle.
vertID2Third 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ subdivideTriangleValidSum1()

void butterfly::WSubdivisionValidator::subdivideTriangleValidSum1 ( size_t  vertID0,
size_t  vertID1,
size_t  vertID2,
size_t  new0_1id 
)
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..

Author
schwarzkopf
Parameters
vertID0First vertex ID of the triangle.
vertID1Second vertex ID of the triangle.
vertID2Third vertex ID of the triangle.
new0_1idSubdivided Vertex ID between vertID0 and vertID1

Definition at line 539 of file WSubdivisionValidator.cpp.

References m_processedMesh.

Referenced by subdivideTriangle().

+ Here is the caller graph for this function:

◆ subdivideTriangleValidSum2()

void butterfly::WSubdivisionValidator::subdivideTriangleValidSum2 ( size_t  vertID0,
size_t  vertID1,
size_t  vertID2,
size_t  new0_1id,
size_t  new0_2id 
)
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..

Author
schwarzkopf
Parameters
vertID0First vertex ID of the triangle.
vertID1Second vertex ID of the triangle.
vertID2Third vertex ID of the triangle.
new0_1idSubdivided Vertex ID between vertID0 and vertID1
new0_2idSubdivided Vertex ID between vertID0 and vertID2

Definition at line 544 of file WSubdivisionValidator.cpp.

References butterfly::WVertexFactory::getDistance(), and m_processedMesh.

Referenced by subdivideTriangle().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ subdivideTriangleValidSum3()

void butterfly::WSubdivisionValidator::subdivideTriangleValidSum3 ( size_t  vertID0,
size_t  vertID1,
size_t  vertID2,
size_t  new0_1id,
size_t  new0_2id,
size_t  new1_2id 
)
private

Subdivides a triangle with all valid subdividable new vertices.

There's no interpolation but putting triangles at existing and calculated vertices..

Author
schwarzkopf
Parameters
vertID0First vertex ID of the triangle.
vertID1Second vertex ID of the triangle.
vertID2Third vertex ID of the triangle.
new0_1idSubdivided Vertex ID between vertID0 and vertID1
new0_2idSubdivided Vertex ID between vertID0 and vertID2
new1_2idSubdivided Vertex ID between vertID1 and vertID2

Definition at line 561 of file WSubdivisionValidator.cpp.

References m_processedMesh.

Referenced by subdivideTriangle().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_maxAmountOfMaxForVertexJoin

float butterfly::WSubdivisionValidator::m_maxAmountOfMaxForVertexJoin
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().

◆ m_maxNeighbourTriangleAngle

float butterfly::WSubdivisionValidator::m_maxNeighbourTriangleAngle
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().

◆ m_maxNeighbourTriangleAngleLengthRatio

float butterfly::WSubdivisionValidator::m_maxNeighbourTriangleAngleLengthRatio
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().

◆ m_maxNeighbourTriangleAngleTriangleFlip

float butterfly::WSubdivisionValidator::m_maxNeighbourTriangleAngleTriangleFlip
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().

◆ m_maxTransformationAngle

float butterfly::WSubdivisionValidator::m_maxTransformationAngle
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().

◆ m_minAmountOfAverage

float butterfly::WSubdivisionValidator::m_minAmountOfAverage
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().

◆ m_minAmountOfMax

float butterfly::WSubdivisionValidator::m_minAmountOfMax
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().

◆ m_minLenghtsQuotient

float butterfly::WSubdivisionValidator::m_minLenghtsQuotient
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().

◆ m_minNeighbourTriangleAngle

float butterfly::WSubdivisionValidator::m_minNeighbourTriangleAngle
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().

◆ m_minSubdividedLineLength

float butterfly::WSubdivisionValidator::m_minSubdividedLineLength
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().

◆ m_minSubdividedLineLengthMultiplierPerIteration

float butterfly::WSubdivisionValidator::m_minSubdividedLineLengthMultiplierPerIteration
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().

◆ m_minTransformationAngle

float butterfly::WSubdivisionValidator::m_minTransformationAngle
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().

◆ m_processedMesh

std::shared_ptr< WTriangleMesh > butterfly::WSubdivisionValidator::m_processedMesh
private

◆ m_vertexFactory

WVertexFactory* butterfly::WSubdivisionValidator::m_vertexFactory
private

The documentation for this class was generated from the following files: