24 #ifndef OPENSUBDIV3_FAR_TOPOLOGY_REFINER_H 25 #define OPENSUBDIV3_FAR_TOPOLOGY_REFINER_H 27 #include "../version.h" 29 #include "../sdc/types.h" 30 #include "../sdc/options.h" 31 #include "../far/types.h" 32 #include "../far/topologyLevel.h" 38 namespace OPENSUBDIV_VERSION {
41 namespace Far {
namespace internal {
class FeatureMask; } }
209 template <
class MESH>
226 TopologyRefiner(TopologyRefiner
const &) : _uniformOptions(0), _adaptiveOptions(0) { }
227 TopologyRefiner & operator=(TopologyRefiner
const &) {
return *
this; }
229 void selectFeatureAdaptiveComponents(Vtr::internal::SparseSelector& selector,
230 internal::FeatureMask
const & mask);
232 void initializeInventory();
233 void updateInventory(Vtr::internal::Level
const & newLevel);
235 void appendLevel(Vtr::internal::Level & newLevel);
236 void appendRefinement(Vtr::internal::Refinement & newRefinement);
237 void assembleFarLevels();
242 Sdc::Options _subdivOptions;
244 unsigned int _isUniform : 1,
249 UniformOptions _uniformOptions;
250 AdaptiveOptions _adaptiveOptions;
256 int _totalFaceVertices;
260 std::vector<Vtr::internal::Level *> _levels;
261 std::vector<Vtr::internal::Refinement *> _refinements;
263 std::vector<TopologyLevel> _farLevels;
270 return _levels[0]->getNumFVarChannels();
275 return _levels[0]->getFVarOptions(channel).GetFVarLinearInterpolation();
281 using namespace OPENSUBDIV_VERSION;
int GetNumFacesTotal() const
Returns the total number of edges in all levels.
Adaptive refinement options.
friend class PatchTableBuilder
Factory for constructing TopologyRefiners from specific mesh classes.
AdaptiveOptions(int level)
void RefineAdaptive(AdaptiveOptions options)
Feature Adaptive topology refinement (restricted to scheme Catmark)
SchemeType
Enumerated type for all subdivision schemes supported by OpenSubdiv.
int GetMaxValence() const
Returns the maximum vertex valence in all levels.
unsigned int orderVerticesFromFacesFirst
unsigned int secondaryLevel
int GetNumFVarChannels() const
Returns the number of face-varying channels in the tables.
Applies refinement operations to generic primvar data.
int GetNumFaceVerticesTotal() const
Returns the total number of face vertices in all levels.
~TopologyRefiner()
Destructor.
unsigned int refinementLevel
Number of refinement iterations.
Uniform refinement options.
An interface for accessing data in a specific level of a refined topology hierarchy.
int GetNumFVarValuesTotal(int channel=0) const
Returns the total number of face-varying values in all levels.
UniformOptions GetUniformOptions() const
Returns the options specified on refinement.
unsigned int considerFVarChannels
int GetNumEdgesTotal() const
Returns the total number of edges in all levels.
Vtr::internal::Level const & getLevel(int l) const
Private base class of Factories for constructing TopologyRefiners.
unsigned int fullTopologyInLastLevel
Stores topology data for a specified set of refinement options.
TopologyLevel const & GetLevel(int level) const
Returns a handle to access data specific to a particular level.
Object used to compute and query ptex face indices.
Sdc::Options::FVarLinearInterpolation GetFVarLinearInterpolation(int channel=0) const
Returns the face-varying interpolation rule set for a given channel.
unsigned int useInfSharpPatch
void RefineUniform(UniformOptions options)
Refine the topology uniformly.
All supported options applying to subdivision scheme.
UniformOptions(int level)
friend class PatchBuilder
AdaptiveOptions GetAdaptiveOptions() const
Returns the options specified on refinement.
unsigned int isolationLevel
int GetNumLevels() const
Returns the number of refinement levels.
Vtr::internal::Level & getLevel(int l)
int GetNumVerticesTotal() const
Returns the total number of vertices in all levels.
unsigned int useSingleCreasePatch
Sdc::SchemeType GetSchemeType() const
Returns the subdivision scheme.
bool HasHoles() const
Returns true if faces have been tagged as holes.
Sdc::Options GetSchemeOptions() const
Returns the subdivision options.
int GetMaxLevel() const
Returns the highest level of refinement.
Vtr::internal::Refinement const & getRefinement(int l) const
void Unrefine()
Unrefine the topology, keeping only the base level.
Vtr::internal::Refinement & getRefinement(int l)
bool IsUniform() const
Returns true if uniform refinement has been applied.
unsigned int orderVerticesFromFacesFirst