CFx SDK Documentation  2022 SP0
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
#define NULL
Definition: GsProperties.h:177
#define ODCOLORREF
Definition: OdPlatform.h:883
#define ODRGBA(r, g, b, a)
Definition: OdPlatform.h:885
unsigned int OdUInt32
virtual void release()=0
virtual void addRef()=0
virtual OdTrVisRendition * rendition()=0
virtual OdTrVisHlBranchDef * getHlBranchDef(OdTrVisHlBranchId hlId) const =0
virtual OdUInt32 selectAll(OdTrVisViewportId vpId, OdTrVisOverlayId overlayId, SelectionReactor *pSelReactor=NULL, OdUInt32 nFlags=0)=0
virtual void setViewportBorderProps(ViewportBorderType nType, const ViewportBorderProps &props)=0
virtual bool isActiveViewport(OdTrVisViewportId vpId) const =0
virtual OdTrVisViewportDef * getViewportDef(OdTrVisViewportId vpId) const =0
virtual OdTrVisHlBranchId getNestedHlBranch(OdTrVisHlBranchId hlId, OdDbStub *pOwner) const =0
virtual OdUInt32 findViewportMetafileOrderElement(OdTrVisViewportId vpId, OdTrVisOverlayId orId, OdTrVisMetafileId mfId) const =0
virtual OdTrVisMetafileId getViewportMetafileOrderElement(OdTrVisViewportId vpId, OdTrVisOverlayId orId, OdUInt32 nElement) const =0
virtual void modifyViewportMetafileOrderElement(OdTrVisViewportId vpId, OdTrVisOverlayId overlayId, OdTrVisMetafileId mfId)=0
virtual OdTrRndLocalTransientManager * transientManager(bool createIfMissing=true) const =0
virtual OdTrVisHlBranchId getMetafileHlBranch(OdTrVisMetafileId mfId) const =0
virtual void setTransientManager(OdTrRndLocalTransientManager *pTransientManager) const =0
virtual const OdTrVisRendition * rendition() const =0
virtual void appendViewportMetafileOrderElement(OdTrVisViewportId vpId, OdTrVisOverlayId overlayId, OdTrVisMetafileId mfId)=0
virtual OdUInt32 getViewportMetafileOrderLength(OdTrVisViewportId vpId, OdTrVisOverlayId orId) const =0
virtual void prependViewportMetafileOrderElement(OdTrVisViewportId vpId, OdTrVisOverlayId overlayId, OdTrVisMetafileId mfId)=0
virtual OdUInt32 select(OdTrVisViewportId viewportId, OdTrVisOverlayId overlayId, const OdGsDCRect &selRect, const SelectionInfo &selInfo=SelectionInfo(), SelectionReactor *pSelReactor=NULL) const =0
virtual OdGeMatrix3d coordinateSpaceTransform(OdTrVisViewportId vpId, OdTrVisOverlayId orId, CoordinatesSystem inSpace, CoordinatesSystem toSpace, bool bLocalScreenSpace=false) const =0
virtual OdTrVisCamera * getCamera(OdTrVisViewportId vpId, OdTrVisOverlayId orId) const =0
virtual const OdGeExtents3d & getOverlayExtents(OdTrVisViewportId vpId, OdTrVisOverlayId orId) const =0
virtual const ViewportBorderProps & getViewportBorderProps(ViewportBorderType nType) const =0
virtual OdTrVisMetafileContainer * getMetafileData(OdTrVisMetafileId mfId) const =0
virtual void deleteViewportMetafileOrderElement(OdTrVisViewportId vpId, OdTrVisOverlayId overlayId, OdTrVisMetafileId mfId)=0
OdTrGL2LocalRendererPtr & create(OdTrGL2LocalRenditionClient *pClient)
OdTrGL2LocalRendererPtr(const OdTrGL2LocalRendererPtr &ref)
OdTrGL2LocalRendererPtr(const OdTrVisRendition *pRendition)
OdTrGL2LocalRendererPtr & operator=(OdTrGL2LocalRenderer *pObj)
OdTrGL2LocalRendererPtr(const OdTrGL2LocalRenderer *pObj, bool bAttach=false)
static void addRef(OdTrGL2LocalRenderer *pObj)
static void release(OdTrGL2LocalRenderer *pObj)
Definition: TPtr.h:76
TPtr & operator=(TObj *pObj)
Definition: TPtr.h:103
GLenum GLint ref
Definition: gles2_ext.h:262
GLuint GLsizei GLsizei GLint GLenum * type
Definition: gles2_ext.h:274
ODTRRND_SI_DEF_FLAG(kSelSkipHlt, isSelectSkipHighlighted, setSelectSkipHighlighted)
ODTRRND_SI_DEF_FLAG(kSelInserts, isSelectInsertsOnly, setSelectInsertsOnly)
ODTRRND_SI_DEF_FLAG(kSelEnableHlt, isSelectHighlightingEnabled, setSelectHighlightingEnabled)
ODTRRND_SI_DEF_FLAG(kSelInvertHlt, isSelectHighlightingInversionEnabled, setSelectHighlightingInversionEnabled)
ODTRRND_SI_DEF_FLAG(kSelLast, isSelectLast, setSelectLast)
ODTRRND_SI_DEF_FLAG(kSelOnce, isSelectOnce, setSelectOnce)
SelectionInfo(SelectionType type, OdUInt32 flags=0)
ODTRRND_SI_DEF_FLAG(kSelSubEnts, isSelectSubentities, setSelectSubentities)
ODTRRND_SI_DEF_FLAG(kSelTop, isSelectTop, setSelectTop)
ODTRRND_SI_DEF_FLAG(kSelSkipHltSet, selectSkipHighlightedSetting, setSelectSkipHighlightedSetting)
virtual OdTrGL2LocalRenderer::SelectionFeedback selected(OdTrVisViewportId viewportId, OdTrVisOverlayId overlayId, OdTrVisMetafileId *mfId, OdUInt32 nInserts, OdTrVisGsMarker selMarker, const OdTrGL2LocalRenderer::SelectionInfo &selectionInfo, const OdTrGL2LocalRenderer &renderer) const =0
ViewportBorderProps(ViewportBorderState bEnable=kVpBorderDefault, ODCOLORREF color=ODRGBA(255, 255, 255, 255), int nWidth=1)