24 #ifndef VTR_REFINEMENT_H
25 #define VTR_REFINEMENT_H
27 #include "../version.h"
29 #include "../sdc/type.h"
30 #include "../sdc/options.h"
31 #include "../vtr/types.h"
32 #include "../vtr/level.h"
39 namespace OpenSubdiv {
40 namespace OPENSUBDIV_VERSION {
43 class TopologyRefiner;
44 class PatchTablesFactory;
205 void initializeSparseSelectionTags();
206 void markSparseChildComponents();
208 void allocateParentToChildMapping();
209 void populateParentToChildMapping();
210 void printParentToChildMapping()
const;
215 void createChildComponents();
216 void populateChildToParentTags();
217 void populateChildToParentIndices();
218 void populateChildToParentMapping();
223 void propagateComponentTags();
225 void propagateFaceTagsFromParentFaces();
226 void propagateEdgeTagsFromParentFaces();
227 void propagateEdgeTagsFromParentEdges();
228 void propagateVertexTagsFromParentFaces();
229 void propagateVertexTagsFromParentEdges();
230 void propagateVertexTagsFromParentVertices();
232 void subdivideVertexSharpness();
233 void subdivideEdgeSharpness();
234 void reclassifySemisharpVertices();
239 void subdivideFVarChannels();
246 unsigned int _faceVertices : 1;
247 unsigned int _faceEdges : 1;
248 unsigned int _edgeVertices : 1;
249 unsigned int _edgeFaces : 1;
250 unsigned int _vertexFaces : 1;
251 unsigned int _vertexEdges : 1;
253 void setAll(
bool value) {
254 _faceVertices = value;
256 _edgeVertices = value;
258 _vertexFaces = value;
259 _vertexEdges = value;
263 void subdivideTopology(Relations
const& relationsToSubdivide);
267 void initializeFaceVertexCountsAndOffsets();
268 void initializeEdgeFaceCountsAndOffsets();
269 void initializeVertexFaceCountsAndOffsets();
270 void initializeVertexEdgeCountsAndOffsets();
281 void populateFaceVerticesFromParentFaces();
282 void populateFaceEdgesFromParentFaces();
283 void populateEdgeVerticesFromParentFaces();
284 void populateEdgeVerticesFromParentEdges();
285 void populateEdgeFacesFromParentFaces();
286 void populateEdgeFacesFromParentEdges();
287 void populateVertexFacesFromParentFaces();
288 void populateVertexFacesFromParentEdges();
289 void populateVertexFacesFromParentVertices();
290 void populateVertexEdgesFromParentFaces();
291 void populateVertexEdgesFromParentEdges();
292 void populateVertexEdgesFromParentVertices();
316 int _childFaceFromFaceCount;
317 int _childEdgeFromFaceCount;
318 int _childEdgeFromEdgeCount;
319 int _childVertFromFaceCount;
320 int _childVertFromEdgeCount;
321 int _childVertFromVertCount;
371 std::vector<ChildTag> _childFaceTag;
372 std::vector<ChildTag> _childEdgeTag;
373 std::vector<ChildTag> _childVertexTag;
378 std::vector<SparseTag> _parentFaceTag;
379 std::vector<SparseTag> _parentEdgeTag;
380 std::vector<SparseTag> _parentVertexTag;
386 std::vector<FVarRefinement*> _fvarChannels;
407 #ifdef _VTR_COMPUTE_MASK_WEIGHTS_ENABLED
408 void computeMaskWeights();
410 std::vector<float> _faceVertWeights;
411 std::vector<float> _edgeVertWeights;
412 std::vector<float> _edgeFaceWeights;
413 std::vector<float> _vertVertWeights;
414 std::vector<float> _vertEdgeWeights;
415 std::vector<float> _vertFaceWeights;
454 return IndexArray(&_edgeChildEdgeIndices[parentEdge*2], 2);
460 return IndexArray(&_edgeChildEdgeIndices[parentEdge*2], 2);
466 using namespace OPENSUBDIV_VERSION;
void setScheme(Sdc::Type const &schemeType, Sdc::Options const &schemeOptions)
Array< Index > IndexArray
int getNumChildVerticesFromFaces() const
Level const & parent() const
int getChildFaceInParentFace(Index f) const
int getNumFaceVertices(Index faceIndex) const
Index getChildFaceParentFace(Index f) const
Index getFaceChildVertex(Index f) const
unsigned char _transitional
int getOffsetOfFaceVertices(Index faceIndex) const
void refine(Options options=Options())
unsigned char _parentType
int getNumChildVerticesFromEdges() const
std::vector< Index > IndexVector
Index getEdgeChildVertex(Index e) const
Index getVertexChildVertex(Index v) const
unsigned char _incomplete
Index getChildVertexParentIndex(Index v) const
unsigned int _faceTopologyOnly
IndexArray const getFaceChildEdges(Index parentFace) const
IndexArray const getFaceChildFaces(Index parentFace) const
IndexArray const getEdgeChildEdges(Index parentEdge) const
int getNumChildVerticesFromVertices() const
unsigned char _indexInParent
void initialize(Level &parent, Level &child)
Index getChildEdgeParentIndex(Index e) const
Stores topology data for a specified set of refinement options.
Level const & child() const
A specialized factory for feature adaptive PatchTables.