CFx SDK Documentation 2026 SP0
Loading...
Searching...
No Matches
GsBaseVectorizeDevice.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 ODGSBASEVECTORIZEDEVICE_INC
25#define ODGSBASEVECTORIZEDEVICE_INC
26
27#include "TD_PackPush.h"
28#include "Gs/GsBaseModule.h"
29#include "Gs/GsDCRectArray.h"
31#include "Gs/GsModel.h"
32#include "GsOverlayDefs.h"
33#include "SlotManager.h"
34#include "ThreadsCounter.h"
35
36#include "Gs/GsUpdateManager.h"
37
42
43class OdGiPathNode;
46
48class OdGsViewImpl;
49
55
72{
73 friend class OdGsViewImpl;
75
76 friend class OdGsBaseModule;
77 OdGsBaseModulePtr m_pModule;
78 OdSlotManager m_slotManager;
79protected:
80 //DOM-IGNORE-BEGIN
81
91
93
95 enum
96 {
98
117 kSuppressHide = kFirstFlag << 18, //Indicates that GS should not skip hidden entities, device will hide they by himself
118
120 };
121
129 {
130 public:
132 bool hasInvalidRects(OdUInt32 nOverlays = kGsAllOverlays) const;
133 bool mergeInvalidRects(OdGsDCRect* pRect, OdUInt32 nOverlays = kGsAllOverlays) const;
134 bool containsInvalidRects(const OdGsViewImpl &view, bool bIfHas = false, OdUInt32 nOverlays = kGsAllOverlays) const;
135 };
137
138 void registerOverlay(OdGsViewImpl *pView, const OdGsModel *pModel);
139 void unregisterOverlay(OdGsViewImpl *pView, const OdGsModel *pModel);
140
141 virtual void onOverlayActivated(OdGsOverlayId nOverlay);
142 virtual void onOverlayDeactivated(OdGsOverlayId nOverlay);
143
144 //DOM-IGNORE-END
145public:
149 bool invalid() const { return GETBIT(m_flags, kInvalid); }
154 void setInvalid(bool bSet) { SETBIT(m_flags, kInvalid, bSet); }
159 void setValid(bool bFlag);
160
161public:
170 virtual bool supportPartialUpdate() const;
171
175 virtual bool supportPartialScreenUpdate() const;
176
181 void onViewAdded(OdGsView* pView);
182public:
184
189
194
200 void setUserGiContext(OdGiContext* pUserGiContext);
201
206
212
217 int height() const;
218
223 int width() const;
224
229 int hOffset() const;
230
235 int vOffset() const;
236
243
250 void invalidate(const OdGsDCRect &screenRect);
251
260 virtual void invalidate(OdUInt32 nOverlays);
261
270 virtual void invalidate(OdUInt32 nOverlays, const OdGsDCRect &screenRect);
271
279 void invalidate(const OdGsViewImpl *pView, const OdGsDCRect &screenRect);
280
288 void invalidate(const OdGsModel *pModel, const OdGsDCRect &screenRect);
289
297
300
306 bool isValid() const;
307
318 virtual void update(OdGsDCRect* pUpdatedRect);
319
323 virtual void updateGeometry();
324 virtual void updateScreen();
325
336
340 const OdGsDCRect& outputRect() const;
341
346 void getSize(OdGsDCRect& outputRect) const;
347
352
357
370 int bitsPerPixel,
371 int xPixels,
372 int yPixels);
373
374
385 const OdGsClientViewInfo* pViewInfo = 0,
386 bool enableLayerVisibilityPerView = false);
387
393 void addView(OdGsView* pView);
394
401 void insertView(int viewIndex, OdGsView* pView);
402
410 bool eraseView(OdGsView* pView);
411
415 int numViews() const;
416
421 OdGsView* viewAt(int viewIndex);
422
427 const OdGsView* viewAt(int viewIndex) const;
428
433 OdGsViewImpl* viewImplAt(int viewIndex);
434
439 const OdGsViewImpl* viewImplAt(int viewIndex) const;
440
448 bool eraseView(int viewIndex);
449
454
459 bool setBackgroundColor(ODCOLORREF backgroundColor);
460
465
475 void setLogicalPalette(const ODCOLORREF* logicalPalette, int numColors);
476
485 void getSnapShot(OdGiRasterImagePtr &pImage, const OdGsDCRect &region);
486
491 ODCOLORREF getColor(OdUInt16 colorIndex) const;
492
497
501 const ODCOLORREF* getPalette() const;
502
507 const ODCOLORREF* getLogicalPalette(int &numColors) const;
508
516
531 bool isModelCompatible(OdGsModel* pModel) const;
532
536 const OdGsView* rootView() const;
537
538 // renderTypes support
539 bool sortRenderTypes() const;
540 void setSortRenderTypes(bool flag);
544 // overlays support
545
551 bool supportOverlays() const;
552
558 void setSupportOverlays(bool bFlag);
559
565
571
582
588 bool isSpatialIndexDisabled() const;
589
594 void disableSpatialIndex(bool bSet);
595
601 bool isCullingVolumeEnabled() const;
602
607 void enableCullingVolume(bool bSet);
608
614 bool supportHighlightTwoPass() const;
615
620 void setSupportHighlightTwoPass(bool bOn);
621
627 bool isMtDisplay() const;
628
634 bool supportDynamicHighlight() const;
635
641 bool supportDynamicSubhighlight() const;
642
648 bool supportSelectionStyles() const;
649
655 bool supportBlocks() const;
656
664 bool supportComposition() const;
665
673 bool compositionEnabled() const;
674
681 void enableComposition(bool bSet);
682
688 bool isDisplayOffLayersEnabled() const;
689
694 void enableDisplayOffLayers(bool bSet);
695
703 bool isValidViewportId(const OdUInt32 acgiId) const
704 {
705 return m_slotManager.contains(acgiId);
706 }
707
710
715
720
725 OdRxObject* mtServices() { return m_mtServices; }
726
731
737
743 virtual bool isSupportDeviceStateSaving() const;
744
751 bool saveDeviceState(OdGsFiler *pFiler) const;
752
760
767 virtual bool saveClientDeviceState(OdGsFiler *pFiler) const;
768
775 virtual bool loadClientDeviceState(OdGsFiler *pFiler);
776
777 virtual bool saveLinkedDeviceState(OdGsFiler *pFiler) const;
778 virtual bool loadLinkedDeviceState(OdGsFiler *pFiler);
779
788
796
801 OdGsUpdateManagerPtr getUpdateManager( bool createIfNotExist = false );
802
808
813
818 bool isSuppressHide() const { return GETBIT( m_flags, kSuppressHide ); }
819
820protected:
822public:
824
825protected:
826 friend class DisplayScheduler;
827 friend class OdGsNodeContext;
828 virtual bool supportParallelDisplay() const { return false; }
830 void viewUpdateScreen(OdGsBaseVectorizeView* pView, bool bUpdate);
833
834public:
836private:
837 OdRxObjectPtr m_mtServices;
838 OdRefCounter m_vectThreadIndex;
839 OdMutexPtr m_mtInvalidate;
840 OdMutexPtr m_mtSectionGeometryMap;
841 mutable OdMutex m_mtInvalidRects;
842 OdDbBaseDatabaseRawPtrArray m_aDbMtRenderingOn;
843};
844
849
851{
853}
854
859
861{
863}
864
869
874
879
884
889
894
896{
897 return GETBIT(m_flags, kMtDisplay);
898}
899
904
909
914
916{
918}
919
924
929
934
939
944
949
954
955inline const
960
961inline
966
967inline
969{
970 return m_logPalette[colorIndex];
971}
972
973inline
975{
976 return m_logPalette.getPtr();
977}
978
979inline
981{
982 numColors = (int)m_logPalette.size();
983 return m_logPalette.getPtr();
984}
985
986#include "TD_PackPop.h"
987
988#endif // ODGSBASEVECTORIZEDEVICE_INC
OdSmartPtr< OdGiRasterImage > OdGiRasterImagePtr
Definition DbLayout.h:36
false
Definition DimVarDefs.h:165
OdSmartPtr< OdGiTransientManager > OdGiTransientManagerPtr
OdSmartPtr< OdGsUpdateManager > OdGsUpdateManagerPtr
Definition Gs.h:113
OdSmartPtr< OdGsView > OdGsViewPtr
Definition Gs.h:67
OdSmartPtr< OdGsModel > OdGsModelPtr
Definition Gs.h:74
OdSmartPtr< OdRxDictionary > OdRxDictionaryPtr
Definition Gs.h:93
OdSmartPtr< OdGsBaseModule > OdGsBaseModulePtr
OdArray< OdRxObject *, OdMemoryAllocator< OdRxObject * > > OdDbBaseDatabaseRawPtrArray
OdArray< ODCOLORREF, OdMemoryAllocator< ODCOLORREF > > ODGSPALETTE
OdSmartPtr< OdGiTransientManager > OdGiTransientManagerPtr
OdArray< OdGsDCRect, OdMemoryAllocator< OdGsDCRect > > OdGsDCRectArray
#define GS_TOOLKIT_EXPORT
Definition GsExport.h:37
OdGsOverlayId
@ kGsAllOverlays
int OdRefCounter
Definition OdMutex.h:478
#define ODCOLORREF
unsigned int OdUInt32
unsigned short OdUInt16
#define SETBIT(flags, bit, value)
Definition OdaDefs.h:516
#define GETBIT(flags, bit)
Definition OdaDefs.h:517
bool mergeInvalidRects(OdGsDCRect *pRect, OdUInt32 nOverlays=kGsAllOverlays) const
bool containsInvalidRects(const OdGsViewImpl &view, bool bIfHas=false, OdUInt32 nOverlays=kGsAllOverlays) const
void clearInvalidRects(OdUInt32 nOverlays=kGsAllOverlays)
bool hasInvalidRects(OdUInt32 nOverlays=kGsAllOverlays) const
bool eraseView(int viewIndex)
ODCOLORREF getBackgroundColor()
virtual bool isSupportDeviceStateSaving() const
void onDisplayChange(int bitsPerPixel, int xPixels, int yPixels)
void setSupportHighlightTwoPass(bool bOn)
bool isValidViewportId(const OdUInt32 acgiId) const
const OdGsDCRect & outputRect() const
int isOverlayRequireUpdate(OdGsOverlayId overlayId) const
GsDeviceOverlayDataContainer m_overlayData
virtual void update(OdGsDCRect *pUpdatedRect)
OdGsModel::RenderType transientRenderType() const
void unregisterOverlay(OdGsViewImpl *pView, const OdGsModel *pModel)
void setTransientRenderType(OdGsModel::RenderType renderType)
OdGsModel::RenderType m_transientRenderType
const OdGsViewImpl * viewImplAt(int viewIndex) const
void onSize(const OdGsDCRect &outputRect)
virtual bool supportParallelDisplay() const
virtual void updateScreen()
GsVectPerformanceData m_vectPerfData
OdSmartPtr< OdGiContext > m_pUserContext
void setUpdateManager(OdGsUpdateManagerPtr pManager)
const ODCOLORREF * getPalette() const
void onViewAdded(OdGsView *pView)
void invalidate(const OdGsViewImpl *pView, const OdGsDCRect &screenRect)
bool saveDeviceState(OdGsFiler *pFiler) const
bool isModelCompatible(OdGsModel *pModel) const
void invalidate(const OdGsDCRect &screenRect)
virtual OdGsOverlayId renderTypeOverlay(OdGsModel::RenderType renderType) const
OdRxObjectPtr getSectionGeometryMap()
const OdGsView * rootView() const
void setLogicalPalette(const ODCOLORREF *logicalPalette, int numColors)
bool setBackgroundColor(ODCOLORREF backgroundColor)
void collectInvalidRectsFromVports(OdGsOverlayId nOverlay, GsDeviceOverlayData &d) const
void invalidate(const OdGsModel *pModel, const OdGsDCRect &screenRect)
OdGsModelPtr createModel()
virtual void onOverlayActivated(OdGsOverlayId nOverlay)
OdGsUpdateManagerPtr getUpdateManager(bool createIfNotExist=false)
void getSize(OdGsDCRect &outputRect) const
ODCOLORREF getPaletteBackground() const
const ODCOLORREF * getLogicalPalette(int &numColors) const
OdGsView * viewAt(int viewIndex)
virtual OdUInt32 renderTypeWeight(OdGsModel::RenderType renderType) const
virtual bool supportPartialScreenUpdate() const
void setSupportInteractiveViewMode(bool bSet)
void viewUpdateScreen(OdGsBaseVectorizeView *pView, bool bUpdate)
OdGsUpdateManagerPtr m_pUpdateManager
virtual void onOverlayDeactivated(OdGsOverlayId nOverlay)
bool eraseView(OdGsView *pView)
virtual void invalidate(OdUInt32 nOverlays, const OdGsDCRect &screenRect)
virtual bool saveLinkedDeviceState(OdGsFiler *pFiler) const
void registerOverlay(OdGsViewImpl *pView, const OdGsModel *pModel)
void setValid(bool bFlag)
ODCOLORREF getColor(OdUInt16 colorIndex) const
bool loadDeviceState(OdGsFiler *pFiler)
OdGsOverlayId gsModelOverlay(const OdGsModel *pModel) const
virtual bool supportPartialUpdate() const
void addView(OdGsView *pView)
ODRX_DECLARE_MEMBERS(OdGsBaseVectorizeDevice)
virtual bool loadLinkedDeviceState(OdGsFiler *pFiler)
const OdGsDCRectArray * invalidRects(OdGsOverlayId overlayId) const
const OdGsView * viewAt(int viewIndex) const
OdGiTransientManagerPtr m_transientManager
void getInvalidRectsFromVports(OdUInt32 nOverlays=kGsAllOverlays)
virtual void updateGeometry()
OdArray< OdGsViewPtr > m_views
void setUserGiContext(OdGiContext *pUserGiContext)
OdGiContext * userGiContext() const
virtual void invalidate(OdUInt32 nOverlays)
virtual bool loadClientDeviceState(OdGsFiler *pFiler)
void invalidateRegion(const OdGiPathNode &path)
const OdGsDCRectArray & invalidRects() const
OdGsUpdateManager * updateManager()
virtual bool saveClientDeviceState(OdGsFiler *pFiler) const
OdGsViewPtr createView(const OdGsClientViewInfo *pViewInfo=0, bool enableLayerVisibilityPerView=false)
void setTransientManager(OdGiTransientManager *pManager)
void insertView(int viewIndex, OdGsView *pView)
virtual OdGiSectionGeometryManager * getSectionGeometryManager()
OdGiTransientManager * transientManager()
OdRxDictionaryPtr properties()
void getSnapShot(OdGiRasterImagePtr &pImage, const OdGsDCRect &region)
OdGsViewImpl * viewImplAt(int viewIndex)
virtual void getSize(OdGsDCRect &outputRect) const =0
virtual const ODCOLORREF * getLogicalPalette(int &numColors) const =0
Definition Gs.h:141