My Project: opensubdiv/sdc/options.h Source File

| My Project

options.h
Go to the documentation of this file.
1 //
2 // Copyright 2014 DreamWorks Animation LLC.
3 //
4 // Licensed under the Apache License, Version 2.0 (the "Apache License")
5 // with the following modification; you may not use this file except in
6 // compliance with the Apache License and the following modification to it:
7 // Section 6. Trademarks. is deleted and replaced with:
8 //
9 // 6. Trademarks. This License does not grant permission to use the trade
10 // names, trademarks, service marks, or product names of the Licensor
11 // and its affiliates, except as required to comply with Section 4(c) of
12 // the License and to reproduce the content of the NOTICE file.
13 //
14 // You may obtain a copy of the Apache License at
15 //
16 // http://www.apache.org/licenses/LICENSE-2.0
17 //
18 // Unless required by applicable law or agreed to in writing, software
19 // distributed under the Apache License with the above modification is
20 // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21 // KIND, either express or implied. See the Apache License for the specific
22 // language governing permissions and limitations under the Apache License.
23 //
24 #ifndef OPENSUBDIV3_SDC_OPTIONS_H
25 #define OPENSUBDIV3_SDC_OPTIONS_H
26
27 #include "../version.h"
28
29 namespace OpenSubdiv {
30 namespace OPENSUBDIV_VERSION {
31
32 namespace Sdc {
33
50
51 class Options {
52 public:
53 enum VtxBoundaryInterpolation {
54 VTX_BOUNDARY_NONE = 0,
55 VTX_BOUNDARY_EDGE_ONLY,
56 VTX_BOUNDARY_EDGE_AND_CORNER
57 };
58 enum FVarLinearInterpolation {
59 FVAR_LINEAR_NONE = 0,
60 FVAR_LINEAR_CORNERS_ONLY,
61 FVAR_LINEAR_CORNERS_PLUS1,
62 FVAR_LINEAR_CORNERS_PLUS2,
63 FVAR_LINEAR_BOUNDARIES,
64 FVAR_LINEAR_ALL
65 };
66 enum CreasingMethod {
67 CREASE_UNIFORM = 0,
68 CREASE_CHAIKIN
69 };
70 enum TriangleSubdivision {
71 TRI_SUB_CATMARK = 0,
72 TRI_SUB_SMOOTH
73 };
74
75 public:
76
77 Options() : _vtxBoundInterp(VTX_BOUNDARY_NONE),
78 _fvarLinInterp(FVAR_LINEAR_ALL),
79 _creasingMethod(CREASE_UNIFORM),
80 _triangleSub(TRI_SUB_CATMARK) { }
81
82 //
83 // Trivial get/set methods:
84 //
85
87 VtxBoundaryInterpolation GetVtxBoundaryInterpolation() const { return (VtxBoundaryInterpolation) _vtxBoundInterp; }
88
90 void SetVtxBoundaryInterpolation(VtxBoundaryInterpolation b) { _vtxBoundInterp = b; }
91
93 FVarLinearInterpolation GetFVarLinearInterpolation() const { return (FVarLinearInterpolation) _fvarLinInterp; }
94
96 void SetFVarLinearInterpolation(FVarLinearInterpolation b) { _fvarLinInterp = b; }
97
99 CreasingMethod GetCreasingMethod() const { return (CreasingMethod) _creasingMethod; }
100
102 void SetCreasingMethod(CreasingMethod c) { _creasingMethod = c; }
103
105 TriangleSubdivision GetTriangleSubdivision() const { return (TriangleSubdivision) _triangleSub; }
106
108 void SetTriangleSubdivision(TriangleSubdivision t) { _triangleSub = t; }
109
110 private:
111
112 // Bitfield members:
113 unsigned int _vtxBoundInterp : 2,
114 _fvarLinInterp : 3,
115 _creasingMethod : 2,
116 _triangleSub : 2;
117 };
118
119 } // end namespace sdc
120
121 } // end namespace OPENSUBDIV_VERSION
122 using namespace OPENSUBDIV_VERSION;
123 } // end namespace OpenSubdiv
124
125 #endif /* OPENSUBDIV3_SDC_OPTIONS_H */
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::Options
Options()
Definition: options.h:77
OpenSubdiv
Definition: error.h:30
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::TriangleSubdivision
TriangleSubdivision
Definition: options.h:70
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::CREASE_UNIFORM
Catmark rule.
Definition: options.h:67
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::FVAR_LINEAR_NONE
smooth everywhere ("edge only")
Definition: options.h:59
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::SetTriangleSubdivision
void SetTriangleSubdivision(TriangleSubdivision t)
Set triangle subdivision weights rule (Catmark scheme only !)
Definition: options.h:108
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::TRI_SUB_CATMARK
Catmark weights (Catmark scheme only)
Definition: options.h:71
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::FVarLinearInterpolation
FVarLinearInterpolation
Definition: options.h:58
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::TRI_SUB_SMOOTH
"smooth triangle" weights (Catmark scheme only)
Definition: options.h:72
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::VTX_BOUNDARY_EDGE_ONLY
sharpen edges
Definition: options.h:55
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::FVAR_LINEAR_BOUNDARIES
sharpen all boundaries ("always sharp")
Definition: options.h:63
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options
All supported options applying to subdivision scheme.
Definition: options.h:51
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::VtxBoundaryInterpolation
VtxBoundaryInterpolation
Definition: options.h:53
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::GetTriangleSubdivision
TriangleSubdivision GetTriangleSubdivision() const
Get triangle subdivision weights rule (Catmark scheme only !)
Definition: options.h:105
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::GetVtxBoundaryInterpolation
VtxBoundaryInterpolation GetVtxBoundaryInterpolation() const
Get vertex boundary interpolation rule.
Definition: options.h:87
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::VTX_BOUNDARY_EDGE_AND_CORNER
sharpen edges and corners
Definition: options.h:56
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::VTX_BOUNDARY_NONE
do not interpolate boundaries
Definition: options.h:54
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::GetCreasingMethod
CreasingMethod GetCreasingMethod() const
Get edge crease rule.
Definition: options.h:99
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::FVAR_LINEAR_CORNERS_ONLY
sharpen corners only
Definition: options.h:60
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::FVAR_LINEAR_CORNERS_PLUS1
("edge corner")
Definition: options.h:61
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::SetCreasingMethod
void SetCreasingMethod(CreasingMethod c)
Set edge crease rule.
Definition: options.h:102
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::SetFVarLinearInterpolation
void SetFVarLinearInterpolation(FVarLinearInterpolation b)
Set face-varying interpolation rule.
Definition: options.h:96
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::CreasingMethod
CreasingMethod
Definition: options.h:66
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::CREASE_CHAIKIN
Chaikin rule.
Definition: options.h:68
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::SetVtxBoundaryInterpolation
void SetVtxBoundaryInterpolation(VtxBoundaryInterpolation b)
Set vertex boundary interpolation rule.
Definition: options.h:90
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::FVAR_LINEAR_ALL
bilinear interpolation ("bilinear")
Definition: options.h:64
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::FVAR_LINEAR_CORNERS_PLUS2
("edge and corner + propagate corner")
Definition: options.h:62
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::GetFVarLinearInterpolation
FVarLinearInterpolation GetFVarLinearInterpolation() const
Get face-varying interpolation rule.
Definition: options.h:93