7#ifndef OPENSUBDIV3_FAR_TOPOLOGY_REFINER_H
8#define OPENSUBDIV3_FAR_TOPOLOGY_REFINER_H
10#include "../version.h"
21namespace OPENSUBDIV_VERSION {
23namespace Vtr {
namespace internal {
class SparseSelector; } }
24namespace Far {
namespace internal {
class FeatureMask; } }
205 template <
class MESH>
211 template <
typename REAL>
219 Vtr::internal::Level &
getLevel(
int l) {
return *_levels[l]; }
220 Vtr::internal::Level
const &
getLevel(
int l)
const {
return *_levels[l]; }
222 Vtr::internal::Refinement &
getRefinement(
int l) {
return *_refinements[l]; }
223 Vtr::internal::Refinement
const &
getRefinement(
int l)
const {
return *_refinements[l]; }
228 TopologyRefiner & operator=(TopologyRefiner
const &) {
return *
this; }
230 void selectFeatureAdaptiveComponents(Vtr::internal::SparseSelector& selector,
231 internal::FeatureMask
const & mask,
233 void selectLinearIrregularFaces(Vtr::internal::SparseSelector& selector,
236 void initializeInventory();
237 void updateInventory(Vtr::internal::Level
const & newLevel);
239 void appendLevel(Vtr::internal::Level & newLevel);
240 void appendRefinement(Vtr::internal::Refinement & newRefinement);
241 void assembleFarLevels();
248 unsigned int _isUniform : 1;
249 unsigned int _hasHoles : 1;
250 unsigned int _hasIrregFaces : 1;
251 unsigned int _regFaceSize : 3;
252 unsigned int _maxLevel : 4;
255 UniformOptions _uniformOptions;
256 AdaptiveOptions _adaptiveOptions;
262 int _totalFaceVertices;
266 bool _baseLevelOwned;
268 std::vector<Vtr::internal::Level *> _levels;
269 std::vector<Vtr::internal::Refinement *> _refinements;
271 std::vector<TopologyLevel> _farLevels;
278 return _levels[0]->getNumFVarChannels();
283 return _levels[0]->getFVarOptions(channel).GetFVarLinearInterpolation();
289using namespace OPENSUBDIV_VERSION;
Vtr::ConstIndexArray ConstIndexArray
SchemeType
Enumerated type for all subdivision schemes supported by OpenSubdiv.
Applies refinement operations to generic primvar data.
Object used to compute and query ptex face indices.
An interface for accessing data in a specific level of a refined topology hierarchy.
Factory for constructing TopologyRefiners from specific mesh classes.
Stores topology data for a specified set of refinement options.
TopologyRefiner(TopologyRefiner const &source)
int GetMaxValence() const
Returns the maximum vertex valence in all levels.
Vtr::internal::Level const & getLevel(int l) const
bool HasHoles() const
Returns true if faces have been tagged as holes.
int GetNumLevels() const
Returns the number of refinement levels.
int GetNumFVarValuesTotal(int channel=0) const
Returns the total number of face-varying values in all levels.
Vtr::internal::Refinement const & getRefinement(int l) const
Sdc::Options GetSchemeOptions() const
Returns the subdivision options.
Vtr::internal::Level & getLevel(int l)
bool IsUniform() const
Returns true if uniform refinement has been applied.
Sdc::SchemeType GetSchemeType() const
Returns the subdivision scheme.
int GetMaxLevel() const
Returns the highest level of refinement.
TopologyRefiner(Sdc::SchemeType type, Sdc::Options options=Sdc::Options())
Constructor.
int GetNumEdgesTotal() const
Returns the total number of edges in all levels.
friend class PatchBuilder
int GetNumFVarChannels() const
Returns the number of face-varying channels in the tables.
UniformOptions GetUniformOptions() const
Returns the options specified on refinement.
int GetNumFacesTotal() const
Returns the total number of edges in all levels.
int GetNumFaceVerticesTotal() const
Returns the total number of face vertices in all levels.
Vtr::internal::Refinement & getRefinement(int l)
void RefineUniform(UniformOptions options)
Refine the topology uniformly.
~TopologyRefiner()
Destructor.
friend class PatchTableBuilder
TopologyLevel const & GetLevel(int level) const
Returns a handle to access data specific to a particular level.
int GetNumVerticesTotal() const
Returns the total number of vertices in all levels.
void Unrefine()
Unrefine the topology, keeping only the base level.
AdaptiveOptions GetAdaptiveOptions() 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.
void RefineAdaptive(AdaptiveOptions options, ConstIndexArray selectedFaces=ConstIndexArray())
Feature Adaptive topology refinement.
Uniform refinement options.
unsigned int refinementLevel
Number of refinement iterations.
unsigned int orderVerticesFromFacesFirst
void SetRefinementLevel(int level)
Set uniform refinement level.
unsigned int fullTopologyInLastLevel
UniformOptions(int level)
Adaptive refinement options.
unsigned int secondaryLevel
unsigned int orderVerticesFromFacesFirst
AdaptiveOptions(int level)
unsigned int isolationLevel
unsigned int useSingleCreasePatch
unsigned int useInfSharpPatch
void SetIsolationLevel(int level)
Set isolation level.
unsigned int considerFVarChannels
void SetSecondaryLevel(int level)
Set secondary isolation level.
Private base class of Factories for constructing TopologyRefiners.
All supported options applying to subdivision scheme.