CFx SDK Documentation  2020SP3
Db2dPolyline.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 
26 
27 #ifndef _OD_DB_2DPOLYLINE_
28 #define _OD_DB_2DPOLYLINE_
29 
30 #include "TD_PackPush.h"
31 
32 #include "DbCurve.h"
33 #include "DbObjectIterator.h"
34 #include "Db2dVertex.h"
35 
36 class OdGePoint3d;
37 class OdDbSequenceEnd;
38 template <class T> class OdSmartPtr;
39 
44 
49 namespace OdDb
50 {
52  {
53  k2dSimplePoly = 0, // Simple polyline.
54  k2dFitCurvePoly = 1, // Curve fit (DXF 70, bit 0x04).
55  k2dQuadSplinePoly = 2, // Quadratic B-spline fit (DXF 80, bit 0x08; DXF 75 == 5).
56  k2dCubicSplinePoly = 3 // Cubic B-spline-fit (DXF 80, bit 0x08; DXF 75 == 6).
57  };
58 }
68 {
69 public:
70 
72 
74 
90 
108  OdDb::Poly2dType polyType);
109 
113  void makeClosed();
114 
118  void makeOpen();
119 
123  double defaultStartWidth() const;
124 
130  double defaultStartWidth);
131 
135  double defaultEndWidth() const;
136 
142  double defaultEndWidth);
143 
150  double thickness() const;
151 
159  double thickness);
160 
165 
170  void setNormal(
171  const OdGeVector3d& normal);
172 
179  double elevation() const;
180 
190  double elevation);
191 
200 
209 
218 
225  void straighten();
226 
245  OdDb2dVertex* pVertex);
246 
268  const OdDbObjectId& indexVertId,
269  OdDb2dVertex* pVertex);
270 
292  const OdDb2dVertex* pIndexVert,
293  OdDb2dVertex* pVertex);
294 
306  OdDbObjectId vertId,
307  OdDb::OpenMode mode,
308  bool openErasedOne = false);
309 
323  OdDb::OpenMode mode);
324 
330 
337  const OdDb2dVertex& vertex) const;
338 
339  virtual bool subWorldDraw(
340  OdGiWorldDraw* pWd) const;
341 
342  //FELIX_CHANGE_BEGIN
344  OdGeExtents3d& extents) const;
345  //FELIX_CHANGE_END
346 
348  OdDbDwgFiler* pFiler);
349 
350  virtual void dwgOutFields(
351  OdDbDwgFiler* pFiler) const;
352 
354  OdDbDxfFiler* pFiler);
355 
356  virtual void dxfOutFields(
357  OdDbDxfFiler* pFiler) const;
358 
360  OdDbDxfFiler* pFiler);
361 
362  virtual void dxfOutFields_R12(
363  OdDbDxfFiler* pFiler) const;
364 
365  virtual void dxfOut(
366  OdDbDxfFiler* pFiler) const;
367 
368  virtual OdResult dxfIn(
369  OdDbDxfFiler* pFiler);
370 
371  virtual void subClose();
372 
374  OdRxObjectPtrArray& entitySet) const ODRX_OVERRIDE;
375 
377  OdRxObjectPtrArray& entitySet) const ODRX_OVERRIDE;
378 
380  const OdGeMatrix3d& xfm) ODRX_OVERRIDE;
381 
383  void* pClsid) const ODRX_OVERRIDE;
384 
385  virtual bool isPlanar() const;
386 
387  virtual OdResult getArea(
388  double& area) const;
389 
391  OdGePlane& plane,
392  OdDb::Planarity& planarity) const;
393 
394 
395  // OdDbCurveMethods
396 
400  virtual bool isClosed() const;
401 
402  virtual bool isPeriodic() const;
403 
405  double& startParam) const;
406 
408  double& endParam) const;
409 
411  OdGePoint3d& startPoint) const;
412 
414  OdGePoint3d& endPoint) const;
415 
417  double param,
418  OdGePoint3d& pointOnCurve) const;
419 
421  const OdGePoint3d& pointOnCurve,
422  double& param) const;
423 
424  virtual OdResult getDistAtParam( double param, double& dist ) const;
425 
426  virtual OdResult getParamAtDist( double dist, double& param ) const;
427 
429  double param,
430  OdGeVector3d& firstDeriv) const;
431 
433  double param,
434  OdGeVector3d& secondDeriv) const;
435 
438 
456 
463 
471 
482  OdResult splineFit(OdDb::Poly2dType splineType, OdInt16 splineSegs);
483 
485  OdGsMarker gsMark,
486  const OdGePoint3d& ,
487  const OdGeMatrix3d& ,
488  OdDbFullSubentPathArray& subentPaths,
489  const OdDbObjectIdArray* pEntAndInsertStack ) const;
491  OdGsMarkerArray& gsMarkers) const;
492 
494 
499 
500  virtual OdResult getOdGeCurve(OdGeCurve3d*& pGeCurve, const OdGeTol& tol = OdGeContext::gTol) const;
501  virtual OdResult setFromOdGeCurve(const OdGeCurve3d& geCurve, OdGeVector3d *normal = NULL, const OdGeTol& tol = OdGeContext::gTol);
502 
510 
511  virtual OdInt32 findVertexIndex(const OdDbVertex* vert) const;
512 };
517 
518 
519 /*
520 
521 inline void OdDb2dPolyline::extend(double)
522 {
523  return OdeNotApplicable;
524 }
525 */
526 #include "TD_PackPop.h"
527 
528 #endif
529 
OdDb2dPolyline::subTransformBy
virtual OdResult subTransformBy(const OdGeMatrix3d &xfm) ODRX_OVERRIDE
OdResult
OdResult
Definition: OdResult.h:29
OdDbCurve::getFirstDeriv
virtual OdResult getFirstDeriv(double param, OdGeVector3d &firstDeriv) const =0
OdGePlane
Definition: GePlane.h:45
OdGeVector3d
Definition: GeVector3d.h:54
NULL
#define NULL
Definition: GsProperties.h:177
OdDb2dPolyline::dxfInFields
virtual OdResult dxfInFields(OdDbDxfFiler *pFiler)
OdDb2dPolyline::isPlanar
virtual bool isPlanar() const
OdDb2dPolyline::subGetSubentPathsAtGsMarker
OdResult subGetSubentPathsAtGsMarker(OdDb::SubentType type, OdGsMarker gsMark, const OdGePoint3d &, const OdGeMatrix3d &, OdDbFullSubentPathArray &subentPaths, const OdDbObjectIdArray *pEntAndInsertStack) const
OdDb2dPolyline::ODDB_DECLARE_MEMBERS
ODDB_DECLARE_MEMBERS(OdDb2dPolyline)
OdDb2dPolyline::straighten
void straighten()
OdDb2dPolyline::dxfOutFields
virtual void dxfOutFields(OdDbDxfFiler *pFiler) const
OdDb::Planarity
Planarity
Definition: DbEntity.h:74
OdDb2dPolyline::setDefaultEndWidth
void setDefaultEndWidth(double defaultEndWidth)
tol
tol
Definition: DimVarDefs.h:2287
OdDb2dPolyline::dxfIn
virtual OdResult dxfIn(OdDbDxfFiler *pFiler)
OdDb2dPolyline::elevation
double elevation() const
OdDb2dPolyline::polyType
OdDb::Poly2dType polyType() const
OdDb2dPolyline::convertToPolyType
OdResult convertToPolyType(OdDb::Poly2dType newVal)
OdDb2dPolyline::dwgInFields
virtual OdResult dwgInFields(OdDbDwgFiler *pFiler)
type
GLuint GLsizei GLsizei GLint GLenum * type
Definition: gles2_ext.h:274
OdDb2dPolyline::subWorldDraw
virtual bool subWorldDraw(OdGiWorldDraw *pWd) const
OdDbObjectId
Definition: DbObjectId.h:99
OdDb::k2dSimplePoly
@ k2dSimplePoly
Definition: Db2dPolyline.h:53
OdDb2dPolyline::getEndPoint
virtual OdResult getEndPoint(OdGePoint3d &endPoint) const
OdDb2dPolyline::getParamAtPoint
virtual OdResult getParamAtPoint(const OdGePoint3d &pointOnCurve, double &param) const
OdDbCurve::getSecondDeriv
virtual OdResult getSecondDeriv(double param, OdGeVector3d &secondDeriv) const
OdDb2dPolyline::insertVertexAt
OdDbObjectId insertVertexAt(const OdDbObjectId &indexVertId, OdDb2dVertex *pVertex)
OdDbFullSubentPath
Definition: DbSubentId.h:49
OdDb2dPolyline::subGetClassID
virtual OdResult subGetClassID(void *pClsid) const ODRX_OVERRIDE
OdArray< OdRxObjectPtr >
TD_PackPop.h
OdDb2dPolyline::setFromOdGeCurve
virtual OdResult setFromOdGeCurve(const OdGeCurve3d &geCurve, OdGeVector3d *normal=NULL, const OdGeTol &tol=OdGeContext::gTol)
OdDb2dPolyline::explodeGeometry
virtual OdResult explodeGeometry(OdRxObjectPtrArray &entitySet) const ODRX_OVERRIDE
OdDb2dPolyline::OdDb2dPolyline
OdDb2dPolyline()
OdDb2dPolyline::subGetGeomExtents
virtual OdResult subGetGeomExtents(OdGeExtents3d &extents) const
OdGsMarker
ptrdiff_t OdGsMarker
Definition: OdPlatformSettings.h:889
OdDb2dPolyline::defaultEndWidth
double defaultEndWidth() const
OdDb2dPolyline::setElevation
void setElevation(double elevation)
OdDb2dPolyline::openSequenceEnd
OdDbSequenceEndPtr openSequenceEnd(OdDb::OpenMode mode)
OdDbSequenceEnd
Definition: DbSequenceEnd.h:55
OdDb2dPolyline::isPeriodic
virtual bool isPeriodic() const
OdDbSequenceEndPtr
OdSmartPtr< OdDbSequenceEnd > OdDbSequenceEndPtr
Definition: Db2dPolyline.h:38
OdDb2dPolyline::curveFit
OdResult curveFit()
OdGeMatrix3d
Definition: GeMatrix3d.h:73
OdInt16
short OdInt16
Definition: OdPlatformSettings.h:756
OdDb2dPolyline::subSubentPtr
OdDbEntityPtr subSubentPtr(const OdDbFullSubentPath &path) const
OdDb2dPolyline::getPointAtParam
virtual OdResult getPointAtParam(double param, OdGePoint3d &pointOnCurve) const
OdDb2dPolyline::subClose
virtual void subClose()
OdDb2dPolyline::setDefaultStartWidth
void setDefaultStartWidth(double defaultStartWidth)
OdDb2dPolylinePtr
OdSmartPtr< OdDb2dPolyline > OdDb2dPolylinePtr
Definition: Db2dPolyline.h:516
OdDb2dPolyline::TD_USING
TD_USING(OdDbCurve::getFirstDeriv)
OdDb2dPolyline::getSecondDeriv
virtual OdResult getSecondDeriv(double param, OdGeVector3d &secondDeriv) const
OdDb::k2dCubicSplinePoly
@ k2dCubicSplinePoly
Definition: Db2dPolyline.h:56
OdDb2dPolyline::getDistAtParam
virtual OdResult getDistAtParam(double param, double &dist) const
OdDb2dPolyline::thickness
double thickness() const
OdSmartPtr
Definition: SmartPtr.h:58
OdDb2dPolyline::getStartPoint
virtual OdResult getStartPoint(OdGePoint3d &startPoint) const
OdDb2dPolyline::makeClosed
void makeClosed()
OdGePoint3d
Definition: GePoint3d.h:55
OdDb2dPolyline::isLinetypeGenerationOn
bool isLinetypeGenerationOn() const
OdDb::SubentType
SubentType
Definition: DbBaseSubentId.h:38
DbCurve.h
OdInt32
int OdInt32
Definition: OdPlatformSettings.h:782
OdDb2dPolyline::makeOpen
void makeOpen()
OdDb2dPolyline::findVertexIndex
virtual OdInt32 findVertexIndex(const OdDbVertex *vert) const
OdDb2dPolyline::dwgOutFields
virtual void dwgOutFields(OdDbDwgFiler *pFiler) const
OdDb2dPolyline::getFirstDeriv
virtual OdResult getFirstDeriv(double param, OdGeVector3d &firstDeriv) const
OdDb2dPolyline::TD_USING
TD_USING(OdDbCurve::getSecondDeriv)
OdDb2dPolyline::dxfInFields_R12
virtual OdResult dxfInFields_R12(OdDbDxfFiler *pFiler)
OdDb2dPolyline::insertVertexAt
OdDbObjectId insertVertexAt(const OdDb2dVertex *pIndexVert, OdDb2dVertex *pVertex)
OdDb2dPolyline::subExplode
virtual OdResult subExplode(OdRxObjectPtrArray &entitySet) const ODRX_OVERRIDE
OdDb2dPolyline::setThickness
void setThickness(double thickness)
OdDbDxfFiler
Definition: DbFiler.h:194
OdDb2dPolyline::dxfOutFields_R12
virtual void dxfOutFields_R12(OdDbDxfFiler *pFiler) const
TD_PackPush.h
OdDb::Poly2dType
Poly2dType
Definition: Db2dPolyline.h:52
OdDbVertex
Definition: DbVertex.h:56
OdDb2dPolyline::getEcs
OdGeMatrix3d getEcs() const
OdDb2dPolyline::defaultStartWidth
double defaultStartWidth() const
OdGiWorldDraw
Definition: GiWorldDraw.h:44
OdDb2dPolyline::vertexPosition
OdGePoint3d vertexPosition(const OdDb2dVertex &vertex) const
OdDb2dPolyline
Definition: Db2dPolyline.h:68
Db2dVertex.h
OdDb2dPolyline::getOdGeCurve
virtual OdResult getOdGeCurve(OdGeCurve3d *&pGeCurve, const OdGeTol &tol=OdGeContext::gTol) const
OdDb::OpenMode
OpenMode
Definition: DbObjectId.h:54
OdDb2dPolyline::getArea
virtual OdResult getArea(double &area) const
OdDb2dPolyline::subGetGsMarkersAtSubentPath
OdResult subGetGsMarkersAtSubentPath(const OdDbFullSubentPath &subPath, OdGsMarkerArray &gsMarkers) const
OdDb::k2dQuadSplinePoly
@ k2dQuadSplinePoly
Definition: Db2dPolyline.h:55
OdDb2dPolyline::getEndParam
virtual OdResult getEndParam(double &endParam) const
OdDb2dPolyline::getPlane
virtual OdResult getPlane(OdGePlane &plane, OdDb::Planarity &planarity) const
OdGeCurve3d
Definition: GeCurve3d.h:56
OdDbCurve
Definition: DbCurve.h:53
OdDb2dPolyline::vertexIterator
OdDbObjectIteratorPtr vertexIterator() const
OdGeContext::gTol
static GE_STATIC_EXPORT OdGeTol gTol
Definition: GeGbl.h:60
OdGeExtents3d
Definition: GeExtents3d.h:45
OdDb2dPolyline::getStartParam
virtual OdResult getStartParam(double &startParam) const
OdDb2dPolyline::dxfOut
virtual void dxfOut(OdDbDxfFiler *pFiler) const
OdDb2dPolyline::openVertex
OdDb2dVertexPtr openVertex(OdDbObjectId vertId, OdDb::OpenMode mode, bool openErasedOne=false)
OdDb
Definition: Db2dPolyline.h:50
OdDb2dPolyline::appendVertex
OdDbObjectId appendVertex(OdDb2dVertex *pVertex)
OdDb::k2dFitCurvePoly
@ k2dFitCurvePoly
Definition: Db2dPolyline.h:54
DbObjectIterator.h
TOOLKIT_EXPORT
#define TOOLKIT_EXPORT
Definition: DbExport.h:40
ODRX_OVERRIDE
#define ODRX_OVERRIDE
Definition: OdPlatformSettings.h:114
OdDb2dPolyline::isClosed
virtual bool isClosed() const
OdDb2dPolyline::normal
OdGeVector3d normal() const
OdGeTol
Definition: GeTol.h:49
OdDb2dPolyline::setPolyType
void setPolyType(OdDb::Poly2dType polyType)
OdDb2dPolyline::setLinetypeGenerationOn
void setLinetypeGenerationOn()
OdDb2dPolyline::splineFit
OdResult splineFit(OdDb::Poly2dType splineType, OdInt16 splineSegs)
OdDb2dPolyline::getParamAtDist
virtual OdResult getParamAtDist(double dist, double &param) const
OdDbDwgFiler
Definition: DbFiler.h:1031
OdDb2dPolyline::setLinetypeGenerationOff
void setLinetypeGenerationOff()
OdDb2dPolyline::reverseCurve
virtual OdResult reverseCurve()
OdDb2dPolyline::setNormal
void setNormal(const OdGeVector3d &normal)
OdDb2dVertex
Definition: Db2dVertex.h:58
OdDb2dPolyline::splineFit
OdResult splineFit()