CFx SDK Documentation  2020SP3
TrVisOverlayDef.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2017, 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 Teigha(R) software pursuant to a license
16 // agreement with Open Design Alliance.
17 // Teigha(R) Copyright (C) 2002-2017 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 "Ge/GeMatrix3d.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  };
47 
48  // Set of overlay buffer flags
50  // Overlay rendering order position
52 
53  // Reset overlay flags
54  void resetOverlayFlags(OdUInt16 overlayFlags = 0) { m_overlayFlags = overlayFlags; }
55 
56  // Overlay "enabled" flag
57  bool isOverlayEnabled() const { return GETBIT(m_overlayFlags, kOBEnabled); }
58  void setOverlayEnabled(bool bSet) { SETBIT(m_overlayFlags, kOBEnabled, bSet); }
59 
60  // Overlay "depth buffer" flag
63 
64  // Overlay "merge depth" flag
67 
68  // Overlay "direct render" flag
71 
72  // Overlay "highlight" flag
75 
76  // Overlay "contrast" flag
79 
80  // Setup default values
81  void setDefault()
82  {
83  m_overlayFlags = 0;
84  m_renderOrder = 0;
85  }
86 };
87 
92 {
93  bool m_bClipped;
94  double m_clipDist;
96  OdTrVisViewClipped(bool bClipped, double clipDist) : m_bClipped(false), m_clipDist(0.) { set(bClipped, clipDist); }
97  void set(bool bClipped, double clipDist) { m_bClipped = bClipped; m_clipDist = (bClipped) ? clipDist : 0.; }
98  void reset() { m_bClipped = false; m_clipDist = 0.; }
99  bool enabled() const { return m_bClipped; }
100  enum ApplyType { kGreater = 0, kLess = 1 };
101  void apply(double &dVal, ApplyType appType) const
102  {
103  if (m_bClipped && (((appType == kGreater) && (m_clipDist > dVal)) || ((appType == kLess) && (m_clipDist < dVal))))
104  dVal = m_clipDist;
105  }
106 };
107 
112 {
113  // Orientation properties related to Gs only
120  // Orientation properties related to Gs and Xml together
124  // Orientation properties related to Xml only
125  double m_fieldWidth;
127  double m_lensLength;
131 
132  // Setup default values
133  void setDefault()
134  {
144  m_bPerspectiveProjection = false;
145  m_fieldWidth = 1.0;
146  m_fieldHeight = 1.0;
147  m_lensLength = 51.0;
149  m_frontClip .reset();
150  m_backClip .reset();
151  }
152 
153  // Check does view parameters cumulative
154  bool isCumulative(const OdTrVisViewParamsDef &secParams) const
155  { // View parameters cumulative in case if view orientation similar. View projection can differ.
156  return m_viewPosition.isEqualTo(secParams.m_viewPosition) &&
157  m_viewBasis[1].isEqualTo(secParams.m_viewBasis[1]) &&
158  //(m_bPerspectiveProjection == secParams.m_bPerspectiveProjection) &&
159  //OdEqual(m_fieldWidth, secParams.m_fieldWidth) &&
160  //OdEqual(m_fieldHeight, secParams.m_fieldHeight) &&
161  //OdEqual(m_lensLength, secParams.m_lensLength) &&
163  }
164 };
165 
166 #include "TD_PackPop.h"
167 
168 #endif // ODTRVISOVERLAYDEF
GETBIT
#define GETBIT(flags, bit)
Definition: OdaDefs.h:498
OdTrVisOverlayDef::setDefault
void setDefault()
Definition: TrVisOverlayDef.h:81
OdGeVector3d
Definition: GeVector3d.h:54
OdTrVisViewParamsDef::m_screenMatrix
OdGeMatrix3d m_screenMatrix
Definition: TrVisOverlayDef.h:114
OdTrVisViewParamsDef::m_bPerspectiveProjection
bool m_bPerspectiveProjection
Definition: TrVisOverlayDef.h:123
OdTrVisOverlayDef::kOBContrast
@ kOBContrast
Definition: TrVisOverlayDef.h:45
OdTrVisViewParamsDef::m_viewBasis
OdGeVector3d m_viewBasis[3]
Definition: TrVisOverlayDef.h:122
OdTrVisOverlayDef::kOBMergeDepth
@ kOBMergeDepth
Definition: TrVisOverlayDef.h:42
OdTrVisOverlayDef::OverlayDefFlags
OverlayDefFlags
Definition: TrVisOverlayDef.h:39
false
false
Definition: DimVarDefs.h:165
OdTrVisOverlayDef::resetOverlayFlags
void resetOverlayFlags(OdUInt16 overlayFlags=0)
Definition: TrVisOverlayDef.h:54
OdTrVisOverlayDef::m_renderOrder
OdInt16 m_renderOrder
Definition: TrVisOverlayDef.h:51
OdTrVisOverlayDef::m_overlayFlags
OdUInt16 m_overlayFlags
Definition: TrVisOverlayDef.h:49
SETBIT
#define SETBIT(flags, bit, value)
Definition: OdaDefs.h:497
OdGeVector3d::kXAxis
static GE_STATIC_EXPORT const OdGeVector3d kXAxis
Definition: GeVector3d.h:89
OdTrVisOverlayDef::isOverlayHighlightingEnabled
bool isOverlayHighlightingEnabled() const
Definition: TrVisOverlayDef.h:73
OdTrVisViewClipped::enabled
bool enabled() const
Definition: TrVisOverlayDef.h:99
OdGeVector3d::isEqualTo
bool isEqualTo(const OdGeVector3d &vect, const OdGeTol &tol=OdGeContext::gTol) const
TD_PackPop.h
OdTrVisOverlayDef::kOBHighlight
@ kOBHighlight
Definition: TrVisOverlayDef.h:44
OdTrVisViewClipped::kGreater
@ kGreater
Definition: TrVisOverlayDef.h:100
OdTrVisViewClipped::apply
void apply(double &dVal, ApplyType appType) const
Definition: TrVisOverlayDef.h:101
OdUInt16
unsigned short OdUInt16
Definition: OdPlatformSettings.h:760
OdTrVisViewParamsDef::setDefault
void setDefault()
Definition: TrVisOverlayDef.h:133
OdTrVisViewClipped::m_clipDist
double m_clipDist
Definition: TrVisOverlayDef.h:94
OdTrVisViewParamsDef::m_fieldHeight
double m_fieldHeight
Definition: TrVisOverlayDef.h:126
OdTrVisViewClipped::OdTrVisViewClipped
OdTrVisViewClipped()
Definition: TrVisOverlayDef.h:95
OdGeMatrix3d
Definition: GeMatrix3d.h:73
OdInt16
short OdInt16
Definition: OdPlatformSettings.h:756
OdTrVisViewParamsDef::m_viewPosition
OdGePoint3d m_viewPosition
Definition: TrVisOverlayDef.h:121
OdTrVisViewParamsDef::m_projectionMatrix
OdGeMatrix3d m_projectionMatrix
Definition: TrVisOverlayDef.h:116
OdTrVisViewParamsDef::m_viewingMatrix
OdGeMatrix3d m_viewingMatrix
Definition: TrVisOverlayDef.h:115
OdTrVisOverlayDef::isOverlayEnabled
bool isOverlayEnabled() const
Definition: TrVisOverlayDef.h:57
OdTrVisOverlayDef
Definition: TrVisOverlayDef.h:36
OdGeMatrix3d::setToIdentity
OdGeMatrix3d & setToIdentity()
OdTrVisViewClipped::OdTrVisViewClipped
OdTrVisViewClipped(bool bClipped, double clipDist)
Definition: TrVisOverlayDef.h:96
OdTrVisOverlayDef::kOBDirectRender
@ kOBDirectRender
Definition: TrVisOverlayDef.h:43
OdGeVector3d::kZAxis
static GE_STATIC_EXPORT const OdGeVector3d kZAxis
Definition: GeVector3d.h:91
OdGePoint3d
Definition: GePoint3d.h:55
OdTrVisOverlayDef::setOverlayDepthBufferEnabled
void setOverlayDepthBufferEnabled(bool bSet)
Definition: TrVisOverlayDef.h:62
OdTrVisOverlayDef::kOBEnabled
@ kOBEnabled
Definition: TrVisOverlayDef.h:40
OdTrVisViewClipped::reset
void reset()
Definition: TrVisOverlayDef.h:98
OdTrVisOverlayDef::isOverlayDepthBufferEnabled
bool isOverlayDepthBufferEnabled() const
Definition: TrVisOverlayDef.h:61
OdTrVisViewClipped::ApplyType
ApplyType
Definition: TrVisOverlayDef.h:100
OdTrVisViewParamsDef::m_backClip
OdTrVisViewClipped m_backClip
Definition: TrVisOverlayDef.h:130
OdTrVisViewParamsDef::m_frontClip
OdTrVisViewClipped m_frontClip
Definition: TrVisOverlayDef.h:129
OdGePoint3d::kOrigin
static GE_STATIC_EXPORT const OdGePoint3d kOrigin
Definition: GePoint3d.h:89
TD_PackPush.h
OdTrVisOverlayDef::setOverlayHighlightingEnabled
void setOverlayHighlightingEnabled(bool bSet)
Definition: TrVisOverlayDef.h:74
OdTrVisViewClipped
Definition: TrVisOverlayDef.h:92
OdTrVisViewParamsDef::isCumulative
bool isCumulative(const OdTrVisViewParamsDef &secParams) const
Definition: TrVisOverlayDef.h:154
OdTrVisOverlayDef::setOverlayDepthBufferMergeEnabled
void setOverlayDepthBufferMergeEnabled(bool bSet)
Definition: TrVisOverlayDef.h:66
OdTrVisOverlayDef::setOverlayEnabled
void setOverlayEnabled(bool bSet)
Definition: TrVisOverlayDef.h:58
OdTrVisViewClipped::kLess
@ kLess
Definition: TrVisOverlayDef.h:100
OdTrVisViewParamsDef::m_fieldWidth
double m_fieldWidth
Definition: TrVisOverlayDef.h:125
OdTrVisViewParamsDef
Definition: TrVisOverlayDef.h:112
OdTrVisViewParamsDef::m_metafileMatrix
OdGeMatrix3d m_metafileMatrix
Definition: TrVisOverlayDef.h:119
OdTrVisOverlayDef::isOverlayContrastStyleEnabled
bool isOverlayContrastStyleEnabled() const
Definition: TrVisOverlayDef.h:77
OdGeVector3d::kYAxis
static GE_STATIC_EXPORT const OdGeVector3d kYAxis
Definition: GeVector3d.h:90
OdTrVisOverlayDef::kOBDepthBuffer
@ kOBDepthBuffer
Definition: TrVisOverlayDef.h:41
OdTrVisViewParamsDef::m_correctionMatrix
OdGeMatrix3d m_correctionMatrix
Definition: TrVisOverlayDef.h:117
OdTrVisOverlayDef::setOverlayDirectRenderEnabled
void setOverlayDirectRenderEnabled(bool bSet)
Definition: TrVisOverlayDef.h:70
OdTrVisOverlayDef::isOverlayDepthBufferMergeEnabled
bool isOverlayDepthBufferMergeEnabled() const
Definition: TrVisOverlayDef.h:65
OdGePoint3d::isEqualTo
bool isEqualTo(const OdGePoint3d &point, const OdGeTol &tol=OdGeContext::gTol) const
OdTrVisViewParamsDef::m_lensLength
double m_lensLength
Definition: TrVisOverlayDef.h:127
OdTrVisViewClipped::m_bClipped
bool m_bClipped
Definition: TrVisOverlayDef.h:93
GeMatrix3d.h
OdTrVisViewClipped::set
void set(bool bClipped, double clipDist)
Definition: TrVisOverlayDef.h:97
OdTrVisOverlayDef::isOverlayDirectRenderEnabled
bool isOverlayDirectRenderEnabled() const
Definition: TrVisOverlayDef.h:69
OdTrVisOverlayDef::setOverlayContrastStyleEnabled
void setOverlayContrastStyleEnabled(bool bSet)
Definition: TrVisOverlayDef.h:78
OdTrVisViewParamsDef::m_viewTarget
OdGePoint3d m_viewTarget
Definition: TrVisOverlayDef.h:128
OdTrVisViewParamsDef::m_outputMatrix
OdGeMatrix3d m_outputMatrix
Definition: TrVisOverlayDef.h:118