OBJParser
OBJ File Parser Powered by Boost Spirit
 All Classes Functions Variables Enumerations Enumerator Pages
OBJRenderState.hpp
1 /*
2  * Copyright 2016 Steven T Sell (ssell@vertexfragment.com)
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef __H__OBJ_PARSER_RENDER_STATE__H__
18 #define __H__OBJ_PARSER_RENDER_STATE__H__
19 
20 #include <boost/fusion/adapted.hpp>
21 
22 #include <string>
23 #include <cstdint>
24 
25 //------------------------------------------------------------------------------------------
26 
27 enum class OBJSubdivision
28 {
29  None = 0,
30  Parametric,
31  ParametricA,
32  ParametricB,
33  Spatial,
34  Curvature,
35 
36 };
37 
43 {
45  : technique(OBJSubdivision::None),
46  res(0.0f),
47  maxLength(0.0f),
48  maxDistance(0.0f),
49  maxAngle(0.0f)
50  {
51 
52  }
53 
54  OBJSubdivision technique;
55 
56  float res;
57 
58  float maxLength;
59  float maxDistance;
60  float maxAngle;
61 };
62 
68 {
70  : technique(OBJSubdivision::None),
71  resU(0.0f),
72  resV(0.0f),
73  maxLength(0.0f),
74  maxDistance(0.0f),
75  maxAngle(0.0f)
76  {
77 
78  }
79 
80  OBJSubdivision technique;
81 
82  float resU;
83  float resV;
84 
85  float maxLength;
86  float maxDistance;
87  float maxAngle;
88 };
89 
101 {
103  : smoothing(0), lod(0), bevelInterp(false), colorInterp(false), dissolveInterp(false)
104  {
105 
106  }
107 
108  //--------------------------------------------------------------------
109 
110  uint32_t smoothing;
111  uint32_t lod;
112 
113  bool bevelInterp;
114  bool colorInterp;
116 
117  std::string material;
118  std::string textureMap;
119  std::string shadowObj;
120  std::string traceObj;
121 
124 };
125 
126 //------------------------------------------------------------------------------------------
127 
128 #endif
Specifies free-form curve subdivision technique.
Definition: OBJRenderState.hpp:42
std::string textureMap
Specifies the texture map to use. Empty or "off" means no map specified.
Definition: OBJRenderState.hpp:118
float maxDistance
Maximum distance between line segments and curve in Curvature subdivision. 0.0 if not used...
Definition: OBJRenderState.hpp:59
bool dissolveInterp
Sets dissolve interpolation on/off. Default off. Polygons only.
Definition: OBJRenderState.hpp:115
bool colorInterp
Sets color interpolation on/off. Default off. Polygons only.
Definition: OBJRenderState.hpp:114
float maxLength
Maximum length of line segments with Spatial subdivision. 0.0 if not used.
Definition: OBJRenderState.hpp:85
float maxDistance
Maximum distance between line segments and curve in Curvature subdivision. 0.0 if not used...
Definition: OBJRenderState.hpp:86
Struct of optional state settings.
Definition: OBJRenderState.hpp:100
float resU
Resolution parameter for the U direction with Parametric subdivision. If technique is ParametricB...
Definition: OBJRenderState.hpp:82
float maxLength
Maximum length of line segments with Spatial subdivision. 0.0 if not used.
Definition: OBJRenderState.hpp:58
OBJSubdivision technique
Subdivision type. For curves this may be: Parametric, Spatial, or Curvature. If None, then this technique has not been specified.
Definition: OBJRenderState.hpp:54
std::string shadowObj
Specifies the shadow object filename. Empty means no object specified.
Definition: OBJRenderState.hpp:119
float res
Resolution used with Parametric subdivision. 0.0 if not used.
Definition: OBJRenderState.hpp:56
std::string material
Specifies the material to use. Empty means no material. Once set, material can only be changed...
Definition: OBJRenderState.hpp:117
OBJSurfaceTechnique surfaceTechnique
Specified the surface approximation technique. Free-froms only.
Definition: OBJRenderState.hpp:123
bool bevelInterp
Sets bevel interpolation on/off. Default off. Polygons only.
Definition: OBJRenderState.hpp:113
float maxAngle
Angle between tangent vectors at line segment ends in Curvature subdivision. 0.0 if not used...
Definition: OBJRenderState.hpp:60
std::string traceObj
Specifies the ray tracing object filename. Empty means no object specified.
Definition: OBJRenderState.hpp:120
OBJSubdivision technique
Subdivision type. For surfaces this may be: ParametricA, ParametricB, Spatial, or Curvature...
Definition: OBJRenderState.hpp:80
OBJCurveTechnique curveTechnique
Specifies the curve approximation technique. Free-forms only.
Definition: OBJRenderState.hpp:122
Specifies free-form surface subdivision technique.
Definition: OBJRenderState.hpp:67
uint32_t lod
Level-of-detail displayed. Off is 0. Otherwise, range of [1,100].
Definition: OBJRenderState.hpp:111
uint32_t smoothing
Smoothing group number. Default/no smoothing group is 0.
Definition: OBJRenderState.hpp:110
float resV
Resolution parameter for the V direction with Parametric subdivision. If technique is ParametricB...
Definition: OBJRenderState.hpp:83
float maxAngle
Angle between tangent vectors at line segment ends in Curvature subdivision. 0.0 if not used...
Definition: OBJRenderState.hpp:87