CFx SDK Documentation  2022 SP0
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 
unsigned int uint
Definition: FxQtCore.h:73
OdSmartPtr< OdGiSectionGeometryManager > OdGiSectionGeometryManagerPtr
Definition: GiCommonDraw.h:90
OdSmartPtr< OdGiDrawable > OdGiDrawablePtr
Definition: GiCommonDraw.h:39
OdRxObject OdDbBaseDatabase
Definition: GiCommonDraw.h:35
OdGiRegenType
Definition: GiCommonDraw.h:50
@ kOdGiStandardDisplay
Definition: GiCommonDraw.h:52
@ kOdGiHideOrShadeCommand
Definition: GiCommonDraw.h:53
@ kOdGiRenderCommand
Definition: GiCommonDraw.h:54
@ kOdGiForExtents
Definition: GiCommonDraw.h:57
@ kOdGiForExplode
Definition: GiCommonDraw.h:55
@ kOdGiSaveWorldDrawForProxy
Definition: GiCommonDraw.h:56
@ eOdGiRegenTypeInvalid
Definition: GiCommonDraw.h:51
OdGiDeviationType
Definition: GiCommonDraw.h:64
@ kOdGiMaxDevForCircle
Definition: GiCommonDraw.h:65
@ kOdGiMaxDevForIsoline
Definition: GiCommonDraw.h:68
@ kOdGiMaxDevForCurve
Definition: GiCommonDraw.h:66
@ kOdGiMaxDevForFacet
Definition: GiCommonDraw.h:69
@ kOdGiMaxDevForBoundary
Definition: GiCommonDraw.h:67
@ kOdGiIncludeScores
Definition: GiCommonDraw.h:82
@ kOdGiTextExtents
Definition: GiCommonDraw.h:87
@ kOdGiDrawShape
Definition: GiCommonDraw.h:85
@ kOdGiIgnoreMIF
Definition: GiCommonDraw.h:86
@ kOdGiRawText
Definition: GiCommonDraw.h:83
@ kOdGiIncludePenups
Definition: GiCommonDraw.h:84
#define NULL
Definition: GsProperties.h:177
#define ODCOLORREF
Definition: OdPlatform.h:883
unsigned int OdUInt32
int OdInt32
ptrdiff_t OdIntPtr
wchar_t OdChar
#define GETBIT(flags, bit)
Definition: OdaDefs.h:498
#define FIRSTDLL_EXPORT
Definition: RootExport.h:39
virtual double deviation(const OdGiDeviationType deviationType, const OdGePoint3d &pointOnCurve) const =0
virtual bool isDragging() const =0
virtual bool regenAbort() const =0
virtual OdGiGeometry & rawGeometry() const =0
virtual const OdGiPathNode * currentGiPath() const
virtual bool displayModelerSilhouettes() const
virtual OdGiSubEntityTraits & subEntityTraits() const =0
virtual OdGiContext * context() const =0
ODRX_DECLARE_MEMBERS(OdGiCommonDraw)
virtual OdUInt32 numberOfIsolines() const =0
virtual OdGiRegenType regenType() const =0
virtual OdUInt32 numberOfIsolines() const
virtual OdDbStub * getStubByID(OdUInt64 persistentId) const
virtual void drawShape(OdGiConveyorGeometry *pDest, const OdGePoint3d &position, const OdGeVector3d &direction, const OdGeVector3d &upVector, int shapeNumber, const OdGiTextStyle *pTextStyle, const OdGeVector3d *pExtrusion)
virtual ODCOLORREF paletteBackground() const
virtual bool ttfPolyDraw() const
virtual bool quickTextMode() const
virtual OdDbStub * getOwnerIDByStub(OdDbStub *objectId) const
ODRX_DECLARE_MEMBERS(OdGiContext)
virtual OdGiDrawablePtr openDrawable(OdDbStub *drawableId)=0
virtual void shapeExtentsBox(const OdGiTextStyle &textStyle, int shapeNumber, OdGePoint3d &min, OdGePoint3d &max)
virtual bool fillTtf() const
virtual OdUInt32 displaySilhouettes() const
virtual OdUInt64 getIDByStub(OdDbStub *objectId) const
virtual OdUInt32 drawableFilterFunction(OdIntPtr functionId, const OdGiDrawable *pDrawable, OdUInt32 nFlags)
bool displayMeshSilhouettes() const
Definition: GiCommonDraw.h:541
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)
virtual void drawShape(OdGiCommonDraw *pDraw, OdGePoint3d &position, int shapeNumber, const OdGiTextStyle *pTextStyle)
virtual void plotStyle(OdDbStub *objectId, OdPsPlotStyleData &plotStyleData) const
virtual void plotStyle(int penNumber, OdPsPlotStyleData &plotStyleData) const
virtual bool fillMode() const
virtual OdDbBaseDatabase * database() const =0
bool displayModelerSilhouettes() const
Definition: GiCommonDraw.h:545
virtual unsigned int circleZoomPercent(OdDbStub *viewportId) const
virtual bool xrefPropertiesOverride() const
virtual void drawText(OdGiCommonDraw *pDraw, OdGePoint3d &position, const OdChar *msg, OdInt32 numBytes, const OdGiTextStyle *pTextStyle, OdUInt32 flags=0)
virtual void getDefaultTextStyle(OdGiTextStyle &textStyle)
virtual void drawText(OdGiCommonDraw *pDraw, OdGePoint3d &position, double height, double width, double oblique, const OdString &msg)
virtual OdDbStub * getStubByMatName(const OdString &strMatName) const
virtual OdGiSectionGeometryManagerPtr getSectionGeometryManager()
virtual OdUInt32 antiAliasingMode() const
virtual OdUInt32 fadingIntensityPercentage(FadingType fadingType) const
virtual OdDb::LineWeight defaultLineWeight() const
virtual ImageQuality imageQuality() const
virtual OdUInt32 glyphSize(GlyphType glyphType) const
virtual OdDbBaseDatabase * getDatabaseByStub(OdDbStub *objectId) const
virtual PStyleType plotStyleType() const
virtual OdUInt32 textQuality() const
virtual double commonLinetypeScale() const
virtual void textExtentsBox(const OdGiTextStyle &textStyle, const OdChar *msg, int nLength, OdUInt32 flags, OdGePoint3d &min, OdGePoint3d &max, OdGePoint3d *pEndPos=0)
virtual bool regenAbort() const
virtual bool isPlotGeneration() const
virtual OdUInt32 lineWeightConfiguration(LineWeightStyle styleEntry) const
virtual OdIntPtr drawableFilterFunctionId(OdDbStub *viewportId) const
OdGiDrawFlagsHelper(OdGiSubEntityTraits &pTraits, OdUInt32 addFlags, OdUInt32 delFlags=0)
Definition: GiCommonDraw.h:690
OdGiSubEntityTraits * m_pTraits
Definition: GiCommonDraw.h:687
virtual OdUInt32 drawFlags() const
virtual void setDrawFlags(OdUInt32 drawFlags)
GLint GLenum GLsizei width
Definition: gles2_ext.h:110
GLint GLenum GLsizei GLsizei height
Definition: gles2_ext.h:110
const T & min(const T &x, const T &y)
const T & max(const T &x, const T &y)
@ kMeshSilhouettes
Definition: FxHLR.h:47
LineWeight
Definition: OdaDefs.h:382