CFx SDK Documentation  2020SP3
FMSegment2D.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2015, 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-2015 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 __FMSEGMENT2D_H__
25 #define __FMSEGMENT2D_H__
26 
27 #include "FMContoursBase.h"
28 #include <Ge/GePoint2d.h>
29 #include <Ge/GeVector2d.h>
30 
31 class OdGeExtents2d;
32 class OdGeMatrix2d;
33 class OdGeLine2d;
34 class OdGeLineSeg2d;
35 class OdGeCircArc2d;
36 
40 namespace FacetModeler
41 {
42 
43 class IBulgeSeg2D;
44 
54 class FMGEOMETRY_API Segment2D
55 {
56  public:
61 
65  explicit Segment2D( SegmentImplClass eImplClass );
66 
70  Segment2D( const OdGePoint2d& ptA,
71  const OdGePoint2d& ptB, double dBulge = 0.0, OdIntPtr uMetaData = 0, OdUInt32 uRawFlags = 0 );
72 
76  Segment2D( const OdGePoint2d& ptA,
77  const OdGePoint2d& ptB, const OdGePoint2d& ptIntermediate );
78 
82  Segment2D( const Segment2D & rSeg,
83  SegmentImplClass eImplClass = esicBulgeSeg2D );
84 
88  explicit Segment2D( const IBulgeSeg2D & rSeg,
89  SegmentImplClass eImplClass = esicBulgeSeg2D );
90 
95 
99  Segment2D& operator = ( const Segment2D& rSeg );
100 
104  Segment2D& operator = ( const IBulgeSeg2D& rSeg );
105 
110 
114  const OdGePoint2d& startPt() const;
115 
119  const OdGePoint2d& endPt() const;
120 
124  double bulge() const;
125 
129  SegmentType type() const;
130 
134  double deviation() const;
135 
139  void getDir( OdGeVector2d& vDir ) const;
140 
144  double dirLength() const;
145 
149  double length() const;
150 
157  Result getLineSeg( OdGeLineSeg2d& rLine ) const;
158 
166 
170  Result getPoint( double dParam,
171  OdGePoint2d& ptPoint ) const;
172 
176  Result getTangent( double dParam,
177  OdGeVector2d& vTangent ) const;
178 
182  void addExtents( OdGeExtents2d& extExtents,
183  double dTol = 0.0 ) const;
184 
192  bool isOn( const OdGePoint2d& ptTest, double* pParam = 0,
193  const OdGeTol& gTol = FMGeGbl::gTol ) const;
194 
201  double nearestParam( const OdGePoint2d& ptTest,
202  OdGePoint2d* ptNearest = 0 ) const;
203 
208  double integrate( const OdGePoint2d& ptOrigin = OdGePoint2d::kOrigin ) const;
209 
216  Result getSubSegment( double dStartParam, double dEndParam,
217  IBulgeSeg2D & rSubSeg ) const;
218 
225  Result getParallelSegment( double dNormalOffset,
226  IBulgeSeg2D& rParSeg ) const;
227 
236  OdUInt32 intersectXRay( const OdGePoint2d& ptTest, bool* pOnSegment = 0,
237  const OdGeTol& gTol = FMGeGbl::gTol ) const;
238 
243  OdGePoint2d* pPt1, OdGePoint2d* pPt2 = 0,
244  const OdGeTol& gTol = FMGeGbl::gTol ) const;
245 
250  Intersection* pInt1 = 0, Intersection* pInt2 = 0,
251  const OdGeTol& gTol = FMGeGbl::gTol ) const;
252 
260  const OdGeLine2d& rGeLine,
261  Intersection* pInt1 = 0, Intersection* pInt2 = 0,
262  const OdGeTol& gTol = FMGeGbl::gTol ) const;
263 
268 
272  double arcRadius() const;
273 
278  double& dRadius ) const;
279 
286  double arcAngle() const;
287 
294  double arcStartAngle() const;
295 
299  Result getArcData( OdGePoint2d& ptCenter, double& dRadius,
300  double& dStartAngle, double& dInclAngle ) const;
301 
305  Result transformBy( const OdGeMatrix2d& mTrans );
306 
311 
315  Result set( const OdGePoint2d& ptA,
316  const OdGePoint2d& ptB, double dBulge = 0.0, OdIntPtr iMetaData = 0, OdUInt32 iRawFlags = 0 );
317 
321  Result set( const OdGePoint2d& ptA,
322  const OdGePoint2d& ptB, const OdGePoint2d& ptIntermediate );
323 
327  Result set( const OdGeLineSeg2d& geLine );
328 
332  Result set( const OdGeCircArc2d& geArc );
333 
337  Result set( const IBulgeSeg2D& rSeg );
338 
339  //
340  //
341  Result shift( const double dAngle, const double dShiftDist );
342 
347 
352 
356  bool isHidden() const;
357 
361  Result setHidden( bool bHidden = true );
362 
367 
372 
376  bool isExplodedArc() const;
377 
381  Result setExplodedArc( bool bExplodedArc = true );
382 
387 
392 
393  public:
395  inline operator const IBulgeSeg2D& () const
396  { return *m_pImpl; }
398  inline operator IBulgeSeg2D& ()
399  { return *m_pImpl; }
401  inline const IBulgeSeg2D& impl() const
402  { return *m_pImpl; }
404  inline IBulgeSeg2D& impl()
405  { return *m_pImpl; }
406 
407  private:
409  IBulgeSeg2D* m_pImpl;
410 };
411 
412 }; // namespace FacetModeler
413 
414 #endif //__FMSEGMENT2D_H__
FacetModeler::Segment2D::deviation
double deviation() const
FacetModeler::Segment2D::intersectLine
OdUInt32 intersectLine(const OdGeLine2d &rGeLine, Intersection *pInt1=0, Intersection *pInt2=0, const OdGeTol &gTol=FMGeGbl::gTol) const
FacetModeler::FMGeGbl::gTol
static FMGEOMETRY_API_STATIC OdGeTol gTol
Definition: FMGeometry.h:156
FacetModeler::Segment2D::getArcData
Result getArcData(OdGePoint2d &ptCenter, double &dRadius, double &dStartAngle, double &dInclAngle) const
GeVector2d.h
FacetModeler::Segment2D
Definition: FMSegment2D.h:55
FacetModeler::Segment2D::set
Result set(const IBulgeSeg2D &rSeg)
FacetModeler::Segment2D::set
Result set(const OdGePoint2d &ptA, const OdGePoint2d &ptB, const OdGePoint2d &ptIntermediate)
FacetModeler
Definition: FMContour2D.h:35
FacetModeler::FaceOrientation
FaceOrientation
Definition: FMGeometry.h:113
FacetModeler::Segment2D::set
Result set(const OdGeLineSeg2d &geLine)
FacetModeler::Segment2D::setExplodedArc
Result setExplodedArc(bool bExplodedArc=true)
FacetModeler::Segment2D::arcCenter
OdGePoint2d arcCenter() const
FacetModeler::Segment2D::getTangent
Result getTangent(double dParam, OdGeVector2d &vTangent) const
FacetModeler::Segment2D::getParallelSegment
Result getParallelSegment(double dNormalOffset, IBulgeSeg2D &rParSeg) const
FacetModeler::Segment2D::impl
IBulgeSeg2D & impl()
DOM.
Definition: FMSegment2D.h:404
FacetModeler::Segment2D::getSubSegment
Result getSubSegment(double dStartParam, double dEndParam, IBulgeSeg2D &rSubSeg) const
OdGeExtents2d
Definition: GeExtents2d.h:43
OdUInt32
unsigned int OdUInt32
Definition: OdPlatformSettings.h:783
FacetModeler::Intersection
Definition: FMContoursBase.h:239
OdGeLineSeg2d
Definition: GeLineSeg2d.h:42
FacetModeler::IBulgeSeg2D
Definition: FM_IBulgeSeg2D.h:50
FacetModeler::Segment2D::transformBy
Result transformBy(const OdGeMatrix2d &mTrans)
FacetModeler::Segment2D::set
Result set(const OdGePoint2d &ptA, const OdGePoint2d &ptB, double dBulge=0.0, OdIntPtr iMetaData=0, OdUInt32 iRawFlags=0)
OdGeCircArc2d
Definition: GeCircArc2d.h:47
FacetModeler::esicBulgeSeg2D
@ esicBulgeSeg2D
Definition: FMContoursBase.h:230
FacetModeler::Segment2D::getPoint
Result getPoint(double dParam, OdGePoint2d &ptPoint) const
FacetModeler::Segment2D::intersect
OdUInt32 intersect(const IBulgeSeg2D &rSegB, OdGePoint2d *pPt1, OdGePoint2d *pPt2=0, const OdGeTol &gTol=FMGeGbl::gTol) const
FacetModeler::Segment2D::Segment2D
Segment2D()
OdGeLine2d
Definition: GeLine2d.h:43
FMContoursBase.h
FacetModeler::Segment2D::Segment2D
Segment2D(SegmentImplClass eImplClass)
FacetModeler::Segment2D::impl
const IBulgeSeg2D & impl() const
DOM.
Definition: FMSegment2D.h:401
FacetModeler::Segment2D::getDir
void getDir(OdGeVector2d &vDir) const
FacetModeler::Segment2D::bulge
double bulge() const
FacetModeler::Segment2D::addExtents
void addExtents(OdGeExtents2d &extExtents, double dTol=0.0) const
FacetModeler::SegmentImplClass
SegmentImplClass
DOM.
Definition: FMContoursBase.h:228
OdGeVector2d
Definition: GeVector2d.h:51
FacetModeler::Segment2D::setHidden
Result setHidden(bool bHidden=true)
FacetModeler::Segment2D::nearestParam
double nearestParam(const OdGePoint2d &ptTest, OdGePoint2d *ptNearest=0) const
FacetModeler::Segment2D::Segment2D
Segment2D(const OdGePoint2d &ptA, const OdGePoint2d &ptB, double dBulge=0.0, OdIntPtr uMetaData=0, OdUInt32 uRawFlags=0)
FacetModeler::Segment2D::getLineSeg
Result getLineSeg(OdGeLineSeg2d &rLine) const
FacetModeler::Segment2D::isHidden
bool isHidden() const
FacetModeler::Segment2D::endPt
const OdGePoint2d & endPt() const
FacetModeler::Segment2D::setMetadata
Result setMetadata(OdIntPtr iNewData)
FacetModeler::Result
Result
Definition: FMContoursBase.h:44
FacetModeler::Segment2D::setOrientation
Result setOrientation(FaceOrientation eOrientation)
FacetModeler::SegmentType
SegmentType
Definition: FMContoursBase.h:158
FacetModeler::Segment2D::shift
Result shift(const double dAngle, const double dShiftDist)
FacetModeler::Segment2D::isOn
bool isOn(const OdGePoint2d &ptTest, double *pParam=0, const OdGeTol &gTol=FMGeGbl::gTol) const
OdIntPtr
ptrdiff_t OdIntPtr
Definition: OdPlatformSettings.h:884
FacetModeler::Segment2D::intersect
OdUInt32 intersect(const IBulgeSeg2D &rSegB, Intersection *pInt1=0, Intersection *pInt2=0, const OdGeTol &gTol=FMGeGbl::gTol) const
FacetModeler::Segment2D::isExplodedArc
bool isExplodedArc() const
FacetModeler::Segment2D::metadata
OdIntPtr metadata() const
FacetModeler::Segment2D::startPt
const OdGePoint2d & startPt() const
FacetModeler::Segment2D::length
double length() const
OdGeMatrix2d
Definition: GeMatrix2d.h:73
FacetModeler::Segment2D::arcAngle
double arcAngle() const
FacetModeler::Segment2D::~Segment2D
~Segment2D()
FacetModeler::Segment2D::arcRadius
double arcRadius() const
FacetModeler::Segment2D::rawFlags
OdUInt32 rawFlags() const
FacetModeler::Segment2D::set
Result set(const OdGeCircArc2d &geArc)
FacetModeler::Segment2D::arcStartAngle
double arcStartAngle() const
FacetModeler::Segment2D::orientation
FaceOrientation orientation() const
FacetModeler::Segment2D::getArcSeg
Result getArcSeg(OdGeCircArc2d &rArc) const
OdGePoint2d::kOrigin
static GE_STATIC_EXPORT const OdGePoint2d kOrigin
Definition: GePoint2d.h:80
FacetModeler::Segment2D::setRawFlags
Result setRawFlags(OdUInt32 iRawFlags)
FacetModeler::Segment2D::Segment2D
Segment2D(const OdGePoint2d &ptA, const OdGePoint2d &ptB, const OdGePoint2d &ptIntermediate)
FacetModeler::Segment2D::Segment2D
Segment2D(const IBulgeSeg2D &rSeg, SegmentImplClass eImplClass=esicBulgeSeg2D)
OdGeTol
Definition: GeTol.h:49
FacetModeler::Segment2D::dirLength
double dirLength() const
FacetModeler::Segment2D::intersectXRay
OdUInt32 intersectXRay(const OdGePoint2d &ptTest, bool *pOnSegment=0, const OdGeTol &gTol=FMGeGbl::gTol) const
FacetModeler::Segment2D::implClass
SegmentImplClass implClass() const
FacetModeler::Segment2D::type
SegmentType type() const
GePoint2d.h
FacetModeler::Segment2D::getCircleData
Result getCircleData(OdGePoint2d &ptCenter, double &dRadius) const
FacetModeler::Segment2D::reverse
Result reverse()
FacetModeler::Segment2D::integrate
double integrate(const OdGePoint2d &ptOrigin=OdGePoint2d::kOrigin) const
FacetModeler::Segment2D::Segment2D
Segment2D(const Segment2D &rSeg, SegmentImplClass eImplClass=esicBulgeSeg2D)
OdGePoint2d
Definition: GePoint2d.h:60