7 #ifndef __draw_DrawMode_h__ 8 #define __draw_DrawMode_h__ 67 m_drawStyle(e_defaultStyle),
74 m_frontfaceCulling(FALSE),
75 m_backfaceCulling(TRUE),
76 m_twoSidedLighting(FALSE),
81 { setName(
"DrawMode"); }
85 m_spTextureImage=a_spDrawMode->m_spTextureImage;
86 m_textureImageID=a_spDrawMode->m_textureImageID;
87 m_drawStyle=a_spDrawMode->m_drawStyle;
88 m_coloring=a_spDrawMode->m_coloring;
89 m_group=a_spDrawMode->m_group;
90 m_layer=a_spDrawMode->m_layer;
91 m_pointSize=a_spDrawMode->m_pointSize;
92 m_lineWidth=a_spDrawMode->m_lineWidth;
93 m_refinement=a_spDrawMode->m_refinement;
94 m_antialias=a_spDrawMode->m_antialias;
95 m_frontfaceCulling=a_spDrawMode->m_frontfaceCulling;
96 m_backfaceCulling=a_spDrawMode->m_backfaceCulling;
97 m_twoSidedLighting=a_spDrawMode->m_twoSidedLighting;
98 m_zBuffering=a_spDrawMode->m_zBuffering;
99 m_lit=a_spDrawMode->m_lit;
100 m_shadows=a_spDrawMode->m_shadows;
101 m_uvSpace=a_spDrawMode->m_uvSpace;
106 { m_spTextureImage=spImageI; }
110 {
return m_spTextureImage; }
118 { m_textureImageID=a_imageId; }
122 {
return m_textureImageID; }
134 Coloring
coloring(
void)
const {
return m_coloring; }
146 I32
layer(
void)
const {
return m_layer; }
150 { m_pointSize=pixels; }
154 {
return m_pointSize; }
158 { m_lineWidth=pixels; }
162 {
return m_lineWidth; }
166 { m_refinement=level; }
170 {
return m_refinement; }
174 { m_antialias=antialias; }
178 {
return m_antialias; }
182 { m_frontfaceCulling=frontfaceCulling; }
186 {
return m_frontfaceCulling; }
190 { m_backfaceCulling=backfaceCulling; }
194 {
return m_backfaceCulling; }
199 { m_twoSidedLighting=twoSidedLighting; }
204 {
return m_twoSidedLighting; }
208 { m_zBuffering=zBuffering; }
212 {
return m_zBuffering; }
224 { m_shadows=shadows; }
228 {
return m_shadows; }
232 { m_uvSpace=uvSpace; }
236 {
return m_uvSpace; }
240 static Coloring stringToColoring(
const String &a_coloringName);
245 I32 m_textureImageID;
254 BWORD m_frontfaceCulling;
255 BWORD m_backfaceCulling;
256 BWORD m_twoSidedLighting;
263 static char DrawStyleText[DrawMode::e_drawStyleCount][32] =
275 static char ColoringText[DrawMode::e_coloringCount][32] =
286 if(a_styleName ==
"pointCloud") {
return e_pointCloud; }
287 if(a_styleName ==
"wireframe") {
return e_wireframe; }
288 if(a_styleName ==
"outline") {
return e_outline; }
289 if(a_styleName ==
"edgedSolid") {
return e_edgedSolid; }
290 if(a_styleName ==
"solid") {
return e_solid; }
291 if(a_styleName ==
"foreshadow") {
return e_foreshadow; }
292 if(a_styleName ==
"ghost") {
return e_ghost; }
294 return e_defaultStyle;
297 inline DrawMode::Coloring DrawMode::stringToColoring(
298 const String &a_coloringName)
300 if(a_coloringName ==
"normal") {
return e_normal; }
301 if(a_coloringName ==
"tangent") {
return e_tangent; }
302 if(a_coloringName ==
"uv") {
return e_uv; }
303 if(a_coloringName ==
"partition" ||
304 a_coloringName ==
"part") {
return e_partition; }
317 return ext::DrawStyleText[a_drawStyle%ext::DrawMode::e_drawStyleCount];
320 inline String print(ext::DrawMode::Coloring a_coloring)
322 return ext::ColoringText[a_coloring%ext::DrawMode::e_coloringCount];
328 s.
sPrintf(
"style \"%s\" coloring \"%s\" layer %d pointSize %g lineWidth %g" 329 " refinement %d\n aa %d front %d back %d twoSided %d z %d lit %d" 330 " shadows %d uv %d texture %p group \"%s\"",
332 ext::DrawStyleText[spDrawMode->drawStyle()%
333 ext::DrawMode::e_drawStyleCount],
335 ext::ColoringText[spDrawMode->coloring()%
336 ext::DrawMode::e_coloringCount],
339 spDrawMode->pointSize(),
340 spDrawMode->lineWidth(),
341 spDrawMode->refinement(),
342 spDrawMode->antialias(),
343 spDrawMode->frontfaceCulling(),
344 spDrawMode->backfaceCulling(),
345 spDrawMode->twoSidedLighting(),
346 spDrawMode->zBuffering(),
348 spDrawMode->shadows(),
349 spDrawMode->uvSpace(),
350 spDrawMode->textureImage().raw(),
351 spDrawMode->group().c_str());
BWORD zBuffering(void) const
Get whether z-buffering is used.
Definition: DrawMode.h:211
void setFrontfaceCulling(BWORD frontfaceCulling)
Set whether frontfaces are removed.
Definition: DrawMode.h:181
BWORD shadows(void) const
Get whether shadows.
Definition: DrawMode.h:227
BWORD backfaceCulling(void) const
Get whether backfaces are removed.
Definition: DrawMode.h:193
Heap-based support for classes participating in fe::ptr <>
Definition: Counted.h:35
Real pointSize(void) const
Get diameter of all following drawn points.
Definition: DrawMode.h:153
String group(void) const
Get named group.
Definition: DrawMode.h:140
kernel
Definition: namespace.dox:3
Configuration for rendering such as line width and backface culling.
Definition: DrawMode.h:33
Real lineWidth(void) const
Get width of all following drawn lines.
Definition: DrawMode.h:161
void setLineWidth(Real pixels)
Set width of all following drawn lines.
Definition: DrawMode.h:157
void setShadows(BWORD shadows)
Set shadows.
Definition: DrawMode.h:223
void setTextureImageID(I32 a_imageId)
Set raster for texture mapping.
Definition: DrawMode.h:117
void setTextureImage(sp< ImageI > spImageI)
Set raster for texture mapping.
Definition: DrawMode.h:105
void setBackfaceCulling(BWORD backfaceCulling)
Set whether backfaces are removed.
Definition: DrawMode.h:189
I32 refinement(void) const
Get subvision level of all following drawn polys.
Definition: DrawMode.h:169
void setAntialias(BWORD antialias)
Set rasterization anti-aliasing.
Definition: DrawMode.h:173
void setRefinement(I32 level)
Set subvision level of all following drawn polys.
Definition: DrawMode.h:165
void setGroup(String a_group)
Set named group.
Definition: DrawMode.h:137
BWORD frontfaceCulling(void) const
Get whether frontfaces are removed.
Definition: DrawMode.h:185
String & sPrintf(const char *fmt,...)
Populate the string in the manner of sprintf().
Definition: String.cc:529
Automatically reference-counted string container.
Definition: String.h:128
void setDrawStyle(DrawStyle style)
Set rendering scheme (see DrawStyle)
Definition: DrawMode.h:125
BWORD uvSpace(void) const
Get whether in UV space.
Definition: DrawMode.h:235
void setLit(BWORD lit)
Set lit.
Definition: DrawMode.h:215
void setTwoSidedLighting(BWORD twoSidedLighting)
Set whether backfaces have an independent material.
Definition: DrawMode.h:198
void setLayer(I32 set)
Set rendering ordering (highest last)
Definition: DrawMode.h:143
BWORD antialias(void) const
Get whether anti-aliasing is used.
Definition: DrawMode.h:177
sp< ImageI > textureImage(void) const
Get raster for texture mapping.
Definition: DrawMode.h:109
DrawStyle drawStyle(void) const
Get rendering scheme (see DrawStyle)
Definition: DrawMode.h:128
DrawStyle
Rendering schemes that an an implementation may recognize.
Definition: DrawMode.h:42
void setColoring(Coloring coloring)
Set color source (see Coloring)
Definition: DrawMode.h:131
Coloring coloring(void) const
Get color source (see Coloring)
Definition: DrawMode.h:134
I32 textureImageID(void) const
Get raster for texture mapping.
Definition: DrawMode.h:121
I32 layer(void) const
Get rendering ordering (highest last)
Definition: DrawMode.h:146
BWORD twoSidedLighting(void) const
Get whether backfaces have an independent material.
Definition: DrawMode.h:203
void setZBuffering(BWORD zBuffering)
Set whether z-buffering is used.
Definition: DrawMode.h:207
BWORD lit(void) const
Get whether lit.
Definition: DrawMode.h:219
void setUvSpace(BWORD uvSpace)
Set whether in UV space.
Definition: DrawMode.h:231
void setPointSize(Real pixels)
Set diameter of all following drawn points.
Definition: DrawMode.h:149