CFx SDK Documentation 2026 SP0
Loading...
Searching...
No Matches
TrVisRenderMode.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2024, Open Design Alliance (the "Alliance").
3// All rights reserved.
4//
5// This software and its documentation and related materials are owned by
6// the Alliance. The software may only be incorporated into application
7// programs owned by members of the Alliance, subject to a signed
8// Membership Agreement and Supplemental Software License Agreement with the
9// Alliance. The structure and organization of this software are the valuable
10// trade secrets of the Alliance and its suppliers. The software is also
11// protected by copyright law and international treaty provisions. Application
12// programs incorporating this software must include the following statement
13// with their copyright notices:
14//
15// This application incorporates Open Design Alliance software pursuant to a license
16// agreement with Open Design Alliance.
17// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.
18// All rights reserved.
19//
20// By use of this software, its documentation or related materials, you
21// acknowledge and accept the above terms.
23// GLES2 device render mode definition
24
25#ifndef ODTRVISRENDERMODE
26#define ODTRVISRENDERMODE
27
28#include "TD_PackPush.h"
29
30#include "TrVisDefs.h"
31
36{
37 protected:
47 protected:
49 public:
50 // Constructors, setters/getters
53 void reset() { for (long i = 0; i < kNumFlags; i++) m_bFlags[i] = false; } /* reset to 2d mode by default */
54 bool depthBufferEnabled() const { return m_bFlags[kDepthBuffer]; } void setDepthBufferEnabled(bool bSet) { m_bFlags[kDepthBuffer] = bSet; }
55 bool stencilBufferEnabled() const { return m_bFlags[kStencilBuffer]; } void setStencilBufferEnabled(bool bSet) { m_bFlags[kStencilBuffer] = bSet; }
56 bool polygonOffsetEnabled() const { return m_bFlags[kPolygonOffset]; } void setPolygonOffsetEnabled(bool bSet) { m_bFlags[kPolygonOffset] = bSet; }
57 bool lightingEnabled() const { return m_bFlags[kLighting]; } void setLightingEnabled(bool bSet) { m_bFlags[kLighting] = bSet; }
58 bool faceNormalsEnabled() const { return m_bFlags[kFaceNormals]; } void setFaceNormalsEnabled(bool bSet) { m_bFlags[kFaceNormals] = bSet; }
59 // Serialization
60 OdUInt32 serializeOut() const { OdUInt32 nRez = 0; for (long i = 0; i < kNumFlags; i++) { if (m_bFlags[i]) nRez |= 1 << i; } return nRez; }
61 void serializeIn(OdUInt32 nFlags) { for (long i = 0; i < kNumFlags; i++) { m_bFlags[i] = (nFlags | (1 << i)) != 0; } }
62 // Control version
63 const long controlVersion() const { return kNumFlags; }
64 // Gs Render Mode compatibility
65 // 2dOptimized mode
68 // Wireframe mode
71 // Wireframe 2d or 3d mode
72 bool is_wf() const
74 // HiddenLine mode
77 // Shaded (any) modes
78 bool is_sa() const
80 // Shaded without edges modes
83 // ShadedWithWireframe modes
86 // FlatShaded mode
89 // GouraudShaded mode
92 // FlatShadedWithWireframe mode
95 // GouraudShadedWithWireframe mode
98 // RenderMode from flags
113 // Flags from render mode
115 {
116 switch (rm)
117 {
120 break;
123 break;
126 break;
129 break;
132 break;
135 break;
138 break;
139 default: break;
140 }
141 return *this;
142 }
143 // Calibrate settings
144 void calibrate() { make_fs(make_rm()); }
145};
146
147#include "TD_PackPop.h"
148
149#endif // ODTRVISRENDERMODE
unsigned int OdUInt32
RenderMode
Definition Gs.h:149
@ kFlatShadedWithWireframe
Definition Gs.h:156
@ kHiddenLine
Definition Gs.h:153
@ kGouraudShadedWithWireframe
Definition Gs.h:157
@ kWireframe
Definition Gs.h:152
@ kFlatShaded
Definition Gs.h:154
@ k2DOptimized
Definition Gs.h:151
@ kGouraudShaded
Definition Gs.h:155
void setFaceNormalsEnabled(bool bSet)
OdGsView::RenderMode make_rm() const
bool depthBufferEnabled() const
bool lightingEnabled() const
void setStencilBufferEnabled(bool bSet)
OdUInt32 serializeOut() const
const long controlVersion() const
void serializeIn(OdUInt32 nFlags)
bool faceNormalsEnabled() const
OdTrVisRenderMode & make_fs(OdGsView::RenderMode rm)
bool polygonOffsetEnabled() const
void setLightingEnabled(bool bSet)
void setDepthBufferEnabled(bool bSet)
bool stencilBufferEnabled() const
bool m_bFlags[kNumFlags]
void setPolygonOffsetEnabled(bool bSet)