CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
TrVisOverlayDef.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2022, 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-2022 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 // Main overlay definition
50 };
51
52 // Set of overlay buffer flags
54 // Overlay rendering order position
56
57 // Reset overlay flags
58 void resetOverlayFlags(OdUInt16 overlayFlags = 0) { m_overlayFlags = overlayFlags; }
59
60 // Overlay "enabled" flag
63
64 // Overlay "depth buffer" flag
67
68 // Overlay "merge depth" flag
71
72 // Overlay "direct render" flag
75
76 // Overlay "highlight" flag
79
80 // Overlay "contrast" flag
83
84 // Overlay "generate shadows" flag
87
88 // Overlay "use shadows" flag
91
92 // Setup default values
94 {
96 m_renderOrder = 0;
97 }
98};
99
104{
108 OdTrVisViewClipped(bool bClipped, double clipDist) : m_bClipped(false), m_clipDist(0.) { set(bClipped, clipDist); }
109 void set(bool bClipped, double clipDist) { m_bClipped = bClipped; m_clipDist = (bClipped) ? clipDist : 0.; }
110 void reset() { m_bClipped = false; m_clipDist = 0.; }
111 bool enabled() const { return m_bClipped; }
112 double clipDistance() const { return m_clipDist; }
113 enum ApplyType { kGreater = 0, kLess = 1 };
114 void apply(double &dVal, ApplyType appType) const
115 {
116 if (m_bClipped && (((appType == kGreater) && (m_clipDist > dVal)) || ((appType == kLess) && (m_clipDist < dVal))))
117 dVal = m_clipDist;
118 }
119};
120
125{
126 // Orientation properties related to Gs only
133 // Orientation properties related to Gs and Xml together
136 // Orientation properties related to Xml only
143
144 // Setup default values
146 {
155 m_fieldWidth = 1.0;
156 m_fieldHeight = 1.0;
157 m_lensLength = 51.0;
160 m_backClip .reset();
161 }
162
163 // Check does view parameters cumulative
164 bool isCumulative(const OdTrVisViewParamsDef &secParams) const
165 { // View parameters cumulative in case if view orientation similar. View projection can differ.
166 return m_viewBasis == secParams.m_viewBasis &&
167 //(m_bPerspectiveProjection == secParams.m_bPerspectiveProjection) &&
168 //OdEqual(m_fieldWidth, secParams.m_fieldWidth) &&
169 //OdEqual(m_fieldHeight, secParams.m_fieldHeight) &&
170 //OdEqual(m_lensLength, secParams.m_lensLength) &&
172 }
173};
174
175#include "TD_PackPop.h"
176
177#endif // ODTRVISOVERLAYDEF
false
Definition: DimVarDefs.h:165
short OdInt16
unsigned short OdUInt16
#define SETBIT(flags, bit, value)
Definition: OdaDefs.h:516
#define GETBIT(flags, bit)
Definition: OdaDefs.h:517
OdGeMatrix3d & setToIdentity()
bool isEqualTo(const OdGePoint3d &point, const OdGeTol &tol=OdGeContext::gTol) const
static GE_STATIC_EXPORT const OdGePoint3d kOrigin
Definition: GePoint3d.h:106
static GE_STATIC_EXPORT const OdGeVector3d kZAxis
Definition: GeVector3d.h:103
OdTrVisViewBasis & setDefault()
Definition: TrVisBasis.h:285
bool isOverlayShadowsApplyingEnabled() const
bool isOverlayDirectRenderEnabled() const
bool isOverlayHighlightingEnabled() const
bool isOverlayEnabled() const
void setOverlayDepthBufferEnabled(bool bSet)
bool isOverlayDepthBufferMergeEnabled() 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 enabled() 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