CFx SDK Documentation 2026 SP0
Loading...
Searching...
No Matches
TrVisOverlayDef.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 overlay buffer definition
24
25#ifndef ODTRVISOVERLAYDEF
26#define ODTRVISOVERLAYDEF
27
28#include "TD_PackPush.h"
29
30#include "TrVisBasis.h"
31
36{
37 // Flags
39 {
40 kOBEnabled = (1 << 0), // Overlay buffer visible
41 kOBDepthBuffer = (1 << 1), // Depth buffer enabled for this overlay
42 kOBMergeDepth = (1 << 2), // Merge depth buffer with primary depth buffer
43 kOBDirectRender = (1 << 3), // Render directly on screen
44 kOBHighlight = (1 << 4), // Render geometry as highlighted
45 kOBContrast = (1 << 5), // Render geometry with contrast style applied
46 kOBGenShadows = (1 << 6), // Enable shadows generation
47 kOBUseShadows = (1 << 7), // Apply shadows
48 kOBGenReflects = (1 << 8), // Enable reflections generation
49 // Main overlay definition
51 };
52
53 // Set of overlay buffer flags
55 // Overlay rendering order position
57
58 // Reset overlay flags
59 void resetOverlayFlags(OdUInt16 overlayFlags = 0) { m_overlayFlags = overlayFlags; }
60
61 // Overlay "enabled" flag
64
65 // Overlay "depth buffer" flag
68
69 // Overlay "merge depth" flag
72
73 // Overlay "direct render" flag
76
77 // Overlay "highlight" flag
80
81 // Overlay "contrast" flag
84
85 // Overlay "generate shadows" flag
88
89 // Overlay "use shadows" flag
92
93 // Overlay "generate reflections" flag
96
97 // Setup default values
99 {
100 m_overlayFlags = 0;
101 m_renderOrder = 0;
102 }
103};
104
109{
113 OdTrVisViewClipped(bool bClipped, double clipDist) : m_bClipped(false), m_clipDist(0.) { set(bClipped, clipDist); }
114 void set(bool bClipped, double clipDist) { m_bClipped = bClipped; m_clipDist = (bClipped) ? clipDist : 0.; }
115 void reset() { m_bClipped = false; m_clipDist = 0.; }
116 bool enabled() const { return m_bClipped; }
117 double clipDistance() const { return m_clipDist; }
118 enum ApplyType { kGreater = 0, kLess = 1 };
119 void apply(double &dVal, ApplyType appType) const
120 {
121 if (m_bClipped && (((appType == kGreater) && (m_clipDist > dVal)) || ((appType == kLess) && (m_clipDist < dVal))))
122 dVal = m_clipDist;
123 }
124 bool operator ==(const OdTrVisViewClipped &vc2) const
125 { return (m_bClipped == vc2.m_bClipped) && (!m_bClipped || OdEqual(m_clipDist, vc2.m_clipDist)); }
126 bool operator !=(const OdTrVisViewClipped &vc2) const
127 { return (m_bClipped != vc2.m_bClipped) || (m_bClipped && !OdEqual(m_clipDist, vc2.m_clipDist)); }
128};
129
134{
135 // Orientation properties related to Gs only
142 // Orientation properties related to Gs and Xml together
145 // Orientation properties related to Xml only
152
153 // Setup default values
155 {
156 m_screenMatrix .setToIdentity();
157 m_viewingMatrix .setToIdentity();
158 m_projectionMatrix .setToIdentity();
159 m_correctionMatrix .setToIdentity();
160 m_outputMatrix .setToIdentity();
161 m_metafileMatrix .setToIdentity();
162 m_viewBasis .setDefault();
164 m_fieldWidth = 1.0;
165 m_fieldHeight = 1.0;
166 m_lensLength = 51.0;
168 m_frontClip .reset();
169 m_backClip .reset();
170 }
171
172 // Check does view parameters cumulative
173 bool isCumulative(const OdTrVisViewParamsDef &secParams) const
174 { // View parameters cumulative in case if view orientation similar. View projection can differ.
175 return m_viewBasis == secParams.m_viewBasis &&
176 //(m_bPerspectiveProjection == secParams.m_bPerspectiveProjection) &&
177 //OdEqual(m_fieldWidth, secParams.m_fieldWidth) &&
178 //OdEqual(m_fieldHeight, secParams.m_fieldHeight) &&
179 //OdEqual(m_lensLength, secParams.m_lensLength) &&
180 m_viewTarget.isEqualTo(secParams.m_viewTarget);
181 }
182};
183
184#include "TD_PackPop.h"
185
186#endif // ODTRVISOVERLAYDEF
false
Definition DimVarDefs.h:165
short OdInt16
unsigned short OdUInt16
bool OdEqual(double x, double y, double tol=1.e-10)
Definition OdaDefs.h:542
#define SETBIT(flags, bit, value)
Definition OdaDefs.h:516
#define GETBIT(flags, bit)
Definition OdaDefs.h:517
static GE_STATIC_EXPORT const OdGePoint3d kOrigin
Definition GePoint3d.h:106
static GE_STATIC_EXPORT const OdGeVector3d kZAxis
Definition GeVector3d.h:103
bool isOverlayShadowsApplyingEnabled() const
bool isOverlayDirectRenderEnabled() const
void setOverlayReflectionsGenerationEnabled(bool bSet)
bool isOverlayHighlightingEnabled() const
bool isOverlayEnabled() const
void setOverlayDepthBufferEnabled(bool bSet)
bool isOverlayDepthBufferMergeEnabled() const
bool isOverlayReflectionsGenerationEnabled() const
void setOverlayShadowsGenerationEnabled(bool bSet)
void setOverlayContrastStyleEnabled(bool bSet)
void setOverlayDepthBufferMergeEnabled(bool bSet)
void resetOverlayFlags(OdUInt16 overlayFlags=0)
void setOverlayShadowsApplyingEnabled(bool bSet)
void setOverlayEnabled(bool bSet)
void setOverlayDirectRenderEnabled(bool bSet)
bool isOverlayShadowsGenerationEnabled() const
bool isOverlayContrastStyleEnabled() const
bool isOverlayDepthBufferEnabled() const
void setOverlayHighlightingEnabled(bool bSet)
OdTrVisViewClipped(bool bClipped, double clipDist)
void apply(double &dVal, ApplyType appType) const
bool operator==(const OdTrVisViewClipped &vc2) const
bool operator!=(const OdTrVisViewClipped &vc2) const
double clipDistance() const
void set(bool bClipped, double clipDist)
OdTrVisViewClipped m_frontClip
OdGeMatrix3d m_outputMatrix
OdTrVisViewBasis m_viewBasis
bool isCumulative(const OdTrVisViewParamsDef &secParams) const
OdGeMatrix3d m_viewingMatrix
OdTrVisViewClipped m_backClip
OdGeMatrix3d m_correctionMatrix
OdGeMatrix3d m_projectionMatrix
OdGeMatrix3d m_screenMatrix
OdGeMatrix3d m_metafileMatrix