CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
TrRndLocalRenderer.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// Rendering device local interface
24
25#ifndef ODTRRNDLOCALRENDERER
26#define ODTRRNDLOCALRENDERER
27
28#include "TD_PackPush.h"
29
31
32// Forward declarations
35class OdTrVisCamera;
36
41{
42 public:
43 // Selection
45 {
48 };
50 {
53 };
55 {
56 // Flags related to select() method only
57 kSelOnce = 0x0001, // Select single entity only
58 kSelTop = 0x0002, // Select top entity only
59 kSelLast = 0x0004, // Select last entity only
60 kSelSubEnts = 0x0008, // Enable subentities selection
61 kSelInserts = 0x0010, // Avoid selection of nested metafiles
62 kSelExplGroups = 0x0020, // Explode metafile groups
63 // Flags related to both select() and selectAll() methods
64 kSelEnableHlt = 0x0040, // Highlight metafiles (flag is only to pass into client code)
65 kSelInvertHlt = 0x0080, // Invert metafiles highlighting (flag is only to pass into client code)
66 kSelSkipHlt = 0x0100, // Enable skipping of highlighted/unhighlighted metafiles during selection
67 kSelSkipHltSet = 0x0200 // if kSelSkipHlt enabled this flag represents that highlighted or unhighlighted metafiles should be skipped
68 };
70 {
75
76#define ODTRRND_SI_DEF_FLAG(flagName, getterName, setterName) \
77 bool getterName() const { return GETBIT(m_flags, flagName); } \
78 void setterName(bool bSet) { SETBIT(m_flags, flagName, bSet); }
79 ODTRRND_SI_DEF_FLAG(kSelOnce , isSelectOnce , setSelectOnce);
80 ODTRRND_SI_DEF_FLAG(kSelTop , isSelectTop , setSelectTop);
81 ODTRRND_SI_DEF_FLAG(kSelLast , isSelectLast , setSelectLast);
82 ODTRRND_SI_DEF_FLAG(kSelSubEnts , isSelectSubentities , setSelectSubentities);
83 ODTRRND_SI_DEF_FLAG(kSelInserts , isSelectInsertsOnly , setSelectInsertsOnly);
84 ODTRRND_SI_DEF_FLAG(kSelExplGroups, isSelectGroupsExploded , setSelectGroupsExploded);
85 ODTRRND_SI_DEF_FLAG(kSelEnableHlt , isSelectHighlightingEnabled , setSelectHighlightingEnabled);
86 ODTRRND_SI_DEF_FLAG(kSelInvertHlt , isSelectHighlightingInversionEnabled, setSelectHighlightingInversionEnabled);
87 ODTRRND_SI_DEF_FLAG(kSelSkipHlt , isSelectSkipHighlighted , setSelectSkipHighlighted);
88 ODTRRND_SI_DEF_FLAG(kSelSkipHltSet, selectSkipHighlightedSetting , setSelectSkipHighlightedSetting);
89#undef ODTRRND_SI_DEF_FLAG
90 };
92 {
96 : m_mfId(mfId), m_grId(grId) {}
97 bool hasGroup() const { return (m_grId != kTrVisNullId); }
98 };
100 {
102 const OdTrRndLocalRenderer::SelectionInfo &selectionInfo, const OdTrRndLocalRenderer &renderer) const = 0;
103 };
104 // Viewport borders setup
106 {
107 kVpBorderMS = 0, // ModelSpace viewport
108 kVpBorderMSActive, // Active ModelSpace viewport
109 kVpBorderPS, // ModelSpace viewport inside PaperSpace
110 kVpBorderPSActive, // Active ModelSpace viewport inside PaperSpace
111 kNumVpBorderTypes // Number of types (should be last enumeration member)
112 };
114 {
115 kVpBorderDefault = 0, // Use default viewport setting
116 kVpBorderEnabled, // Enable viewport border override
117 kVpBorderDisabled // Disable viewport border override
118 };
120 {
121 ViewportBorderState m_bEnable; // Enable viewport border
122 ODCOLORREF m_color; // Viewport border color
123 int m_nWidth; // Viewport border line width
124 ViewportBorderProps(ViewportBorderState bEnable = kVpBorderDefault, ODCOLORREF color = ODRGBA(255, 255, 255, 255), int nWidth = 1)
125 : m_bEnable(bEnable)
126 , m_color(color)
127 , m_nWidth(nWidth)
128 { }
129 };
130 public:
132 virtual const OdTrVisRendition *rendition() const = 0;
133
135 virtual const OdTrRndLocalViewer *viewer() const = 0;
136
137 virtual bool detachWindowContext() = 0;
138 virtual void attachWindowContext(OdTrVisRenderClient *pRenderClient) = 0;
139
140 // Data accessors
141
146
148
154
155 virtual OdTrVisOwning getGroupOwner(OdTrVisGroupId groupId) const = 0;
158
159 //virtual long screenWidth() const = 0;
160 //virtual long screenHeight() const = 0;
161
163 {
167 };
168 virtual OdGeMatrix3d coordinateSpaceTransform(OdTrVisViewportId vpId, OdTrVisOverlayId orId, CoordinatesSystem inSpace, CoordinatesSystem toSpace, bool bLocalScreenSpace = false) const = 0;
169
170 // Viewport borders
171
173 virtual void setViewportBorderProps(ViewportBorderType nType, const ViewportBorderProps& props) = 0;
174 virtual bool isActiveViewport(OdTrVisViewportId vpId) const = 0;
175
176 // Draw order modifiers
177
181
186
187 // Selection
188
189 virtual OdUInt32 select(OdTrVisViewportId viewportId, OdTrVisOverlayId overlayId, const OdGsDCRect &selRect,
190 const SelectionInfo &selInfo = SelectionInfo(), SelectionReactor *pSelReactor = NULL) const = 0;
191
192 virtual OdUInt32 selectAll(OdTrVisViewportId vpId, OdTrVisOverlayId overlayId, SelectionReactor *pSelReactor = NULL, OdUInt32 nFlags = 0) = 0;
193
194 // Highlighting
195
196 virtual void highlightMetafile(OdTrVisMetafileId mfId, const SelectionInfo &hltInfo) = 0;
197 virtual void highlightMetafilesGroup(OdTrVisGroupId grId, const SelectionInfo &hltInfo) = 0;
198
199 // Transient drawables manager
200 virtual void setTransientManager(OdTrRndLocalTransientManager *pTransientManager) const = 0;
201 virtual OdTrRndLocalTransientManager *transientManager(bool createIfMissing = true) const = 0;
202};
203
208{
209 public:
210 static void addRef(OdTrRndLocalRenderer* pObj) { if (pObj) pObj->rendition()->addRef(); }
211 static void release(OdTrRndLocalRenderer* pObj) { if (pObj) pObj->rendition()->release(); }
212};
213
217class OdTrRndLocalRendererPtr : public TPtr<OdTrRndLocalRenderer, OdTrRndLocalRendererTPtrAdaptor>
218{
219 public:
224 OdTrRndLocalRendererPtr(const OdTrRndLocalRenderer* pObj, bool bAttach = false)
231};
232
233#include "TD_PackPop.h"
234
235#endif // ODTRRNDLOCALRENDERER
#define ODCOLORREF
Definition: OdPlatform.h:933
#define ODRGBA(r, g, b, a)
Definition: OdPlatform.h:935
unsigned int OdUInt32
const OdTrVisId kTrVisNullId
Definition: TrVisDefs.h:134
virtual void release()=0
virtual void addRef()=0
virtual void prependViewportMetafileOrderElement(OdTrVisViewportId vpId, OdTrVisOverlayId overlayId, OdTrVisMetafileId mfId)=0
virtual OdTrVisOwning getStateBranchOwner(OdTrVisStateBranchId branchId) const =0
virtual void attachWindowContext(OdTrVisRenderClient *pRenderClient)=0
virtual OdTrVisCamera * getCamera(OdTrVisViewportId vpId, OdTrVisOverlayId orId) const =0
virtual const OdGeExtents3d & getOverlayExtents(OdTrVisViewportId vpId, OdTrVisOverlayId orId) const =0
virtual bool detachWindowContext()=0
virtual OdTrVisMetafileContainer * getMetafileData(OdTrVisMetafileId mfId) const =0
virtual OdTrVisOwning getGroupOwner(OdTrVisGroupId groupId) const =0
virtual void setViewportBorderProps(ViewportBorderType nType, const ViewportBorderProps &props)=0
virtual bool isActiveViewport(OdTrVisViewportId vpId) const =0
virtual OdGeMatrix3d coordinateSpaceTransform(OdTrVisViewportId vpId, OdTrVisOverlayId orId, CoordinatesSystem inSpace, CoordinatesSystem toSpace, bool bLocalScreenSpace=false) const =0
virtual OdTrVisOwning getMetafileOwner(OdTrVisMetafileId mfId) const =0
virtual OdTrVisStateBranchId getMetafileVsBranch(OdTrVisMetafileId mfId) const =0
virtual const ViewportBorderProps & getViewportBorderProps(ViewportBorderType nType) const =0
virtual OdUInt32 select(OdTrVisViewportId viewportId, OdTrVisOverlayId overlayId, const OdGsDCRect &selRect, const SelectionInfo &selInfo=SelectionInfo(), SelectionReactor *pSelReactor=NULL) const =0
virtual void setTransientManager(OdTrRndLocalTransientManager *pTransientManager) const =0
virtual OdUInt32 getViewportMetafileOrderLength(OdTrVisViewportId vpId, OdTrVisOverlayId orId) const =0
virtual OdTrVisStateBranchId getGroupHlBranch(OdTrVisGroupId groupId) const =0
virtual OdTrVisMetafileId getViewportMetafileOrderElement(OdTrVisViewportId vpId, OdTrVisOverlayId orId, OdUInt32 nElement) const =0
virtual OdUInt32 findViewportMetafileOrderElement(OdTrVisViewportId vpId, OdTrVisOverlayId orId, OdTrVisMetafileId mfId) const =0
virtual const OdTrRndLocalViewer * viewer() const =0
virtual OdTrVisViewportData * getViewportData(OdTrVisViewportId vpId) const =0
virtual void highlightMetafile(OdTrVisMetafileId mfId, const SelectionInfo &hltInfo)=0
virtual void appendViewportMetafileOrderElement(OdTrVisViewportId vpId, OdTrVisOverlayId overlayId, OdTrVisMetafileId mfId)=0
virtual OdTrVisStateBranchId getMetafileHlBranch(OdTrVisMetafileId mfId) const =0
virtual OdTrVisStateBranchId getNestedStateBranch(OdTrVisStateBranchId branchId, OdTrVisOwning ownerId) const =0
virtual void modifyViewportMetafileOrderElement(OdTrVisViewportId vpId, OdTrVisOverlayId overlayId, OdTrVisMetafileId mfId)=0
virtual OdTrVisStateBranchDef * getStateBranchDef(OdTrVisStateBranchId branchId) const =0
virtual OdTrRndLocalViewer * viewer()=0
virtual OdTrVisRendition * rendition()=0
virtual OdTrRndLocalTransientManager * transientManager(bool createIfMissing=true) const =0
virtual void deleteViewportMetafileOrderElement(OdTrVisViewportId vpId, OdTrVisOverlayId overlayId, OdTrVisMetafileId mfId)=0
virtual const OdTrVisRendition * rendition() const =0
virtual OdTrVisStateBranchId getGroupVsBranch(OdTrVisGroupId groupId) const =0
virtual void highlightMetafilesGroup(OdTrVisGroupId grId, const SelectionInfo &hltInfo)=0
virtual OdUInt32 selectAll(OdTrVisViewportId vpId, OdTrVisOverlayId overlayId, SelectionReactor *pSelReactor=NULL, OdUInt32 nFlags=0)=0
OdTrRndLocalRendererPtr(const OdTrRndLocalRendererPtr &ref)
OdTrRndLocalRendererPtr(const OdTrRndLocalRenderer *pObj, bool bAttach=false)
OdTrRndLocalRendererPtr & operator=(OdTrRndLocalRenderer *pObj)
static void release(OdTrRndLocalRenderer *pObj)
static void addRef(OdTrRndLocalRenderer *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(kSelInserts, isSelectInsertsOnly, setSelectInsertsOnly)
SelectionInfo(SelectionType type, OdUInt32 flags=0)
ODTRRND_SI_DEF_FLAG(kSelSubEnts, isSelectSubentities, setSelectSubentities)
ODTRRND_SI_DEF_FLAG(kSelExplGroups, isSelectGroupsExploded, setSelectGroupsExploded)
ODTRRND_SI_DEF_FLAG(kSelSkipHltSet, selectSkipHighlightedSetting, setSelectSkipHighlightedSetting)
ODTRRND_SI_DEF_FLAG(kSelTop, isSelectTop, setSelectTop)
ODTRRND_SI_DEF_FLAG(kSelOnce, isSelectOnce, setSelectOnce)
ODTRRND_SI_DEF_FLAG(kSelSkipHlt, isSelectSkipHighlighted, setSelectSkipHighlighted)
ODTRRND_SI_DEF_FLAG(kSelEnableHlt, isSelectHighlightingEnabled, setSelectHighlightingEnabled)
ODTRRND_SI_DEF_FLAG(kSelLast, isSelectLast, setSelectLast)
ODTRRND_SI_DEF_FLAG(kSelInvertHlt, isSelectHighlightingInversionEnabled, setSelectHighlightingInversionEnabled)
virtual OdTrRndLocalRenderer::SelectionFeedback selected(OdTrVisViewportId viewportId, OdTrVisOverlayId overlayId, const SelectionResult *pRes, OdUInt32 nInserts, OdTrVisGsMarker selMarker, const OdTrRndLocalRenderer::SelectionInfo &selectionInfo, const OdTrRndLocalRenderer &renderer) const =0
SelectionResult(OdTrVisMetafileId mfId=kTrVisNullId, OdTrVisGroupId grId=kTrVisNullId)
ViewportBorderProps(ViewportBorderState bEnable=kVpBorderDefault, ODCOLORREF color=ODRGBA(255, 255, 255, 255), int nWidth=1)