CFx SDK Documentation  2022 SP0
DbSection.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 
25 #ifndef _OdDbSection_h_Included_
26 #define _OdDbSection_h_Included_
27 
28 #include "DbEntity.h"
29 #include "SmartPtr.h"
30 #include "DbHatch.h"
31 #include "TD_PackPush.h"
32 #include "ModelerGeometry.h"
33 
36 
37 class OdDbSection;
39 
45 {
46 public:
47  enum State
48  {
49  kPlane = 0x01,
50  kBoundary = 0x02,
51  kVolume = 0x04
52  };
53 
54  enum SubItem
55  {
56  kNone = 0x00,
57  kSectionLine = 0x01,
58  kSectionLineTop = 0x02,
59  kSectionLineBottom = 0x04,
60  kBackLine = 0x08,
61  kBackLineTop = 0x10,
62  kBackLineBottom = 0x20,
63  kVerticalLineTop = 0x40,
64  kVerticalLineBottom = 0x80
65  };
66 
67  enum Height
68  {
69  kHeightAboveSectionLine = 0x1,
70  kHeightBelowSectionLine = 0x2
71  };
72 
73 public:
75 
78  const OdGeVector3d& verticalDir);
80  const OdGeVector3d& verticalDir, const OdGeVector3d& vecViewingDir);
81 
84 
85  const OdString getName() const;
86  void getName(OdString& sName) const;
87  void setName(const OdString& pszName);
88 
91 
94 
96  OdResult plane(OdGeVector3d& uAxis, OdGeVector3d& vAxis) const;
97 
98  int indicatorTransparency() const;
99  void setIndicatorTransparency(int nTransparency);
100 
102  void setIndicatorFillColor(const OdCmColor& color);
103 
104  int numVertices() const;
105  OdResult getVertex(int nIndex,
106  OdGePoint3d& pt) const;
107  OdResult setVertex(int nIndex,
108  const OdGePoint3d& pt);
109  OdResult addVertex(int nInsertAt,
110  const OdGePoint3d& pt);
111  OdResult removeVertex(int nIndex);
112  void getVertices(OdGePoint3dArray& pts) const;
114 
115  double height(OdDbSection::Height nHeightType) const;
116  OdResult setHeight(OdDbSection::Height nHeightType, double fHeight);
117 
118  //bool hitTest(const OdGePoint3d& ptHit, int* pSegmentIndex, OdGePoint3d* ptOnSegment, OdDbSection::SubItem* pSubItem) const;
119  OdResult createJog (const OdGePoint3d& ptOnSection);
120  bool hasJogs() const;
121 
124 
125  bool isLiveSectionEnabled() const;
126  void enableLiveSection(bool bEnable);
127 
128  bool isSlice() const;
129  OdResult setIsSlice( bool bIsSlice );
130 
131  double thicknesDepth() const;
132  OdResult setThicknesDepth( double depth );
133 
134  double sectionPlaneOffset() const;
136 
137 public:
138  // Base class overrides
140  virtual void dwgOutFields(OdDbDwgFiler* pFiler) const;
141 
143  virtual void dxfOutFields(OdDbDxfFiler* pFiler) const;
144 
145  virtual bool subWorldDraw(OdGiWorldDraw* pWd) const;
146 
147  virtual void subViewportDraw(OdGiViewportDraw* pVd) const;
148 
149  virtual OdResult subGetClassID(void* pClsid) const;
150 
151  virtual void subClose();
152 
153  virtual OdResult subTransformBy(const OdGeMatrix3d& xform);
154 
155  virtual OdResult subGetTransformedCopy(const OdGeMatrix3d& mat, OdDbEntityPtr& pCopy) const;
156 
157  //virtual OdResult subGetGeomExtents(OdGeExtents3d& extents) const;
158 
160  OdArray<OdDbEntityPtr>& intBoundaryEnts,
161  OdArray<OdDbEntityPtr>& intFillEnts,
162  OdArray<OdDbEntityPtr>& backgroundEnts,
163  OdArray<OdDbEntityPtr>& foregroundEnts,
164  OdArray<OdDbEntityPtr>& curveTangencyEnts) const;
165 
166  // INTERNAL USE ONLY
168  OdArray<OdDbEntityPtr>& intBoundaryEnts,
169  OdArray<OdDbEntityPtr>& intFillEnts,
170  OdArray<OdDbEntityPtr>& backgroundEnts,
171  OdArray<OdDbEntityPtr>& foregroundEnts,
172  OdArray<OdDbEntityPtr>& curveTangencyEnts,
173  bool bIsSetProperties) const;
174 
175 
176  double topPlane() const;
178 
179  double bottomPlane() const;
181 
182  double elevation() const;
184 };
185 
186 
187 //*************************************************************************
188 // OdDbSectionSettings
189 //*************************************************************************
190 
196 {
197 public:
199  {
200  kLiveSection = 0x1,
201  k2dSection = 0x2,
202  k3dSection = 0x4
203  };
204 
205  enum Geometry
206  {
207  kIntersectionBoundary = 0x1,
208  kIntersectionFill = 0x2,
209  kBackgroundGeometry = 0x4,
210  kForegroundGeometry = 0x8,
211  kCurveTangencyLines = 0x10
212  };
213 
215  {
216  kSourceAllObjects = 0x1,
217  kSourceSelectedObjects = 0x2,
218 
219  kDestinationNewBlock = 0x10,
220  kDestinationReplaceBlock = 0x20,
221  kDestinationFile = 0x40
222  };
223 
224 public:
226 
228 
230  OdDbDwgFiler* pFiler);
231 
232  virtual void dwgOutFields(
233  OdDbDwgFiler* pFiler) const;
234 
236  OdDbDxfFiler* pFiler);
237 
238  virtual void dxfOutFields(
239  OdDbDxfFiler* pFiler) const;
240 
242  void* pClsid) const;
243 
244  void reset();
246 
249 
253 
255  OdDbObjectIdArray& ids) const;
257  const OdDbObjectIdArray& ids);
258 
261  const OdDbObjectId& id);
262 
265  const OdString& pszFileName);
266 
268  OdDbSectionSettings::Geometry nGeometry) const;
271  bool bVisible);
273  OdDbSectionSettings::Geometry nGeometry) const;
275  OdDbSectionSettings::Geometry nGeometry, const OdCmColor& color);
277  OdDbSectionSettings::Geometry nGeometry) const;
280  const OdString& pszLayer);
282  OdDbSectionSettings::Geometry nGeometry) const;
285  const OdString& pszLinetype);
287  OdDbSectionSettings::Geometry nGeometry) const;
290  double fScale);
292  OdDbSectionSettings::Geometry nGeometry) const;
295  const OdString& pszPlotStyleName);
297  OdDbSectionSettings::Geometry nGeometry) const;
300  OdDb::LineWeight nLineWeight);
302  OdDbSectionSettings::Geometry nGeometry) const;
305  int nTransparency);
307  OdDbSectionSettings::Geometry nGeometry) const;
310  int nTransparency);
312  OdDbSectionSettings::Geometry nGeometry) const;
315  bool bVisible);
318  OdDbHatch::HatchPatternType& nPatternType,
319  OdString& pszPatternName) const;
322  OdDbHatch::HatchPatternType nPatternType,
323  const OdString& pszPatternName);
325  OdDbSectionSettings::Geometry nGeometry) const;
328  double fAngle);
330  OdDbSectionSettings::Geometry nGeometry) const;
333  double fSpacing);
335  OdDbSectionSettings::Geometry nGeometry) const;
338  double fScale);
340  OdDbSectionSettings::Geometry nGeometry) const;
343  bool bHiddenLine);
345  OdDbSectionSettings::Geometry nGeometry) const;
348  bool bShow);
349 };
350 
351 
352 #include "TD_PackPop.h"
353 
354 #endif //_OdDbSection_h_Included_
#define TOOLKIT_EXPORT
Definition: DbExport.h:40
OdSmartPtr< OdDbSectionSettings > OdDbSectionSettingsPtr
Definition: DbSection.h:34
OdSmartPtr< OdDbSection > OdDbSectionPtr
Definition: DbSection.h:37
OdResult
Definition: OdResult.h:29
HatchPatternType
Definition: DbHatch.h:102
virtual OdResult dwgInFields(OdDbDwgFiler *pFiler)
void setIndicatorTransparency(int nTransparency)
virtual bool subWorldDraw(OdGiWorldDraw *pWd) const
OdResult setIsSlice(bool bIsSlice)
OdResult setTopPlane(double)
OdDbSection::State state() const
OdResult setHeight(OdDbSection::Height nHeightType, double fHeight)
OdResult plane(OdGeVector3d &uAxis, OdGeVector3d &vAxis) const
static OdDbSectionPtr createObject(const OdGePoint3dArray &pts, const OdGeVector3d &verticalDir)
OdResult setVertex(int nIndex, const OdGePoint3d &pt)
int indicatorTransparency() const
OdResult generateSectionGeometry(OdDbEntity *pEnt, OdArray< OdDbEntityPtr > &intBoundaryEnts, OdArray< OdDbEntityPtr > &intFillEnts, OdArray< OdDbEntityPtr > &backgroundEnts, OdArray< OdDbEntityPtr > &foregroundEnts, OdArray< OdDbEntityPtr > &curveTangencyEnts) const
void getName(OdString &sName) const
ODDB_DECLARE_MEMBERS(OdDbSection)
OdGeVector3d viewingDirection() const
OdResult addVertex(int nInsertAt, const OdGePoint3d &pt)
OdGeVector3d verticalDirection() const
void setState(OdDbSection::State nState)
OdResult setThicknesDepth(double depth)
const OdString getName() const
virtual OdResult dxfInFields(OdDbDxfFiler *pFiler)
OdResult setSectionPlaneOffset(double offset)
OdResult setBottomPlane(double)
OdResult setViewingDirection(const OdGeVector3d &dir)
bool hasJogs() const
int numVertices() const
double thicknesDepth() const
void getVertices(OdGePoint3dArray &pts) const
bool isLiveSectionEnabled() const
OdCmColor indicatorFillColor() const
void setName(const OdString &pszName)
OdResult removeVertex(int nIndex)
double height(OdDbSection::Height nHeightType) const
double bottomPlane() const
virtual OdResult subTransformBy(const OdGeMatrix3d &xform)
OdResult setVertices(const OdGePoint3dArray &pts)
virtual void subViewportDraw(OdGiViewportDraw *pVd) const
bool isSlice() const
virtual void dwgOutFields(OdDbDwgFiler *pFiler) const
OdGeVector3d normal() const
OdResult getVertex(int nIndex, OdGePoint3d &pt) const
void enableLiveSection(bool bEnable)
OdResult generateSectionGeometry(OdDbEntity *pEnt, OdArray< OdDbEntityPtr > &intBoundaryEnts, OdArray< OdDbEntityPtr > &intFillEnts, OdArray< OdDbEntityPtr > &backgroundEnts, OdArray< OdDbEntityPtr > &foregroundEnts, OdArray< OdDbEntityPtr > &curveTangencyEnts, bool bIsSetProperties) const
OdDbObjectId getSettings() const
OdResult setElevation(double)
void setIndicatorFillColor(const OdCmColor &color)
virtual OdResult subGetTransformedCopy(const OdGeMatrix3d &mat, OdDbEntityPtr &pCopy) const
static OdDbSectionPtr createObject(const OdGePoint3dArray &pts, const OdGeVector3d &verticalDir, const OdGeVector3d &vecViewingDir)
double elevation() const
virtual OdResult subGetClassID(void *pClsid) const
double sectionPlaneOffset() const
OdDbSectionSettingsPtr getSettings(OdDb::OpenMode mode) const
virtual void subClose()
OdResult createJog(const OdGePoint3d &ptOnSection)
virtual void dxfOutFields(OdDbDxfFiler *pFiler) const
double topPlane() const
OdResult setVerticalDirection(const OdGeVector3d &dir)
double linetypeScale(OdDbSectionSettings::SectionType nSecType, OdDbSectionSettings::Geometry nGeometry) const
double hatchAngle(OdDbSectionSettings::SectionType nSecType, OdDbSectionSettings::Geometry nGeometry) const
OdString layer(OdDbSectionSettings::SectionType nSecType, OdDbSectionSettings::Geometry nGeometry) const
bool visibility(OdDbSectionSettings::SectionType nSecType, OdDbSectionSettings::Geometry nGeometry) const
virtual void dwgOutFields(OdDbDwgFiler *pFiler) const
OdDbSectionSettings::SectionType currentSectionType() const
void setLinetype(OdDbSectionSettings::SectionType nSecType, OdDbSectionSettings::Geometry nGeometry, const OdString &pszLinetype)
int edgeTransparency(OdDbSectionSettings::SectionType nSecType, OdDbSectionSettings::Geometry nGeometry) const
void setGenerationOptions(OdDbSectionSettings::SectionType nSecType, OdDbSectionSettings::Generation nOptions)
void setSourceObjects(OdDbSectionSettings::SectionType nSecType, const OdDbObjectIdArray &ids)
OdDbObjectId destinationBlock(OdDbSectionSettings::SectionType nSecType) const
void setDestinationBlock(OdDbSectionSettings::SectionType nSecType, const OdDbObjectId &id)
OdString linetype(OdDbSectionSettings::SectionType nSecType, OdDbSectionSettings::Geometry nGeometry) const
void setDestinationFile(OdDbSectionSettings::SectionType nSecType, const OdString &pszFileName)
int faceTransparency(OdDbSectionSettings::SectionType nSecType, OdDbSectionSettings::Geometry nGeometry) const
void setLayer(OdDbSectionSettings::SectionType nSecType, OdDbSectionSettings::Geometry nGeometry, const OdString &pszLayer)
void reset(OdDbSectionSettings::SectionType nSecType)
void setHatchPattern(OdDbSectionSettings::SectionType nSecType, OdDbSectionSettings::Geometry nGeometry, OdDbHatch::HatchPatternType nPatternType, const OdString &pszPatternName)
const OdString destinationFile(OdDbSectionSettings::SectionType nSecType) const
bool hiddenLine(OdDbSectionSettings::SectionType nSecType, OdDbSectionSettings::Geometry nGeometry) const
void setHatchScale(OdDbSectionSettings::SectionType nSecType, OdDbSectionSettings::Geometry nGeometry, double fScale)
bool hatchVisibility(OdDbSectionSettings::SectionType nSecType, OdDbSectionSettings::Geometry nGeometry) const
virtual void dxfOutFields(OdDbDxfFiler *pFiler) const
void setFaceTransparency(OdDbSectionSettings::SectionType nSecType, OdDbSectionSettings::Geometry nGeometry, int nTransparency)
OdCmColor color(OdDbSectionSettings::SectionType nSecType, OdDbSectionSettings::Geometry nGeometry) const
OdString plotStyleName(OdDbSectionSettings::SectionType nSecType, OdDbSectionSettings::Geometry nGeometry) const
void setHiddenLine(OdDbSectionSettings::SectionType nSecType, OdDbSectionSettings::Geometry nGeometry, bool bHiddenLine)
void getSourceObjects(OdDbSectionSettings::SectionType nSecType, OdDbObjectIdArray &ids) const
void setDivisionLines(OdDbSectionSettings::SectionType nSecType, OdDbSectionSettings::Geometry nGeometry, bool bShow)
void setHatchSpacing(OdDbSectionSettings::SectionType nSecType, OdDbSectionSettings::Geometry nGeometry, double fSpacing)
void setLinetypeScale(OdDbSectionSettings::SectionType nSecType, OdDbSectionSettings::Geometry nGeometry, double fScale)
void setEdgeTransparency(OdDbSectionSettings::SectionType nSecType, OdDbSectionSettings::Geometry nGeometry, int nTransparency)
void getHatchPattern(OdDbSectionSettings::SectionType nSecType, OdDbSectionSettings::Geometry nGeometry, OdDbHatch::HatchPatternType &nPatternType, OdString &pszPatternName) const
bool divisionLines(OdDbSectionSettings::SectionType nSecType, OdDbSectionSettings::Geometry nGeometry) const
void setVisibility(OdDbSectionSettings::SectionType nSecType, OdDbSectionSettings::Geometry nGeometry, bool bVisible)
OdDb::LineWeight lineWeight(OdDbSectionSettings::SectionType nSecType, OdDbSectionSettings::Geometry nGeometry) const
void setLineWeight(OdDbSectionSettings::SectionType nSecType, OdDbSectionSettings::Geometry nGeometry, OdDb::LineWeight nLineWeight)
void setHatchVisibility(OdDbSectionSettings::SectionType nSecType, OdDbSectionSettings::Geometry nGeometry, bool bVisible)
virtual OdResult subGetClassID(void *pClsid) const
double hatchSpacing(OdDbSectionSettings::SectionType nSecType, OdDbSectionSettings::Geometry nGeometry) const
void setColor(OdDbSectionSettings::SectionType nSecType, OdDbSectionSettings::Geometry nGeometry, const OdCmColor &color)
double hatchScale(OdDbSectionSettings::SectionType nSecType, OdDbSectionSettings::Geometry nGeometry) const
ODDB_DECLARE_MEMBERS(OdDbSectionSettings)
virtual OdResult dwgInFields(OdDbDwgFiler *pFiler)
OdDbSectionSettings::Generation generationOptions(OdDbSectionSettings::SectionType nSecType) const
void setHatchAngle(OdDbSectionSettings::SectionType nSecType, OdDbSectionSettings::Geometry nGeometry, double fAngle)
void setCurrentSectionType(OdDbSectionSettings::SectionType nSecType)
virtual OdResult dxfInFields(OdDbDxfFiler *pFiler)
void setPlotStyleName(OdDbSectionSettings::SectionType nSecType, OdDbSectionSettings::Geometry nGeometry, const OdString &pszPlotStyleName)
GLintptr offset
Definition: gles2_ext.h:183
LineWeight
Definition: OdaDefs.h:382
OpenMode
Definition: DbObjectId.h:54
@ kNone
Light mode is inherited from the annotation.