CFx SDK Documentation  2022 SP0
DbPolyline.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_DBPL_H
28 #define OD_DBPL_H
29 
30 #include "TD_PackPush.h"
31 
32 #include "DbCurve.h"
33 #include "Db2dPolyline.h"
34 
35 class OdDb2dPolyline;
36 class OdGeLineSeg2d;
37 class OdGeLineSeg3d;
38 class OdGeCircArc2d;
39 class OdGeCircArc3d;
40 
63 {
64 public:
66 
68 
101  OdDbEntity* pSource,
102  bool transferId = true);
103 
129  OdDb2dPolyline* pDest,
130  bool transferId = true);
131 
139  unsigned int vertexIndex,
140  OdGePoint2d& point2d) const;
141 
149  unsigned int vertexIndex,
150  OdGePoint3d& point3d) const;
151 
152 
153  enum SegType
154  {
155  kLine, // Straight segment with length > 0.
156  kArc, // Arc segment with length > 0.
157  kCoincident, // Segment with length == 0.
158  kPoint, // Polyline with 1 vertex.
159  kEmpty // Polyline with 0 vertices.
160  };
161 
179  unsigned int segmentIndex) const;
180 
187  unsigned int segmentIndex,
188  OdGeLineSeg2d& line2d) const;
189 
196  unsigned int segmentIndex,
197  OdGeLineSeg3d& line3d) const;
198 
205  unsigned int segmentIndex,
206  OdGeCircArc2d& arc2d) const;
207 
214  unsigned int segmentIndex,
215  OdGeCircArc3d& arc3d) const;
216 
229  virtual bool onSegAt(
230  unsigned int segmentIndex,
231  const OdGePoint2d& point2d,
232  double& param) const;
233 
239  void setClosed(
240  bool closed);
241 
255  bool plinegen);
256 
266  double elevation);
267 
275  double thickness);
276 
282  double constantWidth);
283 
288  void setNormal(
289  const OdGeVector3d& normal);
290 
294  bool isOnlyLines() const;
295 
306  bool hasPlinegen() const;
307 
314  double elevation() const;
315 
322  double thickness() const;
323 
327  double getConstantWidth() const;
328 
333 
351  unsigned int vertexIndex,
352  const OdGePoint2d& point2d,
353  double bulge = 0.,
354  double startWidth = -1.,
355  double endWidth = -1.,
356  OdInt32 vertexIdentifier = 0);
357 
363  unsigned int vertexIndex);
364 
368  unsigned int numVerts() const;
369 
370 
379  double getBulgeAt(
380  unsigned int index) const;
381 
388  unsigned int index) const;
389 
398  unsigned int segmentIndex,
399  double& startWidth,
400  double& endWidth) const;
401 
408  unsigned int vertexIndex,
409  const OdGePoint2d& point2d);
410 
422  unsigned int index,
423  double bulge);
424 
432  unsigned int index,
433  OdInt32 suggestedId);
434 
443  unsigned int index,
444  double startWidth,
445  double endWidth);
446 
454 
459 
472  void reset(
473  bool reuse,
474  unsigned int numVerts);
475 
479  bool hasBulges() const;
480 
484  bool hasVertexIdentifiers() const;
485 
489  bool hasWidth() const;
490 
492  const OdGeMatrix3d& mat, OdDbEntityPtr& pCopy) const ODRX_OVERRIDE;
493 
495  const OdGeMatrix3d& xfm) ODRX_OVERRIDE;
496 
497  virtual bool subWorldDraw(
498  OdGiWorldDraw* pWd) const ODRX_OVERRIDE;
499 
500  //FELIX_CHANGE_BEGIN
502  OdGeExtents3d& extents) const ODRX_OVERRIDE;
503  //FELIX_CHANGE_END
504 
505  virtual void subViewportDraw(
506  OdGiViewportDraw* pVd) const ODRX_OVERRIDE;
507 
509  OdDbDwgFiler* pFiler) ODRX_OVERRIDE;
510 
511  virtual void dwgOutFields(
512  OdDbDwgFiler* pFiler) const ODRX_OVERRIDE;
513 
515  OdDbDxfFiler* pFiler) ODRX_OVERRIDE;
516 
518  OdDbDxfFiler* pFiler) ODRX_OVERRIDE;
519 
520  virtual void dxfOutFields(
521  OdDbDxfFiler* pFiler) const ODRX_OVERRIDE;
522 
524  void* pClsid) const ODRX_OVERRIDE;
525 
526  virtual bool isPlanar() const ODRX_OVERRIDE;
527 
528  virtual OdResult getPlane(
529  OdGePlane& plane,
530  OdDb::Planarity& planarity) const;
531 
532 
533 
538  virtual bool isClosed() const;
539 
540  virtual bool isPeriodic() const;
541 
542  virtual OdResult getStartParam(
543  double& startParam) const;
544 
545  virtual OdResult getEndParam (
546  double& endParam) const;
547 
548  virtual OdResult getStartPoint(
549  OdGePoint3d& startPoint) const;
550 
551  virtual OdResult getEndPoint(
552  OdGePoint3d& endPoint) const;
553 
554  virtual OdResult getPointAtParam(
555  double param,
556  OdGePoint3d& pointOnCurve) const;
557 
558  virtual OdResult getParamAtPoint(
559  const OdGePoint3d& pointOnCurve,
560  double& param) const;
561 
562  virtual OdResult getFirstDeriv (
563  double param,
564  OdGeVector3d& firstDeriv) const;
565 
566  virtual OdResult getSecondDeriv (
567  double param,
568  OdGeVector3d& secondDeriv) const;
569 
570  virtual OdResult getArea(
571  double& area) const;
572 
573  TD_USING(OdDbCurve::getFirstDeriv);
574  TD_USING(OdDbCurve::getSecondDeriv);
575 
576  virtual OdResult getDistAtParam( double param, double& dist ) const;
577 
578  virtual OdResult getParamAtDist( double dist, double& param ) const;
579 
580  virtual OdResult subExplode(
581  OdRxObjectPtrArray& entitySet) const;
582 
583  virtual OdResult explodeGeometry(
584  OdRxObjectPtrArray& entitySet) const;
585 
586  virtual OdResult subGetSubentPathsAtGsMarker(OdDb::SubentType type,
587  OdGsMarker gsMark,
588  const OdGePoint3d& pickPoint,
589  const OdGeMatrix3d& viewXform,
590  OdDbFullSubentPathArray& subentPaths,
591  const OdDbObjectIdArray* pEntAndInsertStack) const;
592 
593  virtual OdResult subGetGsMarkersAtSubentPath( const OdDbFullSubentPath& subPath,
594  OdGsMarkerArray& gsMarkers) const;
595 
596  virtual OdDbEntityPtr subSubentPtr(const OdDbFullSubentPath& path) const;
597 
598  virtual OdResult reverseCurve();
599 
603  OdGeMatrix3d getEcs( ) const;
604 
605  virtual OdResult getOdGeCurve(OdGeCurve3d*& pGeCurve, const OdGeTol& tol = OdGeContext::gTol) const;
606  virtual OdResult setFromOdGeCurve(const OdGeCurve3d& geCurve, OdGeVector3d *normal = NULL, const OdGeTol& tol = OdGeContext::gTol);
607 };
608 
613 
614 #include "TD_PackPop.h"
615 
616 #endif //OD_DBPL_H
617 
#define TOOLKIT_EXPORT
Definition: DbExport.h:40
tol
Definition: DimVarDefs.h:2287
#define NULL
Definition: GsProperties.h:177
#define TD_USING(a)
Definition: OdPlatform.h:597
ptrdiff_t OdGsMarker
int OdInt32
#define ODRX_OVERRIDE
OdResult
Definition: OdResult.h:29
void setBulgeAt(unsigned int index, double bulge)
double elevation() const
OdInt32 getVertexIdentifierAt(unsigned int index) const
void setWidthsAt(unsigned int index, double startWidth, double endWidth)
bool isOnlyLines() const
void setPlinegen(bool plinegen)
void setConstantWidth(double constantWidth)
void reset(bool reuse, unsigned int numVerts)
void getPointAt(unsigned int vertexIndex, OdGePoint3d &point3d) const
virtual bool onSegAt(unsigned int segmentIndex, const OdGePoint2d &point2d, double &param) const
void minimizeMemory()
OdResult convertTo(OdDb2dPolyline *pDest, bool transferId=true)
virtual OdResult subGetClassID(void *pClsid) const ODRX_OVERRIDE
virtual OdResult subGetTransformedCopy(const OdGeMatrix3d &mat, OdDbEntityPtr &pCopy) const ODRX_OVERRIDE
virtual OdResult dwgInFields(OdDbDwgFiler *pFiler) ODRX_OVERRIDE
bool hasPlinegen() const
void getPointAt(unsigned int vertexIndex, OdGePoint2d &point2d) const
void setVertexIdentifierAt(unsigned int index, OdInt32 suggestedId)
virtual OdResult dxfInFields_R12(OdDbDxfFiler *pFiler) ODRX_OVERRIDE
void addVertexAt(unsigned int vertexIndex, const OdGePoint2d &point2d, double bulge=0., double startWidth=-1., double endWidth=-1., OdInt32 vertexIdentifier=0)
void maximizeMemory()
double getConstantWidth() const
virtual void subViewportDraw(OdGiViewportDraw *pVd) const ODRX_OVERRIDE
virtual bool isPlanar() const ODRX_OVERRIDE
void getArcSegAt(unsigned int segmentIndex, OdGeCircArc3d &arc3d) const
void setNormal(const OdGeVector3d &normal)
bool hasWidth() const
bool hasVertexIdentifiers() const
void setPointAt(unsigned int vertexIndex, const OdGePoint2d &point2d)
ODDB_DECLARE_MEMBERS(OdDbPolyline)
virtual OdResult dxfInFields(OdDbDxfFiler *pFiler) ODRX_OVERRIDE
virtual OdResult subGetGeomExtents(OdGeExtents3d &extents) const ODRX_OVERRIDE
void setElevation(double elevation)
void setClosed(bool closed)
void removeVertexAt(unsigned int vertexIndex)
bool hasBulges() const
void setThickness(double thickness)
SegType segType(unsigned int segmentIndex) const
OdResult convertFrom(OdDbEntity *pSource, bool transferId=true)
double thickness() const
void getLineSegAt(unsigned int segmentIndex, OdGeLineSeg2d &line2d) const
double getBulgeAt(unsigned int index) const
void getLineSegAt(unsigned int segmentIndex, OdGeLineSeg3d &line3d) const
virtual OdResult subTransformBy(const OdGeMatrix3d &xfm) ODRX_OVERRIDE
void getWidthsAt(unsigned int segmentIndex, double &startWidth, double &endWidth) const
OdGeVector3d normal() const
unsigned int numVerts() const
virtual void dwgOutFields(OdDbDwgFiler *pFiler) const ODRX_OVERRIDE
void getArcSegAt(unsigned int segmentIndex, OdGeCircArc2d &arc2d) const
virtual void dxfOutFields(OdDbDxfFiler *pFiler) const ODRX_OVERRIDE
virtual bool subWorldDraw(OdGiWorldDraw *pWd) const ODRX_OVERRIDE
Definition: GeTol.h:49
GLuint index
Definition: gles2_ext.h:265
GLuint GLsizei GLsizei GLint GLenum * type
Definition: gles2_ext.h:274
Planarity
Definition: DbEntity.h:74
void arc2d(OdGiGeometry &geom, const OdGePoint2d &p1, const OdGePoint2d &p2, const OdGePoint2d &p3, double z=0.0)
Definition: FMGiTools.h:43