CFx SDK Documentation  2022 SP0
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
false
Definition: DimVarDefs.h:165
short OdInt16
unsigned short OdUInt16
#define SETBIT(flags, bit, value)
Definition: OdaDefs.h:497
#define GETBIT(flags, bit)
Definition: OdaDefs.h:498
OdGeMatrix3d & setToIdentity()
bool isEqualTo(const OdGePoint3d &point, const OdGeTol &tol=OdGeContext::gTol) const
static GE_STATIC_EXPORT const OdGePoint3d kOrigin
Definition: GePoint3d.h:89
static GE_STATIC_EXPORT const OdGeVector3d kZAxis
Definition: GeVector3d.h:91
bool isEqualTo(const OdGeVector3d &vect, const OdGeTol &tol=OdGeContext::gTol) const
static GE_STATIC_EXPORT const OdGeVector3d kYAxis
Definition: GeVector3d.h:90
static GE_STATIC_EXPORT const OdGeVector3d kXAxis
Definition: GeVector3d.h:89
bool isOverlayDirectRenderEnabled() const
bool isOverlayHighlightingEnabled() const
bool isOverlayEnabled() const
void setOverlayDepthBufferEnabled(bool bSet)
bool isOverlayDepthBufferMergeEnabled() const
void setOverlayContrastStyleEnabled(bool bSet)
void setOverlayDepthBufferMergeEnabled(bool bSet)
void resetOverlayFlags(OdUInt16 overlayFlags=0)
void setOverlayEnabled(bool bSet)
void setOverlayDirectRenderEnabled(bool bSet)
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
void set(bool bClipped, double clipDist)
OdTrVisViewClipped m_frontClip
OdGeMatrix3d m_outputMatrix
bool isCumulative(const OdTrVisViewParamsDef &secParams) const
OdGeMatrix3d m_viewingMatrix
OdTrVisViewClipped m_backClip
OdGeMatrix3d m_correctionMatrix
OdGeVector3d m_viewBasis[3]
OdGeMatrix3d m_projectionMatrix
OdGeMatrix3d m_screenMatrix
OdGePoint3d m_viewPosition
OdGeMatrix3d m_metafileMatrix