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)); }
141 std::memcpy(
this, &bits,
sizeof(bits));
145 std::memcpy(&bits,
this,
sizeof(bits));
256 Level const & _level;
262 bool _hasLinearBoundaries;
263 bool _hasDependentSharpness;
278 std::vector<Index> _faceVertValues;
281 std::vector<ETag> _edgeTags;
284 std::vector<Sibling> _vertSiblingCounts;
285 std::vector<int> _vertSiblingOffsets;
286 std::vector<Sibling> _vertFaceSiblings;
289 std::vector<Index> _vertValueIndices;
290 std::vector<ValueTag> _vertValueTags;
291 std::vector<CreaseEndPair> _vertValueCreaseEnds;
300 int vCount = _level.getNumFaceVertices(fIndex);
301 int vOffset = _level.getOffsetOfFaceVertices(fIndex);
307 int vCount = _level.getNumFaceVertices(fIndex);
308 int vOffset = _level.getOffsetOfFaceVertices(fIndex);
309 return IndexArray(&_faceVertValues[vOffset], vCount);
315 int vCount = _level.getNumVertexFaces(vIndex);
316 int vOffset = _level.getOffsetOfVertexFaces(vIndex);
322 int vCount = _level.getNumVertexFaces(vIndex);
323 int vOffset = _level.getOffsetOfVertexFaces(vIndex);
324 return SiblingArray(&_vertFaceSiblings[vOffset], vCount);
339 return IndexArray(&_vertValueIndices[vOffset], vCount);
375 if (_level.getDepth() > 0)
return valueIndex;
378 while (_vertValueIndices[vvIndex] != valueIndex) {
407 if (this->isCorner()) {
412 if (this->isCrease() || this->isSemiSharp()) {
419 levelTag.
_corner = !this->_infIrregular && !this->_infSharpEdges;
436 using namespace OPENSUBDIV_VERSION;
LocalIndexArray SiblingArray
void initializeFaceValuesFromFaceVertices()
Level::VTag combineWithLevelVTag(Level::VTag) const
ConstLocalIndexArray ConstSiblingArray
ConstIndexArray getVertexValues(Index vIndex) const
int getNumVertexValues(Index v) const
FVarLevel(Level const &level)
Index getVertexValue(Index v, Sibling i=0) const
Vtr::ConstArray< ValueTag > ConstValueTagArray
void getFaceValueTags(Index faceIndex, ValueTag valueTags[]) const
bool hasCreaseEnds() const
ConstIndexArray getFaceValues(Index fIndex) const
ValueTag(ValueTagSize bits)
ValueTag getFaceCompositeValueTag(Index faceIndex) const
void getVertexEdgeValues(Index vIndex, Index valuesPerEdge[]) const
ValueTagSize _nonManifold
bool hasInfSharpEdges() const
void setOptions(Sdc::Options const &options)
Sdc::Options getOptions() const
ConstSiblingArray getVertexFaceSiblings(Index vIndex) const
ValueTagSize getBits() const
unsigned short LocalIndex
bool hasSmoothBoundaries() const
ValueTagSize _infIrregular
void completeTopologyFromFaceValues(int regBoundaryValence)
Index getVertexValueOffset(Index v, Sibling i=0) const
ConstValueTagArray getVertexValueTags(Index vIndex) const
ValueTag getValueTag(Index valueIndex) const
Index findVertexValueIndex(Index vertexIndex, Index valueIndex) const
Vtr::Array< ValueTag > ValueTagArray
unsigned char ValueTagSize
void buildFaceVertexSiblingsFromVertexFaceSiblings(std::vector< Sibling > &fvSiblings) const
Vtr::Array< CreaseEndPair > CreaseEndPairArray
CreaseEndPair getValueCreaseEndPair(Index valueIndex) const
ConstArray< Index > ConstIndexArray
bool hasLinearBoundaries() const
bool edgeTopologyMatches(Index eIndex) const
void resizeValues(int numValues)
Level const & getLevel() const
Vtr::ConstArray< CreaseEndPair > ConstCreaseEndPairArray
All supported options applying to subdivision scheme.
void getEdgeFaceValues(Index eIndex, int fIncToEdge, Index valuesPerVert[2]) const
void getVertexCreaseEndValues(Index vIndex, Sibling sibling, Index endValues[2]) const
void gatherValueSpans(Index vIndex, ValueSpan *vValueSpans) const
void initializeFaceValuesFromVertexFaceSiblings()
ETag getEdgeTag(Index eIndex) const
bool hasInfIrregularity() const
int getNumFaceValuesTotal() const
ValueTagSize _infSharpEdges
bool valueTopologyMatches(Index valueIndex) const
Array< Index > IndexArray
Level::ETag combineWithLevelETag(Level::ETag) const
ConstCreaseEndPairArray getVertexValueCreaseEnds(Index vIndex) const
void resizeVertexValues(int numVertexValues)
bool hasCreaseEnds() const