| 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 terms set forth in the LICENSE.txt file available at
5// https://opensubdiv.org/license.
6//
7#ifndef OPENSUBDIV3_SDC_OPTIONS_H
8#define OPENSUBDIV3_SDC_OPTIONS_H
9
10#include "../version.h"
11
12 namespace OpenSubdiv {
13 namespace OPENSUBDIV_VERSION {
14
15 namespace Sdc {
16
33
34 class Options {
35 public:
36 enum VtxBoundaryInterpolation {
37 VTX_BOUNDARY_NONE = 0,
39 VTX_BOUNDARY_EDGE_ONLY,
40 VTX_BOUNDARY_EDGE_AND_CORNER
42 };
43 enum FVarLinearInterpolation {
44 FVAR_LINEAR_NONE = 0,
45 FVAR_LINEAR_CORNERS_ONLY,
46 FVAR_LINEAR_CORNERS_PLUS1,
47 FVAR_LINEAR_CORNERS_PLUS2,
48 FVAR_LINEAR_BOUNDARIES,
49 FVAR_LINEAR_ALL
50 };
51 enum CreasingMethod {
52 CREASE_UNIFORM = 0,
53 CREASE_CHAIKIN
54 };
55 enum TriangleSubdivision {
56 TRI_SUB_CATMARK = 0,
57 TRI_SUB_SMOOTH
58 };
59
60 public:
61
62 Options() : _vtxBoundInterp(VTX_BOUNDARY_NONE),
63 _fvarLinInterp(FVAR_LINEAR_ALL),
64 _creasingMethod(CREASE_UNIFORM),
65 _triangleSub(TRI_SUB_CATMARK) { }
66
67 //
68 // Trivial get/set methods:
69 //
70
72 VtxBoundaryInterpolation GetVtxBoundaryInterpolation() const { return (VtxBoundaryInterpolation) _vtxBoundInterp; }
73
75 void SetVtxBoundaryInterpolation(VtxBoundaryInterpolation b) { _vtxBoundInterp = (EnumIntType) b; }
76
78 FVarLinearInterpolation GetFVarLinearInterpolation() const { return (FVarLinearInterpolation) _fvarLinInterp; }
79
81 void SetFVarLinearInterpolation(FVarLinearInterpolation b) { _fvarLinInterp = (EnumIntType) b; }
82
84 CreasingMethod GetCreasingMethod() const { return (CreasingMethod) _creasingMethod; }
85
87 void SetCreasingMethod(CreasingMethod c) { _creasingMethod = (EnumIntType) c; }
88
90 TriangleSubdivision GetTriangleSubdivision() const { return (TriangleSubdivision) _triangleSub; }
91
93 void SetTriangleSubdivision(TriangleSubdivision t) { _triangleSub = (EnumIntType) t; }
94
95 private:
96 // Use a small integer type to pack these rather than bitfields:
97 typedef unsigned char EnumIntType;
98
99 EnumIntType _vtxBoundInterp;
100 EnumIntType _fvarLinInterp;
101 EnumIntType _creasingMethod;
102 EnumIntType _triangleSub;
103};
104
105} // end namespace sdc
106
107} // end namespace OPENSUBDIV_VERSION
108 using namespace OPENSUBDIV_VERSION;
109} // end namespace OpenSubdiv
110
111#endif /* OPENSUBDIV3_SDC_OPTIONS_H */
OpenSubdiv
Definition limits.h:15
OpenSubdiv::OPENSUBDIV_VERSION
Definition limits.h:16
OpenSubdiv::OPENSUBDIV_VERSION::Sdc
Definition bilinearScheme.h:17
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::TriangleSubdivision
TriangleSubdivision
Definition options.h:55
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::TRI_SUB_CATMARK
@ TRI_SUB_CATMARK
Catmark weights (Catmark scheme only).
Definition options.h:56
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::TRI_SUB_SMOOTH
@ TRI_SUB_SMOOTH
"smooth triangle" weights (Catmark scheme only)
Definition options.h:57
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::CreasingMethod
CreasingMethod
Definition options.h:51
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::CREASE_UNIFORM
@ CREASE_UNIFORM
Catmark rule.
Definition options.h:52
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::CREASE_CHAIKIN
@ CREASE_CHAIKIN
Chaikin rule.
Definition options.h:53
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::GetTriangleSubdivision
TriangleSubdivision GetTriangleSubdivision() const
Get triangle subdivision weights rule (Catmark scheme only !).
Definition options.h:90
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::GetCreasingMethod
CreasingMethod GetCreasingMethod() const
Get edge crease rule.
Definition options.h:84
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::Options
Options()
Definition options.h:62
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::SetFVarLinearInterpolation
void SetFVarLinearInterpolation(FVarLinearInterpolation b)
Set face-varying interpolation rule.
Definition options.h:81
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::SetTriangleSubdivision
void SetTriangleSubdivision(TriangleSubdivision t)
Set triangle subdivision weights rule (Catmark scheme only !).
Definition options.h:93
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::GetVtxBoundaryInterpolation
VtxBoundaryInterpolation GetVtxBoundaryInterpolation() const
Get vertex boundary interpolation rule.
Definition options.h:72
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::FVarLinearInterpolation
FVarLinearInterpolation
Definition options.h:43
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::FVAR_LINEAR_CORNERS_ONLY
@ FVAR_LINEAR_CORNERS_ONLY
sharpen corners only
Definition options.h:45
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::FVAR_LINEAR_BOUNDARIES
@ FVAR_LINEAR_BOUNDARIES
sharpen all boundaries ("always sharp")
Definition options.h:48
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::FVAR_LINEAR_CORNERS_PLUS2
@ FVAR_LINEAR_CORNERS_PLUS2
("edge and corner + propagate corner")
Definition options.h:47
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::FVAR_LINEAR_CORNERS_PLUS1
@ FVAR_LINEAR_CORNERS_PLUS1
("edge corner")
Definition options.h:46
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::FVAR_LINEAR_ALL
@ FVAR_LINEAR_ALL
bilinear interpolation ("bilinear")
Definition options.h:49
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::FVAR_LINEAR_NONE
@ FVAR_LINEAR_NONE
smooth everywhere ("edge only")
Definition options.h:44
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::SetVtxBoundaryInterpolation
void SetVtxBoundaryInterpolation(VtxBoundaryInterpolation b)
Set vertex boundary interpolation rule.
Definition options.h:75
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::GetFVarLinearInterpolation
FVarLinearInterpolation GetFVarLinearInterpolation() const
Get face-varying interpolation rule.
Definition options.h:78
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::VtxBoundaryInterpolation
VtxBoundaryInterpolation
Definition options.h:36
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::VTX_BOUNDARY_NONE
@ VTX_BOUNDARY_NONE
Definition options.h:37
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::VTX_BOUNDARY_EDGE_ONLY
@ VTX_BOUNDARY_EDGE_ONLY
all boundary edges sharpened and interpolated
Definition options.h:39
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::VTX_BOUNDARY_EDGE_AND_CORNER
@ VTX_BOUNDARY_EDGE_AND_CORNER
Definition options.h:40
OpenSubdiv::OPENSUBDIV_VERSION::Sdc::Options::SetCreasingMethod
void SetCreasingMethod(CreasingMethod c)
Set edge crease rule.
Definition options.h:87