Added new public members to Far::TopologyRefiner::AdaptiveOptions:

- added flag to consider features in face-varying channels
    - added flag to reduce refinement for infinitely sharp patches
    - added secondary isolation level to reduce refinement of smooth features
This commit is contained in:
barry 2016-09-27 19:30:27 -07:00
parent 9a82ba67eb
commit 98451db803
2 changed files with 18 additions and 15 deletions

View File

@ -287,11 +287,6 @@ namespace internal {
int_type selectNonManifold : 1;
int_type selectFVarFeatures : 1;
private:
// Temporary options pending addition to public interface of Refiner::AdaptiveOptions:
static int const options_reduceInfSharpPatches = false;
static int const options_considerFVarChannels = false;
};
void
@ -322,25 +317,25 @@ namespace internal {
selectSemiSharpNonSingle = true;
// Inf-sharp features -- boundary extra-ordinary vertices are irreg creases:
selectInfSharpRegularCrease = !(options_reduceInfSharpPatches || useSingleCreasePatch);
selectInfSharpRegularCorner = !options_reduceInfSharpPatches;
selectInfSharpRegularCrease = !(options.useInfSharpPatch || useSingleCreasePatch);
selectInfSharpRegularCorner = !options.useInfSharpPatch;
selectInfSharpIrregularDart = true;
selectInfSharpIrregularCrease = true;
selectInfSharpIrregularCorner = true;
selectNonManifold = true;
selectFVarFeatures = options_considerFVarChannels;
selectFVarFeatures = options.considerFVarChannels;
}
void
FeatureMask::ReduceFeatures(Options const & /* options */) {
FeatureMask::ReduceFeatures(Options const & options) {
// Disable typical xordinary vertices:
selectXOrdinaryInterior = false;
selectXOrdinaryBoundary = false;
// If minimizing inf-sharp patches, disable all but sharp/corner irregularities
if (options_reduceInfSharpPatches) {
if (options.useInfSharpPatch) {
selectInfSharpRegularCrease = false;
selectInfSharpRegularCorner = false;
selectInfSharpIrregularDart = false;
@ -379,8 +374,7 @@ TopologyRefiner::RefineAdaptive(AdaptiveOptions options) {
// of levels isolating different sets of features, initialize the two feature sets
// up front and use the appropriate one for each level:
//
//int shallowLevel = std::min<int>(options_secondaryLevel, options.isolationLevel);
int shallowLevel = options.isolationLevel;
int shallowLevel = std::min<int>(options.secondaryLevel, options.isolationLevel);
int deeperLevel = options.isolationLevel;
int potentialMaxLevel = deeperLevel;

View File

@ -135,14 +135,23 @@ public:
AdaptiveOptions(int level) :
isolationLevel(level),
secondaryLevel(15),
useSingleCreasePatch(false),
useInfSharpPatch(false),
considerFVarChannels(false),
orderVerticesFromFacesFirst(false) { }
unsigned int isolationLevel:4, ///< Number of iterations applied to isolate
unsigned int isolationLevel:4; ///< Number of iterations applied to isolate
///< extraordinary vertices and creases
useSingleCreasePatch:1, ///< Use 'single-crease' patch and stop
unsigned int secondaryLevel:4; ///< Shallower level to stop isolation of
///< smooth irregular features
unsigned int useSingleCreasePatch:1; ///< Use 'single-crease' patch and stop
///< isolation where applicable
orderVerticesFromFacesFirst:1; ///< Order child vertices from faces first
unsigned int useInfSharpPatch:1; ///< Use infinitely sharp patches and stop
///< isolation where applicable
unsigned int considerFVarChannels:1; ///< Inspect face-varying channels and
///< isolate when irregular features present
unsigned int orderVerticesFromFacesFirst:1; ///< Order child vertices from faces first
///< instead of child vertices of vertices
};