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 {
40 namespace Vtr {
namespace internal {
class SparseSelector; } }
41 namespace Far {
namespace internal {
class FeatureMask; } }
45 template <
typename REAL>
class PrimvarRefinerReal;
222 template <
class MESH>
228 template <
typename REAL>
236 Vtr::internal::Level &
getLevel(
int l) {
return *_levels[l]; }
237 Vtr::internal::Level
const &
getLevel(
int l)
const {
return *_levels[l]; }
239 Vtr::internal::Refinement &
getRefinement(
int l) {
return *_refinements[l]; }
240 Vtr::internal::Refinement
const &
getRefinement(
int l)
const {
return *_refinements[l]; }
245 TopologyRefiner & operator=(TopologyRefiner
const &) {
return *
this; }
247 void selectFeatureAdaptiveComponents(Vtr::internal::SparseSelector& selector,
248 internal::FeatureMask
const & mask,
250 void selectLinearIrregularFaces(Vtr::internal::SparseSelector& selector,
253 void initializeInventory();
254 void updateInventory(Vtr::internal::Level
const & newLevel);
256 void appendLevel(Vtr::internal::Level & newLevel);
257 void appendRefinement(Vtr::internal::Refinement & newRefinement);
258 void assembleFarLevels();
265 unsigned int _isUniform : 1;
266 unsigned int _hasHoles : 1;
267 unsigned int _hasIrregFaces : 1;
268 unsigned int _regFaceSize : 3;
269 unsigned int _maxLevel : 4;
272 UniformOptions _uniformOptions;
273 AdaptiveOptions _adaptiveOptions;
279 int _totalFaceVertices;
283 bool _baseLevelOwned;
285 std::vector<Vtr::internal::Level *> _levels;
286 std::vector<Vtr::internal::Refinement *> _refinements;
288 std::vector<TopologyLevel> _farLevels;
295 return _levels[0]->getNumFVarChannels();
300 return _levels[0]->getFVarOptions(channel).GetFVarLinearInterpolation();
306 using namespace OPENSUBDIV_VERSION;
unsigned int secondaryLevel
AdaptiveOptions(int level)
int GetMaxValence() const
Returns the maximum vertex valence in all levels.
AdaptiveOptions GetAdaptiveOptions() const
Returns the options specified on refinement.
void RefineUniform(UniformOptions options)
Refine the topology uniformly.
friend class PatchTableBuilder
void SetSecondaryLevel(int level)
Set secondary isolation level.
Sdc::Options GetSchemeOptions() const
Returns the subdivision options.
int GetNumVerticesTotal() const
Returns the total number of vertices in all levels.
bool HasHoles() const
Returns true if faces have been tagged as holes.
Vtr::internal::Level & getLevel(int l)
int GetNumFaceVerticesTotal() const
Returns the total number of face vertices in all levels.
void SetIsolationLevel(int level)
Set isolation level.
int GetNumEdgesTotal() const
Returns the total number of edges in all levels.
bool IsUniform() const
Returns true if uniform refinement has been applied.
int GetNumFVarChannels() const
Returns the number of face-varying channels in the tables.
unsigned int fullTopologyInLastLevel
friend class PatchBuilder
unsigned int orderVerticesFromFacesFirst
UniformOptions GetUniformOptions() const
Returns the options specified on refinement.
Sdc::Options::FVarLinearInterpolation GetFVarLinearInterpolation(int channel=0) const
Returns the face-varying interpolation rule set for a given channel.
Applies refinement operations to generic primvar data.
Adaptive refinement options.
Vtr::internal::Refinement const & getRefinement(int l) const
SchemeType
Enumerated type for all subdivision schemes supported by OpenSubdiv.
int GetNumFVarValuesTotal(int channel=0) const
Returns the total number of face-varying values in all levels.
unsigned int considerFVarChannels
unsigned int orderVerticesFromFacesFirst
unsigned int refinementLevel
Number of refinement iterations.
Factory for constructing TopologyRefiners from specific mesh classes.
void RefineAdaptive(AdaptiveOptions options, ConstIndexArray selectedFaces=ConstIndexArray())
Feature Adaptive topology refinement.
void SetRefinementLevel(int level)
Set uniform refinement level.
Vtr::ConstIndexArray ConstIndexArray
All supported options applying to subdivision scheme.
Sdc::SchemeType GetSchemeType() const
Returns the subdivision scheme.
Vtr::internal::Level const & getLevel(int l) const
Uniform refinement options.
An interface for accessing data in a specific level of a refined topology hierarchy.
TopologyLevel const & GetLevel(int level) const
Returns a handle to access data specific to a particular level.
~TopologyRefiner()
Destructor.
void Unrefine()
Unrefine the topology, keeping only the base level.
unsigned int useInfSharpPatch
Private base class of Factories for constructing TopologyRefiners.
Stores topology data for a specified set of refinement options.
unsigned int isolationLevel
unsigned int useSingleCreasePatch
int GetMaxLevel() const
Returns the highest level of refinement.
int GetNumLevels() const
Returns the number of refinement levels.
Object used to compute and query ptex face indices.
UniformOptions(int level)
int GetNumFacesTotal() const
Returns the total number of edges in all levels.
Vtr::internal::Refinement & getRefinement(int l)