Renaming of a few Sdc types and constants:

- renamed Sdc::Type to SchemeType and TypeTraits to SchemeTypeTraits
    - renamed TYPE_ prefix to SCHEME_
    - updated all usage within core library
    - updated all usage in examples, tutorials, etc.
This commit is contained in:
barfowl 2015-01-06 17:40:11 -08:00
parent f8e7549d1b
commit 9bb98a94fd
36 changed files with 192 additions and 192 deletions

View File

@ -657,7 +657,7 @@ createOsdMesh(int level, int kernel) {
typedef OpenSubdiv::Far::ConstIndexArray IndexArray;
// create Vtr mesh (topology)
OpenSubdiv::Sdc::Type sdctype = GetSdcType(*shape);
OpenSubdiv::Sdc::SchemeType sdctype = GetSdcType(*shape);
OpenSubdiv::Sdc::Options sdcoptions = GetSdcOptions(*shape);
OpenSubdiv::Far::TopologyRefiner * refiner =

View File

@ -278,7 +278,7 @@ createOsdMesh(ShapeDesc const & shapeDesc, int level, int kernel, Scheme scheme=
Shape * shape = Shape::parseObj(shapeDesc.data.c_str(), shapeDesc.scheme);
// create Vtr mesh (topology)
OpenSubdiv::Sdc::Type sdctype = GetSdcType(*shape);
OpenSubdiv::Sdc::SchemeType sdctype = GetSdcType(*shape);
OpenSubdiv::Sdc::Options sdcoptions = GetSdcOptions(*shape);
OpenSubdiv::Far::TopologyRefiner * refiner =

View File

@ -328,7 +328,7 @@ createOsdMesh(ShapeDesc const & shapeDesc, int level) {
Shape * shape = Shape::parseObj(shapeDesc.data.c_str(), shapeDesc.scheme);
// create Vtr mesh (topology)
OpenSubdiv::Sdc::Type sdctype = GetSdcType(*shape);
OpenSubdiv::Sdc::SchemeType sdctype = GetSdcType(*shape);
OpenSubdiv::Sdc::Options sdcoptions = GetSdcOptions(*shape);
delete g_topologyRefiner;

View File

@ -313,7 +313,7 @@ createOsdMesh(ShapeDesc const & shapeDesc, int level, Scheme scheme = kCatmark)
Shape * shape = Shape::parseObj(shapeDesc.data.c_str(), shapeDesc.scheme);
// create Vtr mesh (topology)
OpenSubdiv::Sdc::Type sdctype = GetSdcType(*shape);
OpenSubdiv::Sdc::SchemeType sdctype = GetSdcType(*shape);
OpenSubdiv::Sdc::Options sdcoptions = GetSdcOptions(*shape);
sdcoptions.SetFVarLinearInterpolation(g_fvarBoundary);

View File

@ -221,7 +221,7 @@ createOsdMesh() {
g_orgPositions=shape->verts;
// create Vtr mesh (topology)
OpenSubdiv::Sdc::Type sdctype = GetSdcType(*shape);
OpenSubdiv::Sdc::SchemeType sdctype = GetSdcType(*shape);
OpenSubdiv::Sdc::Options sdcoptions = GetSdcOptions(*shape);
OpenSubdiv::Far::TopologyRefiner * refiner =

View File

@ -1001,7 +1001,7 @@ createOsdMesh(int level, int kernel) {
typedef OpenSubdiv::Far::ConstIndexArray IndexArray;
// create Vtr mesh (topology)
OpenSubdiv::Sdc::Type sdctype = GetSdcType(*shape);
OpenSubdiv::Sdc::SchemeType sdctype = GetSdcType(*shape);
OpenSubdiv::Sdc::Options sdcoptions = GetSdcOptions(*shape);
OpenSubdiv::Far::TopologyRefiner * refiner =

View File

@ -572,7 +572,7 @@ createOsdMesh( const std::string &shapeStr, int level, Scheme scheme=kCatmark )
Far::TopologyRefiner * refiner = 0;
{
Sdc::Type type = GetSdcType(*shape);
Sdc::SchemeType type = GetSdcType(*shape);
Sdc::Options options = GetSdcOptions(*shape);
refiner = Far::TopologyRefinerFactory<Shape>::Create(*shape,

View File

@ -289,7 +289,7 @@ createMesh(ShapeDesc const & shapeDesc, int level) {
Shape const * shape = Shape::parseObj(shapeDesc.data.c_str(), shapeDesc.scheme);
// create Vtr mesh (topology)
OpenSubdiv::Sdc::Type sdctype = GetSdcType(*shape);
OpenSubdiv::Sdc::SchemeType sdctype = GetSdcType(*shape);
OpenSubdiv::Sdc::Options sdcoptions = GetSdcOptions(*shape);
OpenSubdiv::Far::TopologyRefiner * refiner =

View File

@ -490,7 +490,7 @@ createOsdMesh(ShapeDesc const & shapeDesc, int level, int kernel, Scheme scheme=
}
// create Vtr mesh (topology)
OpenSubdiv::Sdc::Type sdctype = GetSdcType(*shape);
OpenSubdiv::Sdc::SchemeType sdctype = GetSdcType(*shape);
OpenSubdiv::Sdc::Options sdcoptions = GetSdcOptions(*shape);
OpenSubdiv::Far::TopologyRefiner * refiner =

View File

@ -309,7 +309,7 @@ getMayaFvarFieldParams(
static OpenSubdiv::Far::TopologyRefiner *
gatherTopology( MFnMesh const & inMeshFn,
MItMeshPolygon & inMeshItPolygon,
OpenSubdiv::Sdc::Type type,
OpenSubdiv::Sdc::SchemeType type,
OpenSubdiv::Sdc::Options options,
float * maxCreaseSharpness=0 ) {
@ -628,7 +628,7 @@ MayaPolySmooth::compute( const MPlug& plug, MDataBlock& data ) {
MCHECKERR(status, "ERROR getting inMeshItPolygon\n");
// Convert attr values to OSD enums
OpenSubdiv::Sdc::Type type = OpenSubdiv::Sdc::TYPE_CATMARK;
OpenSubdiv::Sdc::SchemeType type = OpenSubdiv::Sdc::SCHEME_CATMARK;
//
// Create Far topology

View File

@ -830,7 +830,7 @@ Far::PatchTablesFactory::Create(Hmesh & mesh, int maxvalence) {
typedef Far::PatchDescriptorVector DescVec;
DescVec const & catmarkDescs = Far::PatchDescriptor::GetAdaptivePatchDescriptors(Sdc::TYPE_CATMARK);
DescVec const & catmarkDescs = Far::PatchDescriptor::GetAdaptivePatchDescriptors(Sdc::SCHEME_CATMARK);
int voffset=0, poffset=0, qoffset=0;
for (DescVec::const_iterator it=catmarkDescs.begin(); it!=catmarkDescs.end(); ++it) {

View File

@ -656,8 +656,8 @@ createVtrMesh(Shape * shape, int maxlevel) {
s.Start();
// create Vtr mesh (topology)
OpenSubdiv::Sdc::Type sdctype = GetSdcType(*shape);
OpenSubdiv::Sdc::Options sdcoptions = GetSdcOptions(*shape);
OpenSubdiv::Sdc::SchemeType sdctype = GetSdcType(*shape);
OpenSubdiv::Sdc::Options sdcoptions = GetSdcOptions(*shape);
OpenSubdiv::Far::TopologyRefiner * refiner =
OpenSubdiv::Far::TopologyRefinerFactory<Shape>::Create(*shape,

View File

@ -91,14 +91,14 @@ getAdaptiveLoopDescriptors() {
return _descriptors;
}
PatchDescriptorVector const &
PatchDescriptor::GetAdaptivePatchDescriptors(Sdc::Type type) {
PatchDescriptor::GetAdaptivePatchDescriptors(Sdc::SchemeType type) {
static PatchDescriptorVector _empty;
switch (type) {
case Sdc::TYPE_BILINEAR : return _empty;
case Sdc::TYPE_CATMARK : return getAdaptiveCatmarkDescriptors();
case Sdc::TYPE_LOOP : return getAdaptiveLoopDescriptors();
case Sdc::SCHEME_BILINEAR : return _empty;
case Sdc::SCHEME_CATMARK : return getAdaptiveCatmarkDescriptors();
case Sdc::SCHEME_LOOP : return getAdaptiveLoopDescriptors();
default:
assert(0);
}

View File

@ -154,7 +154,7 @@ public:
/// \brief Returns a vector of all the legal patch descriptors for the
/// given adaptive subdivision scheme
static std::vector<PatchDescriptor> const & GetAdaptivePatchDescriptors(Sdc::Type type);
static std::vector<PatchDescriptor> const & GetAdaptivePatchDescriptors(Sdc::SchemeType type);
/// \brief Allows ordering of patches by type
inline bool operator < ( PatchDescriptor const other ) const;

View File

@ -688,8 +688,8 @@ PatchTablesFactory::createUniform( TopologyRefiner const & refiner, Options opti
assert(refiner.IsUniform());
// ensure that triangulateQuads is only set for quadrilateral schemes
options.triangulateQuads &= (refiner.GetSchemeType()==Sdc::TYPE_BILINEAR or
refiner.GetSchemeType()==Sdc::TYPE_CATMARK);
options.triangulateQuads &= (refiner.GetSchemeType()==Sdc::SCHEME_BILINEAR or
refiner.GetSchemeType()==Sdc::SCHEME_CATMARK);
int maxvalence = refiner.getLevel(0).getMaxValence(),
maxlevel = refiner.GetMaxLevel(),
@ -701,9 +701,9 @@ PatchTablesFactory::createUniform( TopologyRefiner const & refiner, Options opti
ptype = PatchDescriptor::TRIANGLES;
} else {
switch (refiner.GetSchemeType()) {
case Sdc::TYPE_BILINEAR :
case Sdc::TYPE_CATMARK : ptype = PatchDescriptor::QUADS; break;
case Sdc::TYPE_LOOP : ptype = PatchDescriptor::TRIANGLES; break;
case Sdc::SCHEME_BILINEAR :
case Sdc::SCHEME_CATMARK : ptype = PatchDescriptor::QUADS; break;
case Sdc::SCHEME_LOOP : ptype = PatchDescriptor::TRIANGLES; break;
}
}
assert(ptype!=PatchDescriptor::NON_PATCH);
@ -852,7 +852,7 @@ PatchTablesFactory::createAdaptive( TopologyRefiner const & refiner, Options opt
// sort through the inventory and push back non-empty patch arrays
typedef PatchDescriptorVector DescVec;
DescVec const & descs = PatchDescriptor::GetAdaptivePatchDescriptors(Sdc::TYPE_CATMARK);
DescVec const & descs = PatchDescriptor::GetAdaptivePatchDescriptors(Sdc::SCHEME_CATMARK);
int voffset=0, poffset=0, qoffset=0;
for (DescVec::const_iterator it=descs.begin(); it!=descs.end(); ++it) {
@ -1136,7 +1136,7 @@ PatchTablesFactory::populateAdaptivePatches( TopologyRefiner const & refiner,
typedef PatchDescriptorVector DescVec;
DescVec const & descs = PatchDescriptor::GetAdaptivePatchDescriptors(Sdc::TYPE_CATMARK);
DescVec const & descs = PatchDescriptor::GetAdaptivePatchDescriptors(Sdc::SCHEME_CATMARK);
for (DescVec::const_iterator it=descs.begin(); it!=descs.end(); ++it) {

View File

@ -80,11 +80,11 @@ StencilTablesFactory::Create(TopologyRefiner const & refiner,
bool interpolateVarying = false;
switch (options.interpolationMode) {
case INTERPOLATE_VERTEX: {
Sdc::Type type = refiner.GetSchemeType();
Sdc::SchemeType type = refiner.GetSchemeType();
switch (type) {
case Sdc::TYPE_BILINEAR : maxsize = 5; break;
case Sdc::TYPE_CATMARK : maxsize = 17; break;
case Sdc::TYPE_LOOP : maxsize = 10; break;
case Sdc::SCHEME_BILINEAR : maxsize = 5; break;
case Sdc::SCHEME_CATMARK : maxsize = 17; break;
case Sdc::SCHEME_LOOP : maxsize = 10; break;
default:
assert(0);
}

View File

@ -39,7 +39,7 @@ namespace Far {
// Relatively trivial construction/destruction -- the base level (level[0]) needs
// to be explicitly initialized after construction and refinement then applied
//
TopologyRefiner::TopologyRefiner(Sdc::Type schemeType, Sdc::Options schemeOptions) :
TopologyRefiner::TopologyRefiner(Sdc::SchemeType schemeType, Sdc::Options schemeOptions) :
_subdivType(schemeType),
_subdivOptions(schemeOptions),
_isUniform(true),
@ -147,7 +147,7 @@ TopologyRefiner::initializePtexIndices() const {
int nfaces = coarseLevel.getNumFaces();
ptexIndices.resize(nfaces+1);
int ptexID=0;
int regFaceSize = Sdc::TypeTraits::GetRegularFaceSize(GetSchemeType());
int regFaceSize = Sdc::SchemeTypeTraits::GetRegularFaceSize(GetSchemeType());
for (int i = 0; i < nfaces; ++i) {
ptexIndices[i] = ptexID;
Vtr::ConstIndexArray fverts = coarseLevel.getFaceVertices(i);
@ -188,7 +188,7 @@ void
TopologyRefiner::GetPtexAdjacency(int face, int quadrant,
int adjFaces[4], int adjEdges[4]) const {
assert(GetSchemeType()==Sdc::TYPE_CATMARK);
assert(GetSchemeType()==Sdc::SCHEME_CATMARK);
if (_ptexIndices.empty()) {
initializePtexIndices();
@ -312,7 +312,7 @@ TopologyRefiner::RefineUniform(UniformOptions options) {
_isUniform = true;
_maxLevel = options.refinementLevel;
Sdc::Split splitType = (_subdivType == Sdc::TYPE_LOOP) ? Sdc::SPLIT_TO_TRIS : Sdc::SPLIT_TO_QUADS;
Sdc::Split splitType = (_subdivType == Sdc::SCHEME_LOOP) ? Sdc::SPLIT_TO_TRIS : Sdc::SPLIT_TO_QUADS;
//
// Initialize refinement options for Vtr -- adjusting full-topology for the last level:
@ -361,7 +361,7 @@ TopologyRefiner::RefineAdaptive(AdaptiveOptions options) {
refineOptions._sparse = true;
refineOptions._faceTopologyOnly = not options.fullTopologyInLastLevel;
Sdc::Split splitType = (_subdivType == Sdc::TYPE_LOOP) ? Sdc::SPLIT_TO_TRIS : Sdc::SPLIT_TO_QUADS;
Sdc::Split splitType = (_subdivType == Sdc::SCHEME_LOOP) ? Sdc::SPLIT_TO_TRIS : Sdc::SPLIT_TO_QUADS;
for (int i = 1; i <= (int)options.isolationLevel; ++i) {
// Keeping full topology on for debugging -- may need to go back a level and "prune"

View File

@ -59,13 +59,13 @@ class TopologyRefiner {
public:
/// \brief Constructor
TopologyRefiner(Sdc::Type type, Sdc::Options options = Sdc::Options());
TopologyRefiner(Sdc::SchemeType type, Sdc::Options options = Sdc::Options());
/// \brief Destructor
~TopologyRefiner();
/// \brief Returns the subdivision scheme
Sdc::Type GetSchemeType() const { return _subdivType; }
Sdc::SchemeType GetSchemeType() const { return _subdivType; }
/// \brief Returns the subdivision options
Sdc::Options GetSchemeOptions() const { return _subdivOptions; }
@ -557,28 +557,28 @@ protected:
private:
void selectFeatureAdaptiveComponents(Vtr::SparseSelector& selector);
template <Sdc::Type SCHEME, class T, class U> void interpolateChildVertsFromFaces(Vtr::Refinement const &, T const & src, U & dst) const;
template <Sdc::Type SCHEME, class T, class U> void interpolateChildVertsFromEdges(Vtr::Refinement const &, T const & src, U & dst) const;
template <Sdc::Type SCHEME, class T, class U> void interpolateChildVertsFromVerts(Vtr::Refinement const &, T const & src, U & dst) const;
template <Sdc::SchemeType SCHEME, class T, class U> void interpolateChildVertsFromFaces(Vtr::Refinement const &, T const & src, U & dst) const;
template <Sdc::SchemeType SCHEME, class T, class U> void interpolateChildVertsFromEdges(Vtr::Refinement const &, T const & src, U & dst) const;
template <Sdc::SchemeType SCHEME, class T, class U> void interpolateChildVertsFromVerts(Vtr::Refinement const &, T const & src, U & dst) const;
template <class T, class U> void varyingInterpolateChildVertsFromFaces(Vtr::Refinement const &, T const & src, U & dst) const;
template <class T, class U> void varyingInterpolateChildVertsFromEdges(Vtr::Refinement const &, T const & src, U & dst) const;
template <class T, class U> void varyingInterpolateChildVertsFromVerts(Vtr::Refinement const &, T const & src, U & dst) const;
template <Sdc::Type SCHEME, class T, class U> void faceVaryingInterpolateChildVertsFromFaces(Vtr::Refinement const &, T const & src, U & dst, int channel) const;
template <Sdc::Type SCHEME, class T, class U> void faceVaryingInterpolateChildVertsFromEdges(Vtr::Refinement const &, T const & src, U & dst, int channel) const;
template <Sdc::Type SCHEME, class T, class U> void faceVaryingInterpolateChildVertsFromVerts(Vtr::Refinement const &, T const & src, U & dst, int channel) const;
template <Sdc::SchemeType SCHEME, class T, class U> void faceVaryingInterpolateChildVertsFromFaces(Vtr::Refinement const &, T const & src, U & dst, int channel) const;
template <Sdc::SchemeType SCHEME, class T, class U> void faceVaryingInterpolateChildVertsFromEdges(Vtr::Refinement const &, T const & src, U & dst, int channel) const;
template <Sdc::SchemeType SCHEME, class T, class U> void faceVaryingInterpolateChildVertsFromVerts(Vtr::Refinement const &, T const & src, U & dst, int channel) const;
template <Sdc::Type SCHEME, class T, class U> void limit(T const & src, U * dst) const;
template <Sdc::SchemeType SCHEME, class T, class U> void limit(T const & src, U * dst) const;
template <Sdc::Type SCHEME, class T, class U> void faceVaryingLimit(T const & src, U * dst, int channel) const;
template <Sdc::SchemeType SCHEME, class T, class U> void faceVaryingLimit(T const & src, U * dst, int channel) const;
void initializePtexIndices() const;
private:
Sdc::Type _subdivType;
Sdc::Options _subdivOptions;
Sdc::SchemeType _subdivType;
Sdc::Options _subdivOptions;
unsigned int _isUniform : 1,
_hasHoles : 1,
@ -613,25 +613,25 @@ TopologyRefiner::Interpolate(int level, T const & src, U & dst) const {
Vtr::Refinement const & refinement = getRefinement(level-1);
switch (_subdivType) {
case Sdc::TYPE_CATMARK:
interpolateChildVertsFromFaces<Sdc::TYPE_CATMARK>(refinement, src, dst);
interpolateChildVertsFromEdges<Sdc::TYPE_CATMARK>(refinement, src, dst);
interpolateChildVertsFromVerts<Sdc::TYPE_CATMARK>(refinement, src, dst);
case Sdc::SCHEME_CATMARK:
interpolateChildVertsFromFaces<Sdc::SCHEME_CATMARK>(refinement, src, dst);
interpolateChildVertsFromEdges<Sdc::SCHEME_CATMARK>(refinement, src, dst);
interpolateChildVertsFromVerts<Sdc::SCHEME_CATMARK>(refinement, src, dst);
break;
case Sdc::TYPE_LOOP:
interpolateChildVertsFromFaces<Sdc::TYPE_LOOP>(refinement, src, dst);
interpolateChildVertsFromEdges<Sdc::TYPE_LOOP>(refinement, src, dst);
interpolateChildVertsFromVerts<Sdc::TYPE_LOOP>(refinement, src, dst);
case Sdc::SCHEME_LOOP:
interpolateChildVertsFromFaces<Sdc::SCHEME_LOOP>(refinement, src, dst);
interpolateChildVertsFromEdges<Sdc::SCHEME_LOOP>(refinement, src, dst);
interpolateChildVertsFromVerts<Sdc::SCHEME_LOOP>(refinement, src, dst);
break;
case Sdc::TYPE_BILINEAR:
interpolateChildVertsFromFaces<Sdc::TYPE_BILINEAR>(refinement, src, dst);
interpolateChildVertsFromEdges<Sdc::TYPE_BILINEAR>(refinement, src, dst);
interpolateChildVertsFromVerts<Sdc::TYPE_BILINEAR>(refinement, src, dst);
case Sdc::SCHEME_BILINEAR:
interpolateChildVertsFromFaces<Sdc::SCHEME_BILINEAR>(refinement, src, dst);
interpolateChildVertsFromEdges<Sdc::SCHEME_BILINEAR>(refinement, src, dst);
interpolateChildVertsFromVerts<Sdc::SCHEME_BILINEAR>(refinement, src, dst);
break;
}
}
template <Sdc::Type SCHEME, class T, class U>
template <Sdc::SchemeType SCHEME, class T, class U>
inline void
TopologyRefiner::interpolateChildVertsFromFaces(
Vtr::Refinement const & refinement, T const & src, U & dst) const {
@ -672,7 +672,7 @@ TopologyRefiner::interpolateChildVertsFromFaces(
}
}
template <Sdc::Type SCHEME, class T, class U>
template <Sdc::SchemeType SCHEME, class T, class U>
inline void
TopologyRefiner::interpolateChildVertsFromEdges(
Vtr::Refinement const & refinement, T const & src, U & dst) const {
@ -744,7 +744,7 @@ TopologyRefiner::interpolateChildVertsFromEdges(
}
}
template <Sdc::Type SCHEME, class T, class U>
template <Sdc::SchemeType SCHEME, class T, class U>
inline void
TopologyRefiner::interpolateChildVertsFromVerts(
Vtr::Refinement const & refinement, T const & src, U & dst) const {
@ -943,25 +943,25 @@ TopologyRefiner::InterpolateFaceVarying(int level, T const & src, U & dst, int c
Vtr::Refinement const & refinement = getRefinement(level-1);
switch (_subdivType) {
case Sdc::TYPE_CATMARK:
faceVaryingInterpolateChildVertsFromFaces<Sdc::TYPE_CATMARK>(refinement, src, dst, channel);
faceVaryingInterpolateChildVertsFromEdges<Sdc::TYPE_CATMARK>(refinement, src, dst, channel);
faceVaryingInterpolateChildVertsFromVerts<Sdc::TYPE_CATMARK>(refinement, src, dst, channel);
case Sdc::SCHEME_CATMARK:
faceVaryingInterpolateChildVertsFromFaces<Sdc::SCHEME_CATMARK>(refinement, src, dst, channel);
faceVaryingInterpolateChildVertsFromEdges<Sdc::SCHEME_CATMARK>(refinement, src, dst, channel);
faceVaryingInterpolateChildVertsFromVerts<Sdc::SCHEME_CATMARK>(refinement, src, dst, channel);
break;
case Sdc::TYPE_LOOP:
faceVaryingInterpolateChildVertsFromFaces<Sdc::TYPE_LOOP>(refinement, src, dst, channel);
faceVaryingInterpolateChildVertsFromEdges<Sdc::TYPE_LOOP>(refinement, src, dst, channel);
faceVaryingInterpolateChildVertsFromVerts<Sdc::TYPE_LOOP>(refinement, src, dst, channel);
case Sdc::SCHEME_LOOP:
faceVaryingInterpolateChildVertsFromFaces<Sdc::SCHEME_LOOP>(refinement, src, dst, channel);
faceVaryingInterpolateChildVertsFromEdges<Sdc::SCHEME_LOOP>(refinement, src, dst, channel);
faceVaryingInterpolateChildVertsFromVerts<Sdc::SCHEME_LOOP>(refinement, src, dst, channel);
break;
case Sdc::TYPE_BILINEAR:
faceVaryingInterpolateChildVertsFromFaces<Sdc::TYPE_BILINEAR>(refinement, src, dst, channel);
faceVaryingInterpolateChildVertsFromEdges<Sdc::TYPE_BILINEAR>(refinement, src, dst, channel);
faceVaryingInterpolateChildVertsFromVerts<Sdc::TYPE_BILINEAR>(refinement, src, dst, channel);
case Sdc::SCHEME_BILINEAR:
faceVaryingInterpolateChildVertsFromFaces<Sdc::SCHEME_BILINEAR>(refinement, src, dst, channel);
faceVaryingInterpolateChildVertsFromEdges<Sdc::SCHEME_BILINEAR>(refinement, src, dst, channel);
faceVaryingInterpolateChildVertsFromVerts<Sdc::SCHEME_BILINEAR>(refinement, src, dst, channel);
break;
}
}
template <Sdc::Type SCHEME, class T, class U>
template <Sdc::SchemeType SCHEME, class T, class U>
inline void
TopologyRefiner::faceVaryingInterpolateChildVertsFromFaces(
Vtr::Refinement const & refinement, T const & src, U & dst, int channel) const {
@ -1008,7 +1008,7 @@ TopologyRefiner::faceVaryingInterpolateChildVertsFromFaces(
}
}
template <Sdc::Type SCHEME, class T, class U>
template <Sdc::SchemeType SCHEME, class T, class U>
inline void
TopologyRefiner::faceVaryingInterpolateChildVertsFromEdges(
Vtr::Refinement const & refinement, T const & src, U & dst, int channel) const {
@ -1151,7 +1151,7 @@ TopologyRefiner::faceVaryingInterpolateChildVertsFromEdges(
}
}
template <Sdc::Type SCHEME, class T, class U>
template <Sdc::SchemeType SCHEME, class T, class U>
inline void
TopologyRefiner::faceVaryingInterpolateChildVertsFromVerts(
Vtr::Refinement const & refinement, T const & src, U & dst, int channel) const {
@ -1324,19 +1324,19 @@ TopologyRefiner::Limit(T const & src, U * dst) const {
assert(GetMaxLevel() > 0);
switch (_subdivType) {
case Sdc::TYPE_CATMARK:
limit<Sdc::TYPE_CATMARK>(src, dst);
case Sdc::SCHEME_CATMARK:
limit<Sdc::SCHEME_CATMARK>(src, dst);
break;
case Sdc::TYPE_LOOP:
limit<Sdc::TYPE_LOOP>(src, dst);
case Sdc::SCHEME_LOOP:
limit<Sdc::SCHEME_LOOP>(src, dst);
break;
case Sdc::TYPE_BILINEAR:
limit<Sdc::TYPE_BILINEAR>(src, dst);
case Sdc::SCHEME_BILINEAR:
limit<Sdc::SCHEME_BILINEAR>(src, dst);
break;
}
}
template <Sdc::Type SCHEME, class T, class U>
template <Sdc::SchemeType SCHEME, class T, class U>
inline void
TopologyRefiner::limit(T const & src, U * dst) const {
@ -1418,19 +1418,19 @@ TopologyRefiner::LimitFaceVarying(T const & src, U * dst, int channel) const {
assert(GetMaxLevel() > 0);
switch (_subdivType) {
case Sdc::TYPE_CATMARK:
faceVaryingLimit<Sdc::TYPE_CATMARK>(src, dst, channel);
case Sdc::SCHEME_CATMARK:
faceVaryingLimit<Sdc::SCHEME_CATMARK>(src, dst, channel);
break;
case Sdc::TYPE_LOOP:
faceVaryingLimit<Sdc::TYPE_LOOP>(src, dst, channel);
case Sdc::SCHEME_LOOP:
faceVaryingLimit<Sdc::SCHEME_LOOP>(src, dst, channel);
break;
case Sdc::TYPE_BILINEAR:
faceVaryingLimit<Sdc::TYPE_BILINEAR>(src, dst, channel);
case Sdc::SCHEME_BILINEAR:
faceVaryingLimit<Sdc::SCHEME_BILINEAR>(src, dst, channel);
break;
}
}
template <Sdc::Type SCHEME, class T, class U>
template <Sdc::SchemeType SCHEME, class T, class U>
inline void
TopologyRefiner::faceVaryingLimit(T const & src, U * dst, int channel) const {

View File

@ -141,7 +141,7 @@ TopologyRefinerFactoryBase::prepareComponentTagsAndSharpness(TopologyRefiner& re
//
int schemeRegularBoundaryValence = 2;
int schemeRegularInteriorValence = 4;
if (refiner.GetSchemeType() == Sdc::TYPE_LOOP) {
if (refiner.GetSchemeType() == Sdc::SCHEME_LOOP) {
schemeRegularBoundaryValence = 3;
schemeRegularInteriorValence = 6;
}

View File

@ -122,13 +122,13 @@ public:
struct Options {
Options(Sdc::Type sdcType = Sdc::TYPE_CATMARK, Sdc::Options sdcOptions = Sdc::Options()) :
Options(Sdc::SchemeType sdcType = Sdc::SCHEME_CATMARK, Sdc::Options sdcOptions = Sdc::Options()) :
schemeType(sdcType),
schemeOptions(sdcOptions),
validateFullTopology(false) { }
Sdc::Type schemeType; ///< The subdivision scheme type identifier
Sdc::Options schemeOptions; ///< The full set of options for the scheme,
Sdc::SchemeType schemeType; ///< The subdivision scheme type identifier
Sdc::Options schemeOptions; ///< The full set of options for the scheme,
///< e.g. boundary interpolation rules...
unsigned int validateFullTopology : 1; ///< Apply more extensive validation of
///< the constructed topology -- intended

View File

@ -34,23 +34,23 @@ namespace OPENSUBDIV_VERSION {
namespace Sdc {
//
// Specializations for Scheme<TYPE_BILINEAR>:
// Specializations for Scheme<SCHEME_BILINEAR>:
//
//
// Bilinear traits:
//
template <>
inline Split Scheme<TYPE_BILINEAR>::GetTopologicalSplitType() { return SPLIT_TO_QUADS; }
inline Split Scheme<SCHEME_BILINEAR>::GetTopologicalSplitType() { return SPLIT_TO_QUADS; }
template <>
inline int Scheme<TYPE_BILINEAR>::GetRegularFaceSize() { return 4; }
inline int Scheme<SCHEME_BILINEAR>::GetRegularFaceSize() { return 4; }
template <>
inline int Scheme<TYPE_BILINEAR>::GetRegularVertexValence() { return 4; }
inline int Scheme<SCHEME_BILINEAR>::GetRegularVertexValence() { return 4; }
template <>
inline int Scheme<TYPE_BILINEAR>::GetLocalNeighborhoodSize() { return 0; }
inline int Scheme<SCHEME_BILINEAR>::GetLocalNeighborhoodSize() { return 0; }
//
@ -59,7 +59,7 @@ inline int Scheme<TYPE_BILINEAR>::GetLocalNeighborhoodSize() { return 0; }
template <>
template <typename EDGE, typename MASK>
void
Scheme<TYPE_BILINEAR>::ComputeEdgeVertexMask(EDGE const& edge, MASK& mask,
Scheme<SCHEME_BILINEAR>::ComputeEdgeVertexMask(EDGE const& edge, MASK& mask,
Crease::Rule, Crease::Rule) const {
// This should be inline, otherwise trivially replicate it:
assignCreaseMaskForEdge(edge, mask);
@ -68,7 +68,7 @@ Scheme<TYPE_BILINEAR>::ComputeEdgeVertexMask(EDGE const& edge, MASK& mask,
template <>
template <typename VERTEX, typename MASK>
void
Scheme<TYPE_BILINEAR>::ComputeVertexVertexMask(VERTEX const& vertex, MASK& mask,
Scheme<SCHEME_BILINEAR>::ComputeVertexVertexMask(VERTEX const& vertex, MASK& mask,
Crease::Rule, Crease::Rule) const {
// This should be inline, otherwise trivially replicate it:
assignCornerMaskForVertex(vertex, mask);
@ -82,7 +82,7 @@ Scheme<TYPE_BILINEAR>::ComputeVertexVertexMask(VERTEX const& vertex, MASK& mask,
template <>
template <typename VERTEX, typename MASK>
inline void
Scheme<TYPE_BILINEAR>::assignInteriorLimitMask(VERTEX const& /* vertex */, MASK& posMask) const {
Scheme<SCHEME_BILINEAR>::assignInteriorLimitMask(VERTEX const& /* vertex */, MASK& posMask) const {
posMask.SetNumVertexWeights(1);
posMask.SetNumEdgeWeights(0);
@ -95,7 +95,7 @@ Scheme<TYPE_BILINEAR>::assignInteriorLimitMask(VERTEX const& /* vertex */, MASK&
template <>
template <typename VERTEX, typename MASK>
inline void
Scheme<TYPE_BILINEAR>::assignBoundaryLimitMask(VERTEX const& vertex, MASK& posMask) const {
Scheme<SCHEME_BILINEAR>::assignBoundaryLimitMask(VERTEX const& vertex, MASK& posMask) const {
assignInteriorLimitMask(vertex, posMask);
}
@ -103,7 +103,7 @@ Scheme<TYPE_BILINEAR>::assignBoundaryLimitMask(VERTEX const& vertex, MASK& posMa
template <>
template <typename VERTEX, typename MASK>
inline void
Scheme<TYPE_BILINEAR>::assignInteriorLimitTangentMasks(VERTEX const& /* vertex */,
Scheme<SCHEME_BILINEAR>::assignInteriorLimitTangentMasks(VERTEX const& /* vertex */,
MASK& tan1Mask, MASK& tan2Mask) const {
tan1Mask.SetNumVertexWeights(1);
@ -123,7 +123,7 @@ Scheme<TYPE_BILINEAR>::assignInteriorLimitTangentMasks(VERTEX const& /* vertex *
template <>
template <typename VERTEX, typename MASK>
inline void
Scheme<TYPE_BILINEAR>::assignBoundaryLimitTangentMasks(VERTEX const& vertex,
Scheme<SCHEME_BILINEAR>::assignBoundaryLimitTangentMasks(VERTEX const& vertex,
MASK& tan1Mask, MASK& tan2Mask) const {
assignInteriorLimitTangentMasks(vertex, tan1Mask, tan2Mask);

View File

@ -37,23 +37,23 @@ namespace OPENSUBDIV_VERSION {
namespace Sdc {
//
// Specializations for Scheme<TYPE_CATMARK>:
// Specializations for Scheme<SCHEME_CATMARK>:
//
//
// Catmark traits:
//
template <>
inline Split Scheme<TYPE_CATMARK>::GetTopologicalSplitType() { return SPLIT_TO_QUADS; }
inline Split Scheme<SCHEME_CATMARK>::GetTopologicalSplitType() { return SPLIT_TO_QUADS; }
template <>
inline int Scheme<TYPE_CATMARK>::GetRegularFaceSize() { return 4; }
inline int Scheme<SCHEME_CATMARK>::GetRegularFaceSize() { return 4; }
template <>
inline int Scheme<TYPE_CATMARK>::GetRegularVertexValence() { return 4; }
inline int Scheme<SCHEME_CATMARK>::GetRegularVertexValence() { return 4; }
template <>
inline int Scheme<TYPE_CATMARK>::GetLocalNeighborhoodSize() { return 1; }
inline int Scheme<SCHEME_CATMARK>::GetLocalNeighborhoodSize() { return 1; }
//
@ -68,7 +68,7 @@ inline int Scheme<TYPE_CATMARK>::GetLocalNeighborhoodSize() { return 1; }
template <>
template <typename EDGE, typename MASK>
inline void
Scheme<TYPE_CATMARK>::assignSmoothMaskForEdge(EDGE const& edge, MASK& mask) const {
Scheme<SCHEME_CATMARK>::assignSmoothMaskForEdge(EDGE const& edge, MASK& mask) const {
typedef typename MASK::Weight Weight;
@ -145,7 +145,7 @@ Scheme<TYPE_CATMARK>::assignSmoothMaskForEdge(EDGE const& edge, MASK& mask) cons
template <>
template <typename VERTEX, typename MASK>
inline void
Scheme<TYPE_CATMARK>::assignCreaseMaskForVertex(VERTEX const& vertex, MASK& mask, float const edgeSharpness[]) const {
Scheme<SCHEME_CATMARK>::assignCreaseMaskForVertex(VERTEX const& vertex, MASK& mask, float const edgeSharpness[]) const {
typedef typename MASK::Weight Weight;
@ -184,7 +184,7 @@ Scheme<TYPE_CATMARK>::assignCreaseMaskForVertex(VERTEX const& vertex, MASK& mask
template <>
template <typename VERTEX, typename MASK>
inline void
Scheme<TYPE_CATMARK>::assignSmoothMaskForVertex(VERTEX const& vertex, MASK& mask) const {
Scheme<SCHEME_CATMARK>::assignSmoothMaskForVertex(VERTEX const& vertex, MASK& mask) const {
typedef typename MASK::Weight Weight;
@ -225,7 +225,7 @@ Scheme<TYPE_CATMARK>::assignSmoothMaskForVertex(VERTEX const& vertex, MASK& mask
template <>
template <typename VERTEX, typename MASK>
inline void
Scheme<TYPE_CATMARK>::assignBoundaryLimitMask(VERTEX const& vertex, MASK& posMask) const {
Scheme<SCHEME_CATMARK>::assignBoundaryLimitMask(VERTEX const& vertex, MASK& posMask) const {
typedef typename MASK::Weight Weight;
@ -250,7 +250,7 @@ Scheme<TYPE_CATMARK>::assignBoundaryLimitMask(VERTEX const& vertex, MASK& posMas
template <>
template <typename VERTEX, typename MASK>
inline void
Scheme<TYPE_CATMARK>::assignInteriorLimitMask(VERTEX const& vertex, MASK& posMask) const {
Scheme<SCHEME_CATMARK>::assignInteriorLimitMask(VERTEX const& vertex, MASK& posMask) const {
typedef typename MASK::Weight Weight;
@ -282,7 +282,7 @@ Scheme<TYPE_CATMARK>::assignInteriorLimitMask(VERTEX const& vertex, MASK& posMas
template <>
template <typename VERTEX, typename MASK>
inline void
Scheme<TYPE_CATMARK>::assignBoundaryLimitTangentMasks(VERTEX const& /* vertex */,
Scheme<SCHEME_CATMARK>::assignBoundaryLimitTangentMasks(VERTEX const& /* vertex */,
MASK& tan1Mask, MASK& tan2Mask) const {
tan1Mask.SetNumVertexWeights(1);
@ -301,7 +301,7 @@ Scheme<TYPE_CATMARK>::assignBoundaryLimitTangentMasks(VERTEX const& /* vertex */
template <>
template <typename VERTEX, typename MASK>
inline void
Scheme<TYPE_CATMARK>::assignInteriorLimitTangentMasks(VERTEX const& vertex,
Scheme<SCHEME_CATMARK>::assignInteriorLimitTangentMasks(VERTEX const& vertex,
MASK& tan1Mask, MASK& tan2Mask) const {
typedef typename MASK::Weight Weight;

View File

@ -36,7 +36,7 @@ namespace Sdc {
//
// Specializations for Sdc::Scheme<TYPE_LOOP>:
// Specializations for Sdc::Scheme<SCHEME_LOOP>:
//
//
@ -44,16 +44,16 @@ namespace Sdc {
// Loop traits:
//
template <>
inline Split Scheme<TYPE_LOOP>::GetTopologicalSplitType() { return SPLIT_TO_TRIS; }
inline Split Scheme<SCHEME_LOOP>::GetTopologicalSplitType() { return SPLIT_TO_TRIS; }
template <>
inline int Scheme<TYPE_LOOP>::GetRegularFaceSize() { return 3; }
inline int Scheme<SCHEME_LOOP>::GetRegularFaceSize() { return 3; }
template <>
inline int Scheme<TYPE_LOOP>::GetRegularVertexValence() { return 6; }
inline int Scheme<SCHEME_LOOP>::GetRegularVertexValence() { return 6; }
template <>
inline int Scheme<TYPE_LOOP>::GetLocalNeighborhoodSize() { return 1; }
inline int Scheme<SCHEME_LOOP>::GetLocalNeighborhoodSize() { return 1; }
//
@ -66,7 +66,7 @@ inline int Scheme<TYPE_LOOP>::GetLocalNeighborhoodSize() { return 1; }
template <>
template <typename EDGE, typename MASK>
inline void
Scheme<TYPE_LOOP>::assignCreaseMaskForEdge(EDGE const&, MASK& mask) const
Scheme<SCHEME_LOOP>::assignCreaseMaskForEdge(EDGE const&, MASK& mask) const
{
mask.SetNumVertexWeights(2);
mask.SetNumEdgeWeights(0);
@ -80,7 +80,7 @@ Scheme<TYPE_LOOP>::assignCreaseMaskForEdge(EDGE const&, MASK& mask) const
template <>
template <typename EDGE, typename MASK>
inline void
Scheme<TYPE_LOOP>::assignSmoothMaskForEdge(EDGE const& edge, MASK& mask) const
Scheme<SCHEME_LOOP>::assignSmoothMaskForEdge(EDGE const& edge, MASK& mask) const
{
int faceCount = edge.GetNumFaces();
@ -138,7 +138,7 @@ Scheme<TYPE_LOOP>::assignSmoothMaskForEdge(EDGE const& edge, MASK& mask) const
template <>
template <typename VERTEX, typename MASK>
inline void
Scheme<TYPE_LOOP>::assignCornerMaskForVertex(VERTEX const&, MASK& mask) const
Scheme<SCHEME_LOOP>::assignCornerMaskForVertex(VERTEX const&, MASK& mask) const
{
mask.SetNumVertexWeights(1);
mask.SetNumEdgeWeights(0);
@ -151,7 +151,7 @@ Scheme<TYPE_LOOP>::assignCornerMaskForVertex(VERTEX const&, MASK& mask) const
template <>
template <typename VERTEX, typename MASK>
inline void
Scheme<TYPE_LOOP>::assignCreaseMaskForVertex(VERTEX const& vertex, MASK& mask, float const edgeSharpness[]) const
Scheme<SCHEME_LOOP>::assignCreaseMaskForVertex(VERTEX const& vertex, MASK& mask, float const edgeSharpness[]) const
{
typedef typename MASK::Weight Weight;
@ -175,7 +175,7 @@ Scheme<TYPE_LOOP>::assignCreaseMaskForVertex(VERTEX const& vertex, MASK& mask, f
template <>
template <typename VERTEX, typename MASK>
inline void
Scheme<TYPE_LOOP>::assignSmoothMaskForVertex(VERTEX const& vertex, MASK& mask) const
Scheme<SCHEME_LOOP>::assignSmoothMaskForVertex(VERTEX const& vertex, MASK& mask) const
{
typedef typename MASK::Weight Weight;
@ -215,7 +215,7 @@ Scheme<TYPE_LOOP>::assignSmoothMaskForVertex(VERTEX const& vertex, MASK& mask) c
template <>
template <typename VERTEX, typename MASK>
inline void
Scheme<TYPE_LOOP>::assignBoundaryLimitMask(VERTEX const& vertex, MASK& posMask) const {
Scheme<SCHEME_LOOP>::assignBoundaryLimitMask(VERTEX const& vertex, MASK& posMask) const {
typedef typename MASK::Weight Weight;
@ -240,7 +240,7 @@ Scheme<TYPE_LOOP>::assignBoundaryLimitMask(VERTEX const& vertex, MASK& posMask)
template <>
template <typename VERTEX, typename MASK>
inline void
Scheme<TYPE_LOOP>::assignInteriorLimitMask(VERTEX const& vertex, MASK& posMask) const {
Scheme<SCHEME_LOOP>::assignInteriorLimitMask(VERTEX const& vertex, MASK& posMask) const {
typedef typename MASK::Weight Weight;
@ -278,7 +278,7 @@ Scheme<TYPE_LOOP>::assignInteriorLimitMask(VERTEX const& vertex, MASK& posMask)
template <>
template <typename VERTEX, typename MASK>
inline void
Scheme<TYPE_LOOP>::assignBoundaryLimitTangentMasks(VERTEX const& /* vertex */,
Scheme<SCHEME_LOOP>::assignBoundaryLimitTangentMasks(VERTEX const& /* vertex */,
MASK& tan1Mask, MASK& tan2Mask) const {
// Need to dig up formulae for this case...
@ -299,7 +299,7 @@ Scheme<TYPE_LOOP>::assignBoundaryLimitTangentMasks(VERTEX const& /* vertex */,
template <>
template <typename VERTEX, typename MASK>
inline void
Scheme<TYPE_LOOP>::assignInteriorLimitTangentMasks(VERTEX const& vertex,
Scheme<SCHEME_LOOP>::assignInteriorLimitTangentMasks(VERTEX const& vertex,
MASK& tan1Mask, MASK& tan2Mask) const {
typedef typename MASK::Weight Weight;

View File

@ -62,7 +62,7 @@ namespace Sdc {
/// efficient retrieval, but subclasses can be created to gather it lazily if
/// desired.
///
template <Type SCHEME_TYPE>
template <SchemeType SCHEME_TYPE>
class Scheme {
public:
@ -291,7 +291,7 @@ protected:
// Crease and corner masks are common to most schemes -- the rest need to be provided
// for each Scheme specialization.
//
template <Sdc::Type SCHEME>
template <SchemeType SCHEME>
template <typename EDGE, typename MASK>
inline void
Scheme<SCHEME>::assignCreaseMaskForEdge(EDGE const&, MASK& mask) const {
@ -305,7 +305,7 @@ Scheme<SCHEME>::assignCreaseMaskForEdge(EDGE const&, MASK& mask) const {
mask.VertexWeight(1) = 0.5f;
}
template <Sdc::Type SCHEME>
template <SchemeType SCHEME>
template <typename VERTEX, typename MASK>
inline void
Scheme<SCHEME>::assignCornerMaskForVertex(VERTEX const&, MASK& mask) const {
@ -322,7 +322,7 @@ Scheme<SCHEME>::assignCornerMaskForVertex(VERTEX const&, MASK& mask) const {
//
// The computation of a face-vertex mask is trivial and consistent for all schemes:
//
template <Sdc::Type SCHEME>
template <SchemeType SCHEME>
template <typename FACE, typename MASK>
void
Scheme<SCHEME>::ComputeFaceVertexMask(FACE const& face, MASK& mask) const {
@ -366,7 +366,7 @@ Scheme<SCHEME>::ComputeFaceVertexMask(FACE const& face, MASK& mask) const {
// assignments are legitimate for the parent and four for the child (Dart being only
// valid for the child and Corner for neither). Results are undefined in these cases.
//
template <Sdc::Type SCHEME>
template <SchemeType SCHEME>
template <typename EDGE, typename MASK>
void
Scheme<SCHEME>::ComputeEdgeVertexMask(EDGE const& edge,
@ -486,7 +486,7 @@ Scheme<SCHEME>::ComputeEdgeVertexMask(EDGE const& edge,
// so the child rule should be assigned to be the same (wish the compiler would allow this
// in default value assignment).
//
template <Type SCHEME>
template <SchemeType SCHEME>
template <typename VERTEX, typename MASK>
void
Scheme<SCHEME>::ComputeVertexVertexMask(VERTEX const& vertex,
@ -576,7 +576,7 @@ Scheme<SCHEME>::ComputeVertexVertexMask(VERTEX const& vertex,
//
// The computation of limit masks for vertices:
//
template <Type SCHEME>
template <SchemeType SCHEME>
template <typename VERTEX, typename MASK>
void
Scheme<SCHEME>::ComputeVertexLimitMask(VERTEX const& vertex,
@ -592,7 +592,7 @@ Scheme<SCHEME>::ComputeVertexLimitMask(VERTEX const& vertex,
}
}
template <Type SCHEME>
template <SchemeType SCHEME>
template <typename VERTEX, typename MASK>
void
Scheme<SCHEME>::ComputeVertexLimitMask(VERTEX const& vertex,

View File

@ -32,7 +32,7 @@ namespace OPENSUBDIV_VERSION {
namespace Sdc {
struct TypeTraitsEntry {
struct TraitsEntry {
char const * _name;
Split _splitType;
@ -41,52 +41,52 @@ struct TypeTraitsEntry {
int _localNeighborhood;
};
static const TypeTraitsEntry typeTraitsTable[3] = {
{ "bilinear", Scheme<TYPE_BILINEAR>::GetTopologicalSplitType(),
Scheme<TYPE_BILINEAR>::GetRegularFaceSize(),
Scheme<TYPE_BILINEAR>::GetRegularVertexValence(),
Scheme<TYPE_BILINEAR>::GetLocalNeighborhoodSize() },
{ "catmark", Scheme<TYPE_CATMARK>::GetTopologicalSplitType(),
Scheme<TYPE_CATMARK>::GetRegularFaceSize(),
Scheme<TYPE_CATMARK>::GetRegularVertexValence(),
Scheme<TYPE_CATMARK>::GetLocalNeighborhoodSize() },
{ "loop", Scheme<TYPE_LOOP>::GetTopologicalSplitType(),
Scheme<TYPE_LOOP>::GetRegularFaceSize(),
Scheme<TYPE_LOOP>::GetRegularVertexValence(),
Scheme<TYPE_LOOP>::GetLocalNeighborhoodSize() }
static const TraitsEntry staticTraitsTable[3] = {
{ "bilinear", Scheme<SCHEME_BILINEAR>::GetTopologicalSplitType(),
Scheme<SCHEME_BILINEAR>::GetRegularFaceSize(),
Scheme<SCHEME_BILINEAR>::GetRegularVertexValence(),
Scheme<SCHEME_BILINEAR>::GetLocalNeighborhoodSize() },
{ "catmark", Scheme<SCHEME_CATMARK>::GetTopologicalSplitType(),
Scheme<SCHEME_CATMARK>::GetRegularFaceSize(),
Scheme<SCHEME_CATMARK>::GetRegularVertexValence(),
Scheme<SCHEME_CATMARK>::GetLocalNeighborhoodSize() },
{ "loop", Scheme<SCHEME_LOOP>::GetTopologicalSplitType(),
Scheme<SCHEME_LOOP>::GetRegularFaceSize(),
Scheme<SCHEME_LOOP>::GetRegularVertexValence(),
Scheme<SCHEME_LOOP>::GetLocalNeighborhoodSize() }
};
//
// Static methods for TypeTraits:
// Static methods for SchemeTypeTraits:
//
char const*
TypeTraits::GetName(Type schemeType) {
SchemeTypeTraits::GetName(SchemeType schemeType) {
return typeTraitsTable[schemeType]._name;
return staticTraitsTable[schemeType]._name;
}
Split
TypeTraits::GetTopologicalSplitType(Type schemeType) {
SchemeTypeTraits::GetTopologicalSplitType(SchemeType schemeType) {
return typeTraitsTable[schemeType]._splitType;
return staticTraitsTable[schemeType]._splitType;
}
int
TypeTraits::GetRegularFaceSize(Type schemeType) {
SchemeTypeTraits::GetRegularFaceSize(SchemeType schemeType) {
return typeTraitsTable[schemeType]._regularFaceSize;
return staticTraitsTable[schemeType]._regularFaceSize;
}
int
TypeTraits::GetRegularVertexValence(Type schemeType) {
SchemeTypeTraits::GetRegularVertexValence(SchemeType schemeType) {
return typeTraitsTable[schemeType]._regularVertexValence;
return staticTraitsTable[schemeType]._regularVertexValence;
}
int
TypeTraits::GetLocalNeighborhoodSize(Type schemeType) {
SchemeTypeTraits::GetLocalNeighborhoodSize(SchemeType schemeType) {
return typeTraitsTable[schemeType]._localNeighborhood;
return staticTraitsTable[schemeType]._localNeighborhood;
}
} // end namespace sdc

View File

@ -34,10 +34,10 @@ namespace Sdc {
///
/// \brief Enumerated type for all subdivisions schemes supported by OpenSubdiv
///
enum Type {
TYPE_BILINEAR,
TYPE_CATMARK,
TYPE_LOOP
enum SchemeType {
SCHEME_BILINEAR,
SCHEME_CATMARK,
SCHEME_LOOP
};
@ -54,16 +54,16 @@ enum Split {
/// \brief Traits associated the types of all subdivision schemes -- parameterized by
/// the scheme type. All traits are also defined on the scheme itself.
///
struct TypeTraits {
struct SchemeTypeTraits {
static Type GetType(Type schemeType) { return schemeType; }
static SchemeType GetType(SchemeType schemeType) { return schemeType; }
static Split GetTopologicalSplitType(Type schemeType);
static int GetRegularFaceSize(Type schemeType);
static int GetRegularVertexValence(Type schemeType);
static int GetLocalNeighborhoodSize(Type schemeType);
static Split GetTopologicalSplitType(SchemeType schemeType);
static int GetRegularFaceSize(SchemeType schemeType);
static int GetRegularVertexValence(SchemeType schemeType);
static int GetLocalNeighborhoodSize(SchemeType schemeType);
static char const* GetName(Type schemeType);
static char const* GetName(SchemeType schemeType);
};
@ -73,4 +73,4 @@ struct TypeTraits {
using namespace OPENSUBDIV_VERSION;
} // end namespace OpenSubdiv
#endif /* SDC_TYPE_H */
#endif /* SDC_TYPES_H */

View File

@ -32,15 +32,15 @@
//------------------------------------------------------------------------------
inline OpenSubdiv::Sdc::Type
inline OpenSubdiv::Sdc::SchemeType
GetSdcType(Shape const & shape) {
OpenSubdiv::Sdc::Type type=OpenSubdiv::Sdc::TYPE_CATMARK;
OpenSubdiv::Sdc::SchemeType type=OpenSubdiv::Sdc::SCHEME_CATMARK;
switch (shape.scheme) {
case kBilinear: type = OpenSubdiv::Sdc::TYPE_BILINEAR; break;
case kCatmark : type = OpenSubdiv::Sdc::TYPE_CATMARK; break;
case kLoop : type = OpenSubdiv::Sdc::TYPE_LOOP; break;
case kBilinear: type = OpenSubdiv::Sdc::SCHEME_BILINEAR; break;
case kCatmark : type = OpenSubdiv::Sdc::SCHEME_CATMARK; break;
case kLoop : type = OpenSubdiv::Sdc::SCHEME_LOOP; break;
}
return type;
}

View File

@ -107,7 +107,7 @@ int main(int, char **) {
typedef Far::TopologyRefinerFactoryBase::TopologyDescriptor Descriptor;
Sdc::Type type = OpenSubdiv::Sdc::TYPE_CATMARK;
Sdc::SchemeType type = OpenSubdiv::Sdc::SCHEME_CATMARK;
Sdc::Options options;
options.SetVtxBoundaryInterpolation(Sdc::Options::VTX_BOUNDARY_EDGE_ONLY);

View File

@ -161,8 +161,8 @@ struct Converter {
public:
Sdc::Type GetType() const {
return Sdc::TYPE_CATMARK;
Sdc::SchemeType GetType() const {
return Sdc::SCHEME_CATMARK;
}
Sdc::Options GetOptions() const {

View File

@ -209,7 +209,7 @@ createFarTopologyRefiner() {
typedef Far::TopologyRefinerFactoryBase::TopologyDescriptor Descriptor;
Sdc::Type type = OpenSubdiv::Sdc::TYPE_CATMARK;
Sdc::SchemeType type = OpenSubdiv::Sdc::SCHEME_CATMARK;
Sdc::Options options;
options.SetVtxBoundaryInterpolation(Sdc::Options::VTX_BOUNDARY_EDGE_ONLY);

View File

@ -164,7 +164,7 @@ int main(int, char **) {
typedef Far::TopologyRefinerFactoryBase::TopologyDescriptor Descriptor;
Sdc::Type type = OpenSubdiv::Sdc::TYPE_CATMARK;
Sdc::SchemeType type = OpenSubdiv::Sdc::SCHEME_CATMARK;
Sdc::Options options;
options.SetVtxBoundaryInterpolation(Sdc::Options::VTX_BOUNDARY_EDGE_ONLY);

View File

@ -166,7 +166,7 @@ createTopologyRefiner() {
// Populate a topology descriptor with our raw data.
typedef Far::TopologyRefinerFactoryBase::TopologyDescriptor Descriptor;
Sdc::Type type = OpenSubdiv::Sdc::TYPE_CATMARK;
Sdc::SchemeType type = OpenSubdiv::Sdc::SCHEME_CATMARK;
Sdc::Options options;
options.SetVtxBoundaryInterpolation(Sdc::Options::VTX_BOUNDARY_EDGE_ONLY);

View File

@ -216,7 +216,7 @@ createTopologyRefiner() {
typedef Far::TopologyRefinerFactoryBase::TopologyDescriptor Descriptor;
Sdc::Type type = OpenSubdiv::Sdc::TYPE_CATMARK;
Sdc::SchemeType type = OpenSubdiv::Sdc::SCHEME_CATMARK;
Sdc::Options options;
options.SetVtxBoundaryInterpolation(Sdc::Options::VTX_BOUNDARY_EDGE_ONLY);

View File

@ -241,7 +241,7 @@ createTopologyRefiner() {
typedef Far::TopologyRefinerFactoryBase::TopologyDescriptor Descriptor;
Sdc::Type type = OpenSubdiv::Sdc::TYPE_CATMARK;
Sdc::SchemeType type = OpenSubdiv::Sdc::SCHEME_CATMARK;
Sdc::Options options;
options.SetVtxBoundaryInterpolation(Sdc::Options::VTX_BOUNDARY_EDGE_ONLY);

View File

@ -218,7 +218,7 @@ createTopologyRefiner() {
// Populate a topology descriptor with our raw data.
typedef Far::TopologyRefinerFactoryBase::TopologyDescriptor Descriptor;
Sdc::Type type = OpenSubdiv::Sdc::TYPE_CATMARK;
Sdc::SchemeType type = OpenSubdiv::Sdc::SCHEME_CATMARK;
Sdc::Options options;
options.SetVtxBoundaryInterpolation(Sdc::Options::VTX_BOUNDARY_EDGE_ONLY);

View File

@ -149,7 +149,7 @@ createTopologyRefiner(int maxlevel) {
typedef Far::TopologyRefinerFactoryBase::TopologyDescriptor Descriptor;
Sdc::Type type = OpenSubdiv::Sdc::TYPE_CATMARK;
Sdc::SchemeType type = OpenSubdiv::Sdc::SCHEME_CATMARK;
Sdc::Options options;
options.SetVtxBoundaryInterpolation(Sdc::Options::VTX_BOUNDARY_EDGE_ONLY);