CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
FMSegment2D.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2022, 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 Open Design Alliance software pursuant to a license
16// agreement with Open Design Alliance.
17// Open Design Alliance Copyright (C) 2002-2022 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
31class OdGeExtents2d;
32class OdGeMatrix2d;
33class OdGeLine2d;
34class OdGeLineSeg2d;
35class OdGeCircArc2d;
36
37namespace FacetModeler
38{
39
40 class IBulgeSeg2D;
41
52 {
53 public:
58
71 Segment2D(const OdGePoint2d& ptA, const OdGePoint2d& ptB,
72 double dBulge = 0.0, OdIntPtr uMetaData = 0, OdUInt32 uRawFlags = 0);
73
82 const OdGePoint2d& ptB, const OdGePoint2d& ptIntermediate);
83
90 Segment2D(const Segment2D & rSeg,
91 SegmentImplClass eImplClass = esicBulgeSeg2D);
92
93
99 explicit Segment2D(SegmentImplClass eImplClass);
100
101
108 explicit Segment2D(const IBulgeSeg2D & rSeg,
109 SegmentImplClass eImplClass = esicBulgeSeg2D);
110
117 Segment2D& operator = (const Segment2D& rSeg);
118
125 Segment2D& operator = (const IBulgeSeg2D& rSeg);
126
133
139 const OdGePoint2d& startPt() const;
140
146 const OdGePoint2d& endPt() const;
147
153 double bulge() const;
154
161
167 double deviation() const;
168
174 void getDir(OdGeVector2d& vDir) const;
175
181 double dirLength() const;
182
191 double length() const;
192
203
214
225 Result getPoint(double dParam,
226 OdGePoint2d& ptPoint) const;
227
238 Result getTangent(double dParam,
239 OdGeVector2d& vTangent) const;
240
247 void addExtents(OdGeExtents2d& extExtents,
248 double dTol = 0.0) const;
249
258 bool isOn(const OdGePoint2d& ptTest, double* pParam = NULL,
259 const OdGeTol& gTol = FMGeGbl::gTol) const;
260
268 double nearestParam(const OdGePoint2d& ptTest,
269 OdGePoint2d* ptNearest = NULL) const;
270
280 double integrate(const OdGePoint2d& ptOrigin = OdGePoint2d::kOrigin) const;
281
290 Result getSubSegment(double dStartParam, double dEndParam,
291 IBulgeSeg2D & rSubSeg) const;
292
300 Result getParallelSegment(double dNormalOffset,
301 IBulgeSeg2D& rParSeg) const;
302
316 OdUInt32 intersectXRay(const OdGePoint2d& ptTest, bool* pOnSegment = NULL,
317 const OdGeTol& gTol = FMGeGbl::gTol) const;
318
329 OdGePoint2d* pPt1, OdGePoint2d* pPt2 = NULL,
330 const OdGeTol& gTol = FMGeGbl::gTol) const;
331
342 Intersection* pInt1 = NULL, Intersection* pInt2 = NULL,
343 const OdGeTol& gTol = FMGeGbl::gTol) const;
344
355 const OdGeLine2d& rGeLine,
356 Intersection* pInt1 = NULL, Intersection* pInt2 = NULL,
357 const OdGeTol& gTol = FMGeGbl::gTol) const;
358
359
369
378 double arcRadius() const;
379
390 Result getCircleData(OdGePoint2d& ptCenter, double& dRadius) const;
391
400 double arcAngle() const;
401
410 double arcStartAngle() const;
411
421 Result getArcData(OdGePoint2d& ptCenter, double& dRadius,
422 double& dStartAngle, double& dInclAngle) const;
423
431
438
452 Result set(const OdGePoint2d& ptA, const OdGePoint2d& ptB, double dBulge = 0.0,
453 OdIntPtr iMetaData = 0, OdUInt32 iRawFlags = 0);
454
463 Result set(const OdGePoint2d& ptA, const OdGePoint2d& ptB, const OdGePoint2d& ptIntermediate);
464
471 Result set(const OdGeLineSeg2d& geLine);
472
479 Result set(const OdGeCircArc2d& geArc);
480
487 Result set(const IBulgeSeg2D& rSeg);
488
496 Result shift(const double dAngle, const double dShiftDist);
497
504
512
518 bool isHidden() const;
519
526 Result setHidden(bool bHidden = true);
527
534
542
548 bool isExplodedArc() const;
549
556 Result setExplodedArc(bool bExplodedArc = true);
557
564
572
577
578 public:
579 //DOM-IGNORE-BEGIN
580 inline operator const IBulgeSeg2D& () const { return *m_pImpl; }
581 inline operator IBulgeSeg2D& () { return *m_pImpl; }
582 inline const IBulgeSeg2D& impl() const { return *m_pImpl; }
583 inline IBulgeSeg2D& impl() { return *m_pImpl; }
584 //DOM-IGNORE-END
585 private:
586
588 IBulgeSeg2D* m_pImpl;
589 };
590
591}; // namespace FacetModeler
592
593#endif //__FMSEGMENT2D_H__
#define FMGEOMETRY_API
unsigned int OdUInt32
ptrdiff_t OdIntPtr
const OdGePoint2d & endPt() const
SegmentImplClass implClass() const
bool isOn(const OdGePoint2d &ptTest, double *pParam=NULL, const OdGeTol &gTol=FMGeGbl::gTol) const
Result getParallelSegment(double dNormalOffset, IBulgeSeg2D &rParSeg) const
Result getLineSeg(OdGeLineSeg2d &rLine) const
OdUInt32 intersectLine(const OdGeLine2d &rGeLine, Intersection *pInt1=NULL, Intersection *pInt2=NULL, const OdGeTol &gTol=FMGeGbl::gTol) const
Result set(const OdGePoint2d &ptA, const OdGePoint2d &ptB, const OdGePoint2d &ptIntermediate)
double bulge() 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)
double integrate(const OdGePoint2d &ptOrigin=OdGePoint2d::kOrigin) const
double dirLength() const
double nearestParam(const OdGePoint2d &ptTest, OdGePoint2d *ptNearest=NULL) 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)
OdIntPtr metadata() const
OdUInt32 intersect(const IBulgeSeg2D &rSegB, OdGePoint2d *pPt1, OdGePoint2d *pPt2=NULL, const OdGeTol &gTol=FMGeGbl::gTol) const
double arcStartAngle() const
bool isExplodedArc() const
const IBulgeSeg2D & impl() const
Definition: FMSegment2D.h:582
double arcAngle() const
Result getTangent(double dParam, OdGeVector2d &vTangent) const
Result set(const OdGeLineSeg2d &geLine)
Result getCircleData(OdGePoint2d &ptCenter, double &dRadius) const
IBulgeSeg2D & impl()
Definition: FMSegment2D.h:583
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
OdUInt32 intersect(const IBulgeSeg2D &rSegB, Intersection *pInt1=NULL, Intersection *pInt2=NULL, const OdGeTol &gTol=FMGeGbl::gTol) const
Segment2D(SegmentImplClass eImplClass)
double length() const
Segment2D(const Segment2D &rSeg, SegmentImplClass eImplClass=esicBulgeSeg2D)
const OdGePoint2d & startPt() const
Segment2D(const OdGePoint2d &ptA, const OdGePoint2d &ptB, const OdGePoint2d &ptIntermediate)
OdUInt32 intersectXRay(const OdGePoint2d &ptTest, bool *pOnSegment=NULL, const OdGeTol &gTol=FMGeGbl::gTol) const
double deviation() const
double arcRadius() const
static GE_STATIC_EXPORT const OdGePoint2d kOrigin
Definition: GePoint2d.h:93
Definition: GeTol.h:49