CFx SDK Documentation  2020SP3
TrRndLocalRenderer.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 local renderer interface
24 
25 #ifndef ODTRGL2LOCALRENDERER
26 #define ODTRGL2LOCALRENDERER
27 
28 #include "TD_PackPush.h"
29 
31 
33 class OdTrVisCamera;
34 
39 {
40  public:
41  // Selection
43  {
46  };
48  {
50  kSelBreak
51  };
53  {
54  // Flags related to select() method only
55  kSelOnce = 0x0001, // Select single entity only
56  kSelTop = 0x0002, // Select top entity only
57  kSelLast = 0x0004, // Select last entity only
58  kSelSubEnts = 0x0008, // Enable subentities selection
59  kSelInserts = 0x0010, // Avoid selection of nested metafiles
60  // Flags related to both select() and selectAll() methods
61  kSelEnableHlt = 0x0020, // Highlight metafiles (flag is only to pass into client code)
62  kSelInvertHlt = 0x0040, // Invert metafiles highlighting (flag is only to pass into client code)
63  kSelSkipHlt = 0x0080, // Enable skipping of highlighted/unhighlighted metafiles during selection
64  kSelSkipHltSet = 0x0100 // if kSelSkipHlt enabled this flag represents that highlighted or unhighlighted metafiles should be skipped
65  };
67  {
72 
73 #define ODTRRND_SI_DEF_FLAG(flagName, getterName, setterName) \
74  bool getterName() const { return GETBIT(m_flags, flagName); } \
75  void setterName(bool bSet) { SETBIT(m_flags, flagName, bSet); }
76  ODTRRND_SI_DEF_FLAG(kSelOnce , isSelectOnce , setSelectOnce);
77  ODTRRND_SI_DEF_FLAG(kSelTop , isSelectTop , setSelectTop);
78  ODTRRND_SI_DEF_FLAG(kSelLast , isSelectLast , setSelectLast);
79  ODTRRND_SI_DEF_FLAG(kSelSubEnts , isSelectSubentities , setSelectSubentities);
80  ODTRRND_SI_DEF_FLAG(kSelInserts , isSelectInsertsOnly , setSelectInsertsOnly);
81  ODTRRND_SI_DEF_FLAG(kSelEnableHlt , isSelectHighlightingEnabled , setSelectHighlightingEnabled);
82  ODTRRND_SI_DEF_FLAG(kSelInvertHlt , isSelectHighlightingInversionEnabled, setSelectHighlightingInversionEnabled);
83  ODTRRND_SI_DEF_FLAG(kSelSkipHlt , isSelectSkipHighlighted , setSelectSkipHighlighted);
84  ODTRRND_SI_DEF_FLAG(kSelSkipHltSet, selectSkipHighlightedSetting , setSelectSkipHighlightedSetting);
85 #undef ODTRRND_SI_DEF_FLAG
86  };
88  {
90  const OdTrGL2LocalRenderer::SelectionInfo &selectionInfo, const OdTrGL2LocalRenderer &renderer) const = 0;
91  };
92  // Viewport borders setup
94  {
95  kVpBorderMS = 0, // ModelSpace viewport
96  kVpBorderMSActive, // Active ModelSpace viewport
97  kVpBorderPS, // ModelSpace viewport inside PaperSpace
98  kVpBorderPSActive, // Active ModelSpace viewport inside PaperSpace
99  kNumVpBorderTypes // Number of types (should be last enumeration member)
100  };
102  {
103  kVpBorderDefault = 0, // Use default viewport setting
104  kVpBorderEnabled, // Enable viewport border override
105  kVpBorderDisabled // Disable viewport border override
106  };
108  {
109  ViewportBorderState m_bEnable; // Enable viewport border
110  ODCOLORREF m_color; // Viewport border color
111  int m_nWidth; // Viewport border line width
112  ViewportBorderProps(ViewportBorderState bEnable = kVpBorderDefault, ODCOLORREF color = ODRGBA(255, 255, 255, 255), int nWidth = 1)
113  : m_bEnable(bEnable)
114  , m_color(color)
115  , m_nWidth(nWidth)
116  { }
117  };
118  public:
119  virtual OdTrVisRendition *rendition() = 0;
120  virtual const OdTrVisRendition *rendition() const = 0;
121 
122  // Data accessors
123 
127 
129 
132  virtual OdTrVisHlBranchId getNestedHlBranch(OdTrVisHlBranchId hlId, OdDbStub *pOwner) const = 0;
133 
134  //virtual long screenWidth() const = 0;
135  //virtual long screenHeight() const = 0;
136 
138  {
142  };
143  virtual OdGeMatrix3d coordinateSpaceTransform(OdTrVisViewportId vpId, OdTrVisOverlayId orId, CoordinatesSystem inSpace, CoordinatesSystem toSpace, bool bLocalScreenSpace = false) const = 0;
144 
145  // Viewport borders
146 
148  virtual void setViewportBorderProps(ViewportBorderType nType, const ViewportBorderProps& props) = 0;
149  virtual bool isActiveViewport(OdTrVisViewportId vpId) const = 0;
150 
151  // Draw order modifiers
152 
156 
161 
162  // Selection
163 
164  virtual OdUInt32 select(OdTrVisViewportId viewportId, OdTrVisOverlayId overlayId, const OdGsDCRect &selRect,
165  const SelectionInfo &selInfo = SelectionInfo(), SelectionReactor *pSelReactor = NULL) const = 0;
166 
167  virtual OdUInt32 selectAll(OdTrVisViewportId vpId, OdTrVisOverlayId overlayId, SelectionReactor *pSelReactor = NULL, OdUInt32 nFlags = 0) = 0;
168 
169  // Transient drawables manager
170  virtual void setTransientManager(OdTrRndLocalTransientManager *pTransientManager) const = 0;
171  virtual OdTrRndLocalTransientManager *transientManager(bool createIfMissing = true) const = 0;
172 
173  // Support for render abort functionality
174  //virtual void enableRenderAbortHandler(bool bEnable) = 0;
175  //virtual bool isRenderAbortHandlerEnabled() const = 0;
176  //virtual void setRenderAbortFlag(bool bAbort = true) = 0;
177  //virtual bool isRenderAbortFlagSet() const = 0;
178 };
179 
184 {
185  public:
186  static void addRef(OdTrGL2LocalRenderer* pObj) { if (pObj) pObj->rendition()->addRef(); }
187  static void release(OdTrGL2LocalRenderer* pObj) { if (pObj) pObj->rendition()->release(); }
188 };
189 
193 class OdTrGL2LocalRendererPtr : public TPtr<OdTrGL2LocalRenderer, OdTrGL2LocalRendererTPtrAdaptor>
194 {
195  public:
200  OdTrGL2LocalRendererPtr(const OdTrGL2LocalRenderer* pObj, bool bAttach = false)
210 };
211 
212 #include "TD_PackPop.h"
213 
214 #endif // ODTRGL2LOCALRENDERER
OdTrGL2LocalRenderer::kSelLast
@ kSelLast
Definition: TrRndLocalRenderer.h:57
OdTrGL2LocalRenderer::deleteViewportMetafileOrderElement
virtual void deleteViewportMetafileOrderElement(OdTrVisViewportId vpId, OdTrVisOverlayId overlayId, OdTrVisMetafileId mfId)=0
OdTrGL2LocalRenderer::rendition
virtual const OdTrVisRendition * rendition() const =0
OdTrGL2LocalRendererPtr::OdTrGL2LocalRendererPtr
OdTrGL2LocalRendererPtr(const OdTrGL2LocalRenderer *pObj, bool bAttach=false)
Definition: TrRndLocalRenderer.h:200
OdTrGL2LocalRenderer::ViewportBorderProps::m_color
ODCOLORREF m_color
Definition: TrRndLocalRenderer.h:110
NULL
#define NULL
Definition: GsProperties.h:177
OdTrGL2LocalRenderer::SelectionInfo::ODTRRND_SI_DEF_FLAG
ODTRRND_SI_DEF_FLAG(kSelSubEnts, isSelectSubentities, setSelectSubentities)
OdTrGL2LocalRenderer::ViewportBorderType
ViewportBorderType
Definition: TrRndLocalRenderer.h:94
OdTrGL2LocalRenditionClient
Definition: TrGL2LocalRenditionHost.h:81
TPtr::operator=
TPtr & operator=(TObj *pObj)
Definition: TPtr.h:103
OdTrGL2LocalRenderer::SelectionInfo::ODTRRND_SI_DEF_FLAG
ODTRRND_SI_DEF_FLAG(kSelTop, isSelectTop, setSelectTop)
OdTrGL2LocalRenderer::rendition
virtual OdTrVisRendition * rendition()=0
OdTrVisMetafileContainer
Definition: TrVisMetafileDef.h:50
OdTrGL2LocalRenderer::SelectionInfo::SelectionInfo
SelectionInfo(SelectionType type, OdUInt32 flags=0)
Definition: TrRndLocalRenderer.h:71
OdTrGL2LocalRenderer::kEyeSpace
@ kEyeSpace
Definition: TrRndLocalRenderer.h:140
type
GLuint GLsizei GLsizei GLint GLenum * type
Definition: gles2_ext.h:274
TrGL2LocalRenditionHost.h
OdTrGL2LocalRenderer
Definition: TrRndLocalRenderer.h:39
OdTrGL2LocalRenderer::kSelSkipHlt
@ kSelSkipHlt
Definition: TrRndLocalRenderer.h:63
OdTrGL2LocalRenderer::kSelContinue
@ kSelContinue
Definition: TrRndLocalRenderer.h:49
OdGsDCRect
Definition: GsDefs.h:111
OdTrGL2LocalRendererPtr
Definition: TrRndLocalRenderer.h:194
OdTrGL2LocalRenderer::prependViewportMetafileOrderElement
virtual void prependViewportMetafileOrderElement(OdTrVisViewportId vpId, OdTrVisOverlayId overlayId, OdTrVisMetafileId mfId)=0
OdTrVisViewportDef
Definition: TrVisViewportDef.h:42
OdTrGL2LocalRenderer::kWorldSpace
@ kWorldSpace
Definition: TrRndLocalRenderer.h:141
OdTrGL2LocalRenderer::SelectionInfo::m_type
SelectionType m_type
Definition: TrRndLocalRenderer.h:68
TD_PackPop.h
OdTrGL2LocalRenderer::getMetafileData
virtual OdTrVisMetafileContainer * getMetafileData(OdTrVisMetafileId mfId) const =0
OdTrGL2LocalRenderer::coordinateSpaceTransform
virtual OdGeMatrix3d coordinateSpaceTransform(OdTrVisViewportId vpId, OdTrVisOverlayId orId, CoordinatesSystem inSpace, CoordinatesSystem toSpace, bool bLocalScreenSpace=false) const =0
OdTrGL2LocalRenderer::kSelWindow
@ kSelWindow
Definition: TrRndLocalRenderer.h:45
OdTrGL2LocalRenderer::SelectionInfo::m_flags
OdUInt32 m_flags
Definition: TrRndLocalRenderer.h:69
OdTrGL2LocalRenderer::modifyViewportMetafileOrderElement
virtual void modifyViewportMetafileOrderElement(OdTrVisViewportId vpId, OdTrVisOverlayId overlayId, OdTrVisMetafileId mfId)=0
OdUInt32
unsigned int OdUInt32
Definition: OdPlatformSettings.h:783
OdGeMatrix3d
Definition: GeMatrix3d.h:73
OdTrGL2LocalRenderer::SelectionInfo::ODTRRND_SI_DEF_FLAG
ODTRRND_SI_DEF_FLAG(kSelSkipHltSet, selectSkipHighlightedSetting, setSelectSkipHighlightedSetting)
OdTrGL2LocalRenderer::SelectionFlags
SelectionFlags
Definition: TrRndLocalRenderer.h:53
OdTrGL2LocalRendererTPtrAdaptor::addRef
static void addRef(OdTrGL2LocalRenderer *pObj)
Definition: TrRndLocalRenderer.h:186
OdTrGL2LocalRenderer::SelectionReactor::selected
virtual OdTrGL2LocalRenderer::SelectionFeedback selected(OdTrVisViewportId viewportId, OdTrVisOverlayId overlayId, OdTrVisMetafileId *mfId, OdUInt32 nInserts, OdTrVisGsMarker selMarker, const OdTrGL2LocalRenderer::SelectionInfo &selectionInfo, const OdTrGL2LocalRenderer &renderer) const =0
OdTrGL2LocalRenderer::getOverlayExtents
virtual const OdGeExtents3d & getOverlayExtents(OdTrVisViewportId vpId, OdTrVisOverlayId orId) const =0
ref
GLenum GLint ref
Definition: gles2_ext.h:262
OdTrGL2LocalRenderer::CoordinatesSystem
CoordinatesSystem
Definition: TrRndLocalRenderer.h:138
OdTrGL2LocalRenderer::kVpBorderDefault
@ kVpBorderDefault
Definition: TrRndLocalRenderer.h:103
OdTrGL2LocalRenderer::kVpBorderMSActive
@ kVpBorderMSActive
Definition: TrRndLocalRenderer.h:96
OdTrGL2LocalRenderer::kNumVpBorderTypes
@ kNumVpBorderTypes
Definition: TrRndLocalRenderer.h:99
OdTrGL2LocalRenderer::SelectionInfo::ODTRRND_SI_DEF_FLAG
ODTRRND_SI_DEF_FLAG(kSelEnableHlt, isSelectHighlightingEnabled, setSelectHighlightingEnabled)
OdTrGL2LocalRenderer::kVpBorderEnabled
@ kVpBorderEnabled
Definition: TrRndLocalRenderer.h:104
OdTrGL2LocalRendererPtr::operator=
OdTrGL2LocalRendererPtr & operator=(OdTrGL2LocalRenderer *pObj)
Definition: TrRndLocalRenderer.h:203
OdTrGL2LocalRenderer::SelectionInfo::ODTRRND_SI_DEF_FLAG
ODTRRND_SI_DEF_FLAG(kSelLast, isSelectLast, setSelectLast)
OdTrGL2LocalRenderer::kSelEnableHlt
@ kSelEnableHlt
Definition: TrRndLocalRenderer.h:61
OdTrGL2LocalRenderer::kSelInserts
@ kSelInserts
Definition: TrRndLocalRenderer.h:59
OdTrGL2LocalRenderer::kVpBorderPS
@ kVpBorderPS
Definition: TrRndLocalRenderer.h:97
OdTrGL2LocalRendererPtr::OdTrGL2LocalRendererPtr
OdTrGL2LocalRendererPtr(const OdTrGL2LocalRendererPtr &ref)
Definition: TrRndLocalRenderer.h:198
OdTrGL2LocalRenderer::setViewportBorderProps
virtual void setViewportBorderProps(ViewportBorderType nType, const ViewportBorderProps &props)=0
OdTrGL2LocalRenderer::kSelOnce
@ kSelOnce
Definition: TrRndLocalRenderer.h:55
OdTrGL2LocalRenderer::setTransientManager
virtual void setTransientManager(OdTrRndLocalTransientManager *pTransientManager) const =0
OdTrGL2LocalRenderer::getViewportDef
virtual OdTrVisViewportDef * getViewportDef(OdTrVisViewportId vpId) const =0
OdTrGL2LocalRenderer::transientManager
virtual OdTrRndLocalTransientManager * transientManager(bool createIfMissing=true) const =0
OdTrGL2LocalRenderer::kSelCrossing
@ kSelCrossing
Definition: TrRndLocalRenderer.h:44
OdTrGL2LocalRendererTPtrAdaptor::release
static void release(OdTrGL2LocalRenderer *pObj)
Definition: TrRndLocalRenderer.h:187
OdTrGL2LocalRenderer::appendViewportMetafileOrderElement
virtual void appendViewportMetafileOrderElement(OdTrVisViewportId vpId, OdTrVisOverlayId overlayId, OdTrVisMetafileId mfId)=0
OdTrGL2LocalRenderer::SelectionInfo::ODTRRND_SI_DEF_FLAG
ODTRRND_SI_DEF_FLAG(kSelOnce, isSelectOnce, setSelectOnce)
OdTrVisCamera
Definition: TrVisCamera.h:37
TD_PackPush.h
OdTrGL2LocalRenderer::getViewportBorderProps
virtual const ViewportBorderProps & getViewportBorderProps(ViewportBorderType nType) const =0
OdTrGL2LocalRenderer::ViewportBorderState
ViewportBorderState
Definition: TrRndLocalRenderer.h:102
OdTrGL2LocalRenderer::SelectionReactor
Definition: TrRndLocalRenderer.h:88
OdTrGL2LocalRenderer::getCamera
virtual OdTrVisCamera * getCamera(OdTrVisViewportId vpId, OdTrVisOverlayId orId) const =0
OdTrGL2LocalRenderer::kScreenSpace
@ kScreenSpace
Definition: TrRndLocalRenderer.h:139
OdTrGL2LocalRenderer::selectAll
virtual OdUInt32 selectAll(OdTrVisViewportId vpId, OdTrVisOverlayId overlayId, SelectionReactor *pSelReactor=NULL, OdUInt32 nFlags=0)=0
OdTrGL2LocalRenderer::kSelSkipHltSet
@ kSelSkipHltSet
Definition: TrRndLocalRenderer.h:64
OdRxObject::release
virtual void release()=0
OdTrGL2LocalRenderer::getMetafileHlBranch
virtual OdTrVisHlBranchId getMetafileHlBranch(OdTrVisMetafileId mfId) const =0
OdTrGL2LocalRenderer::kSelBreak
@ kSelBreak
Definition: TrRndLocalRenderer.h:50
TPtr
Definition: TPtr.h:76
OdTrGL2LocalRenderer::SelectionFeedback
SelectionFeedback
Definition: TrRndLocalRenderer.h:48
OdTrGL2LocalRenderer::getViewportMetafileOrderElement
virtual OdTrVisMetafileId getViewportMetafileOrderElement(OdTrVisViewportId vpId, OdTrVisOverlayId orId, OdUInt32 nElement) const =0
OdTrGL2LocalRenderer::ViewportBorderProps::m_nWidth
int m_nWidth
Definition: TrRndLocalRenderer.h:111
OdTrGL2LocalRenderer::getHlBranchDef
virtual OdTrVisHlBranchDef * getHlBranchDef(OdTrVisHlBranchId hlId) const =0
OdTrGL2LocalRenderer::ViewportBorderProps::m_bEnable
ViewportBorderState m_bEnable
Definition: TrRndLocalRenderer.h:109
OdTrVisRendition
Definition: TrVisRendition.h:61
OdGeExtents3d
Definition: GeExtents3d.h:45
OdTrGL2LocalRenderer::SelectionInfo::ODTRRND_SI_DEF_FLAG
ODTRRND_SI_DEF_FLAG(kSelInvertHlt, isSelectHighlightingInversionEnabled, setSelectHighlightingInversionEnabled)
OdTrGL2LocalRenderer::kSelTop
@ kSelTop
Definition: TrRndLocalRenderer.h:56
OdTrGL2LocalRenderer::kSelInvertHlt
@ kSelInvertHlt
Definition: TrRndLocalRenderer.h:62
OdTrGL2LocalRendererTPtrAdaptor
Definition: TrRndLocalRenderer.h:184
OdTrGL2LocalRenderer::ViewportBorderProps::ViewportBorderProps
ViewportBorderProps(ViewportBorderState bEnable=kVpBorderDefault, ODCOLORREF color=ODRGBA(255, 255, 255, 255), int nWidth=1)
Definition: TrRndLocalRenderer.h:112
ODRGBA
#define ODRGBA(r, g, b, a)
Definition: OdPlatform.h:885
OdRxObject::addRef
virtual void addRef()=0
ODCOLORREF
#define ODCOLORREF
Definition: OdPlatform.h:883
OdTrGL2LocalRenderer::SelectionType
SelectionType
Definition: TrRndLocalRenderer.h:43
OdTrGL2LocalRenderer::kVpBorderMS
@ kVpBorderMS
Definition: TrRndLocalRenderer.h:95
OdTrGL2LocalRenderer::getViewportMetafileOrderLength
virtual OdUInt32 getViewportMetafileOrderLength(OdTrVisViewportId vpId, OdTrVisOverlayId orId) const =0
OdTrGL2LocalRenderer::isActiveViewport
virtual bool isActiveViewport(OdTrVisViewportId vpId) const =0
OdTrGL2LocalRenderer::kVpBorderDisabled
@ kVpBorderDisabled
Definition: TrRndLocalRenderer.h:105
OdTrGL2LocalRendererPtr::create
OdTrGL2LocalRendererPtr & create(OdTrGL2LocalRenditionClient *pClient)
OdTrGL2LocalRenderer::findViewportMetafileOrderElement
virtual OdUInt32 findViewportMetafileOrderElement(OdTrVisViewportId vpId, OdTrVisOverlayId orId, OdTrVisMetafileId mfId) const =0
OdTrGL2LocalRenderer::getNestedHlBranch
virtual OdTrVisHlBranchId getNestedHlBranch(OdTrVisHlBranchId hlId, OdDbStub *pOwner) const =0
OdTrGL2LocalRenderer::ViewportBorderProps
Definition: TrRndLocalRenderer.h:108
OdTrGL2LocalRenderer::SelectionInfo::SelectionInfo
SelectionInfo()
Definition: TrRndLocalRenderer.h:70
OdTrVisHlBranchDef
Definition: TrVisHlBranchDef.h:37
OdTrGL2LocalRenderer::select
virtual OdUInt32 select(OdTrVisViewportId viewportId, OdTrVisOverlayId overlayId, const OdGsDCRect &selRect, const SelectionInfo &selInfo=SelectionInfo(), SelectionReactor *pSelReactor=NULL) const =0
OdTrGL2LocalRendererPtr::OdTrGL2LocalRendererPtr
OdTrGL2LocalRendererPtr(const OdTrVisRendition *pRendition)
OdTrGL2LocalRendererPtr::OdTrGL2LocalRendererPtr
OdTrGL2LocalRendererPtr()
Definition: TrRndLocalRenderer.h:196
OdTrRndLocalTransientManager
Definition: TrGL2LocalTransient.h:93
OdTrGL2LocalRendererPtr::release
void release()
Definition: TrRndLocalRenderer.h:208
OdTrGL2LocalRenderer::kVpBorderPSActive
@ kVpBorderPSActive
Definition: TrRndLocalRenderer.h:98
OdTrGL2LocalRenderer::SelectionInfo
Definition: TrRndLocalRenderer.h:67
OdTrGL2LocalRenderer::SelectionInfo::ODTRRND_SI_DEF_FLAG
ODTRRND_SI_DEF_FLAG(kSelInserts, isSelectInsertsOnly, setSelectInsertsOnly)
OdTrGL2LocalRenderer::SelectionInfo::ODTRRND_SI_DEF_FLAG
ODTRRND_SI_DEF_FLAG(kSelSkipHlt, isSelectSkipHighlighted, setSelectSkipHighlighted)
OdTrGL2LocalRenderer::kSelSubEnts
@ kSelSubEnts
Definition: TrRndLocalRenderer.h:58
OdUInt64
Definition: Int64.h:137