CFx SDK Documentation 2026 SP0
Loading...
Searching...
No Matches
GiCommonDraw.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2024, 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-2024 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)
90 ,kOdGiTextExtents = 0x10000000 //FELIX_CHANGE
91};
92
98
113class FIRSTDLL_EXPORT OdGiContext : public OdRxObject
114{
115public:
117
124 virtual OdDbBaseDatabase* database() const = 0;
125
135 OdDbStub* drawableId) = 0;
136
144
151 virtual double commonLinetypeScale() const;
152
159 OdGiTextStyle& textStyle);
160
169 virtual void drawShape(
170 OdGiCommonDraw* pDraw,
171 OdGePoint3d& position,
172 int shapeNumber,
173 const OdGiTextStyle* pTextStyle);
174
186 virtual void drawShape(
188 const OdGePoint3d& position,
189 const OdGeVector3d& direction,
190 const OdGeVector3d& upVector,
191 int shapeNumber,
192 const OdGiTextStyle* pTextStyle,
193 const OdGeVector3d* pExtrusion);
194
208 virtual void drawText(
209 OdGiCommonDraw* pDraw,
210 OdGePoint3d& position,
211 const OdChar* msg,
212 OdInt32 numBytes,
213 const OdGiTextStyle* pTextStyle,
214 OdUInt32 flags = 0);
215
231 virtual void drawText(
232 OdGiCommonDraw* pDraw,
233 OdGePoint3d& position,
234 double height,
235 double width,
236 double oblique,
237 const OdString& msg);
238
252 virtual void drawText(
254 const OdGePoint3d& position,
255 const OdGeVector3d& direction,
256 const OdGeVector3d& upVector,
257 const OdChar* msg,
258 OdInt32 numBytes,
259 bool raw,
260 const OdGiTextStyle* pTextStyle,
261 const OdGeVector3d* pExtrusion);
262
275 virtual void textExtentsBox(
276 const OdGiTextStyle& textStyle,
277 const OdChar* msg,
278 int nLength,
279 OdUInt32 flags,
280 OdGePoint3d& min,
281 OdGePoint3d& max,
282 OdGePoint3d* pEndPos = 0);
283
292 virtual void shapeExtentsBox(
293 const OdGiTextStyle& textStyle,
294 int shapeNumber,
295 OdGePoint3d& min,
296 OdGePoint3d& max);
297
306 virtual unsigned int circleZoomPercent(
307 OdDbStub* viewportId) const;
308
315 virtual bool isPlotGeneration() const;
316
324
331 virtual bool fillTtf() const;
332
339 virtual OdUInt32 numberOfIsolines() const;
340
347 virtual bool fillMode() const;
348
355 virtual bool quickTextMode() const;
356
365 virtual OdUInt32 textQuality() const;
366
373 virtual bool useTtfTriangleCache() const;
374
381 virtual double getAnnotationScale(OdDbStub* viewportId);
382
387 {
388 kImageQualityDraft = 0, // Draft quality.
389 kImageQualityHigh = 1 // High quality.
390 };
391
398 virtual ImageQuality imageQuality() const;
399
404 {
405 kImageHighlight = (1 << 0), // Highlight contents of a raster image.
406 kImageSelect = (1 << 1) // Select contents of a raster image.
407 };
408
416
421 {
422 kLockedLayerFade = 0, // Fading objects on locked layers.
423 kXrefFade = 1, // Fading xref objects.
424 kRefEditFade = 2 // Fading references being edited.
425 };
426
436
441 {
442 kLightGlyph = 0, // Light glyph.
443 kCameraGlyph = 1 // Camera glyph.
444 };
445
461 virtual OdUInt32 glyphSize(GlyphType glyphType) const;
462
467 {
468 kPointLineWeight = 0, // Point lineweight style.
469 kLineCapStyle = 1, // Line cap style.
470 kLineJoinStyle = 2 // Line join style.
471 };
472
488
501 virtual OdUInt32 selectionStyle(OdUInt32 nStyle, OdGiSelectionStyle &selStyle) const;
502
507 {
509 kWCS = 0,
511 kECS = 1,
513 kNDC = 2,
516 };
517
529
534 {
535 kNestedDrawable = 0x1000000 // Nested drawable flag.
536 };
537
542 {
543 kSkipVectorization = 1 // Skip vectorization flag.
544 };
545
550 {
551 kDrawableFilterAppRangeStart = 0x1000000 // Start of the drawable filter range.
552#if defined(OD_SWIGCSHARP)
553 , kDrawableFilterAppRangeMask = (uint)0xFF000000 // Drawable filter range mask for C#.
554#elif defined(OD_SWIGJAVA)
555 , kDrawableFilterAppRangeMask = (long)0xFF000000 // Drawable filter range mask for Java.
556#else
557 , kDrawableFilterAppRangeMask = (OdInt32)0xFF000000 // Drawable filter range mask for other languages.
558#endif
559 };
560
569 virtual OdIntPtr drawableFilterFunctionId(OdDbStub* viewportId) const;
570
581 virtual OdUInt32 drawableFilterFunction(OdIntPtr functionId, const OdGiDrawable *pDrawable, OdUInt32 nFlags) ODRX_FINAL;
582
593 virtual OdUInt32 drawableFilterFunction(OdIntPtr functionId, const OdGiPathNode* pPathNode, OdUInt32 nFlags);
594
603 virtual bool ttfPolyDraw() const;
604
611 virtual bool regenAbort() const;
612
617 {
618 kPsNone = 0, // Style is disabled.
619 kPsByColor = 1, // "By color" style.
620 kPsByName = 2 // "By name" style.
621 };
622
636 virtual PStyleType plotStyleType() const;
637
645 virtual void plotStyle(
646 int penNumber,
647 OdPsPlotStyleData& plotStyleData) const;
648
655 virtual void plotStyle(
656 OdDbStub* objectId,
657 OdPsPlotStyleData& plotStyleData) const;
658
667 virtual OdDbStub* getStubByID( OdUInt64 persistentId ) const;
668
674 virtual OdUInt64 getIDByStub( OdDbStub* objectId ) const;
675
684 virtual OdDbBaseDatabase *getDatabaseByStub( OdDbStub* objectId ) const;
685
694 virtual OdDbStub* getOwnerIDByStub( OdDbStub* objectId ) const;
695
705 virtual OdDbStub* getStubByMatName( OdDbBaseDatabase *pBaseDb, const OdString& strMatName ) const;
706
716 virtual OdDbStub* getStubByMaterialId(OdDbBaseDatabase *pBaseDb, const OdUInt64& materialId) const;
717
722 {
723 kNoSilhouettes = 0, // Disables all types of silhouettes.
724 kMeshSilhouettes = (1 << 0), // Generates silhouettes for mesh primitives on Gi side.
725 kModelerSilhouettes = (1 << 1), // Generates silhouettes for Brep's on modeler geometry side.
726 kAllSilhouettes = kMeshSilhouettes | kModelerSilhouettes // Enables all types of silhouettes.
727 };
728
750
758
765 virtual OdUInt32 antiAliasingMode() const;
766
770 virtual bool xrefPropertiesOverride() const;
771
775 virtual bool multiplyByBlockLinetypeScales() const;
776};
777
786class FIRSTDLL_EXPORT OdGiCommonDraw : public OdRxObject
787{
788public:
790
808 virtual OdGiRegenType regenType() const = 0;
809
816 virtual bool regenAbort() const = 0;
817
828
835 virtual OdGiGeometry& rawGeometry() const = 0;
836
843 virtual bool isDragging() const = 0;
844
870 virtual double deviation(
871 const OdGiDeviationType deviationType,
872 const OdGePoint3d& pointOnCurve) const = 0;
873
885 virtual OdUInt32 numberOfIsolines() const = 0;
886
893 virtual OdGiContext* context() const = 0;
894
901 virtual const OdGiPathNode* currentGiPath() const;
902
910 virtual bool displayModelerSilhouettes() const;
911};
912
924{
925 protected:
928 public:
929
938 : m_pTraits(NULL)
939 , m_prevFlags(0)
940 {
941 if (addFlags || delFlags)
942 {
943 m_prevFlags = pTraits.drawFlags();
944 OdUInt32 newFlags = (m_prevFlags & ~delFlags) | addFlags;
945 if (m_prevFlags != newFlags)
946 {
947 pTraits.setDrawFlags(newFlags);
948 m_pTraits = &pTraits;
949 }
950 }
951 }
952
957 {
958 if (m_pTraits)
959 m_pTraits->setDrawFlags(m_prevFlags);
960 }
961};
962
964{
965protected:
968public:
977 {
978 if (m_pTraits)
979 {
980 m_bSaved = m_pTraits->selectionGeom();
981 m_pTraits->setSelectionGeom(bOn);
982 }
983 }
984
989 {
990 if (m_pTraits)
991 m_pTraits->setSelectionGeom(m_bSaved);
992 }
993};
994#include "TD_PackPop.h"
995
996#endif
997
OdRxObject OdDbBaseDatabase
false
Definition DimVarDefs.h:165
unsigned int uint
OdSmartPtr< OdGiSectionGeometryManager > OdGiSectionGeometryManagerPtr
OdSmartPtr< OdGiDrawable > OdGiDrawablePtr
OdGiRegenType
@ kOdGiStandardDisplay
@ kOdGiHideOrShadeCommand
@ kOdGiRenderCommand
@ kOdGiForExtents
@ kOdGiForExplode
@ kOdGiSaveWorldDrawForProxy
@ eOdGiRegenTypeInvalid
@ kOdGiIncludeScores
@ kOdGiTextExtents
@ kOdGiDrawShape
@ kOdGiIgnoreMIF
@ kOdGiRawText
@ kOdGiIncludePenups
@ kForMTextExtents
@ kOdGiLastPosOnly
OdGiDeviationType
@ kOdGiMaxDevForCircle
@ kOdGiMaxDevForIsoline
@ kOdGiMaxDevForCurve
@ kOdGiMaxDevForFacet
@ kOdGiMaxDevForBoundary
#define ODCOLORREF
#define ODRX_FINAL
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 OdUInt32 drawableFilterFunction(OdIntPtr functionId, const OdGiDrawable *pDrawable, OdUInt32 nFlags) ODRX_FINAL
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)
@ kDrawableFilterAppRangeMask
@ kDrawableFilterAppRangeStart
virtual bool fillTtf() const
virtual OdUInt32 displaySilhouettes() const
virtual OdUInt64 getIDByStub(OdDbStub *objectId) const
bool displayMeshSilhouettes() const
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 OdUInt32 drawableFilterFunction(OdIntPtr functionId, const OdGiPathNode *pPathNode, OdUInt32 nFlags)
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
virtual double getAnnotationScale(OdDbStub *viewportId)
bool displayModelerSilhouettes() const
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)
OdGiSubEntityTraits * m_pTraits
OdGiSubEntityTraits * m_pTraits
OdGiSelectionGeomState(OdGiSubEntityTraits *pTraits, bool bOn)
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
LineWeight
Definition OdaDefs.h:386