CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
GsModel.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
24#ifndef __ODGSMODEL_H_INCLUDED_
25#define __ODGSMODEL_H_INCLUDED_
26
27#include "Gs/Gs.h"
28
29class OdGiPathNode;
30
31#include "TD_PackPush.h"
32
40{
41public:
43
47 virtual OdGsModel* model() const = 0;
48
52 virtual void setDrawableNull() = 0;
53
62 virtual bool extents(OdGeExtents3d& extents) const = 0;
63};
64
65typedef OdGiDrawablePtr (*OdGiOpenDrawableFn)(OdDbStub* id);
66
68
77{
78public:
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
127 virtual void onModifiedGraphics(const OdGiDrawable* pModified, OdDbStub* parentID) = 0;
128
135 virtual void onErased(OdGiDrawable* pErased, OdGiDrawable* pParent) = 0;
136
143 virtual void onErased(OdGiDrawable* pErased, OdDbStub* parentID) = 0;
144
151 virtual void onUnerased(OdGiDrawable* pUnerased, OdGiDrawable* pParent);
152
159 virtual void onUnerased(OdGiDrawable* pUnerased, OdDbStub* parentID);
160
161 // Invalidation Hint
162
168 {
169 kInvalidateIsolines = 0, // Invalidate isolines
170 kInvalidateViewportCache = 1, // Invalidate viewport cache
171 kInvalidateAll = 2, // Invalidate all caches
172 kInvalidateMaterials = 3, // Invalidate materials
173 kInvalidateLinetypes = 4 // Invalidate all linetype caches
174 };
175
193 virtual void invalidate(InvalidationHint hint) = 0;
194
200 virtual void invalidate(OdGsView* pView) = 0;
201
207 virtual void invalidateVisible( OdGsDevice* pDevice ) = 0;
208
214 virtual void setTransform(const OdGeMatrix3d&) = 0;
215
219 virtual OdGeMatrix3d transform() const = 0;
220
229 virtual void highlight(const OdGiPathNode& path, bool bDoIt = true, OdUInt32 nStyle = 0, const OdGsView* pView = NULL) = 0;
230
241 virtual void highlight(const OdGiPathNode& path, const OdGsMarker* pMarkers, OdUInt32 nMarkers, bool bDoIt = true,
242 OdUInt32 nStyle = 0, const OdGsView* pView = NULL) = 0;
243
252 virtual void hide(const OdGiPathNode& path, bool bDoIt = true, bool bSelectHidden = false, const OdGsView* pView = NULL) = 0;
253
264 virtual void hide(const OdGiPathNode& path, const OdGsMarker* pMarkers, OdUInt32 nMarkers, bool bDoIt = true,
265 bool bSelectHidden = false, const OdGsView* pView = 0) = 0;
266
271 {
272 kMinRenderType = -3, // Number of RenderType's in negative values range
273 kUserBg1 = -3, // User-defined background rendering type without Z-buffer
274 kUserBg2 = -2, // User-defined background rendering type with own Z-buffer
275 kUserBg3 = -1, // User-defined background rendering type with Z-buffer
276 kMain = 0, // Use main Z-buffer
277 kSprite, // Use alternate Z-buffer (for sprites)
278 kDirect, // Render on device directly
279 kHighlight, // Render on device directly (skipping frame buffer and Z-buffer)
280 kHighlightSelection, // Render on device directly using highlighting style (skipping frame buffer and Z-buffer)
281 kDirectTopmost, // Render on top of all other render types without Z-buffer
282 kContrast, // Render with contrast style
283 kCount, // Number of primary predefined RenderType's
284 kUserFg1 = kCount, // User-defined foreground rendering type with Z-buffer
285 kUserFg2, // User-defined foreground rendering type with own Z-buffer
286 kUserFg3, // Second user-defined foreground rendering type without Z-buffer
287 kMaxRenderType, // Number of RenderType's in positive values range
288 kNumRenderTypes = kMaxRenderType - kMinRenderType // Exact number of RenderType's including predefined and user-defined RenderType's
289 };
290
296 virtual void setRenderType(RenderType renderType) = 0;
297
301 virtual RenderType renderType() const = 0;
302
303 //virtual bool addSceneGraphRoot(OdGiDrawable* pRoot) = 0;
304 //virtual bool eraseSceneGraphRoot(OdGiDrawable* pRoot) = 0;
305
315
323
330 virtual void setViewClippingOverride(bool bEnable) = 0;
331
335 virtual bool viewClippingOverride() const = 0;
336
342 virtual void setBackground(OdDbStub *backgroundId) = 0;
343
347 virtual OdDbStub *background() const = 0;
348
360 virtual void setVisualStyle(OdDbStub *visualStyleId) = 0;
361
365 virtual OdDbStub *visualStyle() const = 0;
366
374 virtual void setVisualStyle(const OdGiVisualStyle &visualStyle) = 0;
375
383 virtual bool visualStyle(OdGiVisualStyle &visualStyle) const = 0;
384
390 virtual void addModelReactor(OdGsModelReactor *pReactor) = 0;
391
397 virtual void removeModelReactor(OdGsModelReactor *pReactor) = 0;
398
404 virtual void setEnableSectioning(bool bEnable) = 0;
405
410 virtual bool isSectioningEnabled() const = 0;
411
424 virtual bool setSectioning(const OdGePoint3dArray &points, const OdGeVector3d &upVector) = 0;
425
445 virtual bool setSectioning(const OdGePoint3dArray &points, const OdGeVector3d &upVector,
446 double dTop, double dBottom) = 0;
447
456 virtual void setSectioningVisualStyle(OdDbStub *visualStyleId) = 0;
457
463 virtual void setEnableLinetypes(bool bEnable) = 0;
464
468 virtual bool isLinetypesEnabled() const = 0;
469
477 virtual void setSelectable(bool bEnable) = 0;
478
484 virtual bool isSelectable() const = 0;
485
493 virtual void setEnableViewExtentsCalculation(bool bEnable) = 0;
494
500 virtual bool isViewExtentsCalculationEnabled() const = 0;
501
507 virtual void setEnableLightsInBlocks(bool bEnable) = 0;
508
512 virtual bool isLightsInBlocksEnabled() const = 0;
513
520 virtual void setViewSectioningOverride(bool bEnable) = 0;
521
525 virtual bool viewSectioningOverride() const = 0;
526};
527
535{
536 public:
538 virtual ~OdGsModelReactor() { }
539
540 //virtual bool onSceneGraphRootAdded(OdGsModel *pModel, OdGiDrawable *pAdded) { return true; }
541 //virtual bool onSceneGraphRootErased(OdGsModel *pModel, OdGiDrawable *pErased) { return true; }
542
552 virtual bool onAdded(OdGsModel *pModel, OdGiDrawable *pAdded, OdGiDrawable *pParent) { return true; }
553
563 virtual bool onAdded(OdGsModel *pModel, OdGiDrawable *pAdded, OdDbStub *parentID) { return true; }
564
574 virtual bool onErased(OdGsModel *pModel, OdGiDrawable *pErased, OdGiDrawable *pParent) { return true; }
575
585 virtual bool onErased(OdGsModel *pModel, OdGiDrawable *pErased, OdDbStub *parentID) { return true; }
586
596 virtual bool onModified(OdGsModel *pModel, OdGiDrawable *pModified, OdGiDrawable *pParent) { return true; }
597
607 virtual bool onModified(OdGsModel *pModel, OdGiDrawable *pModified, OdDbStub *parentID) { return true; }
608
616 virtual bool onUnerased(OdGsModel *pModel, OdGiDrawable *pUnerased, OdGiDrawable *pParent) { return onAdded(pModel, pUnerased, pParent); }
617
625 virtual bool onUnerased(OdGsModel *pModel, OdGiDrawable *pUnerased, OdDbStub *parentID) { return onAdded(pModel, pUnerased, parentID); }
626};
627
628#include "TD_PackPop.h"
629
630#endif // __ODGSMODEL_H_INCLUDED_
OdSmartPtr< OdGiDrawable > OdGiDrawablePtr
Definition: GiCommonDraw.h:45
OdGiDrawablePtr(* OdGiOpenDrawableFn)(OdDbStub *id)
Definition: GsModel.h:65
ptrdiff_t OdGsMarker
unsigned int OdUInt32
#define ODRX_ABSTRACT
#define FIRSTDLL_EXPORT
Definition: RootExport.h:39
ODRX_DECLARE_MEMBERS(OdGsCache)
virtual void setDrawableNull()=0
virtual OdGsModel * model() const =0
virtual bool extents(OdGeExtents3d &extents) const =0
virtual void removeModelReactor(OdGsModelReactor *pReactor)=0
virtual OdDbStub * visualStyle() const =0
virtual void setEnableViewExtentsCalculation(bool bEnable)=0
virtual void onErased(OdGiDrawable *pErased, OdDbStub *parentID)=0
virtual bool isLightsInBlocksEnabled() const =0
virtual void addModelReactor(OdGsModelReactor *pReactor)=0
virtual void onModifiedGraphics(const OdGiDrawable *pModified, OdDbStub *parentID)=0
virtual void onUnerased(OdGiDrawable *pUnerased, OdGiDrawable *pParent)
virtual bool visualStyle(OdGiVisualStyle &visualStyle) const =0
virtual void setVisualStyle(OdDbStub *visualStyleId)=0
virtual OdGeMatrix3d transform() const =0
virtual bool viewSectioningOverride() const =0
virtual void setVisualStyle(const OdGiVisualStyle &visualStyle)=0
virtual void invalidateVisible(OdGsDevice *pDevice)=0
virtual OdDbStub * background() const =0
virtual void onAdded(OdGiDrawable *pAdded, OdDbStub *parentID)=0
virtual void setRenderType(RenderType renderType)=0
virtual void setViewClippingOverride(bool bEnable)=0
virtual RenderType renderType() const =0
ODRX_DECLARE_MEMBERS(OdGsModel)
virtual void setBackground(OdDbStub *backgroundId)=0
@ kDirect
Definition: GsModel.h:278
@ kContrast
Definition: GsModel.h:282
@ kUserFg2
Definition: GsModel.h:285
@ kMaxRenderType
Definition: GsModel.h:287
@ kHighlightSelection
Definition: GsModel.h:280
@ kHighlight
Definition: GsModel.h:279
@ kSprite
Definition: GsModel.h:277
@ kUserFg3
Definition: GsModel.h:286
@ kCount
Definition: GsModel.h:283
@ kDirectTopmost
Definition: GsModel.h:281
virtual void highlight(const OdGiPathNode &path, const OdGsMarker *pMarkers, OdUInt32 nMarkers, bool bDoIt=true, OdUInt32 nStyle=0, const OdGsView *pView=NULL)=0
virtual void invalidate(OdGsView *pView)=0
virtual OdGsView::RenderMode renderModeOverride() const =0
virtual void invalidate(InvalidationHint hint)=0
virtual void onErased(OdGiDrawable *pErased, OdGiDrawable *pParent)=0
virtual void hide(const OdGiPathNode &path, bool bDoIt=true, bool bSelectHidden=false, const OdGsView *pView=NULL)=0
virtual void setTransform(const OdGeMatrix3d &)=0
virtual bool viewClippingOverride() const =0
virtual void setRenderModeOverride(OdGsView::RenderMode mode=OdGsView::kNone)=0
virtual void setSectioningVisualStyle(OdDbStub *visualStyleId)=0
virtual void highlight(const OdGiPathNode &path, bool bDoIt=true, OdUInt32 nStyle=0, const OdGsView *pView=NULL)=0
virtual void onModified(OdGiDrawable *pModified, OdDbStub *parentID)=0
virtual void setSelectable(bool bEnable)=0
virtual bool isLinetypesEnabled() const =0
virtual bool setSectioning(const OdGePoint3dArray &points, const OdGeVector3d &upVector)=0
virtual void onAdded(OdGiDrawable *pAdded, OdGiDrawable *pParent)=0
virtual void hide(const OdGiPathNode &path, const OdGsMarker *pMarkers, OdUInt32 nMarkers, bool bDoIt=true, bool bSelectHidden=false, const OdGsView *pView=0)=0
virtual void setViewSectioningOverride(bool bEnable)=0
virtual void onModified(OdGiDrawable *pModified, OdGiDrawable *pParent)=0
InvalidationHint
Definition: GsModel.h:168
virtual void onUnerased(OdGiDrawable *pUnerased, OdDbStub *parentID)
virtual bool isSelectable() const =0
virtual void setEnableLightsInBlocks(bool bEnable)=0
virtual bool setSectioning(const OdGePoint3dArray &points, const OdGeVector3d &upVector, double dTop, double dBottom)=0
virtual void setEnableLinetypes(bool bEnable)=0
virtual bool isSectioningEnabled() const =0
virtual void setOpenDrawableFn(OdGiOpenDrawableFn openDrawableFn)=0
virtual void setEnableSectioning(bool bEnable)=0
virtual bool isViewExtentsCalculationEnabled() const =0
virtual bool onErased(OdGsModel *pModel, OdGiDrawable *pErased, OdDbStub *parentID)
Definition: GsModel.h:585
virtual ~OdGsModelReactor()
Definition: GsModel.h:538
virtual bool onAdded(OdGsModel *pModel, OdGiDrawable *pAdded, OdDbStub *parentID)
Definition: GsModel.h:563
virtual bool onAdded(OdGsModel *pModel, OdGiDrawable *pAdded, OdGiDrawable *pParent)
Definition: GsModel.h:552
virtual bool onErased(OdGsModel *pModel, OdGiDrawable *pErased, OdGiDrawable *pParent)
Definition: GsModel.h:574
virtual bool onModified(OdGsModel *pModel, OdGiDrawable *pModified, OdDbStub *parentID)
Definition: GsModel.h:607
virtual bool onUnerased(OdGsModel *pModel, OdGiDrawable *pUnerased, OdGiDrawable *pParent)
Definition: GsModel.h:616
virtual bool onUnerased(OdGsModel *pModel, OdGiDrawable *pUnerased, OdDbStub *parentID)
Definition: GsModel.h:625
virtual bool onModified(OdGsModel *pModel, OdGiDrawable *pModified, OdGiDrawable *pParent)
Definition: GsModel.h:596
Definition: Gs.h:140
RenderMode
Definition: Gs.h:148
@ kNone
Definition: Gs.h:157