refinement.h
Go to the documentation of this file.
//
// Copyright 2014 DreamWorks Animation LLC.
//
// Licensed under the Apache License, Version 2.0 (the "Apache License")
// with the following modification; you may not use this file except in
// compliance with the Apache License and the following modification to it:
// Section 6. Trademarks. is deleted and replaced with:
//
// 6. Trademarks. This License does not grant permission to use the trade
// names, trademarks, service marks, or product names of the Licensor
// and its affiliates, except as required to comply with Section 4(c) of
// the License and to reproduce the content of the NOTICE file.
//
// You may obtain a copy of the Apache License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the Apache License with the above modification is
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the Apache License for the specific
// language governing permissions and limitations under the Apache License.
//
#ifndef OPENSUBDIV3_VTR_REFINEMENT_H
#define OPENSUBDIV3_VTR_REFINEMENT_H
#include "../version.h"
#include "../sdc/types.h"
#include "../sdc/options.h"
#include "../vtr/types.h"
#include "../vtr/level.h"
#include <vector>
//
// Declaration for the main refinement class (Refinement) and its pre-requisites:
//
namespace OpenSubdiv {
namespace OPENSUBDIV_VERSION {
namespace Vtr {
namespace internal {
class FVarRefinement;
//
// Refinement:
// A refinement is a mapping between two levels -- relating the components in the original
// (parent) level to the one refined (child). The refinement may be complete (uniform) or sparse
// (adaptive or otherwise selective), so not all components in the parent level will spawn
// components in the child level.
//
// Refinement is an abstract class and expects subclasses corresponding to the different types
// of topological splits that the supported subdivision schemes collectively require, i.e. those
// listed in Sdc::SplitType. Note the virtual requirements expected of the subclasses in the list
// of protected methods -- they differ mainly in the topology that is created in the child Level
// and not the propagation of tags through refinement, subdivision of sharpness values or the
// treatment of face-varying data. The primary subclasses are QuadRefinement and TriRefinement.
//
// At a high level, all that is necessary in terms of interface is to construct, initialize
// (linking the two levels), optionally select components for sparse refinement (via use of the
// SparseSelector) and call the refine() method. This usage is expected of Far::TopologyRefiner.
//
// Since we really want this class to be restricted from public access eventually, all methods
// begin with lower case (as is the convention for protected methods) and the list of friends
// will be maintained more strictly.
//
class Refinement {
public:
Refinement(Level const & parent, Level & child, Sdc::Options const& schemeOptions);
virtual ~Refinement();
Level const& parent() const { return *_parent; }
Level const& child() const { return *_child; }
Level& child() { return *_child; }
Sdc::Split getSplitType() const { return _splitType; }
int getRegularFaceSize() const { return _regFaceSize; }
Sdc::Options getOptions() const { return _options; }
// Face-varying:
int getNumFVarChannels() const { return (int) _fvarChannels.size(); }
FVarRefinement const & getFVarRefinement(int c) const { return *_fvarChannels[c]; }
//
// Options associated with the actual refinement operation, which may end up
// quite involved if we want to allow for the refinement of data that is not
// of interest to be suppressed. For now we have:
//
// "sparse": the alternative to uniform refinement, which requires that
// components be previously selected/marked to be included.
//
// "minimal topology": this is one that may get broken down into a finer
// set of options. It suppresses "full topology" in the child level
// and only generates what is minimally necessary for interpolation --
// which requires at least the face-vertices for faces, but also the
// vertex-faces for any face-varying channels present. So it will
// generate one or two of the six possible topological relations.
//
// These are strictly controlled right now, e.g. for sparse refinement, we
// currently enforce full topology at the finest level to allow for subsequent
// patch construction.
//
struct Options {
Options() : _sparse(false),
_faceVertsFirst(false),
_minimalTopology(false)
{ }
unsigned int _sparse : 1;
unsigned int _faceVertsFirst : 1;
unsigned int _minimalTopology : 1;
// Still under consideration:
//unsigned int _childToParentMap : 1;
};
void refine(Options options = Options());
bool hasFaceVerticesFirst() const { return _faceVertsFirst; }
public:
//
// Access to members -- some testing classes (involving vertex interpolation)
// currently make use of these:
//
int getNumChildFacesFromFaces() const { return _childFaceFromFaceCount; }
int getNumChildEdgesFromFaces() const { return _childEdgeFromFaceCount; }
int getNumChildEdgesFromEdges() const { return _childEdgeFromEdgeCount; }
int getNumChildVerticesFromFaces() const { return _childVertFromFaceCount; }
int getNumChildVerticesFromEdges() const { return _childVertFromEdgeCount; }
int getNumChildVerticesFromVertices() const { return _childVertFromVertCount; }
Index getFirstChildFaceFromFaces() const { return _firstChildFaceFromFace; }
Index getFirstChildEdgeFromFaces() const { return _firstChildEdgeFromFace; }
Index getFirstChildEdgeFromEdges() const { return _firstChildEdgeFromEdge; }
Index getFirstChildVertexFromFaces() const { return _firstChildVertFromFace; }
Index getFirstChildVertexFromEdges() const { return _firstChildVertFromEdge; }
Index getFirstChildVertexFromVertices() const { return _firstChildVertFromVert; }
Index getFaceChildVertex(Index f) const { return _faceChildVertIndex[f]; }
Index getEdgeChildVertex(Index e) const { return _edgeChildVertIndex[e]; }
Index getVertexChildVertex(Index v) const { return _vertChildVertIndex[v]; }
ConstIndexArray getFaceChildFaces(Index parentFace) const;
ConstIndexArray getFaceChildEdges(Index parentFace) const;
ConstIndexArray getEdgeChildEdges(Index parentEdge) const;
// Child-to-parent relationships
bool isChildVertexComplete(Index v) const { return ! _childVertexTag[v]._incomplete; }
Index getChildFaceParentFace(Index f) const { return _childFaceParentIndex[f]; }
int getChildFaceInParentFace(Index f) const { return _childFaceTag[f]._indexInParent; }
Index getChildEdgeParentIndex(Index e) const { return _childEdgeParentIndex[e]; }
Index getChildVertexParentIndex(Index v) const { return _childVertexParentIndex[v]; }
//
// Modifiers intended for internal/protected use:
//
public:
IndexArray getFaceChildFaces(Index parentFace);
IndexArray getFaceChildEdges(Index parentFace);
IndexArray getEdgeChildEdges(Index parentEdge);
public:
//
// Tags have now been added per-component in Level, but there is additional need to tag
// components within Refinement -- we can't tag the parent level components for any
// refinement (in order to keep it const) and tags associated with children that are
// specific to the child-to-parent mapping may not be warranted in the child level.
//
// Parent tags are only required for sparse refinement. The main property to tag is
// whether a component was selected, and so a single SparseTag is used for all three
// component types. Tagging if a component is "transitional" is also useful. This may
// only be necessary for edges but is currently packed into a mask per-edge for faces,
// which could be deferred, in which case "transitional" could be a single bit.
//
// Child tags are part of the child-to-parent mapping, which consists of the parent
// component index for each child component, plus a tag for the child indicating more
// about its relationship to its parent, e.g. is it completely defined, what the parent
// component type is, what is the index of the child within its parent, etc.
//
struct SparseTag {
SparseTag() : _selected(0), _transitional(0) { }
unsigned char _selected : 1; // component specifically selected for refinement
unsigned char _transitional : 4; // adjacent to a refined component (4-bits for face)
};
struct ChildTag {
ChildTag() { }
unsigned char _incomplete : 1; // incomplete neighborhood to represent limit of parent
unsigned char _parentType : 2; // type of parent component: vertex, edge or face
unsigned char _indexInParent : 2; // index of child wrt parent: 0-3, or iterative if N > 4
};
// Methods to access and modify tags:
SparseTag const & getParentFaceSparseTag( Index f) const { return _parentFaceTag[f]; }
SparseTag const & getParentEdgeSparseTag( Index e) const { return _parentEdgeTag[e]; }
SparseTag const & getParentVertexSparseTag(Index v) const { return _parentVertexTag[v]; }
SparseTag & getParentFaceSparseTag( Index f) { return _parentFaceTag[f]; }
SparseTag & getParentEdgeSparseTag( Index e) { return _parentEdgeTag[e]; }
SparseTag & getParentVertexSparseTag(Index v) { return _parentVertexTag[v]; }
ChildTag const & getChildFaceTag( Index f) const { return _childFaceTag[f]; }
ChildTag const & getChildEdgeTag( Index e) const { return _childEdgeTag[e]; }
ChildTag const & getChildVertexTag(Index v) const { return _childVertexTag[v]; }
ChildTag & getChildFaceTag( Index f) { return _childFaceTag[f]; }
ChildTag & getChildEdgeTag( Index e) { return _childEdgeTag[e]; }
ChildTag & getChildVertexTag(Index v) { return _childVertexTag[v]; }
// Remaining methods should really be protected -- for use by subclasses...
public:
//
// Methods involved in constructing the parent-to-child mapping -- when the
// refinement is sparse, additional methods are needed to identify the selection:
//
void populateParentToChildMapping();
void populateParentChildIndices();
void printParentToChildMapping() const;
virtual void allocateParentChildIndices() = 0;
// Supporting method for sparse refinement:
void initializeSparseSelectionTags();
void markSparseChildComponentIndices();
void markSparseVertexChildren();
void markSparseEdgeChildren();
virtual void markSparseFaceChildren() = 0;
void initializeChildComponentCounts();
//
// Methods involved in constructing the child-to-parent mapping:
//
void populateChildToParentMapping();
void populateFaceParentVectors(ChildTag const initialChildTags[2][4]);
void populateFaceParentFromParentFaces(ChildTag const initialChildTags[2][4]);
void populateEdgeParentVectors(ChildTag const initialChildTags[2][4]);
void populateEdgeParentFromParentFaces(ChildTag const initialChildTags[2][4]);
void populateEdgeParentFromParentEdges(ChildTag const initialChildTags[2][4]);
void populateVertexParentVectors(ChildTag const initialChildTags[2][4]);
void populateVertexParentFromParentFaces(ChildTag const initialChildTags[2][4]);
void populateVertexParentFromParentEdges(ChildTag const initialChildTags[2][4]);
void populateVertexParentFromParentVertices(ChildTag const initialChildTags[2][4]);
//
// Methods involved in propagating component tags from parent to child:
//
void propagateComponentTags();
void populateFaceTagVectors();
void populateFaceTagsFromParentFaces();
void populateEdgeTagVectors();
void populateEdgeTagsFromParentFaces();
void populateEdgeTagsFromParentEdges();
void populateVertexTagVectors();
void populateVertexTagsFromParentFaces();
void populateVertexTagsFromParentEdges();
void populateVertexTagsFromParentVertices();
//
// Methods (and types) involved in subdividing the topology -- though not
// fully exploited, any subset of the 6 relations can be generated:
//
struct Relations {
unsigned int _faceVertices : 1;
unsigned int _faceEdges : 1;
unsigned int _edgeVertices : 1;
unsigned int _edgeFaces : 1;
unsigned int _vertexFaces : 1;
unsigned int _vertexEdges : 1;
void setAll(bool enable) {
_faceVertices = enable;
_faceEdges = enable;
_edgeVertices = enable;
_edgeFaces = enable;
_vertexFaces = enable;
_vertexEdges = enable;
}
};
void subdivideTopology(Relations const& relationsToSubdivide);
virtual void populateFaceVertexRelation() = 0;
virtual void populateFaceEdgeRelation() = 0;
virtual void populateEdgeVertexRelation() = 0;
virtual void populateEdgeFaceRelation() = 0;
virtual void populateVertexFaceRelation() = 0;
virtual void populateVertexEdgeRelation() = 0;
//
// Methods involved in subdividing and inspecting sharpness values:
//
void subdivideSharpnessValues();
void subdivideVertexSharpness();
void subdivideEdgeSharpness();
void reclassifySemisharpVertices();
//
// Methods involved in subdividing face-varying topology:
//
void subdivideFVarChannels();
protected:
// A debug method of Level prints a Refinement (should really change this)
friend void Level::print(const Refinement *) const;
//
// Data members -- the logical grouping of some of these (and methods that make use
// of them) may lead to grouping them into a few utility classes or structs...
//
// Defined on construction:
Level const * _parent;
Level * _child;
Sdc::Options _options;
// Defined by the subclass:
Sdc::Split _splitType;
int _regFaceSize;
// Determined by the refinement options:
bool _uniform;
bool _faceVertsFirst;
//
// Inventory and ordering of the types of child components:
//
int _childFaceFromFaceCount; // arguably redundant (all faces originate from faces)
int _childEdgeFromFaceCount;
int _childEdgeFromEdgeCount;
int _childVertFromFaceCount;
int _childVertFromEdgeCount;
int _childVertFromVertCount;
int _firstChildFaceFromFace; // arguably redundant (all faces originate from faces)
int _firstChildEdgeFromFace;
int _firstChildEdgeFromEdge;
int _firstChildVertFromFace;
int _firstChildVertFromEdge;
int _firstChildVertFromVert;
//
// The parent-to-child mapping:
// These are vectors sized according to the number of parent components (and
// their topology) that contain references/indices to the child components that
// result from them by refinement. When refinement is sparse, parent components
// that have not spawned all child components will have their missing children
// marked as invalid.
//
// NOTE the "Array" members here. Often vectors within the Level can be shared
// with the Refinement, and an Array instance is used to do so. If not shared
// the subclass just initializes the Array members after allocating its own local
// vector members.
//
IndexArray _faceChildFaceCountsAndOffsets;
IndexArray _faceChildEdgeCountsAndOffsets;
IndexVector _faceChildFaceIndices; // *cannot* always use face-vert counts/offsets
IndexVector _faceChildEdgeIndices; // can use face-vert counts/offsets
IndexVector _faceChildVertIndex;
IndexVector _edgeChildEdgeIndices; // trivial/corresponding pair for each
IndexVector _edgeChildVertIndex;
IndexVector _vertChildVertIndex;
//
// The child-to-parent mapping:
//
IndexVector _childFaceParentIndex;
IndexVector _childEdgeParentIndex;
IndexVector _childVertexParentIndex;
std::vector<ChildTag> _childFaceTag;
std::vector<ChildTag> _childEdgeTag;
std::vector<ChildTag> _childVertexTag;
//
// Tags for sparse selection of components:
//
std::vector<SparseTag> _parentFaceTag;
std::vector<SparseTag> _parentEdgeTag;
std::vector<SparseTag> _parentVertexTag;
//
// Refinement data for face-varying channels present in the Levels being refined:
//
std::vector<FVarRefinement*> _fvarChannels;
};
inline ConstIndexArray
Refinement::getFaceChildFaces(Index parentFace) const {
return ConstIndexArray(&_faceChildFaceIndices[_faceChildFaceCountsAndOffsets[2*parentFace+1]],
_faceChildFaceCountsAndOffsets[2*parentFace]);
}
inline IndexArray
Refinement::getFaceChildFaces(Index parentFace) {
return IndexArray(&_faceChildFaceIndices[_faceChildFaceCountsAndOffsets[2*parentFace+1]],
_faceChildFaceCountsAndOffsets[2*parentFace]);
}
inline ConstIndexArray
Refinement::getFaceChildEdges(Index parentFace) const {
return ConstIndexArray(&_faceChildEdgeIndices[_faceChildEdgeCountsAndOffsets[2*parentFace+1]],
_faceChildEdgeCountsAndOffsets[2*parentFace]);
}
inline IndexArray
Refinement::getFaceChildEdges(Index parentFace) {
return IndexArray(&_faceChildEdgeIndices[_faceChildEdgeCountsAndOffsets[2*parentFace+1]],
_faceChildEdgeCountsAndOffsets[2*parentFace]);
}
inline ConstIndexArray
Refinement::getEdgeChildEdges(Index parentEdge) const {
return ConstIndexArray(&_edgeChildEdgeIndices[parentEdge*2], 2);
}
inline IndexArray
Refinement::getEdgeChildEdges(Index parentEdge) {
return IndexArray(&_edgeChildEdgeIndices[parentEdge*2], 2);
}
} // end namespace internal
} // end namespace Vtr
} // end namespace OPENSUBDIV_VERSION
using namespace OPENSUBDIV_VERSION;
} // end namespace OpenSubdiv
#endif /* OPENSUBDIV3_VTR_REFINEMENT_H */
OpenSubdiv
Definition: error.h:30
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::Index
int Index
Definition: types.h:54
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::IndexVector
std::vector< Index > IndexVector
Definition: types.h:77
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::ConstIndexArray
ConstArray< Index > ConstIndexArray
Definition: types.h:80
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::IndexArray
Array< Index > IndexArray
Definition: types.h:79
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Split
Split
Enumerated type for all face splitting schemes.
Definition: types.h:47
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options
All supported options applying to subdivision scheme.
Definition: options.h:51
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::ConstArray< Index >
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::Array< Index >
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::FVarRefinement
Definition: fvarRefinement.h:59
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Level
Definition: level.h:83
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Level::print
void print(const Refinement *parentRefinement=0) const
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement
Definition: refinement.h:69
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::getChildVertexTag
ChildTag & getChildVertexTag(Index v)
Definition: refinement.h:219
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::getNumChildFacesFromFaces
int getNumChildFacesFromFaces() const
Definition: refinement.h:130
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::populateEdgeFaceRelation
virtual void populateEdgeFaceRelation()=0
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::getOptions
Sdc::Options getOptions() const
Definition: refinement.h:81
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::populateVertexTagsFromParentFaces
void populateVertexTagsFromParentFaces()
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::populateEdgeParentFromParentEdges
void populateEdgeParentFromParentEdges(ChildTag const initialChildTags[2][4])
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::_faceVertsFirst
bool _faceVertsFirst
Definition: refinement.h:342
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::hasFaceVerticesFirst
bool hasFaceVerticesFirst() const
Definition: refinement.h:123
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::getVertexChildVertex
Index getVertexChildVertex(Index v) const
Definition: refinement.h:146
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::reclassifySemisharpVertices
void reclassifySemisharpVertices()
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::_firstChildVertFromVert
int _firstChildVertFromVert
Definition: refinement.h:359
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::getNumChildEdgesFromEdges
int getNumChildEdgesFromEdges() const
Definition: refinement.h:132
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::getFaceChildEdges
ConstIndexArray getFaceChildEdges(Index parentFace) const
Definition: refinement.h:425
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::getParentVertexSparseTag
SparseTag & getParentVertexSparseTag(Index v)
Definition: refinement.h:211
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::_parentEdgeTag
std::vector< SparseTag > _parentEdgeTag
Definition: refinement.h:401
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::~Refinement
virtual ~Refinement()
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::_child
Level * _child
Definition: refinement.h:333
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::populateVertexTagsFromParentVertices
void populateVertexTagsFromParentVertices()
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::markSparseEdgeChildren
void markSparseEdgeChildren()
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::initializeSparseSelectionTags
void initializeSparseSelectionTags()
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::getFirstChildVertexFromEdges
Index getFirstChildVertexFromEdges() const
Definition: refinement.h:141
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::_childEdgeParentIndex
IndexVector _childEdgeParentIndex
Definition: refinement.h:390
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::propagateComponentTags
void propagateComponentTags()
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::getChildVertexParentIndex
Index getChildVertexParentIndex(Index v) const
Definition: refinement.h:160
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::populateEdgeTagVectors
void populateEdgeTagVectors()
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::populateVertexFaceRelation
virtual void populateVertexFaceRelation()=0
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::_firstChildFaceFromFace
int _firstChildFaceFromFace
Definition: refinement.h:354
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::_fvarChannels
std::vector< FVarRefinement * > _fvarChannels
Definition: refinement.h:407
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::populateFaceParentFromParentFaces
void populateFaceParentFromParentFaces(ChildTag const initialChildTags[2][4])
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::getFirstChildEdgeFromFaces
Index getFirstChildEdgeFromFaces() const
Definition: refinement.h:138
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::populateVertexParentVectors
void populateVertexParentVectors(ChildTag const initialChildTags[2][4])
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::_faceChildFaceCountsAndOffsets
IndexArray _faceChildFaceCountsAndOffsets
Definition: refinement.h:374
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::getEdgeChildEdges
ConstIndexArray getEdgeChildEdges(Index parentEdge) const
Definition: refinement.h:438
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::getChildEdgeTag
ChildTag const & getChildEdgeTag(Index e) const
Definition: refinement.h:214
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::_edgeChildEdgeIndices
IndexVector _edgeChildEdgeIndices
Definition: refinement.h:381
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::populateParentChildIndices
void populateParentChildIndices()
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::subdivideFVarChannels
void subdivideFVarChannels()
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::initializeChildComponentCounts
void initializeChildComponentCounts()
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::getNumChildEdgesFromFaces
int getNumChildEdgesFromFaces() const
Definition: refinement.h:131
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::getChildFaceTag
ChildTag & getChildFaceTag(Index f)
Definition: refinement.h:217
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::getParentFaceSparseTag
SparseTag const & getParentFaceSparseTag(Index f) const
Definition: refinement.h:205
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::_faceChildVertIndex
IndexVector _faceChildVertIndex
Definition: refinement.h:379
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::getFirstChildVertexFromVertices
Index getFirstChildVertexFromVertices() const
Definition: refinement.h:142
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::populateVertexEdgeRelation
virtual void populateVertexEdgeRelation()=0
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::getNumChildVerticesFromVertices
int getNumChildVerticesFromVertices() const
Definition: refinement.h:135
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::_firstChildEdgeFromFace
int _firstChildEdgeFromFace
Definition: refinement.h:355
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::populateEdgeVertexRelation
virtual void populateEdgeVertexRelation()=0
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::_faceChildEdgeCountsAndOffsets
IndexArray _faceChildEdgeCountsAndOffsets
Definition: refinement.h:375
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::_firstChildVertFromEdge
int _firstChildVertFromEdge
Definition: refinement.h:358
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::getFirstChildFaceFromFaces
Index getFirstChildFaceFromFaces() const
Definition: refinement.h:137
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::getNumChildVerticesFromEdges
int getNumChildVerticesFromEdges() const
Definition: refinement.h:134
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::child
Level & child()
Definition: refinement.h:77
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::_childVertexTag
std::vector< ChildTag > _childVertexTag
Definition: refinement.h:395
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::populateVertexParentFromParentEdges
void populateVertexParentFromParentEdges(ChildTag const initialChildTags[2][4])
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::_firstChildVertFromFace
int _firstChildVertFromFace
Definition: refinement.h:357
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::subdivideVertexSharpness
void subdivideVertexSharpness()
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::populateVertexParentFromParentVertices
void populateVertexParentFromParentVertices(ChildTag const initialChildTags[2][4])
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::_childFaceTag
std::vector< ChildTag > _childFaceTag
Definition: refinement.h:393
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::getFaceChildFaces
ConstIndexArray getFaceChildFaces(Index parentFace) const
Definition: refinement.h:411
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::getFVarRefinement
FVarRefinement const & getFVarRefinement(int c) const
Definition: refinement.h:86
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::_childVertFromVertCount
int _childVertFromVertCount
Definition: refinement.h:352
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::getFirstChildEdgeFromEdges
Index getFirstChildEdgeFromEdges() const
Definition: refinement.h:139
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::_childFaceParentIndex
IndexVector _childFaceParentIndex
Definition: refinement.h:389
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::_uniform
bool _uniform
Definition: refinement.h:341
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::_childEdgeFromFaceCount
int _childEdgeFromFaceCount
Definition: refinement.h:348
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::getChildFaceParentFace
Index getChildFaceParentFace(Index f) const
Definition: refinement.h:155
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::_vertChildVertIndex
IndexVector _vertChildVertIndex
Definition: refinement.h:384
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::child
Level const & child() const
Definition: refinement.h:76
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::refine
void refine(Options options=Options())
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::_faceChildFaceIndices
IndexVector _faceChildFaceIndices
Definition: refinement.h:377
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::_childEdgeFromEdgeCount
int _childEdgeFromEdgeCount
Definition: refinement.h:349
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::Refinement
Refinement(Level const &parent, Level &child, Sdc::Options const &schemeOptions)
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::isChildVertexComplete
bool isChildVertexComplete(Index v) const
Definition: refinement.h:153
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::populateChildToParentMapping
void populateChildToParentMapping()
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::getChildEdgeParentIndex
Index getChildEdgeParentIndex(Index e) const
Definition: refinement.h:158
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::populateEdgeParentFromParentFaces
void populateEdgeParentFromParentFaces(ChildTag const initialChildTags[2][4])
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::getRegularFaceSize
int getRegularFaceSize() const
Definition: refinement.h:80
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::subdivideTopology
void subdivideTopology(Relations const &relationsToSubdivide)
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::printParentToChildMapping
void printParentToChildMapping() const
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::_parentFaceTag
std::vector< SparseTag > _parentFaceTag
Definition: refinement.h:400
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::populateVertexTagVectors
void populateVertexTagVectors()
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::markSparseVertexChildren
void markSparseVertexChildren()
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::getChildVertexTag
ChildTag const & getChildVertexTag(Index v) const
Definition: refinement.h:215
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::getSplitType
Sdc::Split getSplitType() const
Definition: refinement.h:79
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::getParentVertexSparseTag
SparseTag const & getParentVertexSparseTag(Index v) const
Definition: refinement.h:207
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::getParentEdgeSparseTag
SparseTag & getParentEdgeSparseTag(Index e)
Definition: refinement.h:210
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::markSparseChildComponentIndices
void markSparseChildComponentIndices()
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::getFaceChildVertex
Index getFaceChildVertex(Index f) const
Definition: refinement.h:144
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::_splitType
Sdc::Split _splitType
Definition: refinement.h:337
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::populateEdgeTagsFromParentEdges
void populateEdgeTagsFromParentEdges()
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::getNumFVarChannels
int getNumFVarChannels() const
Definition: refinement.h:84
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::_childVertexParentIndex
IndexVector _childVertexParentIndex
Definition: refinement.h:391
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::markSparseFaceChildren
virtual void markSparseFaceChildren()=0
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::populateEdgeTagsFromParentFaces
void populateEdgeTagsFromParentFaces()
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::parent
Level const & parent() const
Definition: refinement.h:75
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::getParentFaceSparseTag
SparseTag & getParentFaceSparseTag(Index f)
Definition: refinement.h:209
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::_childFaceFromFaceCount
int _childFaceFromFaceCount
Definition: refinement.h:347
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::populateFaceVertexRelation
virtual void populateFaceVertexRelation()=0
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::populateParentToChildMapping
void populateParentToChildMapping()
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::_options
Sdc::Options _options
Definition: refinement.h:334
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::getParentEdgeSparseTag
SparseTag const & getParentEdgeSparseTag(Index e) const
Definition: refinement.h:206
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::_firstChildEdgeFromEdge
int _firstChildEdgeFromEdge
Definition: refinement.h:356
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::populateFaceParentVectors
void populateFaceParentVectors(ChildTag const initialChildTags[2][4])
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::populateVertexTagsFromParentEdges
void populateVertexTagsFromParentEdges()
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::_edgeChildVertIndex
IndexVector _edgeChildVertIndex
Definition: refinement.h:382
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::_regFaceSize
int _regFaceSize
Definition: refinement.h:338
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::getChildEdgeTag
ChildTag & getChildEdgeTag(Index e)
Definition: refinement.h:218
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::_parent
Level const * _parent
Definition: refinement.h:332
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::populateFaceTagVectors
void populateFaceTagVectors()
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::populateFaceEdgeRelation
virtual void populateFaceEdgeRelation()=0
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::getChildFaceTag
ChildTag const & getChildFaceTag(Index f) const
Definition: refinement.h:213
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::_childVertFromFaceCount
int _childVertFromFaceCount
Definition: refinement.h:350
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::_childVertFromEdgeCount
int _childVertFromEdgeCount
Definition: refinement.h:351
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::subdivideEdgeSharpness
void subdivideEdgeSharpness()
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::getEdgeChildVertex
Index getEdgeChildVertex(Index e) const
Definition: refinement.h:145
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::populateEdgeParentVectors
void populateEdgeParentVectors(ChildTag const initialChildTags[2][4])
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::getNumChildVerticesFromFaces
int getNumChildVerticesFromFaces() const
Definition: refinement.h:133
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::populateVertexParentFromParentFaces
void populateVertexParentFromParentFaces(ChildTag const initialChildTags[2][4])
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::subdivideSharpnessValues
void subdivideSharpnessValues()
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::allocateParentChildIndices
virtual void allocateParentChildIndices()=0
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::_childEdgeTag
std::vector< ChildTag > _childEdgeTag
Definition: refinement.h:394
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::populateFaceTagsFromParentFaces
void populateFaceTagsFromParentFaces()
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::_faceChildEdgeIndices
IndexVector _faceChildEdgeIndices
Definition: refinement.h:378
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::getFirstChildVertexFromFaces
Index getFirstChildVertexFromFaces() const
Definition: refinement.h:140
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::_parentVertexTag
std::vector< SparseTag > _parentVertexTag
Definition: refinement.h:402
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::getChildFaceInParentFace
int getChildFaceInParentFace(Index f) const
Definition: refinement.h:156
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::Options
Definition: refinement.h:107
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::Options::Options
Options()
Definition: refinement.h:108
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::Options::_faceVertsFirst
unsigned int _faceVertsFirst
Definition: refinement.h:114
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::Options::_minimalTopology
unsigned int _minimalTopology
Definition: refinement.h:115
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::Options::_sparse
unsigned int _sparse
Definition: refinement.h:113
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::SparseTag
Definition: refinement.h:189
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::SparseTag::SparseTag
SparseTag()
Definition: refinement.h:190
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::SparseTag::_selected
unsigned char _selected
Definition: refinement.h:192
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::SparseTag::_transitional
unsigned char _transitional
Definition: refinement.h:193
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::ChildTag
Definition: refinement.h:196
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::ChildTag::_indexInParent
unsigned char _indexInParent
Definition: refinement.h:201
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::ChildTag::_incomplete
unsigned char _incomplete
Definition: refinement.h:199
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::ChildTag::_parentType
unsigned char _parentType
Definition: refinement.h:200
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::ChildTag::ChildTag
ChildTag()
Definition: refinement.h:197
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::Relations
Definition: refinement.h:281
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::Relations::_vertexFaces
unsigned int _vertexFaces
Definition: refinement.h:286
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::Relations::_vertexEdges
unsigned int _vertexEdges
Definition: refinement.h:287
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::Relations::_edgeFaces
unsigned int _edgeFaces
Definition: refinement.h:285
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::Relations::_faceVertices
unsigned int _faceVertices
Definition: refinement.h:282
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::Relations::_faceEdges
unsigned int _faceEdges
Definition: refinement.h:283
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::Relations::setAll
void setAll(bool enable)
Definition: refinement.h:289
OpenSubdiv::OPENSUBDIV_VERSION::Vtr::internal::Refinement::Relations::_edgeVertices
unsigned int _edgeVertices
Definition: refinement.h:284