CFx SDK Documentation  2023 SP0
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__
unsigned int OdUInt32
ptrdiff_t OdIntPtr
SegmentImplClass implClass() const
const OdGePoint2d & startPt() const
Result getParallelSegment(double dNormalOffset, IBulgeSeg2D &rParSeg) const
OdUInt32 intersect(const IBulgeSeg2D &rSegB, Intersection *pInt1=0, Intersection *pInt2=0, const OdGeTol &gTol=FMGeGbl::gTol) const
Result getLineSeg(OdGeLineSeg2d &rLine) const
const OdGePoint2d & endPt() const
const IBulgeSeg2D & impl() const
DOM.
Definition: FMSegment2D.h:401
OdUInt32 intersectLine(const OdGeLine2d &rGeLine, Intersection *pInt1=0, Intersection *pInt2=0, const OdGeTol &gTol=FMGeGbl::gTol) const
Result set(const OdGePoint2d &ptA, const OdGePoint2d &ptB, const OdGePoint2d &ptIntermediate)
double bulge() const
OdUInt32 intersectXRay(const OdGePoint2d &ptTest, bool *pOnSegment=0, const OdGeTol &gTol=FMGeGbl::gTol) const
Result getArcSeg(OdGeCircArc2d &rArc) const
FaceOrientation orientation() const
Result getArcData(OdGePoint2d &ptCenter, double &dRadius, double &dStartAngle, double &dInclAngle) const
Result set(const IBulgeSeg2D &rSeg)
IBulgeSeg2D & impl()
DOM.
Definition: FMSegment2D.h:404
double integrate(const OdGePoint2d &ptOrigin=OdGePoint2d::kOrigin) const
double dirLength() const
void addExtents(OdGeExtents2d &extExtents, double dTol=0.0) const
Result getPoint(double dParam, OdGePoint2d &ptPoint) const
Result setRawFlags(OdUInt32 iRawFlags)
OdUInt32 rawFlags() const
Result transformBy(const OdGeMatrix2d &mTrans)
Result set(const OdGePoint2d &ptA, const OdGePoint2d &ptB, double dBulge=0.0, OdIntPtr iMetaData=0, OdUInt32 iRawFlags=0)
Result setMetadata(OdIntPtr iNewData)
Segment2D(const OdGePoint2d &ptA, const OdGePoint2d &ptB, double dBulge=0.0, OdIntPtr uMetaData=0, OdUInt32 uRawFlags=0)
Result setOrientation(FaceOrientation eOrientation)
OdUInt32 intersect(const IBulgeSeg2D &rSegB, OdGePoint2d *pPt1, OdGePoint2d *pPt2=0, const OdGeTol &gTol=FMGeGbl::gTol) const
bool isOn(const OdGePoint2d &ptTest, double *pParam=0, const OdGeTol &gTol=FMGeGbl::gTol) const
OdIntPtr metadata() const
double nearestParam(const OdGePoint2d &ptTest, OdGePoint2d *ptNearest=0) const
double arcStartAngle() const
bool isExplodedArc() const
double arcAngle() const
Result getTangent(double dParam, OdGeVector2d &vTangent) const
Result set(const OdGeLineSeg2d &geLine)
Result getCircleData(OdGePoint2d &ptCenter, double &dRadius) const
Result setExplodedArc(bool bExplodedArc=true)
void getDir(OdGeVector2d &vDir) const
Segment2D(const IBulgeSeg2D &rSeg, SegmentImplClass eImplClass=esicBulgeSeg2D)
Result setHidden(bool bHidden=true)
Result getSubSegment(double dStartParam, double dEndParam, IBulgeSeg2D &rSubSeg) const
Result shift(const double dAngle, const double dShiftDist)
OdGePoint2d arcCenter() const
Result set(const OdGeCircArc2d &geArc)
SegmentType type() const
Segment2D(SegmentImplClass eImplClass)
double length() const
Segment2D(const Segment2D &rSeg, SegmentImplClass eImplClass=esicBulgeSeg2D)
Segment2D(const OdGePoint2d &ptA, const OdGePoint2d &ptB, const OdGePoint2d &ptIntermediate)
double deviation() const
double arcRadius() const
static GE_STATIC_EXPORT const OdGePoint2d kOrigin
Definition: GePoint2d.h:80
Definition: GeTol.h:49
static FMGEOMETRY_API_STATIC OdGeTol gTol
Definition: FMGeometry.h:156