CFx SDK Documentation  2020SP3
GiCommonDraw.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 __ODGICOMMONDRAW_H__
25 #define __ODGICOMMONDRAW_H__
26 
27 #include "TD_PackPush.h"
28 
29 #include "RxObject.h"
30 #include "Gi/Gi.h"
31 
32 class OdGiGeometry;
33 class OdGiContext;
35 class OdDbStub;
37 class OdGePoint3d;
38 class OdGiDrawable;
39 class OdGiPathNode;
40 
45 
49 typedef enum
50 {
51  eOdGiRegenTypeInvalid = 0, // Invalid regen type.
52  kOdGiStandardDisplay = 2, // Regenerating for 2D wireframe display.
53  kOdGiHideOrShadeCommand = 3, // Regenerating for legacy hide or shade commands.
54  kOdGiRenderCommand = 4, // Regenerating for rendered display.
55  kOdGiForExplode = 5, // Regenerating for explode.
56  kOdGiSaveWorldDrawForProxy = 6, // Regenerating for proxy.
57  kOdGiForExtents = 7 // Regenerating for extents.
59 
63 typedef enum
64 {
65  kOdGiMaxDevForCircle = 0, // Set maximum deviation for circles.
66  kOdGiMaxDevForCurve = 1, // Set maximum deviation for curves.
67  kOdGiMaxDevForBoundary = 2, // Set maximum deviation for boundaries.
68  kOdGiMaxDevForIsoline = 3, // Set maximum deviation for isolines.
69  kOdGiMaxDevForFacet = 4 // Set maximum deviation for facets.
71 
72 class OdGiCommonDraw;
73 class OdGiTextStyle;
74 class OdPsPlotStyleData;
76 
80 enum
81 {
82  kOdGiIncludeScores = 2, // Include scores during text vectorization.
83  kOdGiRawText = 4, // Vectorize text in one raw.
84  kOdGiIncludePenups = 8, // Include penups during text vectorization.
85  kOdGiDrawShape = 16, // Draw shapes during text vectorization.
86  kOdGiIgnoreMIF = 32 // Ignore MIF during text vectorization.
87  ,kOdGiTextExtents = 0x10000000 //FELIX_CHANGE
88 };
89 
92 
108 {
109 public:
111 
115  virtual OdDbBaseDatabase* database() const = 0;
116 
126  OdDbStub* drawableId) = 0;
127 
132 
136  virtual double commonLinetypeScale() const;
137 
143  virtual void getDefaultTextStyle(
144  OdGiTextStyle& textStyle);
145 
154  virtual void drawShape(
155  OdGiCommonDraw* pDraw,
156  OdGePoint3d& position,
157  int shapeNumber,
158  const OdGiTextStyle* pTextStyle);
159 
165  virtual void drawShape(
166  OdGiConveyorGeometry* pDest,
167  const OdGePoint3d& position,
168  const OdGeVector3d& direction,
169  const OdGeVector3d& upVector,
170  int shapeNumber,
171  const OdGiTextStyle* pTextStyle,
172  const OdGeVector3d* pExtrusion);
173 
187  virtual void drawText(
188  OdGiCommonDraw* pDraw,
189  OdGePoint3d& position,
190  const OdChar* msg,
191  OdInt32 numBytes,
192  const OdGiTextStyle* pTextStyle,
193  OdUInt32 flags = 0);
194 
205  virtual void drawText(
206  OdGiCommonDraw* pDraw,
207  OdGePoint3d& position,
208  double height,
209  double width,
210  double oblique,
211  const OdString& msg);
212 
219  virtual void drawText(
220  OdGiConveyorGeometry* pDest,
221  const OdGePoint3d& position,
222  const OdGeVector3d& direction,
223  const OdGeVector3d& upVector,
224  const OdChar* msg,
225  OdInt32 numBytes,
226  bool raw,
227  const OdGiTextStyle* pTextStyle,
228  const OdGeVector3d* pExtrusion);
229 
242  virtual void textExtentsBox(
243  const OdGiTextStyle& textStyle,
244  const OdChar* msg,
245  int nLength,
246  OdUInt32 flags,
247  OdGePoint3d& min,
248  OdGePoint3d& max,
249  OdGePoint3d* pEndPos = 0);
250 
259  virtual void shapeExtentsBox(
260  const OdGiTextStyle& textStyle,
261  int shapeNumber,
262  OdGePoint3d& min,
263  OdGePoint3d& max);
264 
273  virtual unsigned int circleZoomPercent(
274  OdDbStub* viewportId) const;
275 
279  virtual bool isPlotGeneration() const;
280 
284  virtual ODCOLORREF paletteBackground() const;
285 
289  virtual bool fillTtf() const;
290 
294  virtual OdUInt32 numberOfIsolines() const;
295 
299  virtual bool fillMode() const;
300 
304  virtual bool quickTextMode() const;
305 
312  virtual OdUInt32 textQuality() const;
313 
318  {
319  kImageQualityDraft = 0, // Draft quality.
320  kImageQualityHigh = 1 // High quality.
321  };
322 
326  virtual ImageQuality imageQuality() const;
327 
332  {
333  kLockedLayerFade = 0, // Fading objects on locked layers.
334  kXrefFade = 1, // Fading xref objects.
335  kRefEditFade = 2 // Fading references being edited.
336  };
337 
341  virtual OdUInt32 fadingIntensityPercentage(FadingType fadingType) const;
342 
347  {
348  kLightGlyph = 0, // Light glyph.
349  kCameraGlyph = 1 // Camera glyph.
350  };
351 
367  virtual OdUInt32 glyphSize(GlyphType glyphType) const;
368 
373  {
374  kPointLineWeight = 0, // Point lineweight style.
375  kLineCapStyle = 1, // Line cap style.
376  kLineJoinStyle = 2 // Line join style.
377  };
378 
390 
395  {
396  kNestedDrawable = 0x1000000 // Nested drawable flag.
397  };
398 
403  {
404  kSkipVectorization = 1 // Skip vectorization flag.
405  };
406 
411  {
412  kDrawableFilterAppRangeStart = 0x1000000 // Start of the drawable filter range.
413 #if defined(OD_SWIGCSHARP)
414  , kDrawableFilterAppRangeMask = (uint)0xFF000000 // Drawable filter range mask for C#.
415 #elif defined(OD_SWIGJAVA)
416  , kDrawableFilterAppRangeMask = (long)0xFF000000 // Drawable filter range mask for Java.
417 #else
418  , kDrawableFilterAppRangeMask = (OdInt32)0xFF000000 // Drawable filter range mask for other languages.
419 #endif
420  };
421 
427  virtual OdIntPtr drawableFilterFunctionId(OdDbStub* viewportId) const;
428 
436  virtual OdUInt32 drawableFilterFunction(OdIntPtr functionId, const OdGiDrawable *pDrawable, OdUInt32 nFlags);
437 
441  virtual bool ttfPolyDraw() const;
442 
446  virtual bool regenAbort() const;
447 
452  {
453  kPsNone = 0, // Style is disabled.
454  kPsByColor = 1, // "By color" style.
455  kPsByName = 2 // "By name" style.
456  };
457 
471  virtual PStyleType plotStyleType() const;
472 
480  virtual void plotStyle(
481  int penNumber,
482  OdPsPlotStyleData& plotStyleData) const;
483 
484  virtual void plotStyle(
485  OdDbStub* objectId,
486  OdPsPlotStyleData& plotStyleData) const;
487 
493  virtual OdDbStub* getStubByID( OdUInt64 persistentId ) const;
494 
500  virtual OdUInt64 getIDByStub( OdDbStub* objectId ) const;
501 
507  virtual OdDbBaseDatabase *getDatabaseByStub( OdDbStub* objectId ) const;
508 
514  virtual OdDbStub* getOwnerIDByStub( OdDbStub* objectId ) const;
515 
521  virtual OdDbStub* getStubByMatName( const OdString& strMatName ) const;
522 
527  {
528  kNoSilhouettes = 0, // Disables all types of silhouettes.
529  kMeshSilhouettes = (1 << 0), // Generates silhouettes for shell primitives on Gi side.
530  kModelerSilhouettes = (1 << 1), // Generates silhouettes for Brep's on modeler geometry side.
531  kAllSilhouettes = kMeshSilhouettes | kModelerSilhouettes // Enables all types of silhouettes.
532  };
533 
537  virtual OdUInt32 displaySilhouettes() const;
541  inline bool displayMeshSilhouettes() const { return GETBIT(displaySilhouettes(), kMeshSilhouettes); }
545  inline bool displayModelerSilhouettes() const { return GETBIT(displaySilhouettes(), kModelerSilhouettes); }
546 
551 
555  virtual OdUInt32 antiAliasingMode() const;
556 
560  virtual bool xrefPropertiesOverride() const;
561 };
562 
572 {
573 public:
575 
593  virtual OdGiRegenType regenType() const = 0;
594 
598  virtual bool regenAbort() const = 0;
599 
606  virtual OdGiSubEntityTraits& subEntityTraits() const = 0;
607 
614  virtual OdGiGeometry& rawGeometry() const = 0;
615 
621  virtual bool isDragging() const = 0;
622 
648  virtual double deviation(
649  const OdGiDeviationType deviationType,
650  const OdGePoint3d& pointOnCurve) const = 0;
651 
655  virtual OdUInt32 numberOfIsolines() const = 0;
656 
660  virtual OdGiContext* context() const = 0;
661 
665  virtual const OdGiPathNode* currentGiPath() const;
666 
671  virtual bool displayModelerSilhouettes() const;
672 };
673 
685 {
686  protected:
689  public:
690  OdGiDrawFlagsHelper(OdGiSubEntityTraits &pTraits, OdUInt32 addFlags, OdUInt32 delFlags = 0)
691  : m_pTraits(NULL)
692  {
693  if (addFlags || delFlags)
694  {
695  m_prevFlags = pTraits.drawFlags();
696  OdUInt32 newFlags = (m_prevFlags & ~delFlags) | addFlags;
697  if (m_prevFlags != newFlags)
698  {
699  pTraits.setDrawFlags(newFlags);
700  m_pTraits = &pTraits;
701  }
702  }
703  }
705  {
706  if (m_pTraits)
707  m_pTraits->setDrawFlags(m_prevFlags);
708  }
709 };
710 
711 #include "TD_PackPop.h"
712 
713 #endif
714 
GETBIT
#define GETBIT(flags, bit)
Definition: OdaDefs.h:498
FIRSTDLL_EXPORT
#define FIRSTDLL_EXPORT
Definition: RootExport.h:39
OdGiContext::plotStyle
virtual void plotStyle(OdDbStub *objectId, OdPsPlotStyleData &plotStyleData) const
OdGiContext
Definition: GiCommonDraw.h:108
OdGiSectionGeometryManager
Definition: GiSectionGeometry.h:111
OdGiContext::getDatabaseByStub
virtual OdDbBaseDatabase * getDatabaseByStub(OdDbStub *objectId) const
OdGeVector3d
Definition: GeVector3d.h:54
OdString
Definition: OdString.h:95
NULL
#define NULL
Definition: GsProperties.h:177
OdDbBaseDatabase
OdRxObject OdDbBaseDatabase
Definition: GiCommonDraw.h:35
OdGiContext::commonLinetypeScale
virtual double commonLinetypeScale() const
kOdGiStandardDisplay
@ kOdGiStandardDisplay
Definition: GiCommonDraw.h:52
OdGiContext::defaultLineWeight
virtual OdDb::LineWeight defaultLineWeight() const
kOdGiMaxDevForCurve
@ kOdGiMaxDevForCurve
Definition: GiCommonDraw.h:66
OdGiContext::circleZoomPercent
virtual unsigned int circleZoomPercent(OdDbStub *viewportId) const
OdGiCommonDraw::deviation
virtual double deviation(const OdGiDeviationType deviationType, const OdGePoint3d &pointOnCurve) const =0
OdGiContext::LineWeightStyle
LineWeightStyle
Definition: GiCommonDraw.h:373
OdGiContext::lineWeightConfiguration
virtual OdUInt32 lineWeightConfiguration(LineWeightStyle styleEntry) const
kOdGiDrawShape
@ kOdGiDrawShape
Definition: GiCommonDraw.h:85
OdRxObject
Definition: RxObject.h:564
OdGiContext::xrefPropertiesOverride
virtual bool xrefPropertiesOverride() const
OdGiContext::getStubByID
virtual OdDbStub * getStubByID(OdUInt64 persistentId) const
kOdGiForExtents
@ kOdGiForExtents
Definition: GiCommonDraw.h:57
eOdGiRegenTypeInvalid
@ eOdGiRegenTypeInvalid
Definition: GiCommonDraw.h:51
FacetModelerProfile2DBool::min
const T & min(const T &x, const T &y)
Definition: FMImpProfile2DBool.h:98
OdGiContext::regenAbort
virtual bool regenAbort() const
OdGiContext::fillMode
virtual bool fillMode() const
OdGiContext::DrawableFilterOutputFlags
DrawableFilterOutputFlags
Definition: GiCommonDraw.h:403
OdGiContext::drawShape
virtual void drawShape(OdGiConveyorGeometry *pDest, const OdGePoint3d &position, const OdGeVector3d &direction, const OdGeVector3d &upVector, int shapeNumber, const OdGiTextStyle *pTextStyle, const OdGeVector3d *pExtrusion)
TD_PackPop.h
OdGiContext::DrawableFilterInputFlags
DrawableFilterInputFlags
Definition: GiCommonDraw.h:395
OdGiContext::fadingIntensityPercentage
virtual OdUInt32 fadingIntensityPercentage(FadingType fadingType) const
OdGiContext::drawText
virtual void drawText(OdGiCommonDraw *pDraw, OdGePoint3d &position, const OdChar *msg, OdInt32 numBytes, const OdGiTextStyle *pTextStyle, OdUInt32 flags=0)
OdGiContext::getSectionGeometryManager
virtual OdGiSectionGeometryManagerPtr getSectionGeometryManager()
OdGiDrawFlagsHelper::m_prevFlags
OdUInt32 m_prevFlags
Definition: GiCommonDraw.h:688
RxObject.h
OdUInt32
unsigned int OdUInt32
Definition: OdPlatformSettings.h:783
kOdGiRenderCommand
@ kOdGiRenderCommand
Definition: GiCommonDraw.h:54
OdGiCommonDraw
Definition: GiCommonDraw.h:572
OdGiContext::shapeExtentsBox
virtual void shapeExtentsBox(const OdGiTextStyle &textStyle, int shapeNumber, OdGePoint3d &min, OdGePoint3d &max)
OdGiContext::openDrawable
virtual OdGiDrawablePtr openDrawable(OdDbStub *drawableId)=0
OdGiContext::getOwnerIDByStub
virtual OdDbStub * getOwnerIDByStub(OdDbStub *objectId) const
OdGiContext::drawText
virtual void drawText(OdGiConveyorGeometry *pDest, const OdGePoint3d &position, const OdGeVector3d &direction, const OdGeVector3d &upVector, const OdChar *msg, OdInt32 numBytes, bool raw, const OdGiTextStyle *pTextStyle, const OdGeVector3d *pExtrusion)
kOdGiIncludePenups
@ kOdGiIncludePenups
Definition: GiCommonDraw.h:84
OdGiDrawFlagsHelper
Definition: GiCommonDraw.h:685
OdGiConveyorGeometry
Definition: GiConveyorGeometry.h:270
OdGiContext::drawableFilterFunctionId
virtual OdIntPtr drawableFilterFunctionId(OdDbStub *viewportId) const
OdGiTextStyle
Definition: GiTextStyle.h:52
OdGiContext::imageQuality
virtual ImageQuality imageQuality() const
OdSmartPtr< OdGiDrawable >
OdGePoint3d
Definition: GePoint3d.h:55
kOdGiMaxDevForIsoline
@ kOdGiMaxDevForIsoline
Definition: GiCommonDraw.h:68
OdGiPathNode
Definition: GiPathNode.h:36
kOdGiMaxDevForFacet
@ kOdGiMaxDevForFacet
Definition: GiCommonDraw.h:69
OdGiCommonDraw::subEntityTraits
virtual OdGiSubEntityTraits & subEntityTraits() const =0
OdInt32
int OdInt32
Definition: OdPlatformSettings.h:782
OdGiContext::glyphSize
virtual OdUInt32 glyphSize(GlyphType glyphType) const
OdGiCommonDraw::numberOfIsolines
virtual OdUInt32 numberOfIsolines() const =0
OdGiContext::drawText
virtual void drawText(OdGiCommonDraw *pDraw, OdGePoint3d &position, double height, double width, double oblique, const OdString &msg)
OdGiContext::SilhouetteType
SilhouetteType
Definition: GiCommonDraw.h:527
OdGiDrawable
Definition: GiDrawable.h:49
OdGiContext::textExtentsBox
virtual void textExtentsBox(const OdGiTextStyle &textStyle, const OdChar *msg, int nLength, OdUInt32 flags, OdGePoint3d &min, OdGePoint3d &max, OdGePoint3d *pEndPos=0)
FxHLR::kMeshSilhouettes
@ kMeshSilhouettes
Definition: FxHLR.h:47
OdGiContext::textQuality
virtual OdUInt32 textQuality() const
OdGiCommonDraw::displayModelerSilhouettes
virtual bool displayModelerSilhouettes() const
OdGiDrawFlagsHelper::m_pTraits
OdGiSubEntityTraits * m_pTraits
Definition: GiCommonDraw.h:687
OdGiContext::GlyphType
GlyphType
Definition: GiCommonDraw.h:347
FacetModelerProfile2DBool::max
const T & max(const T &x, const T &y)
Definition: FMImpProfile2DBool.h:105
OdChar
wchar_t OdChar
Definition: OdPlatformSettings.h:745
OdGiContext::getDefaultTextStyle
virtual void getDefaultTextStyle(OdGiTextStyle &textStyle)
OdGiContext::displayMeshSilhouettes
bool displayMeshSilhouettes() const
Definition: GiCommonDraw.h:541
height
GLint GLenum GLsizei GLsizei height
Definition: gles2_ext.h:110
width
GLint GLenum GLsizei width
Definition: gles2_ext.h:110
OdGiContext::numberOfIsolines
virtual OdUInt32 numberOfIsolines() const
OdGiCommonDraw::currentGiPath
virtual const OdGiPathNode * currentGiPath() const
OdGiDrawablePtr
OdSmartPtr< OdGiDrawable > OdGiDrawablePtr
Definition: GiCommonDraw.h:39
OdGiContext::drawShape
virtual void drawShape(OdGiCommonDraw *pDraw, OdGePoint3d &position, int shapeNumber, const OdGiTextStyle *pTextStyle)
OdGiSubEntityTraits::drawFlags
virtual OdUInt32 drawFlags() const
TD_PackPush.h
kOdGiSaveWorldDrawForProxy
@ kOdGiSaveWorldDrawForProxy
Definition: GiCommonDraw.h:56
OdGiSubEntityTraits
Definition: Gi.h:94
OdGiContext::database
virtual OdDbBaseDatabase * database() const =0
OdGiContext::fillTtf
virtual bool fillTtf() const
OdGiDrawFlagsHelper::~OdGiDrawFlagsHelper
~OdGiDrawFlagsHelper()
Definition: GiCommonDraw.h:704
OdGiDeviationType
OdGiDeviationType
Definition: GiCommonDraw.h:64
OdGiCommonDraw::ODRX_DECLARE_MEMBERS
ODRX_DECLARE_MEMBERS(OdGiCommonDraw)
OdGiContext::ODRX_DECLARE_MEMBERS
ODRX_DECLARE_MEMBERS(OdGiContext)
OdIntPtr
ptrdiff_t OdIntPtr
Definition: OdPlatformSettings.h:884
kOdGiRawText
@ kOdGiRawText
Definition: GiCommonDraw.h:83
OdGiGeometry
Definition: GiGeometry.h:698
OdDb::LineWeight
LineWeight
Definition: OdaDefs.h:382
kOdGiIncludeScores
@ kOdGiIncludeScores
Definition: GiCommonDraw.h:82
OdGiCommonDraw::rawGeometry
virtual OdGiGeometry & rawGeometry() const =0
OdGiCommonDraw::regenType
virtual OdGiRegenType regenType() const =0
OdGiCommonDraw::context
virtual OdGiContext * context() const =0
kOdGiHideOrShadeCommand
@ kOdGiHideOrShadeCommand
Definition: GiCommonDraw.h:53
OdGiContext::quickTextMode
virtual bool quickTextMode() const
ODCOLORREF
#define ODCOLORREF
Definition: OdPlatform.h:883
kOdGiTextExtents
@ kOdGiTextExtents
Definition: GiCommonDraw.h:87
OdGiCommonDraw::isDragging
virtual bool isDragging() const =0
uint
unsigned int uint
Definition: FxQtCore.h:73
OdPsPlotStyleData
Definition: PlotStyles.h:135
OdGiContext::ImageQuality
ImageQuality
Definition: GiCommonDraw.h:318
kOdGiForExplode
@ kOdGiForExplode
Definition: GiCommonDraw.h:55
OdGiContext::displaySilhouettes
virtual OdUInt32 displaySilhouettes() const
OdGiContext::PStyleType
PStyleType
Definition: GiCommonDraw.h:452
OdGiContext::FadingType
FadingType
Definition: GiCommonDraw.h:332
OdGiContext::ttfPolyDraw
virtual bool ttfPolyDraw() const
kOdGiMaxDevForBoundary
@ kOdGiMaxDevForBoundary
Definition: GiCommonDraw.h:67
OdGiContext::plotStyleType
virtual PStyleType plotStyleType() const
OdGiSubEntityTraits::setDrawFlags
virtual void setDrawFlags(OdUInt32 drawFlags)
kOdGiIgnoreMIF
@ kOdGiIgnoreMIF
Definition: GiCommonDraw.h:86
OdGiContext::getIDByStub
virtual OdUInt64 getIDByStub(OdDbStub *objectId) const
OdGiContext::isPlotGeneration
virtual bool isPlotGeneration() const
OdGiRegenType
OdGiRegenType
Definition: GiCommonDraw.h:50
OdGiContext::displayModelerSilhouettes
bool displayModelerSilhouettes() const
Definition: GiCommonDraw.h:545
OdGiContext::antiAliasingMode
virtual OdUInt32 antiAliasingMode() const
kOdGiMaxDevForCircle
@ kOdGiMaxDevForCircle
Definition: GiCommonDraw.h:65
OdGiDrawFlagsHelper::OdGiDrawFlagsHelper
OdGiDrawFlagsHelper(OdGiSubEntityTraits &pTraits, OdUInt32 addFlags, OdUInt32 delFlags=0)
Definition: GiCommonDraw.h:690
OdGiContext::getStubByMatName
virtual OdDbStub * getStubByMatName(const OdString &strMatName) const
OdGiContext::drawableFilterFunction
virtual OdUInt32 drawableFilterFunction(OdIntPtr functionId, const OdGiDrawable *pDrawable, OdUInt32 nFlags)
OdGiCommonDraw::regenAbort
virtual bool regenAbort() const =0
OdGiSectionGeometryManagerPtr
OdSmartPtr< OdGiSectionGeometryManager > OdGiSectionGeometryManagerPtr
Definition: GiCommonDraw.h:90
OdGiContext::plotStyle
virtual void plotStyle(int penNumber, OdPsPlotStyleData &plotStyleData) const
Gi.h
OdUInt64
Definition: Int64.h:137
OdGiContext::DrawableFilterRanges
DrawableFilterRanges
Definition: GiCommonDraw.h:411
OdGiContext::paletteBackground
virtual ODCOLORREF paletteBackground() const