CFx SDK Documentation  2022 SP0
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_
#define TOOLKIT_EXPORT
Definition: DbExport.h:40
OdSmartPtr< OdGiContextForDbDatabase > OdGiContextForDbDatabasePtr
@ kTTFPolyDraw
#define ODCOLORREF
Definition: OdPlatform.h:883
unsigned int OdUInt32
ptrdiff_t OdIntPtr
bool isContextualColorsManagementEnabled() const
virtual OdUInt32 numberOfIsolines() const
bool isForceDisplaySilhouettesEnabled() const
ODCOLORREF paletteBackground() const
unsigned int circleZoomPercent(OdDbStub *viewportId) const
void enableConstantModelSpaceLineweights(bool bEnable)
virtual OdGiDrawablePtr openDrawable(OdDbStub *drawableId)
bool isPlotGeneration() const
virtual OdUInt32 fadingIntensityPercentage(FadingType fadingType) const
virtual OdUInt32 displaySilhouettes() const
virtual OdUInt32 textQuality() const
virtual OdDb::LineWeight defaultLineWeight() const
virtual bool ttfPolyDraw() const
virtual ImageQuality imageQuality() const
void setForceDisplaySilhouettes(bool bOn)
virtual void fillGsClientViewInfo(const OdDbObjectId &vpId, OdGsClientViewInfo &viewInfo)
void disableLayoutHelperLinkReactors(bool bDisableLinkReactors)
void enableContextualColorsManagement(bool bEnable)
virtual bool xrefPropertiesOverride() const
virtual PStyleType plotStyleType() const
virtual void updateContextualColors(OdGsView *pView)
bool isKeepPSLayoutHelperViewEnabled() const
virtual OdUInt32 antiAliasingMode() const
virtual OdIntPtr drawableFilterFunctionId(OdDbStub *viewportId) const
OdPsPlotStyleTablePtr m_pPlotStyleTable
virtual void plotStyle(int penNumber, OdPsPlotStyleData &plotStyleData) const
void loadPlotStyleTable(OdStreamBuf *pStreamBuf)
void setHatchAsPolygon(SolidHatchAsPolygonMode mode)
virtual void plotStyle(OdDbStub *psNameId, OdPsPlotStyleData &plotStyleData) const
void setErasePSLayoutHelperView(bool bOn)
ODRX_DECLARE_MEMBERS(OdGiContextForDbDatabase)
void enableKeepPSLayoutHelperView(bool bEnable)
void setZeroTextNormals(bool bZeroTextNormals)
void setPaletteBackground(ODCOLORREF paletteBackground)
void setPlotGeneration(bool plotGeneration)
void enableGsModel(bool enable)
void setDatabase(OdDbDatabase *pDb, bool bTrackDbDestroy=true)
virtual OdGiSectionGeometryManagerPtr getSectionGeometryManager()
virtual bool isZeroTextNormals() const
virtual OdUInt32 drawableFilterFunction(OdIntPtr functionId, const OdGiDrawable *pDrawable, OdUInt32 nFlags)
bool erasePSLayoutHelperView() const
virtual void getDefaultTextStyle(OdGiTextStyle &textStyle)
void setTtfPolyDrawMode(bool bPolyDraw)
SolidHatchAsPolygonMode hatchAsPolygon() const
virtual OdDbBaseDatabase * database() const
virtual bool quickTextMode() const
virtual OdDbStub * getStubByID(OdUInt64 objectId) const
virtual OdDbStub * getStubByMatName(const OdString &strMatName) const
virtual double commonLinetypeScale() const
virtual void fillContextualColors(OdGiContextualColorsImpl *pCtxColors)
OdDbDatabase * getDatabase() const
bool isLayoutHelperLinkReactorsDisabled() const
bool isConstantModelSpaceLineweightsEnabled() const
Definition: Gs.h:133
LineWeight
Definition: OdaDefs.h:382