CFx SDK Documentation  2022 SP0
Gi.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 _OD_GI_H_
25 #define _OD_GI_H_
26 
27 #include "RxObject.h"
28 #include "CmColorBase.h"
29 
30 class OdDbStub;
31 class OdCmEntityColor;
32 class OdGeVector3d;
33 class OdGiMapper;
34 class OdCmTransparency;
36 class OdGiFill;
38 
39 typedef enum
40 {
41  kOdGiFillAlways = 1, // Always fill closed graphic primitives.
42  kOdGiFillNever = 2 // Never fill closed graphic primitives.
44 
45 typedef enum
46 {
47  kOdGiInvisible = 0, // Invisible
48  kOdGiVisible = 1, // Visible
49  kOdGiSilhouette = 2 // Silhouette edge
51 
52 #include "TD_PackPush.h"
53 
71 {
72 public:
74 };
75 
94 {
95 public:
96  enum DrawFlags
97  {
98  kNoDrawFlags = 0x0000, // Default value. No DrawFlags specified.
99  kDrawBackfaces = 0x0001, // Forces backfaces vectorization.
100  kDrawHatchGroup = 0x0002, // Next shells and meshes should draw hatches.
101  kDrawFrontfacesOnly = 0x0004, // Forces discard backfaces mode.
102  kDrawGradientFill = 0x0008, // Draws with gradient fill.
103  kDrawSolidFill = 0x0010, // Draws with solid fill.
104  kDrawNoLineWeight = 0x0020, // Disables lineweight.
105  kDrawNoPlotstyle = 0x0080, // Disables plotstyles.
106  // the range before 0x8000 is reserved.
107  kDrawContourFill = 0x08000, // Teigha(R) for .dgn files specific.
108  kDisableLayoutCache = 0x10000, // Disable metafile caching for layout switching.
109  kDrawBoundaryForClipping = 0x20000, // Draw (rough) boundary of object to be checked
110  // when clipping is performed, set by vectorizer.
111  kDrawBoundaryForClippingDrw = 0x40000, // Draw (rough) boundary of object to be checked
112  // when clipping is performed, set by a drawable.
113  kClipSetIsEmpty = 0x80000,
114  kInternalDrawFlags = kDisableLayoutCache | kClipSetIsEmpty,
115  kDrawPolygonFill = 0x100000, // Fill in all modes if FillAlways mode enabled.
116  kExcludeFromViewExt = 0x200000, // Don't use extents of the entity when calculating total extents.
117  kDrawDgLsPolyWithoutBreaks = 0x400000, // Draw polylines/polygons with Dgn Line Style without segmentation.
118  kPolygonProcessing = 0x800000, // Polygon filling logic must be applied for shell primitive.
119  kDisableAutoGenerateNormals = 0x1000000, // Avoid automatic generation of normals for mesh/shell primitives.
120  kDisableFillModeCheck = 0x2000000, // Avoid checking of OdGiContext::fillMode during filling of geometry primitives.
121  kDrawUnderlayReference = 0x4000000, // Draw underlay reference object.
122 //FELIX_CHANGE_BEGIN
123 #ifdef XENON
124  kDrawOnHighlight = 0x08000000,
125  kSkipDrawOnHighlight = 0x10000000,
126  kDrawOnSelection = 0x20000000,
127  kSkipDrawOnSelection = 0x40000000,
128  kXenonFlags = kDrawOnHighlight | kSkipDrawOnHighlight | kDrawOnSelection | kSkipDrawOnSelection,
129  // All bits used! 0x80000000 is used internally to save/restore traits
130 #else
131  kFxNoFillOnSelect = 0x08000000,
132 #endif
133 //FELIX_CHANGE_END
134  // Flags which can be inherited by nested drawables.
135  kInheritableDrawFlags = kDrawNoLineWeight | kDrawNoPlotstyle | kDrawBoundaryForClipping | kDrawBoundaryForClippingDrw |
136  kInternalDrawFlags | kExcludeFromViewExt | kDrawBackfaces | kDrawFrontfacesOnly
137 //FELIX_CHANGE_BEGIN
138 #ifdef XENON
139  | kXenonFlags
140 #endif
141 //FELIX_CHANGE_END
142  };
143 
145  {
146  kShadowsCastAndReceive = 0, // Geometry could cast and receive shadows.
147  kShadowsDoesNotCast = 1, // Geometry doesn't cast shadows.
148  kShadowsDoesNotReceive = 2, // Geometry doesn't receive shadows.
149  kShadowsIgnore = kShadowsDoesNotCast | kShadowsDoesNotReceive
150  };
151 
153  {
154  kNoSelectionFlags = 0, // No selection flags set.
155  kSelectionIgnore = 1, // Avoid geometry selection.
156  kHighlightingGeometry = 2 // Geometry drawn only in case if entire entity highlighted.
157 //FELIX_CHANGE_BEGIN
158  ,
159  kFxSubentitySelection = 0x80 // Selection geometry for subentity selection only.
160 //FELIX_CHANGE_END
161  };
162 
164  {
165  kHint2DAttributes = 1, // Setup attributes only available in 2DWireframe mode (plotStyles and etc.)
166  kHint3DAttributes = 2, // Setup attributes only available in shaded modes (materials and etc.)
167  kHintAllAttributes = kHint2DAttributes | kHint3DAttributes,
168  kHintSnapModeOn = 4, // Setup that we currently inside selection for snap method
169  kHintDefaultState = kHintAllAttributes
170  };
171 public:
173 
196  virtual void setColor(
197  OdUInt16 color) = 0;
198 
204  virtual void setTrueColor(
205  const OdCmEntityColor& color) = 0;
206 
211  virtual void setLayer(
212  OdDbStub* layerId) = 0;
213 
218  virtual void setLineType(
219  OdDbStub* lineTypeId) = 0;
220 
225  virtual void setSelectionMarker(
226  OdGsMarker selectionMarker) = 0;
227 
249  virtual void setFillType(
250  OdGiFillType fillType) = 0;
251 
261  virtual void setFillPlane(
262  const OdGeVector3d* pNormal = 0);
263 
269  virtual void setLineWeight(
270  OdDb::LineWeight lineWeight) = 0;
271 
276  virtual void setLineTypeScale(
277  double lineTypeScale = 1.0) = 0;
278 
283  virtual void setThickness(
284  double thickness) = 0;
285 
305  virtual void setPlotStyleName(
306  OdDb::PlotStyleNameType plotStyleNameType,
307  OdDbStub* plotStyleNameId = 0) = 0;
308 
313  virtual void setMaterial(
314  OdDbStub* materialId) = 0;
315 
320  virtual void setMapper(
321  const OdGiMapper *pMapper) = 0;
322 
327  virtual void setVisualStyle(
328  const OdDbStub* visualStyleId);
329 
335  virtual void setTransparency(
336  const OdCmTransparency &transparency);
337 
343  virtual void setDrawFlags(
344  OdUInt32 drawFlags);
345 
351  virtual void setSelectionGeom(
352  bool bSelectionFlag);
353 
359  virtual void setShadowFlags(
360  ShadowFlags shadowFlags);
361 
367  virtual void setSectionable(
368  bool bSectionableFlag);
369 
375  virtual void setSelectionFlags(
376  SelectionFlags selectionFlags);
377 
398  virtual OdUInt16 color() const = 0;
399 
403  virtual OdCmEntityColor trueColor() const = 0;
404 
408  virtual OdDbStub* layer() const = 0;
409 
413  virtual OdDbStub* lineType() const = 0;
414 
434  virtual OdGiFillType fillType() const = 0;
435 
445  virtual bool fillPlane(
446  OdGeVector3d& normal);
447 
451  virtual OdDb::LineWeight lineWeight() const = 0;
452 
456  virtual double lineTypeScale() const = 0;
457 
461  virtual double thickness() const = 0;
462 
478 
482  virtual OdDbStub* plotStyleNameId() const = 0;
483 
487  virtual OdDbStub* material() const = 0;
488 
492  virtual const OdGiMapper* mapper() const = 0;
493 
497  virtual OdDbStub* visualStyle() const;
498 
503 
507  virtual OdUInt32 drawFlags() const;
508 
512  virtual bool selectionGeom() const;
513 
517  virtual ShadowFlags shadowFlags() const;
518 
522  virtual bool sectionable() const;
523 
528 
529  // Teigha(R) for .dgn files specific
530 
536  virtual void setSecondaryTrueColor(
537  const OdCmEntityColor& color);
538 
543 
549  virtual void setLineStyleModifiers(
550  const OdGiDgLinetypeModifiers* pLSMod);
551 
556 
557  // eof Teigha(R) for .dgn files specific section
558 
564  virtual void setFill(
565  const OdGiFill* pFill);
566 
570  virtual const OdGiFill* fill() const;
571 
577  virtual bool pushLineweightOverride(const OdGiLineweightOverride* pOverride);
578 
582  virtual void popLineweightOverride();
583 
588  virtual OdUInt32 setupForEntity() const;
589 
598  virtual void addLight(
599  const OdDbStub* lightId);
600 };
601 
603 
604 #include "TD_PackPop.h"
605 
606 #endif //_OD_GI_H_
@ kSelectionIgnore
Definition: BrEnums.h:117
OdGiFillType
Definition: Gi.h:40
@ kOdGiFillAlways
Definition: Gi.h:41
@ kOdGiFillNever
Definition: Gi.h:42
OdGiVisibility
Definition: Gi.h:46
@ kOdGiSilhouette
Definition: Gi.h:49
@ kOdGiInvisible
Definition: Gi.h:47
@ kOdGiVisible
Definition: Gi.h:48
OdSmartPtr< OdGiSubEntityTraits > OdGiSubEntityTraitsPtr
Definition: Gi.h:602
ptrdiff_t OdGsMarker
unsigned int OdUInt32
unsigned short OdUInt16
#define FIRSTDLL_EXPORT
Definition: RootExport.h:39
ODRX_DECLARE_MEMBERS(OdGiDrawableTraits)
virtual const OdGiFill * fill() const
virtual void setLayer(OdDbStub *layerId)=0
virtual OdUInt16 color() const =0
virtual OdDbStub * layer() const =0
virtual void setFillPlane(const OdGeVector3d *pNormal=0)
virtual OdDb::PlotStyleNameType plotStyleNameType() const =0
virtual void setFill(const OdGiFill *pFill)
virtual void setLineType(OdDbStub *lineTypeId)=0
virtual OdGiFillType fillType() const =0
virtual void setSectionable(bool bSectionableFlag)
virtual void setLineTypeScale(double lineTypeScale=1.0)=0
virtual bool sectionable() const
virtual OdDbStub * material() const =0
virtual OdUInt32 setupForEntity() const
virtual void setShadowFlags(ShadowFlags shadowFlags)
virtual void setMapper(const OdGiMapper *pMapper)=0
virtual OdDbStub * lineType() const =0
virtual void popLineweightOverride()
virtual SelectionFlags selectionFlags() const
virtual void setLineWeight(OdDb::LineWeight lineWeight)=0
virtual void setVisualStyle(const OdDbStub *visualStyleId)
ODRX_DECLARE_MEMBERS(OdGiSubEntityTraits)
virtual void setSelectionFlags(SelectionFlags selectionFlags)
virtual void setLineStyleModifiers(const OdGiDgLinetypeModifiers *pLSMod)
virtual void setSelectionMarker(OdGsMarker selectionMarker)=0
virtual void setColor(OdUInt16 color)=0
virtual double lineTypeScale() const =0
virtual void setPlotStyleName(OdDb::PlotStyleNameType plotStyleNameType, OdDbStub *plotStyleNameId=0)=0
virtual OdUInt32 drawFlags() const
virtual OdCmTransparency transparency() const
virtual OdDbStub * plotStyleNameId() const =0
virtual void setTrueColor(const OdCmEntityColor &color)=0
virtual OdCmEntityColor trueColor() const =0
virtual ShadowFlags shadowFlags() const
virtual bool fillPlane(OdGeVector3d &normal)
virtual void addLight(const OdDbStub *lightId)
virtual void setDrawFlags(OdUInt32 drawFlags)
virtual const OdGiDgLinetypeModifiers * lineStyleModifiers() const
virtual void setSelectionGeom(bool bSelectionFlag)
virtual void setThickness(double thickness)=0
virtual OdCmEntityColor secondaryTrueColor() const
virtual void setSecondaryTrueColor(const OdCmEntityColor &color)
virtual void setFillType(OdGiFillType fillType)=0
virtual void setMaterial(OdDbStub *materialId)=0
virtual bool selectionGeom() const
virtual OdDb::LineWeight lineWeight() const =0
virtual const OdGiMapper * mapper() const =0
virtual double thickness() const =0
virtual void setTransparency(const OdCmTransparency &transparency)
virtual OdDbStub * visualStyle() const
virtual bool pushLineweightOverride(const OdGiLineweightOverride *pOverride)
PlotStyleNameType
Definition: OdaDefs.h:413
LineWeight
Definition: OdaDefs.h:382