24 #ifndef OPENSUBDIV3_VTR_FVAR_LEVEL_H 25 #define OPENSUBDIV3_VTR_FVAR_LEVEL_H 27 #include "../version.h" 29 #include "../sdc/types.h" 30 #include "../sdc/crease.h" 31 #include "../sdc/options.h" 32 #include "../vtr/types.h" 33 #include "../vtr/level.h" 41 namespace OPENSUBDIV_VERSION {
90 void clear() { std::memset(
this, 0,
sizeof(
ETag)); }
128 ValueTagSize _xordinary : 1;
129 ValueTagSize _nonManifold : 1;
130 ValueTagSize _crease : 1;
131 ValueTagSize _semiSharp : 1;
132 ValueTagSize _depSharp : 1;
134 ValueTagSize _infSharpEdges : 1;
135 ValueTagSize _infIrregular : 1;
246 Level const & _level;
252 bool _hasLinearBoundaries;
253 bool _hasDependentSharpness;
268 std::vector<Index> _faceVertValues;
271 std::vector<ETag> _edgeTags;
274 std::vector<Sibling> _vertSiblingCounts;
275 std::vector<int> _vertSiblingOffsets;
276 std::vector<Sibling> _vertFaceSiblings;
279 std::vector<Index> _vertValueIndices;
280 std::vector<ValueTag> _vertValueTags;
281 std::vector<CreaseEndPair> _vertValueCreaseEnds;
290 int vCount = _level.getNumFaceVertices(fIndex);
291 int vOffset = _level.getOffsetOfFaceVertices(fIndex);
297 int vCount = _level.getNumFaceVertices(fIndex);
298 int vOffset = _level.getOffsetOfFaceVertices(fIndex);
299 return IndexArray(&_faceVertValues[vOffset], vCount);
305 int vCount = _level.getNumVertexFaces(vIndex);
306 int vOffset = _level.getOffsetOfVertexFaces(vIndex);
312 int vCount = _level.getNumVertexFaces(vIndex);
313 int vOffset = _level.getOffsetOfVertexFaces(vIndex);
314 return SiblingArray(&_vertFaceSiblings[vOffset], vCount);
329 return IndexArray(&_vertValueIndices[vOffset], vCount);
365 if (_level.getDepth() > 0)
return valueIndex;
368 while (_vertValueIndices[vvIndex] != valueIndex) {
390 if (this->isCorner()) {
394 levelTag.
_corner = !this->_infIrregular && !this->_infSharpEdges;
415 using namespace OPENSUBDIV_VERSION;
Array< Index > IndexArray
Index findVertexValueIndex(Index vertexIndex, Index valueIndex) const
void setOptions(Sdc::Options const &options)
void gatherValueSpans(Index vIndex, ValueSpan *vValueSpans) const
bool hasCreaseEnds() const
Level::VTag combineWithLevelVTag(Level::VTag) const
LocalIndexArray SiblingArray
bool valueTopologyMatches(Index valueIndex) const
All supported options applying to subdivision scheme.
Index getVertexValue(Index v, Sibling i=0) const
Level::ETag combineWithLevelETag(Level::ETag) const
bool edgeTopologyMatches(Index eIndex) const
bool hasInfSharpEdges() const
ValueTag getFaceCompositeValueTag(Index faceIndex) const
void initializeFaceValuesFromVertexFaceSiblings()
void getEdgeFaceValues(Index eIndex, int fIncToEdge, Index valuesPerVert[2]) const
FVarLevel(Level const &level)
Vtr::Array< ValueTag > ValueTagArray
bool hasCreaseEnds() const
void resizeVertexValues(int numVertexValues)
void getFaceValueTags(Index faceIndex, ValueTag valueTags[]) const
ConstIndexArray getFaceValues(Index fIndex) const
Index getVertexValueOffset(Index v, Sibling i=0) const
Level const & getLevel() const
void getVertexCreaseEndValues(Index vIndex, Sibling sibling, Index endValues[2]) const
ConstValueTagArray getVertexValueTags(Index vIndex) const
void getVertexEdgeValues(Index vIndex, Index valuesPerEdge[]) const
ValueTag getValueTag(Index valueIndex) const
Vtr::ConstArray< ValueTag > ConstValueTagArray
Sdc::Options getOptions() const
ConstArray< Index > ConstIndexArray
bool hasLinearBoundaries() const
ETag getEdgeTag(Index eIndex) const
Vtr::Array< CreaseEndPair > CreaseEndPairArray
CreaseEndPair getValueCreaseEndPair(Index valueIndex) const
bool hasSmoothBoundaries() const
void resizeValues(int numValues)
ConstLocalIndexArray ConstSiblingArray
void initializeFaceValuesFromFaceVertices()
Vtr::ConstArray< CreaseEndPair > ConstCreaseEndPairArray
int getNumFaceValuesTotal() const
unsigned short LocalIndex
int getNumVertexValues(Index v) const
void buildFaceVertexSiblingsFromVertexFaceSiblings(std::vector< Sibling > &fvSiblings) const
ConstIndexArray getVertexValues(Index vIndex) const
ConstSiblingArray getVertexFaceSiblings(Index vIndex) const
bool hasInfIrregularity() const
ConstCreaseEndPairArray getVertexValueCreaseEnds(Index vIndex) const
unsigned char ValueTagSize
void completeTopologyFromFaceValues(int regBoundaryValence)