OpenSubdiv
Loading...
Searching...
No Matches
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
29namespace OpenSubdiv {
30namespace OPENSUBDIV_VERSION {
31
32namespace Sdc {
33
50
51class Options {
52public:
59 };
67 };
71 };
75 };
76
77public:
78
79 Options() : _vtxBoundInterp(VTX_BOUNDARY_NONE),
80 _fvarLinInterp(FVAR_LINEAR_ALL),
81 _creasingMethod(CREASE_UNIFORM),
82 _triangleSub(TRI_SUB_CATMARK) { }
83
84 //
85 // Trivial get/set methods:
86 //
87
90
92 void SetVtxBoundaryInterpolation(VtxBoundaryInterpolation b) { _vtxBoundInterp = (EnumIntType) b; }
93
96
98 void SetFVarLinearInterpolation(FVarLinearInterpolation b) { _fvarLinInterp = (EnumIntType) b; }
99
101 CreasingMethod GetCreasingMethod() const { return (CreasingMethod) _creasingMethod; }
102
104 void SetCreasingMethod(CreasingMethod c) { _creasingMethod = (EnumIntType) c; }
105
108
110 void SetTriangleSubdivision(TriangleSubdivision t) { _triangleSub = (EnumIntType) t; }
111
112private:
113 // Use a small integer type to pack these rather than bitfields:
114 typedef unsigned char EnumIntType;
115
116 EnumIntType _vtxBoundInterp;
117 EnumIntType _fvarLinInterp;
118 EnumIntType _creasingMethod;
119 EnumIntType _triangleSub;
120};
121
122} // end namespace sdc
123
124} // end namespace OPENSUBDIV_VERSION
125using namespace OPENSUBDIV_VERSION;
126} // end namespace OpenSubdiv
127
128#endif /* OPENSUBDIV3_SDC_OPTIONS_H */
All supported options applying to subdivision scheme.
Definition: options.h:51
@ TRI_SUB_CATMARK
Catmark weights (Catmark scheme only)
Definition: options.h:73
@ TRI_SUB_SMOOTH
"smooth triangle" weights (Catmark scheme only)
Definition: options.h:74
TriangleSubdivision GetTriangleSubdivision() const
Get triangle subdivision weights rule (Catmark scheme only !)
Definition: options.h:107
CreasingMethod GetCreasingMethod() const
Get edge crease rule.
Definition: options.h:101
void SetFVarLinearInterpolation(FVarLinearInterpolation b)
Set face-varying interpolation rule.
Definition: options.h:98
void SetTriangleSubdivision(TriangleSubdivision t)
Set triangle subdivision weights rule (Catmark scheme only !)
Definition: options.h:110
VtxBoundaryInterpolation GetVtxBoundaryInterpolation() const
Get vertex boundary interpolation rule.
Definition: options.h:89
@ FVAR_LINEAR_CORNERS_ONLY
sharpen corners only
Definition: options.h:62
@ FVAR_LINEAR_BOUNDARIES
sharpen all boundaries ("always sharp")
Definition: options.h:65
@ FVAR_LINEAR_CORNERS_PLUS2
("edge and corner + propagate corner")
Definition: options.h:64
@ FVAR_LINEAR_ALL
bilinear interpolation ("bilinear")
Definition: options.h:66
@ FVAR_LINEAR_NONE
smooth everywhere ("edge only")
Definition: options.h:61
void SetVtxBoundaryInterpolation(VtxBoundaryInterpolation b)
Set vertex boundary interpolation rule.
Definition: options.h:92
FVarLinearInterpolation GetFVarLinearInterpolation() const
Get face-varying interpolation rule.
Definition: options.h:95
@ VTX_BOUNDARY_EDGE_ONLY
all boundary edges sharpened and interpolated
Definition: options.h:56
void SetCreasingMethod(CreasingMethod c)
Set edge crease rule.
Definition: options.h:104