CFx SDK Documentation  2020SP3
GiContextForDbDatabase.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 _ODGI_CONTEXTFORDBDATABASE_INCLUDED_
25 #define _ODGI_CONTEXTFORDBDATABASE_INCLUDED_
26 
27 #include "GiDefaultContext.h"
28 #include "DbExport.h"
29 #include "OdPlatform.h"
30 #include "StaticRxObject.h"
31 #include "DbDatabase.h"
32 #include "DbDatabaseReactor.h"
33 #include "Ps/PlotStyles.h"
35 #include "Gi/GiLinetyper.h"
36 
37 #include "TD_PackPush.h"
38 
39 struct OdGsClientViewInfo;
40 class OdGsView;
42 
52 {
53 private:
54  enum
55  {
56  kPlotGeneration = 1,
57  kUseGsModel = 2,
58  kOdGiZeroTextNormals = 4,
59  kDisableLayoutHelperLinkReactors = 8,
60  kTTFPolyDraw = 16,
61  kTrackDbDestroy = 32,
62  kManageContextualColors = 64,
63  kKeepPSLayoutHelperView = 128,
64  kErasePSLayoutHelperView = 256,
65  kConstantModelSpaceLineweights = 512,
66  kForceDisplaySilhouettes = 1024,
67  kLastFlag = kForceDisplaySilhouettes
68  };
69 
70  OdUInt32 m_fflags;
71 
72  class TOOLKIT_EXPORT DatabaseHolder : public OdStaticRxObject<OdDbDatabaseReactor>
73  {
74  public:
75  DatabaseHolder();
76  ~DatabaseHolder();
77 
78  OdDbDatabase* m_pDb;
79 
80  void setDatabase( bool bWasTrackDbDestroy, OdDbDatabase* pDb, bool bTrackDbDestroy );
81 
82  void goodbye(const OdDbDatabase* pDb);
83  }
84  m_DbHolder;
85 
86 protected:
89 
91 
92 public:
93 
95 
97 
98  // OdGiContext overridden functions
99 
100  virtual OdDbBaseDatabase* database() const;
101  virtual OdGiDrawablePtr openDrawable(OdDbStub* drawableId);
102  virtual OdUInt32 numberOfIsolines() const;
103  virtual double commonLinetypeScale() const;
105  virtual bool quickTextMode() const;
106  virtual OdUInt32 textQuality() const;
107  virtual ImageQuality imageQuality() const;
108  virtual OdUInt32 fadingIntensityPercentage(FadingType fadingType) const;
109  virtual bool ttfPolyDraw() const;
110  virtual OdUInt32 displaySilhouettes() const;
111 
123  void setDatabase( OdDbDatabase* pDb, bool bTrackDbDestroy = true );
124 
129 
135  virtual void fillGsClientViewInfo(const OdDbObjectId& vpId, OdGsClientViewInfo& viewInfo);
136 
142  virtual OdDbStub* getStubByID( OdUInt64 objectId ) const;
143 
144  virtual OdDbStub* getStubByMatName(const OdString& strMatName) const;
145 
146  virtual void getDefaultTextStyle(OdGiTextStyle& textStyle);
147 
148  unsigned int circleZoomPercent(OdDbStub* viewportId) const;
149 
150  virtual OdIntPtr drawableFilterFunctionId(OdDbStub* viewportId) const;
151  virtual OdUInt32 drawableFilterFunction(OdIntPtr functionId, const OdGiDrawable *pDrawable, OdUInt32 nFlags);
152 
156  bool useGsModel() const;
157 
162  void enableGsModel(bool enable);
163 
167  bool isPlotGeneration() const;
168 
173  void setPlotGeneration(bool plotGeneration);
174 
178  virtual bool isZeroTextNormals() const;
179 
184  void setZeroTextNormals(bool bZeroTextNormals);
185 
190 
195  void disableLayoutHelperLinkReactors(bool bDisableLinkReactors);
196 
201 
207 
212  virtual void updateContextualColors(OdGsView *pView);
213 
219 
224  void setTtfPolyDrawMode(bool bPolyDraw);
225 
230 
235  void enableKeepPSLayoutHelperView(bool bEnable);
236 
241 
247 
252 
258 
263 
269 
273  bool fillTtf() const;
274 
278  bool fillMode() const;
279 
283  ODCOLORREF paletteBackground() const { return m_paletteBackground; }
288  void setPaletteBackground(ODCOLORREF paletteBackground) { m_paletteBackground = paletteBackground; }
289 
294  void loadPlotStyleTable(OdStreamBuf* pStreamBuf);
295 
299  virtual PStyleType plotStyleType() const;
300 
306  virtual void plotStyle(int penNumber, OdPsPlotStyleData& plotStyleData) const;
307 
314  virtual void plotStyle(OdDbStub* psNameId, OdPsPlotStyleData& plotStyleData) const;
315 
320 
324  virtual OdUInt32 antiAliasingMode() const;
325 
329  virtual bool xrefPropertiesOverride() const;
330 
335 
341 };
342 
347 
348 
349 #include "TD_PackPop.h"
350 
351 #endif //_ODGI_CONTEXTFORDBDATABASE_INCLUDED_
OdGiContextForDbDatabase::enableConstantModelSpaceLineweights
void enableConstantModelSpaceLineweights(bool bEnable)
OdGiContextForDbDatabase::setZeroTextNormals
void setZeroTextNormals(bool bZeroTextNormals)
OdGiContextForDbDatabase::isLayoutHelperLinkReactorsDisabled
bool isLayoutHelperLinkReactorsDisabled() const
DbExport.h
OdGiContextForDbDatabase::isContextualColorsManagementEnabled
bool isContextualColorsManagementEnabled() const
OdString
Definition: OdString.h:95
OdDbDatabase
Definition: DbDatabase.h:421
OdGiContextForDbDatabase::isKeepPSLayoutHelperViewEnabled
bool isKeepPSLayoutHelperViewEnabled() const
OdGiContextForDbDatabase::fillContextualColors
virtual void fillContextualColors(OdGiContextualColorsImpl *pCtxColors)
OdGiContextForDbDatabase::xrefPropertiesOverride
virtual bool xrefPropertiesOverride() const
OdGiContextForDbDatabase::useGsModel
bool useGsModel() const
OdPlatform.h
OdGiContextForDbDatabase::OdGiContextForDbDatabase
OdGiContextForDbDatabase()
OdGsView
Definition: Gs.h:133
OdGiContextForDbDatabase::circleZoomPercent
unsigned int circleZoomPercent(OdDbStub *viewportId) const
OdGiContextForDbDatabase::enableKeepPSLayoutHelperView
void enableKeepPSLayoutHelperView(bool bEnable)
OdGiContextForDbDatabase::setPlotGeneration
void setPlotGeneration(bool plotGeneration)
PlotStyles.h
OdRxObject
Definition: RxObject.h:564
OdDbObjectId
Definition: DbObjectId.h:99
OdGiContextForDbDatabase::getDatabase
OdDbDatabase * getDatabase() const
DbDatabaseReactor.h
OdGiContextForDbDatabase::m_pPlotStyleTable
OdPsPlotStyleTablePtr m_pPlotStyleTable
Definition: GiContextForDbDatabase.h:88
OdGiContextForDbDatabase::ttfPolyDraw
virtual bool ttfPolyDraw() const
OdGiDefaultContext::SolidHatchAsPolygonMode
SolidHatchAsPolygonMode
Definition: GiDefaultContext.h:129
TD_PackPop.h
OdGiContextForDbDatabase::drawableFilterFunctionId
virtual OdIntPtr drawableFilterFunctionId(OdDbStub *viewportId) const
GiDefaultContext.h
OdGiContextForDbDatabase::enableGsModel
void enableGsModel(bool enable)
OdGiContextForDbDatabase::loadPlotStyleTable
void loadPlotStyleTable(OdStreamBuf *pStreamBuf)
OdGiContextForDbDatabase::erasePSLayoutHelperView
bool erasePSLayoutHelperView() const
OdGiContextForDbDatabase::setForceDisplaySilhouettes
void setForceDisplaySilhouettes(bool bOn)
OdUInt32
unsigned int OdUInt32
Definition: OdPlatformSettings.h:783
OdGiContextForDbDatabase::openDrawable
virtual OdGiDrawablePtr openDrawable(OdDbStub *drawableId)
OdGiContextForDbDatabase::fillMode
bool fillMode() const
OdGiContextForDbDatabase::m_paletteBackground
ODCOLORREF m_paletteBackground
Definition: GiContextForDbDatabase.h:87
OdGiContextForDbDatabase::fillGsClientViewInfo
virtual void fillGsClientViewInfo(const OdDbObjectId &vpId, OdGsClientViewInfo &viewInfo)
OdGiContextForDbDatabase::setDatabase
void setDatabase(OdDbDatabase *pDb, bool bTrackDbDestroy=true)
OdGiTextStyle
Definition: GiTextStyle.h:52
OdSmartPtr< OdPsPlotStyleTable >
OdGiContextForDbDatabase::textQuality
virtual OdUInt32 textQuality() const
DbDatabase.h
OdGiContextForDbDatabase::updateContextualColors
virtual void updateContextualColors(OdGsView *pView)
OdGiContextForDbDatabase::isZeroTextNormals
virtual bool isZeroTextNormals() const
OdGiContextForDbDatabase::commonLinetypeScale
virtual double commonLinetypeScale() const
OdGiContextForDbDatabase::disableLayoutHelperLinkReactors
void disableLayoutHelperLinkReactors(bool bDisableLinkReactors)
OdGiContextForDbDatabase::plotStyle
virtual void plotStyle(OdDbStub *psNameId, OdPsPlotStyleData &plotStyleData) const
OdGiContextForDbDatabase::isPlotGeneration
bool isPlotGeneration() const
OdGiDrawable
Definition: GiDrawable.h:49
OdGiContextForDbDatabase::hatchAsPolygon
SolidHatchAsPolygonMode hatchAsPolygon() const
OdGiContextForDbDatabase::ODRX_DECLARE_MEMBERS
ODRX_DECLARE_MEMBERS(OdGiContextForDbDatabase)
OdGiContextForDbDatabase::quickTextMode
virtual bool quickTextMode() const
OdGiContextForDbDatabase::database
virtual OdDbBaseDatabase * database() const
OdGiContextForDbDatabase::antiAliasingMode
virtual OdUInt32 antiAliasingMode() const
OdGiContextForDbDatabase::setHatchAsPolygon
void setHatchAsPolygon(SolidHatchAsPolygonMode mode)
TD_PackPush.h
StaticRxObject.h
OdGiContextForDbDatabase::displaySilhouettes
virtual OdUInt32 displaySilhouettes() const
OdGiContextForDbDatabase::plotStyleType
virtual PStyleType plotStyleType() const
OdGiContextForDbDatabase::paletteBackground
ODCOLORREF paletteBackground() const
Definition: GiContextForDbDatabase.h:283
OdGiContextForDbDatabase::defaultLineWeight
virtual OdDb::LineWeight defaultLineWeight() const
GiSubEntityTraitsData.h
OdGiContextualColorsImpl
Definition: GiContextualColors.h:325
OdGiContextForDbDatabase::setTtfPolyDrawMode
void setTtfPolyDrawMode(bool bPolyDraw)
OdGiContextForDbDatabase::enableContextualColorsManagement
void enableContextualColorsManagement(bool bEnable)
OdGiContextForDbDatabase::getStubByMatName
virtual OdDbStub * getStubByMatName(const OdString &strMatName) const
OdIntPtr
ptrdiff_t OdIntPtr
Definition: OdPlatformSettings.h:884
GiLinetyper.h
OdGiContextForDbDatabase
Definition: GiContextForDbDatabase.h:52
OdStreamBuf
Definition: OdStreamBuf.h:67
OdGiDefaultContext
Definition: GiDefaultContext.h:40
OdGsClientViewInfo
Definition: Gs.h:1021
OdStaticRxObject
Definition: StaticRxObject.h:57
OdDb::LineWeight
LineWeight
Definition: OdaDefs.h:382
OdGiContextForDbDatabase::getStubByID
virtual OdDbStub * getStubByID(OdUInt64 objectId) const
OdGiContextForDbDatabasePtr
OdSmartPtr< OdGiContextForDbDatabase > OdGiContextForDbDatabasePtr
Definition: GiContextForDbDatabase.h:346
OdGiContextForDbDatabase::isConstantModelSpaceLineweightsEnabled
bool isConstantModelSpaceLineweightsEnabled() const
ODCOLORREF
#define ODCOLORREF
Definition: OdPlatform.h:883
OdPsPlotStyleData
Definition: PlotStyles.h:135
OdGiContextForDbDatabase::~OdGiContextForDbDatabase
~OdGiContextForDbDatabase()
OdGiContextForDbDatabase::setPaletteBackground
void setPaletteBackground(ODCOLORREF paletteBackground)
Definition: GiContextForDbDatabase.h:288
OdGiContext::ImageQuality
ImageQuality
Definition: GiCommonDraw.h:318
OdGiContext::PStyleType
PStyleType
Definition: GiCommonDraw.h:452
OdGiContext::FadingType
FadingType
Definition: GiCommonDraw.h:332
TOOLKIT_EXPORT
#define TOOLKIT_EXPORT
Definition: DbExport.h:40
OdGiContextForDbDatabase::drawableFilterFunction
virtual OdUInt32 drawableFilterFunction(OdIntPtr functionId, const OdGiDrawable *pDrawable, OdUInt32 nFlags)
OdGiContextForDbDatabase::imageQuality
virtual ImageQuality imageQuality() const
OdGiContextForDbDatabase::getDefaultTextStyle
virtual void getDefaultTextStyle(OdGiTextStyle &textStyle)
OdGiContextForDbDatabase::isForceDisplaySilhouettesEnabled
bool isForceDisplaySilhouettesEnabled() const
OdGiContextForDbDatabase::setErasePSLayoutHelperView
void setErasePSLayoutHelperView(bool bOn)
kTTFPolyDraw
@ kTTFPolyDraw
Definition: GiGeomEntTypes2.h:70
OdGiContextForDbDatabase::getSectionGeometryManager
virtual OdGiSectionGeometryManagerPtr getSectionGeometryManager()
OdGiContextForDbDatabase::fillTtf
bool fillTtf() const
OdGiContextForDbDatabase::fadingIntensityPercentage
virtual OdUInt32 fadingIntensityPercentage(FadingType fadingType) const
OdGiContextForDbDatabase::numberOfIsolines
virtual OdUInt32 numberOfIsolines() const
OdUInt64
Definition: Int64.h:137
OdGiContextForDbDatabase::plotStyle
virtual void plotStyle(int penNumber, OdPsPlotStyleData &plotStyleData) const