CFx SDK Documentation 2026 SP0
Loading...
Searching...
No Matches
GsDisplayContext.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2024, 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-2024 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
24#ifndef __OD_GS_DISPLAY_CONTEXT_H_
25#define __OD_GS_DISPLAY_CONTEXT_H_
26
27#include "TD_PackPush.h"
28
29#include "Gs/GsBaseVectorizer.h"
30struct OdSiShape;
32class OdGsEntityNode;
33class OdGsNestedMetafile;
34
36{
37public:
41 virtual ~OdGsBaseContext(){}
42 virtual bool processNestedMetafile(OdGsEntityNode& node, const OdGsNestedMetafile* pMf) { return false; }
43
44 virtual bool isDeviceDisplayOffLayers() const { return false; }
45
46 virtual void increaseXrefLevel(bool /*bFade*/) {}
47
48 virtual const OdSiShape* query() const = 0;
49};
50
52{
53public:
60
68
75 OdGsViewImpl& view() { return m_vectorizer.view(); }
76
83 bool isHighlighted() const { return m_vectorizer.isHighlighted(); }
84
92 void highlight(bool bHighlight, OdUInt32 nSelStyle = 0) { vectorizer().highlight(bHighlight, nSelStyle); }
93
98 OdUInt32 currentSelectionStyle() const { return m_vectorizer.currentSelectionStyle(); }
99
100 void displaySubnode(bool isHighlightedAll, OdGsEntityNode* pSubNode);
101 void displaySubnode(OdGsContainerNode* pCont, OdGsEntityNode* pSubNode, int nHighlightPass = 0);
102
105
109 { return GETBIT(m_status, kDeviceDisableSpatialIdx) || m_vectorizer.isSpatialIndexDisabled(); }
110
115
122 const void *m_pRefId;
123 public:
124 BlockScopesCallback(const OdGsDisplayContext &ctx, const void *pRefId)
125 : m_pBlockScopes(ctx.blockScopesCallback()), m_pRefId(pRefId)
126 { if (m_pBlockScopes) m_pBlockScopes->blockBegin(m_pRefId); }
128 { if (m_pBlockScopes) m_pBlockScopes->blockEnd(m_pRefId); }
129 };
130
132
133 virtual bool processNestedMetafile(OdGsEntityNode& node, const OdGsNestedMetafile* pMf);
134 virtual void increaseXrefLevel(bool bFade);
135
136 bool isDisplayClippingEnabled() const { return m_vectorizer.view().clippingShapes().size() > 0; }
137 unsigned markToSkipMask() const;
138 bool markedToSkip(OdGsEntityNode* pEnt, unsigned markToSkipMask) const;
139 virtual const OdSiShape* query() const ODRX_OVERRIDE { return m_spQuery; }
140
142 {
144 }
145 void setDeviceSuppressHide( bool bSuppress )
146 {
147 SETBIT( m_status, kDeviceSuppressHide, bSuppress );
148 }
149
151 {
153 }
154 void setDisableBlockContent(bool bDisable)
155 {
157 }
159 {
161 }
162 void setDisableBlockAttributes(bool bDisable)
163 {
165 }
166public:
167 const OdSiShape* m_spQuery; //spatial query for displaying of top-level container
168 const OdGsEntityNode* m_node; //reference node being displayed
169 bool m_bPushModelTransform; //fix model to world transformation when playing metafiles for non-shared OdGsBlockReferenceNodes
170
171protected:
172 enum
173 {
174 //NS: probably temporary
183 };
184protected:
189};
190
192class OdGsBlockNode;
194{
195public:
198 virtual bool processNestedMetafile(OdGsEntityNode& node, const OdGsNestedMetafile* pMf);
200 const OdGsView& view() { return m_view; }
203 virtual const OdSiShape* query() const ODRX_OVERRIDE;
204
205protected:
209};
210
213{
214public:
217 m_vect(vect), m_drw(pDrw), m_vis(pVisitor), m_mode(mode){}
218 virtual bool processNestedMetafile(OdGsEntityNode& node, const OdGsNestedMetafile* pMf);
219 //natalias: OdGsBaseContext extended with query() method to provide customization at
220 //OdGsBaseVectorizer-derived class by means of OdGsBaseVectorizer::m_MfPlayQuery
221 virtual const OdSiShape* query() const ODRX_OVERRIDE;
222
223protected:
227 OdGsView::SelectionMode m_mode;
228};
229
230#include "TD_PackPop.h"
231
232#endif // __OD_GS_DISPLAY_CONTEXT_H_
OdSiRecursiveVisitor OdSiSelBaseVisitor
unsigned int OdUInt32
#define ODRX_OVERRIDE
#define SETBIT(flags, bit, value)
Definition OdaDefs.h:516
#define GETBIT(flags, bit)
Definition OdaDefs.h:517
virtual bool isDeviceDisplayOffLayers() const
virtual bool processNestedMetafile(OdGsEntityNode &node, const OdGsNestedMetafile *pMf)
virtual ~OdGsBaseContext()
virtual const OdSiShape * query() const =0
virtual void increaseXrefLevel(bool)
void highlight(bool bHighlight, OdUInt32 nSelStyle=0)
BlockScopesCallback(const OdGsDisplayContext &ctx, const void *pRefId)
OdGsBaseVectorizer::BlockScopesCallback * blockScopesCallback() const
void setDisableBlockContent(bool bDisable)
OdUInt32 currentSelectionStyle() const
bool isBlockAttributesDisabled() const
void displaySubnode(bool isHighlightedAll, OdGsEntityNode *pSubNode)
void highlight(bool bHighlight, OdUInt32 nSelStyle=0)
virtual void increaseXrefLevel(bool bFade)
bool forceDrawOrder() const
virtual bool processNestedMetafile(OdGsEntityNode &node, const OdGsNestedMetafile *pMf)
bool isDeviceDisableNested() const
void setDeviceSuppressHide(bool bSuppress)
void setDisableBlockAttributes(bool bDisable)
bool isDisplayClippingEnabled() const
void setDeviceDisableNested(bool bSet)
OdGsBaseVectorizer & m_vectorizer
bool isHighlighted() const
const OdSiShape * m_spQuery
OdGsDisplayContext(OdGsBaseVectorizer &vectorizer)
void setBlockScopesCallback(OdGsBaseVectorizer::BlockScopesCallback *pBlockScopesCbk)
bool isDeviceDisplayOffLayers() const
OdGsViewImpl & view()
OdGsBaseVectorizer & vectorizer()
void displaySubnode(OdGsContainerNode *pCont, OdGsEntityNode *pSubNode, int nHighlightPass=0)
bool isDeviceSuppressHide() const
virtual const OdSiShape * query() const ODRX_OVERRIDE
OdGsBaseVectorizer::BlockScopesCallback * m_pBlockScopesCbk
bool isDeviceHighlightOptimized() const
const OdGsEntityNode * m_node
bool markedToSkip(OdGsEntityNode *pEnt, unsigned markToSkipMask) const
unsigned markToSkipMask() const
bool isSpatialIndexDisabled() const
bool isBlockContentDisabled() const
OdGiDrawable * m_drw
OdGsView::SelectionMode m_mode
OdGsSelectContext(OdGsBaseVectorizer &vect, OdGiDrawable *pDrw, OdSiSelBaseVisitor *pVisitor, OdGsView::SelectionMode mode)
virtual bool processNestedMetafile(OdGsEntityNode &node, const OdGsNestedMetafile *pMf)
OdSiSelBaseVisitor * m_vis
virtual const OdSiShape * query() const ODRX_OVERRIDE
OdGsBaseVectorizer & m_vect
void applyQuery(OdGsEntityNode &node)
OdSiRecursiveVisitor * m_vis
OdSiRecursiveVisitor * visitor()
OdGsBlockNode * curBlockNode()
const OdGsView & m_view
OdGsBlockNode * m_curBlockNode
virtual bool processNestedMetafile(OdGsEntityNode &node, const OdGsNestedMetafile *pMf)
virtual const OdSiShape * query() const ODRX_OVERRIDE
OdGsSpQueryContext(const OdGsView &view, OdSiRecursiveVisitor *pVisitor)
const OdGsView & view()
Definition Gs.h:141
SelectionMode
Definition Gs.h:174