Loading...
Searching...
No Matches
options.h
Go to the documentation of this file.
//
// Copyright 2014 DreamWorks Animation LLC.
//
// Licensed under the Apache License, Version 2.0 (the "Apache License")
// with the following modification; you may not use this file except in
// compliance with the Apache License and the following modification to it:
// Section 6. Trademarks. is deleted and replaced with:
//
// 6. Trademarks. This License does not grant permission to use the trade
// names, trademarks, service marks, or product names of the Licensor
// and its affiliates, except as required to comply with Section 4(c) of
// the License and to reproduce the content of the NOTICE file.
//
// You may obtain a copy of the Apache License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the Apache License with the above modification is
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the Apache License for the specific
// language governing permissions and limitations under the Apache License.
//
#ifndef OPENSUBDIV3_SDC_OPTIONS_H
#define OPENSUBDIV3_SDC_OPTIONS_H
#include "../version.h"
namespace OpenSubdiv {
namespace OPENSUBDIV_VERSION {
namespace Sdc {
class Options {
public:
enum VtxBoundaryInterpolation {
VTX_BOUNDARY_NONE = 0,
VTX_BOUNDARY_EDGE_ONLY,
VTX_BOUNDARY_EDGE_AND_CORNER
};
enum FVarLinearInterpolation {
FVAR_LINEAR_NONE = 0,
FVAR_LINEAR_CORNERS_ONLY,
FVAR_LINEAR_CORNERS_PLUS1,
FVAR_LINEAR_CORNERS_PLUS2,
FVAR_LINEAR_BOUNDARIES,
FVAR_LINEAR_ALL
};
enum CreasingMethod {
CREASE_UNIFORM = 0,
CREASE_CHAIKIN
};
enum TriangleSubdivision {
TRI_SUB_CATMARK = 0,
TRI_SUB_SMOOTH
};
public:
Options() : _vtxBoundInterp(VTX_BOUNDARY_NONE),
_fvarLinInterp(FVAR_LINEAR_ALL),
_creasingMethod(CREASE_UNIFORM),
_triangleSub(TRI_SUB_CATMARK) { }
//
// Trivial get/set methods:
//
VtxBoundaryInterpolation GetVtxBoundaryInterpolation() const { return (VtxBoundaryInterpolation) _vtxBoundInterp; }
void SetVtxBoundaryInterpolation(VtxBoundaryInterpolation b) { _vtxBoundInterp = b; }
FVarLinearInterpolation GetFVarLinearInterpolation() const { return (FVarLinearInterpolation) _fvarLinInterp; }
void SetFVarLinearInterpolation(FVarLinearInterpolation b) { _fvarLinInterp = b; }
CreasingMethod GetCreasingMethod() const { return (CreasingMethod) _creasingMethod; }
void SetCreasingMethod(CreasingMethod c) { _creasingMethod = c; }
TriangleSubdivision GetTriangleSubdivision() const { return (TriangleSubdivision) _triangleSub; }
void SetTriangleSubdivision(TriangleSubdivision t) { _triangleSub = t; }
private:
// Bitfield members:
unsigned int _vtxBoundInterp : 2,
_fvarLinInterp : 3,
_creasingMethod : 2,
_triangleSub : 2;
};
} // end namespace sdc
} // end namespace OPENSUBDIV_VERSION
using namespace OPENSUBDIV_VERSION;
} // end namespace OpenSubdiv
#endif /* OPENSUBDIV3_SDC_OPTIONS_H */
OpenSubdiv
Definition error.h:30
OpenSubdiv::OPENSUBDIV_VERSION
Definition error.h:31
OpenSubdiv::OPENSUBDIV_VERSION::Sdc
Definition bilinearScheme.h:34
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::TriangleSubdivision
TriangleSubdivision
Definition options.h:72
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::TRI_SUB_CATMARK
@ TRI_SUB_CATMARK
Catmark weights (Catmark scheme only)
Definition options.h:73
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::TRI_SUB_SMOOTH
@ TRI_SUB_SMOOTH
"smooth triangle" weights (Catmark scheme only)
Definition options.h:74
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::CreasingMethod
CreasingMethod
Definition options.h:68
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::CREASE_UNIFORM
@ CREASE_UNIFORM
Catmark rule.
Definition options.h:69
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::CREASE_CHAIKIN
@ CREASE_CHAIKIN
Chaikin rule.
Definition options.h:70
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::GetTriangleSubdivision
TriangleSubdivision GetTriangleSubdivision() const
Get triangle subdivision weights rule (Catmark scheme only !)
Definition options.h:107
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::GetCreasingMethod
CreasingMethod GetCreasingMethod() const
Get edge crease rule.
Definition options.h:101
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::Options
Options()
Definition options.h:79
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::SetFVarLinearInterpolation
void SetFVarLinearInterpolation(FVarLinearInterpolation b)
Set face-varying interpolation rule.
Definition options.h:98
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::SetTriangleSubdivision
void SetTriangleSubdivision(TriangleSubdivision t)
Set triangle subdivision weights rule (Catmark scheme only !)
Definition options.h:110
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::GetVtxBoundaryInterpolation
VtxBoundaryInterpolation GetVtxBoundaryInterpolation() const
Get vertex boundary interpolation rule.
Definition options.h:89
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::FVarLinearInterpolation
FVarLinearInterpolation
Definition options.h:60
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::FVAR_LINEAR_CORNERS_ONLY
@ FVAR_LINEAR_CORNERS_ONLY
sharpen corners only
Definition options.h:62
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::FVAR_LINEAR_BOUNDARIES
@ FVAR_LINEAR_BOUNDARIES
sharpen all boundaries ("always sharp")
Definition options.h:65
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::FVAR_LINEAR_CORNERS_PLUS2
@ FVAR_LINEAR_CORNERS_PLUS2
("edge and corner + propagate corner")
Definition options.h:64
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::FVAR_LINEAR_CORNERS_PLUS1
@ FVAR_LINEAR_CORNERS_PLUS1
("edge corner")
Definition options.h:63
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::FVAR_LINEAR_ALL
@ FVAR_LINEAR_ALL
bilinear interpolation ("bilinear")
Definition options.h:66
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::FVAR_LINEAR_NONE
@ FVAR_LINEAR_NONE
smooth everywhere ("edge only")
Definition options.h:61
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::SetVtxBoundaryInterpolation
void SetVtxBoundaryInterpolation(VtxBoundaryInterpolation b)
Set vertex boundary interpolation rule.
Definition options.h:92
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::GetFVarLinearInterpolation
FVarLinearInterpolation GetFVarLinearInterpolation() const
Get face-varying interpolation rule.
Definition options.h:95
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::VtxBoundaryInterpolation
VtxBoundaryInterpolation
Definition options.h:53
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::VTX_BOUNDARY_NONE
@ VTX_BOUNDARY_NONE
Definition options.h:54
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::VTX_BOUNDARY_EDGE_ONLY
@ VTX_BOUNDARY_EDGE_ONLY
all boundary edges sharpened and interpolated
Definition options.h:56
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::VTX_BOUNDARY_EDGE_AND_CORNER
@ VTX_BOUNDARY_EDGE_AND_CORNER
Definition options.h:57
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::SetCreasingMethod
void SetCreasingMethod(CreasingMethod c)
Set edge crease rule.
Definition options.h:104