CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
GiCommonDraw.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2022, 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-2022 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
32class OdGiGeometry;
33class OdGiContext;
35class OdDbStub;
37class OdGePoint3d;
38class OdGiDrawable;
39class OdGiPathNode;
41
46
50typedef enum
51{
52 eOdGiRegenTypeInvalid = 0, // Invalid regen type.
53 kOdGiStandardDisplay = 2, // Regenerating for 2D wireframe display.
54 kOdGiHideOrShadeCommand = 3, // Regenerating for legacy hide or shade commands.
55 kOdGiRenderCommand = 4, // Regenerating for rendered display.
56 kOdGiForExplode = 5, // Regenerating for explode.
57 kOdGiSaveWorldDrawForProxy = 6, // Regenerating for proxy.
58 kOdGiForExtents = 7 // Regenerating for extents.
60
64typedef enum
65{
66 kOdGiMaxDevForCircle = 0, // Set maximum deviation for circles.
67 kOdGiMaxDevForCurve = 1, // Set maximum deviation for curves.
68 kOdGiMaxDevForBoundary = 2, // Set maximum deviation for boundaries.
69 kOdGiMaxDevForIsoline = 3, // Set maximum deviation for isolines.
70 kOdGiMaxDevForFacet = 4 // Set maximum deviation for facets.
72
73class OdGiCommonDraw;
74class OdGiTextStyle;
77
81enum
82{
83 kOdGiIncludeScores = 2, // Include scores during text vectorization.
84 kOdGiRawText = 4, // Vectorize text in one raw.
85 kOdGiIncludePenups = 8, // Include penups during text vectorization.
86 kOdGiDrawShape = 16, // Draw shapes during text vectorization.
87 kOdGiIgnoreMIF = 32, // Ignore MIF during text vectorization.
88 kOdGiLastPosOnly = 64 // Calculate last position only (for internal use only)
89 ,kOdGiTextExtents = 0x10000000 //FELIX_CHANGE
90};
91
97
113{
114public:
116
123 virtual OdDbBaseDatabase* database() const = 0;
124
134 OdDbStub* drawableId) = 0;
135
143
150 virtual double commonLinetypeScale() const;
151
158 OdGiTextStyle& textStyle);
159
168 virtual void drawShape(
169 OdGiCommonDraw* pDraw,
170 OdGePoint3d& position,
171 int shapeNumber,
172 const OdGiTextStyle* pTextStyle);
173
185 virtual void drawShape(
187 const OdGePoint3d& position,
188 const OdGeVector3d& direction,
189 const OdGeVector3d& upVector,
190 int shapeNumber,
191 const OdGiTextStyle* pTextStyle,
192 const OdGeVector3d* pExtrusion);
193
207 virtual void drawText(
208 OdGiCommonDraw* pDraw,
209 OdGePoint3d& position,
210 const OdChar* msg,
211 OdInt32 numBytes,
212 const OdGiTextStyle* pTextStyle,
213 OdUInt32 flags = 0);
214
230 virtual void drawText(
231 OdGiCommonDraw* pDraw,
232 OdGePoint3d& position,
233 double height,
234 double width,
235 double oblique,
236 const OdString& msg);
237
251 virtual void drawText(
253 const OdGePoint3d& position,
254 const OdGeVector3d& direction,
255 const OdGeVector3d& upVector,
256 const OdChar* msg,
257 OdInt32 numBytes,
258 bool raw,
259 const OdGiTextStyle* pTextStyle,
260 const OdGeVector3d* pExtrusion);
261
274 virtual void textExtentsBox(
275 const OdGiTextStyle& textStyle,
276 const OdChar* msg,
277 int nLength,
278 OdUInt32 flags,
279 OdGePoint3d& min,
280 OdGePoint3d& max,
281 OdGePoint3d* pEndPos = 0);
282
291 virtual void shapeExtentsBox(
292 const OdGiTextStyle& textStyle,
293 int shapeNumber,
294 OdGePoint3d& min,
295 OdGePoint3d& max);
296
305 virtual unsigned int circleZoomPercent(
306 OdDbStub* viewportId) const;
307
314 virtual bool isPlotGeneration() const;
315
323
330 virtual bool fillTtf() const;
331
338 virtual OdUInt32 numberOfIsolines() const;
339
346 virtual bool fillMode() const;
347
354 virtual bool quickTextMode() const;
355
364 virtual OdUInt32 textQuality() const;
365
372 virtual bool useTtfTriangleCache() const;
373
378 {
379 kImageQualityDraft = 0, // Draft quality.
380 kImageQualityHigh = 1 // High quality.
381 };
382
389 virtual ImageQuality imageQuality() const;
390
395 {
396 kImageHighlight = (1 << 0), // Highlight contents of a raster image.
397 kImageSelect = (1 << 1) // Select contents of a raster image.
398 };
399
407
412 {
413 kLockedLayerFade = 0, // Fading objects on locked layers.
414 kXrefFade = 1, // Fading xref objects.
415 kRefEditFade = 2 // Fading references being edited.
416 };
417
427
432 {
433 kLightGlyph = 0, // Light glyph.
434 kCameraGlyph = 1 // Camera glyph.
435 };
436
452 virtual OdUInt32 glyphSize(GlyphType glyphType) const;
453
458 {
459 kPointLineWeight = 0, // Point lineweight style.
460 kLineCapStyle = 1, // Line cap style.
461 kLineJoinStyle = 2 // Line join style.
462 };
463
479
492 virtual OdUInt32 selectionStyle(OdUInt32 nStyle, OdGiSelectionStyle &selStyle) const;
493
498 {
500 kWCS = 0,
502 kECS = 1,
504 kNDC = 2,
506 kDCS = 3
507 };
508
520
525 {
526 kNestedDrawable = 0x1000000 // Nested drawable flag.
527 };
528
533 {
534 kSkipVectorization = 1 // Skip vectorization flag.
535 };
536
541 {
542 kDrawableFilterAppRangeStart = 0x1000000 // Start of the drawable filter range.
543#if defined(OD_SWIGCSHARP)
544 , kDrawableFilterAppRangeMask = (uint)0xFF000000 // Drawable filter range mask for C#.
545#elif defined(OD_SWIGJAVA)
546 , kDrawableFilterAppRangeMask = (long)0xFF000000 // Drawable filter range mask for Java.
547#else
548 , kDrawableFilterAppRangeMask = (OdInt32)0xFF000000 // Drawable filter range mask for other languages.
549#endif
550 };
551
560 virtual OdIntPtr drawableFilterFunctionId(OdDbStub* viewportId) const;
561
572 virtual OdUInt32 drawableFilterFunction(OdIntPtr functionId, const OdGiDrawable *pDrawable, OdUInt32 nFlags);
573
582 virtual bool ttfPolyDraw() const;
583
590 virtual bool regenAbort() const;
591
596 {
597 kPsNone = 0, // Style is disabled.
598 kPsByColor = 1, // "By color" style.
599 kPsByName = 2 // "By name" style.
600 };
601
615 virtual PStyleType plotStyleType() const;
616
624 virtual void plotStyle(
625 int penNumber,
626 OdPsPlotStyleData& plotStyleData) const;
627
634 virtual void plotStyle(
635 OdDbStub* objectId,
636 OdPsPlotStyleData& plotStyleData) const;
637
646 virtual OdDbStub* getStubByID( OdUInt64 persistentId ) const;
647
653 virtual OdUInt64 getIDByStub( OdDbStub* objectId ) const;
654
663 virtual OdDbBaseDatabase *getDatabaseByStub( OdDbStub* objectId ) const;
664
673 virtual OdDbStub* getOwnerIDByStub( OdDbStub* objectId ) const;
674
684 virtual OdDbStub* getStubByMatName( OdDbBaseDatabase *pBaseDb, const OdString& strMatName ) const;
685
695 virtual OdDbStub* getStubByMaterialId(OdDbBaseDatabase *pBaseDb, const OdUInt64& materialId) const;
696
701 {
702 kNoSilhouettes = 0, // Disables all types of silhouettes.
703 kMeshSilhouettes = (1 << 0), // Generates silhouettes for mesh primitives on Gi side.
704 kModelerSilhouettes = (1 << 1), // Generates silhouettes for Brep's on modeler geometry side.
705 kAllSilhouettes = kMeshSilhouettes | kModelerSilhouettes // Enables all types of silhouettes.
706 };
707
721 inline bool displayMeshSilhouettes() const { return GETBIT(displaySilhouettes(), kMeshSilhouettes); }
728 inline bool displayModelerSilhouettes() const { return GETBIT(displaySilhouettes(), kModelerSilhouettes); }
729
737
744 virtual OdUInt32 antiAliasingMode() const;
745
749 virtual bool xrefPropertiesOverride() const;
750
754 virtual bool multiplyByBlockLinetypeScales() const;
755};
756
766{
767public:
769
787 virtual OdGiRegenType regenType() const = 0;
788
795 virtual bool regenAbort() const = 0;
796
807
814 virtual OdGiGeometry& rawGeometry() const = 0;
815
822 virtual bool isDragging() const = 0;
823
849 virtual double deviation(
850 const OdGiDeviationType deviationType,
851 const OdGePoint3d& pointOnCurve) const = 0;
852
864 virtual OdUInt32 numberOfIsolines() const = 0;
865
872 virtual OdGiContext* context() const = 0;
873
880 virtual const OdGiPathNode* currentGiPath() const;
881
889 virtual bool displayModelerSilhouettes() const;
890};
891
903{
904 protected:
907 public:
908
917 : m_pTraits(NULL)
918 , m_prevFlags(0)
919 {
920 if (addFlags || delFlags)
921 {
922 m_prevFlags = pTraits.drawFlags();
923 OdUInt32 newFlags = (m_prevFlags & ~delFlags) | addFlags;
924 if (m_prevFlags != newFlags)
925 {
926 pTraits.setDrawFlags(newFlags);
927 m_pTraits = &pTraits;
928 }
929 }
930 }
931
936 {
937 if (m_pTraits)
938 m_pTraits->setDrawFlags(m_prevFlags);
939 }
940};
941
943{
944protected:
947public:
949 {
950 if (m_pTraits)
951 {
954 }
955 }
957 {
958 if (m_pTraits)
960 }
961};
962#include "TD_PackPop.h"
963
964#endif
965
false
Definition: DimVarDefs.h:165
unsigned int uint
Definition: FxQtCore.h:73
OdSmartPtr< OdGiSectionGeometryManager > OdGiSectionGeometryManagerPtr
Definition: GiCommonDraw.h:96
OdSmartPtr< OdGiDrawable > OdGiDrawablePtr
Definition: GiCommonDraw.h:45
OdRxObject OdDbBaseDatabase
Definition: GiCommonDraw.h:36
OdGiRegenType
Definition: GiCommonDraw.h:51
@ kOdGiStandardDisplay
Definition: GiCommonDraw.h:53
@ kOdGiHideOrShadeCommand
Definition: GiCommonDraw.h:54
@ kOdGiRenderCommand
Definition: GiCommonDraw.h:55
@ kOdGiForExtents
Definition: GiCommonDraw.h:58
@ kOdGiForExplode
Definition: GiCommonDraw.h:56
@ kOdGiSaveWorldDrawForProxy
Definition: GiCommonDraw.h:57
@ eOdGiRegenTypeInvalid
Definition: GiCommonDraw.h:52
OdGiDeviationType
Definition: GiCommonDraw.h:65
@ kOdGiMaxDevForCircle
Definition: GiCommonDraw.h:66
@ kOdGiMaxDevForIsoline
Definition: GiCommonDraw.h:69
@ kOdGiMaxDevForCurve
Definition: GiCommonDraw.h:67
@ kOdGiMaxDevForFacet
Definition: GiCommonDraw.h:70
@ kOdGiMaxDevForBoundary
Definition: GiCommonDraw.h:68
@ kOdGiIncludeScores
Definition: GiCommonDraw.h:83
@ kOdGiTextExtents
Definition: GiCommonDraw.h:89
@ kOdGiDrawShape
Definition: GiCommonDraw.h:86
@ kOdGiIgnoreMIF
Definition: GiCommonDraw.h:87
@ kOdGiRawText
Definition: GiCommonDraw.h:84
@ kOdGiIncludePenups
Definition: GiCommonDraw.h:85
@ kOdGiLastPosOnly
Definition: GiCommonDraw.h:88
#define ODCOLORREF
Definition: OdPlatform.h:933
unsigned int OdUInt32
int OdInt32
ptrdiff_t OdIntPtr
wchar_t OdChar
#define GETBIT(flags, bit)
Definition: OdaDefs.h:517
#define FIRSTDLL_EXPORT
Definition: RootExport.h:39
virtual OdGiGeometry & rawGeometry() const =0
virtual double deviation(const OdGiDeviationType deviationType, const OdGePoint3d &pointOnCurve) const =0
virtual bool isDragging() const =0
virtual bool regenAbort() const =0
virtual const OdGiPathNode * currentGiPath() const
virtual bool displayModelerSilhouettes() const
ODRX_DECLARE_MEMBERS(OdGiCommonDraw)
virtual OdGiSubEntityTraits & subEntityTraits() const =0
virtual OdUInt32 numberOfIsolines() const =0
virtual OdGiRegenType regenType() const =0
virtual OdGiContext * context() const =0
virtual OdDbBaseDatabase * database() const =0
virtual OdUInt32 numberOfIsolines() const
virtual bool useTtfTriangleCache() 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 OdDbBaseDatabase * getDatabaseByStub(OdDbStub *objectId) const
virtual bool quickTextMode() const
ODRX_DECLARE_MEMBERS(OdGiContext)
virtual OdUInt32 selectionStyle(OdUInt32 nStyle, OdGiSelectionStyle &selStyle) const
virtual OdDbStub * getStubByMaterialId(OdDbBaseDatabase *pBaseDb, const OdUInt64 &materialId) const
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:721
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 bool multiplyByBlockLinetypeScales() const
bool displayModelerSilhouettes() const
Definition: GiCommonDraw.h:728
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 OdGiSectionGeometryManagerPtr getSectionGeometryManager()
virtual OdUInt32 antiAliasingMode() const
virtual OdDbStub * getStubByMatName(OdDbBaseDatabase *pBaseDb, const OdString &strMatName) const
virtual OdUInt32 fadingIntensityPercentage(FadingType fadingType) const
virtual OdDb::LineWeight defaultLineWeight() const
virtual OdDbStub * getOwnerIDByStub(OdDbStub *objectId) const
virtual CoordinatesSystem customViewportGeometryCS(CoordinatesSystem csType) const
virtual ImageQuality imageQuality() const
virtual OdUInt32 glyphSize(GlyphType glyphType) const
virtual OdDbStub * getStubByID(OdUInt64 persistentId) const
virtual PStyleType plotStyleType() const
virtual OdUInt32 textQuality() const
virtual double commonLinetypeScale() const
virtual OdUInt32 imageSelectionBehavior() 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:916
OdGiSubEntityTraits * m_pTraits
Definition: GiCommonDraw.h:905
OdGiSubEntityTraits * m_pTraits
Definition: GiCommonDraw.h:945
OdGiSelectionGeomState(OdGiSubEntityTraits *pTraits, bool bOn)
Definition: GiCommonDraw.h:948
virtual OdUInt32 drawFlags() const
virtual void setDrawFlags(OdUInt32 drawFlags)
virtual void setSelectionGeom(bool bSelectionFlag)
virtual bool selectionGeom() const
GLint GLenum GLsizei width
Definition: gles2_ext.h:110
GLint GLenum GLsizei GLsizei height
Definition: gles2_ext.h:110
LineWeight
Definition: OdaDefs.h:386