24#ifndef OPENSUBDIV3_FAR_TOPOLOGY_REFINER_FACTORY_H
25#define OPENSUBDIV3_FAR_TOPOLOGY_REFINER_FACTORY_H
27#include "../version.h"
29#include "../far/topologyRefiner.h"
30#include "../far/error.h"
35namespace OPENSUBDIV_VERSION {
374 if (! resizeComponentTopology(
refiner,
mesh))
return false;
375 if (! prepareComponentTopologySizing(
refiner))
return false;
382 bool validate =
options.validateFullTopology;
386 if (! assignComponentTopology(
refiner,
mesh))
return false;
393 if (! assignComponentTags(
refiner,
mesh))
return false;
394 if (! prepareComponentTagsAndSharpness(
refiner))
return false;
399 if (! assignFaceVaryingTopology(
refiner,
mesh))
return false;
400 if (! prepareFaceVaryingChannels(
refiner))
return false;
434 return newRefiner._levels[0]->getNumVertices();
493 return newRefiner._levels[0]->getEdgeFaceLocalIndices(
e);
498 return newRefiner._levels[0]->getVertexFaceLocalIndices(
v);
503 return newRefiner._levels[0]->getVertexEdgeLocalIndices(
v);
515 newRefiner._levels[0]->populateLocalIndices();
570 "Failure in TopologyRefinerFactory<>::resizeComponentTopology() -- no specialization provided.");
611 "Failure in TopologyRefinerFactory<>::assignComponentTopology() -- no specialization provided.");
707using namespace OPENSUBDIV_VERSION;
void Error(ErrorType err, const char *format,...)
Sends an OSD error with a message (internal use only)
@ FAR_RUNTIME_ERROR
Issue a generic runtime error, but continue execution.
SchemeType
Enumerated type for all subdivision schemes supported by OpenSubdiv.
Table of subdivision stencils.
Factory for constructing TopologyRefiners from specific mesh classes.
static int getNumBaseFaces(TopologyRefiner const &newRefiner)
static bool assignComponentTopology(TopologyRefiner &newRefiner, MESH const &mesh)
Specify the relationships between vertices, faces, etc. ie the face-vertices, vertex-faces,...
static void reportInvalidTopology(TopologyError errCode, char const *msg, MESH const &mesh)
(Optional) Control run-time topology validation and error reporting
static LocalIndexArray getBaseVertexFaceLocalIndices(TopologyRefiner &newRefiner, Index v)
Assign the local indices of a vertex within each of its incident faces.
static int getNumBaseVertices(TopologyRefiner const &newRefiner)
static void setNumBaseEdgeFaces(TopologyRefiner &newRefiner, Index e, int count)
Specify the number of faces incident each edge.
static IndexArray getBaseFaceVertices(TopologyRefiner &newRefiner, Index f)
Assign the vertices incident each face.
static LocalIndexArray getBaseEdgeFaceLocalIndices(TopologyRefiner &newRefiner, Index e)
Assign the local indices of an edge within each of its incident faces.
static bool populateBaseLevel(TopologyRefiner &refiner, MESH const &mesh, Options options)
static void populateBaseLocalIndices(TopologyRefiner &newRefiner)
Determine all local indices by inspection (only for pure manifold meshes)
static bool assignComponentTags(TopologyRefiner &newRefiner, MESH const &mesh)
(Optional) Specify edge or vertex sharpness or face holes
static bool resizeComponentTopology(TopologyRefiner &newRefiner, MESH const &mesh)
Specify the number of vertices, faces, face-vertices, etc.
static void setNumBaseVertexEdges(TopologyRefiner &newRefiner, Index v, int count)
Specify the number of edges incident each vertex.
Vtr::internal::Level::TopologyError TopologyError
static IndexArray getBaseFaceFVarValues(TopologyRefiner &newRefiner, Index face, int channel=0)
Assign the face-varying values for the corners of each face.
static IndexArray getBaseEdgeFaces(TopologyRefiner &newRefiner, Index e)
Assign the faces incident each edge.
static void setNumBaseVertexFaces(TopologyRefiner &newRefiner, Index v, int count)
Specify the number of faces incident each vertex.
static bool assignFaceVaryingTopology(TopologyRefiner &newRefiner, MESH const &mesh)
(Optional) Specify face-varying data per face
static void setBaseVertexSharpness(TopologyRefiner &newRefiner, Index v, float sharpness)
Assign a sharpness value to a given vertex.
static LocalIndexArray getBaseVertexEdgeLocalIndices(TopologyRefiner &newRefiner, Index v)
Assign the local indices of a vertex within each of its incident edges.
static IndexArray getBaseEdgeVertices(TopologyRefiner &newRefiner, Index e)
Assign the vertices incident each edge.
static IndexArray getBaseVertexFaces(TopologyRefiner &newRefiner, Index v)
Assign the faces incident each vertex.
static void setBaseVertexNonManifold(TopologyRefiner &newRefiner, Index v, bool b)
Tag a vertex as non-manifold.
static void setNumBaseFaces(TopologyRefiner &newRefiner, int count)
Specify the number of faces to be accommodated.
static IndexArray getBaseFaceEdges(TopologyRefiner &newRefiner, Index f)
Assign the edges incident each face.
static void setNumBaseFaceVertices(TopologyRefiner &newRefiner, Index f, int count)
Specify the number of vertices incident each face.
static void setBaseEdgeSharpness(TopologyRefiner &newRefiner, Index e, float sharpness)
Assign a sharpness value to a given edge.
static void setBaseEdgeNonManifold(TopologyRefiner &newRefiner, Index e, bool b)
Tag an edge as non-manifold.
static void setNumBaseEdges(TopologyRefiner &newRefiner, int count)
Specify the number of edges to be accommodated.
static TopologyRefiner * Create(MESH const &mesh, Options options=Options())
Instantiates a TopologyRefiner from client-provided topological representation.
static Index findBaseEdge(TopologyRefiner const &newRefiner, Index v0, Index v1)
Identify an edge to be assigned a sharpness value given a vertex pair.
static IndexArray getBaseVertexEdges(TopologyRefiner &newRefiner, Index v)
Assign the edges incident each vertex.
static int createBaseFVarChannel(TopologyRefiner &newRefiner, int numValues)
Create a new face-varying channel with the given number of values.
static int getNumBaseEdges(TopologyRefiner const &newRefiner)
static void setNumBaseVertices(TopologyRefiner &newRefiner, int count)
Specify the number of vertices to be accommodated.
static void setBaseFaceHole(TopologyRefiner &newRefiner, Index f, bool isHole)
Tag a face as a hole.
Stores topology data for a specified set of refinement options.
Private base class of Factories for constructing TopologyRefiners.
static bool prepareComponentTopologyAssignment(TopologyRefiner &refiner, bool fullValidation, TopologyCallback callback, void const *callbackData)
Vtr::internal::Level::ValidationCallback TopologyCallback
static bool prepareComponentTagsAndSharpness(TopologyRefiner &refiner)
static bool prepareComponentTopologySizing(TopologyRefiner &refiner)
static bool prepareFaceVaryingChannels(TopologyRefiner &refiner)
Options related to the construction of each TopologyRefiner.
Options(Sdc::SchemeType sdcType=Sdc::SCHEME_CATMARK, Sdc::Options sdcOptions=Sdc::Options())
Sdc::Options schemeOptions
Sdc::SchemeType schemeType
The subdivision scheme type identifier.
unsigned int validateFullTopology
All supported options applying to subdivision scheme.
void(* ValidationCallback)(TopologyError errCode, char const *msg, void const *clientData)