CFx SDK Documentation  2020SP3
GsModel.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 
24 #ifndef __ODGSMODEL_H_INCLUDED_
25 #define __ODGSMODEL_H_INCLUDED_
26 
27 #include "Gs/Gs.h"
28 
29 class OdGiPathNode;
30 
31 #include "TD_PackPush.h"
32 
40 {
41 public:
43 
47  virtual OdGsModel* model() const = 0;
48 
52  virtual void setDrawableNull() = 0;
53 
62  virtual bool extents(OdGeExtents3d& extents) const = 0;
63 };
64 
65 typedef OdGiDrawablePtr (*OdGiOpenDrawableFn)(OdDbStub* id);
66 
67 class OdGsModelReactor;
68 
77 {
78 public:
80 
86  virtual void setOpenDrawableFn(OdGiOpenDrawableFn openDrawableFn) = 0;
87 
94  virtual void onAdded(OdGiDrawable* pAdded, OdGiDrawable* pParent) = 0;
95 
102  virtual void onAdded(OdGiDrawable* pAdded, OdDbStub* parentID) = 0;
103 
110  virtual void onModified(OdGiDrawable* pModified, OdGiDrawable* pParent) = 0;
111 
118  virtual void onModified(OdGiDrawable* pModified, OdDbStub* parentID) = 0;
119 
126  virtual void onErased(OdGiDrawable* pErased, OdGiDrawable* pParent) = 0;
127 
134  virtual void onErased(OdGiDrawable* pErased, OdDbStub* parentID) = 0;
135 
142  virtual void onUnerased(OdGiDrawable* pUnerased, OdGiDrawable* pParent);
143 
150  virtual void onUnerased(OdGiDrawable* pUnerased, OdDbStub* parentID);
151 
152  // Invalidation Hint
153 
159  {
160  kInvalidateIsolines = 0, // Invalidate isolines
161  kInvalidateViewportCache = 1, // Invalidate viewport cache
162  kInvalidateAll = 2, // Invalidate all caches
163  kInvalidateMaterials = 3, // Invalidate materials
164  kInvalidateLinetypes = 4 // Invalidate all linetype caches
165  };
166 
184  virtual void invalidate(InvalidationHint hint) = 0;
185 
191  virtual void invalidate(OdGsView* pView) = 0;
192 
198  virtual void invalidateVisible( OdGsDevice* pDevice ) = 0;
199 
205  virtual void setTransform(const OdGeMatrix3d&) = 0;
206 
210  virtual OdGeMatrix3d transform() const = 0;
211 
219  virtual void highlight(const OdGiPathNode& path, bool bDoIt = true, const OdGsView* pView = 0) = 0;
220 
225  {
226  kMinRenderType = -3, // Number of RenderType's in negative values range
227  kUserBg1 = -3, // User-defined background rendering type without Z-buffer
228  kUserBg2 = -2, // User-defined background rendering type with own Z-buffer
229  kUserBg3 = -1, // User-defined background rendering type with Z-buffer
230  kMain = 0, // Use main Z-buffer
231  kSprite, // Use alternate Z-buffer (for sprites)
232  kDirect, // Render on device directly
233  kHighlight, // Render on device directly (skipping frame buffer and Z-buffer)
234  kHighlightSelection, // Render on device directly using highlighting style (skipping frame buffer and Z-buffer)
235  kDirectTopmost, // Render on top of all other render types without Z-buffer
236  kContrast, // Render with contrast style
237  kCount, // Number of primary predefined RenderType's
238  kUserFg1 = kCount, // User-defined foreground rendering type with Z-buffer
239  kUserFg2, // User-defined foreground rendering type with own Z-buffer
240  kUserFg3, // Second user-defined foreground rendering type without Z-buffer
241  kMaxRenderType, // Number of RenderType's in positive values range
242  kNumRenderTypes = kMaxRenderType - kMinRenderType // Exact number of RenderType's including predefined and user-defined RenderType's
243  };
244 
250  virtual void setRenderType(RenderType renderType) = 0;
251 
255  virtual RenderType renderType() const = 0;
256 
257  //virtual bool addSceneGraphRoot(OdGiDrawable* pRoot) = 0;
258  //virtual bool eraseSceneGraphRoot(OdGiDrawable* pRoot) = 0;
259 
269 
276  virtual void setViewClippingOverride(bool bEnable) = 0;
277 
283  virtual void setBackground(OdDbStub *backgroundId) = 0;
284 
288  virtual OdDbStub *background() const = 0;
289 
301  virtual void setVisualStyle(OdDbStub *visualStyleId) = 0;
302 
306  virtual OdDbStub *visualStyle() const = 0;
307 
315  virtual void setVisualStyle(const OdGiVisualStyle &visualStyle) = 0;
316 
324  virtual bool visualStyle(OdGiVisualStyle &visualStyle) const = 0;
325 
331  virtual void addModelReactor(OdGsModelReactor *pReactor) = 0;
332 
338  virtual void removeModelReactor(OdGsModelReactor *pReactor) = 0;
339 
345  virtual void setEnableSectioning(bool bEnable) = 0;
346 
351  virtual bool isSectioningEnabled() const = 0;
352 
365  virtual bool setSectioning(const OdGePoint3dArray &points, const OdGeVector3d &upVector) = 0;
366 
386  virtual bool setSectioning(const OdGePoint3dArray &points, const OdGeVector3d &upVector,
387  double dTop, double dBottom) = 0;
388 
397  virtual void setSectioningVisualStyle(OdDbStub *visualStyleId) = 0;
398 
404  virtual void setEnableLinetypes(bool bEnable) = 0;
405 
409  virtual bool isLinetypesEnabled() const = 0;
410 
418  virtual void setSelectable(bool bEnable) = 0;
419 
425  virtual bool isSelectable() const = 0;
426 
432  virtual void setEnableLightsInBlocks(bool bEnable) = 0;
433 
437  virtual bool isLightsInBlocksEnabled() const = 0;
438 };
439 
447 {
448  public:
450  virtual ~OdGsModelReactor() { }
451 
452  //virtual bool onSceneGraphRootAdded(OdGsModel *pModel, OdGiDrawable *pAdded) { return true; }
453  //virtual bool onSceneGraphRootErased(OdGsModel *pModel, OdGiDrawable *pErased) { return true; }
454 
455  virtual bool onAdded(OdGsModel *pModel, OdGiDrawable *pAdded, OdGiDrawable *pParent) { return true; }
456  virtual bool onAdded(OdGsModel *pModel, OdGiDrawable *pAdded, OdDbStub *parentID) { return true; }
457 
458  virtual bool onErased(OdGsModel *pModel, OdGiDrawable *pErased, OdGiDrawable *pParent) { return true; }
459  virtual bool onErased(OdGsModel *pModel, OdGiDrawable *pErased, OdDbStub *parentID) { return true; }
460 
461  virtual bool onModified(OdGsModel *pModel, OdGiDrawable *pModified, OdGiDrawable *pParent) { return true; }
462  virtual bool onModified(OdGsModel *pModel, OdGiDrawable *pModified, OdDbStub *parentID) { return true; }
463 
464  virtual bool onUnerased(OdGsModel *pModel, OdGiDrawable *pUnerased, OdGiDrawable *pParent) { return onAdded(pModel, pUnerased, pParent); }
465  virtual bool onUnerased(OdGsModel *pModel, OdGiDrawable *pUnerased, OdDbStub *parentID) { return onAdded(pModel, pUnerased, parentID); }
466 };
467 
468 #include "TD_PackPop.h"
469 
470 #endif // __ODGSMODEL_H_INCLUDED_
FIRSTDLL_EXPORT
#define FIRSTDLL_EXPORT
Definition: RootExport.h:39
OdGsModel::setSectioning
virtual bool setSectioning(const OdGePoint3dArray &points, const OdGeVector3d &upVector, double dTop, double dBottom)=0
OdGsModel::kMaxRenderType
@ kMaxRenderType
Definition: GsModel.h:241
OdGeVector3d
Definition: GeVector3d.h:54
OdGsModel::setRenderType
virtual void setRenderType(RenderType renderType)=0
OdGsModel::kCount
@ kCount
Definition: GsModel.h:237
OdGsView::RenderMode
RenderMode
Definition: Gs.h:138
OdGsModelReactor
Definition: GsModel.h:447
OdGsModel::setViewClippingOverride
virtual void setViewClippingOverride(bool bEnable)=0
OdGsModel::kSprite
@ kSprite
Definition: GsModel.h:231
OdGsModelReactor::~OdGsModelReactor
virtual ~OdGsModelReactor()
Definition: GsModel.h:450
OdGsView::kNone
@ kNone
Definition: Gs.h:147
OdGsView
Definition: Gs.h:133
OdGsModel::onAdded
virtual void onAdded(OdGiDrawable *pAdded, OdDbStub *parentID)=0
OdGsModel::renderType
virtual RenderType renderType() const =0
OdGsModel::isSectioningEnabled
virtual bool isSectioningEnabled() const =0
OdGsModelReactor::onAdded
virtual bool onAdded(OdGsModel *pModel, OdGiDrawable *pAdded, OdDbStub *parentID)
Definition: GsModel.h:456
OdGsModel::visualStyle
virtual OdDbStub * visualStyle() const =0
OdGsModel::ODRX_DECLARE_MEMBERS
ODRX_DECLARE_MEMBERS(OdGsModel)
OdRxObject
Definition: RxObject.h:564
OdGsModel::kHighlightSelection
@ kHighlightSelection
Definition: GsModel.h:234
OdGsDevice
Definition: Gs.h:1061
OdGsModelReactor::onUnerased
virtual bool onUnerased(OdGsModel *pModel, OdGiDrawable *pUnerased, OdDbStub *parentID)
Definition: GsModel.h:465
OdGsCache
Definition: GsModel.h:40
OdGsModel::setRenderModeOverride
virtual void setRenderModeOverride(OdGsView::RenderMode mode=OdGsView::kNone)=0
OdGsCache::setDrawableNull
virtual void setDrawableNull()=0
OdArray< OdGePoint3d, OdMemoryAllocator< OdGePoint3d > >
TD_PackPop.h
OdGsModel::setOpenDrawableFn
virtual void setOpenDrawableFn(OdGiOpenDrawableFn openDrawableFn)=0
OdGsModel::kDirect
@ kDirect
Definition: GsModel.h:232
OdGsModel::RenderType
RenderType
Definition: GsModel.h:225
OdGiOpenDrawableFn
OdGiDrawablePtr(* OdGiOpenDrawableFn)(OdDbStub *id)
Definition: GsModel.h:65
OdGsModel::setSectioning
virtual bool setSectioning(const OdGePoint3dArray &points, const OdGeVector3d &upVector)=0
OdGsModel::setVisualStyle
virtual void setVisualStyle(const OdGiVisualStyle &visualStyle)=0
OdGsModel::onErased
virtual void onErased(OdGiDrawable *pErased, OdDbStub *parentID)=0
OdGsCache::ODRX_DECLARE_MEMBERS
ODRX_DECLARE_MEMBERS(OdGsCache)
OdGsModelReactor::onErased
virtual bool onErased(OdGsModel *pModel, OdGiDrawable *pErased, OdGiDrawable *pParent)
Definition: GsModel.h:458
OdGeMatrix3d
Definition: GeMatrix3d.h:73
OdGsModel::setTransform
virtual void setTransform(const OdGeMatrix3d &)=0
OdGsModelReactor::onAdded
virtual bool onAdded(OdGsModel *pModel, OdGiDrawable *pAdded, OdGiDrawable *pParent)
Definition: GsModel.h:455
OdGsModel::addModelReactor
virtual void addModelReactor(OdGsModelReactor *pReactor)=0
OdGsModel::isSelectable
virtual bool isSelectable() const =0
OdGsModel::onAdded
virtual void onAdded(OdGiDrawable *pAdded, OdGiDrawable *pParent)=0
OdGsModel::setEnableLinetypes
virtual void setEnableLinetypes(bool bEnable)=0
OdGsModel::onModified
virtual void onModified(OdGiDrawable *pModified, OdDbStub *parentID)=0
OdGsModelReactor::onErased
virtual bool onErased(OdGsModel *pModel, OdGiDrawable *pErased, OdDbStub *parentID)
Definition: GsModel.h:459
OdGsModel::onUnerased
virtual void onUnerased(OdGiDrawable *pUnerased, OdGiDrawable *pParent)
OdGsModel::kHighlight
@ kHighlight
Definition: GsModel.h:233
OdGsCache::model
virtual OdGsModel * model() const =0
OdGiVisualStyle
Definition: GiVisualStyle.h:996
OdGiPathNode
Definition: GiPathNode.h:36
OdGsModel::InvalidationHint
InvalidationHint
Definition: GsModel.h:159
OdGsModelReactor::onModified
virtual bool onModified(OdGsModel *pModel, OdGiDrawable *pModified, OdDbStub *parentID)
Definition: GsModel.h:462
OdGsModel::setEnableSectioning
virtual void setEnableSectioning(bool bEnable)=0
Gs.h
OdGiDrawable
Definition: GiDrawable.h:49
OdGsModel::setVisualStyle
virtual void setVisualStyle(OdDbStub *visualStyleId)=0
OdGsModel::setBackground
virtual void setBackground(OdDbStub *backgroundId)=0
OdGsModel::onErased
virtual void onErased(OdGiDrawable *pErased, OdGiDrawable *pParent)=0
OdGsModel::kUserFg2
@ kUserFg2
Definition: GsModel.h:239
OdGiDrawablePtr
OdSmartPtr< OdGiDrawable > OdGiDrawablePtr
Definition: GiCommonDraw.h:39
OdGsModel::setEnableLightsInBlocks
virtual void setEnableLightsInBlocks(bool bEnable)=0
TD_PackPush.h
OdGsModelReactor::onUnerased
virtual bool onUnerased(OdGsModel *pModel, OdGiDrawable *pUnerased, OdGiDrawable *pParent)
Definition: GsModel.h:464
ODRX_ABSTRACT
#define ODRX_ABSTRACT
Definition: OdPlatformSettings.h:117
OdGsModel::invalidateVisible
virtual void invalidateVisible(OdGsDevice *pDevice)=0
OdGsModel::isLightsInBlocksEnabled
virtual bool isLightsInBlocksEnabled() const =0
OdGsModel::isLinetypesEnabled
virtual bool isLinetypesEnabled() const =0
OdGsModel::onUnerased
virtual void onUnerased(OdGiDrawable *pUnerased, OdDbStub *parentID)
OdGeExtents3d
Definition: GeExtents3d.h:45
OdGsModel::onModified
virtual void onModified(OdGiDrawable *pModified, OdGiDrawable *pParent)=0
OdGsModelReactor::onModified
virtual bool onModified(OdGsModel *pModel, OdGiDrawable *pModified, OdGiDrawable *pParent)
Definition: GsModel.h:461
OdGsCache::extents
virtual bool extents(OdGeExtents3d &extents) const =0
OdGsModelReactor::OdGsModelReactor
OdGsModelReactor()
Definition: GsModel.h:449
OdGsModel::highlight
virtual void highlight(const OdGiPathNode &path, bool bDoIt=true, const OdGsView *pView=0)=0
OdGsModel::invalidate
virtual void invalidate(OdGsView *pView)=0
OdGsModel::visualStyle
virtual bool visualStyle(OdGiVisualStyle &visualStyle) const =0
OdGsModel::kContrast
@ kContrast
Definition: GsModel.h:236
OdGsModel
Definition: GsModel.h:77
OdGsModel::kUserFg3
@ kUserFg3
Definition: GsModel.h:240
OdGsModel::background
virtual OdDbStub * background() const =0
OdGsModel::setSelectable
virtual void setSelectable(bool bEnable)=0
OdGsModel::transform
virtual OdGeMatrix3d transform() const =0
OdGsModel::setSectioningVisualStyle
virtual void setSectioningVisualStyle(OdDbStub *visualStyleId)=0
OdGsModel::kDirectTopmost
@ kDirectTopmost
Definition: GsModel.h:235
OdGsModel::invalidate
virtual void invalidate(InvalidationHint hint)=0
OdGsModel::removeModelReactor
virtual void removeModelReactor(OdGsModelReactor *pReactor)=0