CFx SDK Documentation 2026 SP0
Loading...
Searching...
No Matches
GsModel.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 __ODGSMODEL_H_INCLUDED_
25#define __ODGSMODEL_H_INCLUDED_
26
27#include "Gs/Gs.h"
28#include "Gs/GsSimpleParams.h"
29#include "Ge/GePoint3dArray.h"
30
31class OdGiPathNode;
32
33#include "TD_PackPush.h"
34
41class FIRSTDLL_EXPORT ODRX_ABSTRACT OdGsCache : public OdRxObject
42{
43public:
45
49 virtual OdGsModel* model() const = 0;
50
54 virtual void setDrawableNull() = 0;
55
64 virtual bool extents(OdGeExtents3d& extents) const = 0;
65};
66
67typedef OdGiDrawablePtr (*OdGiOpenDrawableFn)(OdDbStub* id);
68
70
78class FIRSTDLL_EXPORT ODRX_ABSTRACT OdGsModel : public OdRxObject
79{
80public:
82
88 virtual void setOpenDrawableFn(OdGiOpenDrawableFn openDrawableFn) = 0;
89
96 virtual void onAdded(OdGiDrawable* pAdded, OdGiDrawable* pParent) = 0;
97
104 virtual void onAdded(OdGiDrawable* pAdded, OdDbStub* parentID) = 0;
105
112 virtual void onModified(OdGiDrawable* pModified, OdGiDrawable* pParent) = 0;
113
120 virtual void onModified(OdGiDrawable* pModified, OdDbStub* parentID) = 0;
121
129 virtual void onModifiedGraphics(const OdGiDrawable* pModified, OdDbStub* parentID) = 0;
130
137 virtual void onErased(OdGiDrawable* pErased, OdGiDrawable* pParent) = 0;
138
145 virtual void onErased(OdGiDrawable* pErased, OdDbStub* parentID) = 0;
146
153 virtual void onUnerased(OdGiDrawable* pUnerased, OdGiDrawable* pParent);
154
161 virtual void onUnerased(OdGiDrawable* pUnerased, OdDbStub* parentID);
162
163 // Invalidation Hint
164
170 {
171 kInvalidateIsolines = 0, // Invalidate isolines
172 kInvalidateViewportCache = 1, // Invalidate viewport cache
173 kInvalidateAll = 2, // Invalidate all caches
174 kInvalidateMaterials = 3, // Invalidate materials
175 kInvalidateLinetypes = 4 // Invalidate all linetype caches
176 };
177
195 virtual void invalidate(InvalidationHint hint) = 0;
196
202 virtual void invalidate(OdGsView* pView) = 0;
203
209 virtual void invalidateVisible( OdGsDevice* pDevice ) = 0;
210
216 virtual void setTransform(const OdGeMatrix3d&) = 0;
217
221 virtual OdGeMatrix3d transform() const = 0;
222
231 virtual void highlight(const OdGiPathNode& path, bool bDoIt = true, OdUInt32 nStyle = 0, const OdGsView* pView = NULL) = 0;
232
243 virtual void highlight(const OdGiPathNode& path, const OdGsMarker* pMarkers, OdUInt32 nMarkers, bool bDoIt = true,
244 OdUInt32 nStyle = 0, const OdGsView* pView = NULL) = 0;
245
254 virtual void hide(const OdGiPathNode& path, bool bDoIt = true, bool bSelectHidden = false, const OdGsView* pView = NULL) = 0;
255
266 virtual void hide(const OdGiPathNode& path, const OdGsMarker* pMarkers, OdUInt32 nMarkers, bool bDoIt = true,
267 bool bSelectHidden = false, const OdGsView* pView = NULL) = 0;
268
277 virtual void externalTransform(const OdGiPathNode& path, bool bDoIt = true, const OdGsMatrixParam *xForm = NULL,
278 const OdGsView* pView = NULL) = 0;
279
290 virtual void externalTransform(const OdGiPathNode& path, const OdGsMarker* pMarkers, OdUInt32 nMarkers, bool bDoIt = true,
291 const OdGsMatrixParam *xForm = NULL, const OdGsView* pView = NULL) = 0;
292
300 virtual bool getExternalTransform(const OdGiPathNode &path, const OdGsMatrixParam *&xForm, const OdGsView *pView = NULL) const = 0;
301
306 {
307 kMinRenderType = -3, // Number of RenderType's in negative values range
308 kUserBg1 = -3, // User-defined background rendering type without Z-buffer
309 kUserBg2 = -2, // User-defined background rendering type with own Z-buffer
310 kUserBg3 = -1, // User-defined background rendering type with Z-buffer
311 kMain = 0, // Use main Z-buffer
312 kSprite, // Use alternate Z-buffer (for sprites)
313 kDirect, // Render on device directly
314 kHighlight, // Render on device directly (skipping frame buffer and Z-buffer)
315 kHighlightSelection, // Render on device directly using highlighting style (skipping frame buffer and Z-buffer)
316 kDirectTopmost, // Render on top of all other render types without Z-buffer
317 kContrast, // Render with contrast style
318 kCount, // Number of primary predefined RenderType's
319 kUserFg1 = kCount, // User-defined foreground rendering type with Z-buffer
320 kUserFg2, // User-defined foreground rendering type with own Z-buffer
321 kUserFg3, // Second user-defined foreground rendering type without Z-buffer
322 kMaxRenderType, // Number of RenderType's in positive values range
323 kNumRenderTypes = kMaxRenderType - kMinRenderType // Exact number of RenderType's including predefined and user-defined RenderType's
324 };
325
332
336 virtual RenderType renderType() const = 0;
337
338 //virtual bool addSceneGraphRoot(OdGiDrawable* pRoot) = 0;
339 //virtual bool eraseSceneGraphRoot(OdGiDrawable* pRoot) = 0;
340
350
358
365 virtual void setViewClippingOverride(bool bEnable) = 0;
366
370 virtual bool viewClippingOverride() const = 0;
371
377 virtual void setBackground(OdDbStub *backgroundId) = 0;
378
382 virtual OdDbStub *background() const = 0;
383
395 virtual void setVisualStyle(OdDbStub *visualStyleId) = 0;
396
400 virtual OdDbStub *visualStyle() const = 0;
401
410
418 virtual bool visualStyle(OdGiVisualStyle &visualStyle) const = 0;
419
425 virtual void addModelReactor(OdGsModelReactor *pReactor) = 0;
426
432 virtual void removeModelReactor(OdGsModelReactor *pReactor) = 0;
433
439 virtual void setEnableSectioning(bool bEnable) = 0;
440
445 virtual bool isSectioningEnabled() const = 0;
446
459 virtual bool setSectioning(const OdGePoint3dArray &points, const OdGeVector3d &upVector) = 0;
460
480 virtual bool setSectioning(const OdGePoint3dArray &points, const OdGeVector3d &upVector,
481 double dTop, double dBottom) = 0;
482
491 virtual void setSectioningVisualStyle(OdDbStub *visualStyleId) = 0;
492
498 virtual void setEnableLinetypes(bool bEnable) = 0;
499
503 virtual bool isLinetypesEnabled() const = 0;
504
512 virtual void setSelectable(bool bEnable) = 0;
513
519 virtual bool isSelectable() const = 0;
520
528 virtual void setEnableViewExtentsCalculation(bool bEnable) = 0;
529
535 virtual bool isViewExtentsCalculationEnabled() const = 0;
536
542 virtual void setEnableLightsInBlocks(bool bEnable) = 0;
543
547 virtual bool isLightsInBlocksEnabled() const = 0;
548
555 virtual void setViewSectioningOverride(bool bEnable) = 0;
556
560 virtual bool viewSectioningOverride() const = 0;
561};
562
563#if defined _MSC_VER
564#pragma warning(push)
565#pragma warning(disable:4100) // unreferenced formal parameter
566#endif
567
575{
576 public:
581
585 virtual ~OdGsModelReactor() { }
586
587 //virtual bool onSceneGraphRootAdded(OdGsModel *pModel, OdGiDrawable *pAdded) { return true; }
588 //virtual bool onSceneGraphRootErased(OdGsModel *pModel, OdGiDrawable *pErased) { return true; }
589
599 virtual bool onAdded(OdGsModel *pModel, OdGiDrawable *pAdded, OdGiDrawable *pParent) { return true; }
600
610 virtual bool onAdded(OdGsModel *pModel, OdGiDrawable *pAdded, OdDbStub *parentID) { return true; }
611
621 virtual bool onErased(OdGsModel *pModel, OdGiDrawable *pErased, OdGiDrawable *pParent) { return true; }
622
632 virtual bool onErased(OdGsModel *pModel, OdGiDrawable *pErased, OdDbStub *parentID) { return true; }
633
643 virtual bool onModified(OdGsModel *pModel, OdGiDrawable *pModified, OdGiDrawable *pParent) { return true; }
644
654 virtual bool onModified(OdGsModel *pModel, OdGiDrawable *pModified, OdDbStub *parentID) { return true; }
655
663 virtual bool onUnerased(OdGsModel *pModel, OdGiDrawable *pUnerased, OdGiDrawable *pParent) { return onAdded(pModel, pUnerased, pParent); }
664
672 virtual bool onUnerased(OdGsModel *pModel, OdGiDrawable *pUnerased, OdDbStub *parentID) { return onAdded(pModel, pUnerased, parentID); }
673};
674
675#if defined _MSC_VER
676#pragma warning(pop)
677#endif
678
679#include "TD_PackPop.h"
680
681#endif // __ODGSMODEL_H_INCLUDED_
OdArray< OdGePoint3d, OdMemoryAllocator< OdGePoint3d > > OdGePoint3dArray
OdSmartPtr< OdGiDrawable > OdGiDrawablePtr
OdGiDrawablePtr(* OdGiOpenDrawableFn)(OdDbStub *id)
Definition GsModel.h:67
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 bool getExternalTransform(const OdGiPathNode &path, const OdGsMatrixParam *&xForm, const OdGsView *pView=NULL) 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 externalTransform(const OdGiPathNode &path, const OdGsMarker *pMarkers, OdUInt32 nMarkers, bool bDoIt=true, const OdGsMatrixParam *xForm=NULL, const OdGsView *pView=NULL)=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
@ kMinRenderType
Definition GsModel.h:307
@ kNumRenderTypes
Definition GsModel.h:323
@ kContrast
Definition GsModel.h:317
@ kMaxRenderType
Definition GsModel.h:322
@ kHighlightSelection
Definition GsModel.h:315
@ kHighlight
Definition GsModel.h:314
@ kDirectTopmost
Definition GsModel.h:316
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 hide(const OdGiPathNode &path, const OdGsMarker *pMarkers, OdUInt32 nMarkers, bool bDoIt=true, bool bSelectHidden=false, const OdGsView *pView=NULL)=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 externalTransform(const OdGiPathNode &path, bool bDoIt=true, const OdGsMatrixParam *xForm=NULL, const OdGsView *pView=NULL)=0
virtual void setViewSectioningOverride(bool bEnable)=0
virtual void onModified(OdGiDrawable *pModified, OdGiDrawable *pParent)=0
InvalidationHint
Definition GsModel.h:170
@ kInvalidateIsolines
Definition GsModel.h:171
@ kInvalidateMaterials
Definition GsModel.h:174
@ kInvalidateLinetypes
Definition GsModel.h:175
@ kInvalidateAll
Definition GsModel.h:173
@ kInvalidateViewportCache
Definition GsModel.h:172
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:632
virtual ~OdGsModelReactor()
Definition GsModel.h:585
virtual bool onAdded(OdGsModel *pModel, OdGiDrawable *pAdded, OdDbStub *parentID)
Definition GsModel.h:610
virtual bool onAdded(OdGsModel *pModel, OdGiDrawable *pAdded, OdGiDrawable *pParent)
Definition GsModel.h:599
virtual bool onErased(OdGsModel *pModel, OdGiDrawable *pErased, OdGiDrawable *pParent)
Definition GsModel.h:621
virtual bool onModified(OdGsModel *pModel, OdGiDrawable *pModified, OdDbStub *parentID)
Definition GsModel.h:654
virtual bool onUnerased(OdGsModel *pModel, OdGiDrawable *pUnerased, OdGiDrawable *pParent)
Definition GsModel.h:663
virtual bool onUnerased(OdGsModel *pModel, OdGiDrawable *pUnerased, OdDbStub *parentID)
Definition GsModel.h:672
virtual bool onModified(OdGsModel *pModel, OdGiDrawable *pModified, OdGiDrawable *pParent)
Definition GsModel.h:643
Definition Gs.h:141
RenderMode
Definition Gs.h:149
@ kNone
Definition Gs.h:158