OpenWalnut
1.5.0dev
|
Class that depicts the whole Butterfly subdivision algorithm but nothing more as such. More...
#include <WButterflyCalculator.h>
Public Member Functions | |
WButterflyCalculator () | |
Butterfly subdivision tool object creating instance. More... | |
virtual | ~WButterflyCalculator () |
Destroys the Butterfly instance object and its substructures. More... | |
void | assignInputMesh (std::shared_ptr< WTriangleMesh > inputMesh, WVertexFactory *vertexProperties) |
Assigns the input mesh andd its analyzed data that are required for the butterfly subdivision. More... | |
void | setButterflySettingW (float butterflySettingW) |
Set the general Butterfly Subdivision setting w that affects the subdivision. More... | |
osg::Vec3 | calcNewVertex (size_t vertID1, size_t vertID2) |
Calculate the subdivided new vertex between two vertices using the Butterfly Subdivision. More... | |
Private Member Functions | |
osg::Vec3 | calcMean (size_t vertID1, size_t vertID2) |
Calculate a subdivided mit point between two vertices using the mean calculation. More... | |
Vec3 | getInterpolatedValue (size_t stencilCenterVertID, size_t directedNeighbourVertID, bool isIrregular) |
Calculate the coordinates of a stencil half using the Butterfly subdivision algorithm. More... | |
Private Attributes | |
WVertexFactory * | m_verts |
Associated data set used for analyzation of the triangle mesh. More... | |
std::shared_ptr< WTriangleMesh > | m_inputMesh |
Base triangle mesh used for calculations. More... | |
Static Private Attributes | |
static float | m_w = 0.0f |
The general Butterfly Subdivision setting w that affects the subdivision. More... | |
static float | m_weights [4][7] |
Butterfly subdivision Weights for each neighbor which always are applied for valences 3 and 4. More... | |
static float | m_weightCenterAtBorder = 9.0f / 16.0f |
Weight where both stencil centers lie on a border. More... | |
static float | m_weightRimAtBorder = -1.0f / 16.0f |
Weight where both stencil centers lie on a border. More... | |
Class that depicts the whole Butterfly subdivision algorithm but nothing more as such.
Definition at line 53 of file WButterflyCalculator.h.
butterfly::WButterflyCalculator::WButterflyCalculator | ( | ) |
Butterfly subdivision tool object creating instance.
Definition at line 54 of file WButterflyCalculator.cpp.
References m_verts.
|
virtual |
Destroys the Butterfly instance object and its substructures.
Definition at line 59 of file WButterflyCalculator.cpp.
void butterfly::WButterflyCalculator::assignInputMesh | ( | std::shared_ptr< WTriangleMesh > | inputMesh, |
WVertexFactory * | vertexProperties | ||
) |
Assigns the input mesh andd its analyzed data that are required for the butterfly subdivision.
inputMesh | Triangle mesh that should be subdivided |
vertexProperties | The analyzed data of the input triangle mesh |
Definition at line 63 of file WButterflyCalculator.cpp.
References m_inputMesh, and m_verts.
Referenced by butterfly::WButterflyFactory::examineVertexNeighborhood().
|
private |
Calculate a subdivided mit point between two vertices using the mean calculation.
vertID1 | First vertex to subdivide between. |
vertID2 | Second vertex ID to subdivide between. |
Definition at line 127 of file WButterflyCalculator.cpp.
References m_inputMesh.
Referenced by calcNewVertex().
osg::Vec3 butterfly::WButterflyCalculator::calcNewVertex | ( | size_t | vertID1, |
size_t | vertID2 | ||
) |
Calculate the subdivided new vertex between two vertices using the Butterfly Subdivision.
algorithm.
vertID1 | First vertex to subdivide between. |
vertID2 | Second vertex ID to subdivide between |
Definition at line 80 of file WButterflyCalculator.cpp.
References butterfly::WVertexFactory::add(), calcMean(), WVertexProperty::getBoundClass(), getInterpolatedValue(), butterfly::WVertexFactory::getProperty(), WVertexProperty::getStencilNeighbourID(), WVertexProperty::getStencilNeighbourIndex(), WVertexProperty::getValence(), m_inputMesh, m_verts, m_weightCenterAtBorder, and m_weightRimAtBorder.
Referenced by butterfly::WButterflyFactory::interpolateNewVerticesRange().
|
private |
Calculate the coordinates of a stencil half using the Butterfly subdivision algorithm.
stencilCenterVertID | Vertex ID of the stencil center. Coordinates are calculated for that value. |
directedNeighbourVertID | Vertex ID of the other half of the whole butterfly stencil. |
isIrregular | Calculate stencil half as an irregular. False is set calculating a Stencil where both valences are 6. |
Definition at line 136 of file WButterflyCalculator.cpp.
References butterfly::WVertexFactory::add(), butterfly::WVertexFactory::getProperty(), WVertexProperty::getStencilNeighbourIndex(), m_inputMesh, m_verts, and m_weights.
Referenced by calcNewVertex().
void butterfly::WButterflyCalculator::setButterflySettingW | ( | float | butterflySettingW | ) |
Set the general Butterfly Subdivision setting w that affects the subdivision.
See the algorithm documentation for the exact meaning. It's usually chosen substantially small. The original authors used 0.0f.
butterflySettingW | The general butterfly subdivision parameter w. |
Definition at line 69 of file WButterflyCalculator.cpp.
References m_w, and m_weights.
Referenced by butterfly::WButterflyFactory::setButterflySettingW().
|
private |
Base triangle mesh used for calculations.
Definition at line 150 of file WButterflyCalculator.h.
Referenced by assignInputMesh(), calcMean(), calcNewVertex(), and getInterpolatedValue().
|
private |
Associated data set used for analyzation of the triangle mesh.
Definition at line 145 of file WButterflyCalculator.h.
Referenced by assignInputMesh(), calcNewVertex(), getInterpolatedValue(), and WButterflyCalculator().
|
staticprivate |
The general Butterfly Subdivision setting w that affects the subdivision.
See the algorithm documentation for the exact meaning. It's usually chosen substantially small. The original authors used 0.0f.
Definition at line 101 of file WButterflyCalculator.h.
Referenced by setButterflySettingW().
|
staticprivate |
Weight where both stencil centers lie on a border.
This weight is for a stencil center.
Definition at line 114 of file WButterflyCalculator.h.
Referenced by calcNewVertex().
|
staticprivate |
Weight where both stencil centers lie on a border.
This weight is beside the stencil centers.
Definition at line 120 of file WButterflyCalculator.h.
Referenced by calcNewVertex().
|
staticprivate |
Butterfly subdivision Weights for each neighbor which always are applied for valences 3 and 4.
Valence 6 is applied for Butterfly stencils where both valences are 6. The first row starts with valence 6. The first column starts with the center vertex weight. Then comes the Neighbor vertex connected to the other stencil center vertex.
Definition at line 109 of file WButterflyCalculator.h.
Referenced by getInterpolatedValue(), and setButterflySettingW().