CFx SDK Documentation  2020SP3
Public Member Functions | List of all members
FacetModeler::Segment2D Class Reference

#include <FMSegment2D.h>

Public Member Functions

 Segment2D ()
 
 Segment2D (SegmentImplClass eImplClass)
 
 Segment2D (const OdGePoint2d &ptA, const OdGePoint2d &ptB, double dBulge=0.0, OdIntPtr uMetaData=0, OdUInt32 uRawFlags=0)
 
 Segment2D (const OdGePoint2d &ptA, const OdGePoint2d &ptB, const OdGePoint2d &ptIntermediate)
 
 Segment2D (const Segment2D &rSeg, SegmentImplClass eImplClass=esicBulgeSeg2D)
 
 Segment2D (const IBulgeSeg2D &rSeg, SegmentImplClass eImplClass=esicBulgeSeg2D)
 
 ~Segment2D ()
 
Segment2Doperator= (const Segment2D &rSeg)
 
Segment2Doperator= (const IBulgeSeg2D &rSeg)
 
SegmentImplClass implClass () const
 
const OdGePoint2dstartPt () const
 
const OdGePoint2dendPt () const
 
double bulge () const
 
SegmentType type () const
 
double deviation () const
 
void getDir (OdGeVector2d &vDir) const
 
double dirLength () const
 
double length () const
 
Result getLineSeg (OdGeLineSeg2d &rLine) const
 
Result getArcSeg (OdGeCircArc2d &rArc) const
 
Result getPoint (double dParam, OdGePoint2d &ptPoint) const
 
Result getTangent (double dParam, OdGeVector2d &vTangent) const
 
void addExtents (OdGeExtents2d &extExtents, double dTol=0.0) const
 
bool isOn (const OdGePoint2d &ptTest, double *pParam=0, const OdGeTol &gTol=FMGeGbl::gTol) const
 
double nearestParam (const OdGePoint2d &ptTest, OdGePoint2d *ptNearest=0) const
 
double integrate (const OdGePoint2d &ptOrigin=OdGePoint2d::kOrigin) const
 
Result getSubSegment (double dStartParam, double dEndParam, IBulgeSeg2D &rSubSeg) const
 
Result getParallelSegment (double dNormalOffset, IBulgeSeg2D &rParSeg) const
 
OdUInt32 intersectXRay (const OdGePoint2d &ptTest, bool *pOnSegment=0, const OdGeTol &gTol=FMGeGbl::gTol) const
 
OdUInt32 intersect (const IBulgeSeg2D &rSegB, OdGePoint2d *pPt1, OdGePoint2d *pPt2=0, const OdGeTol &gTol=FMGeGbl::gTol) const
 
OdUInt32 intersect (const IBulgeSeg2D &rSegB, Intersection *pInt1=0, Intersection *pInt2=0, const OdGeTol &gTol=FMGeGbl::gTol) const
 
OdUInt32 intersectLine (const OdGeLine2d &rGeLine, Intersection *pInt1=0, Intersection *pInt2=0, const OdGeTol &gTol=FMGeGbl::gTol) const
 
OdGePoint2d arcCenter () const
 
double arcRadius () const
 
Result getCircleData (OdGePoint2d &ptCenter, double &dRadius) const
 
double arcAngle () const
 
double arcStartAngle () const
 
Result getArcData (OdGePoint2d &ptCenter, double &dRadius, double &dStartAngle, double &dInclAngle) const
 
Result transformBy (const OdGeMatrix2d &mTrans)
 
Result reverse ()
 
Result set (const OdGePoint2d &ptA, const OdGePoint2d &ptB, double dBulge=0.0, OdIntPtr iMetaData=0, OdUInt32 iRawFlags=0)
 
Result set (const OdGePoint2d &ptA, const OdGePoint2d &ptB, const OdGePoint2d &ptIntermediate)
 
Result set (const OdGeLineSeg2d &geLine)
 
Result set (const OdGeCircArc2d &geArc)
 
Result set (const IBulgeSeg2D &rSeg)
 
Result shift (const double dAngle, const double dShiftDist)
 
OdIntPtr metadata () const
 
Result setMetadata (OdIntPtr iNewData)
 
bool isHidden () const
 
Result setHidden (bool bHidden=true)
 
FaceOrientation orientation () const
 
Result setOrientation (FaceOrientation eOrientation)
 
bool isExplodedArc () const
 
Result setExplodedArc (bool bExplodedArc=true)
 
OdUInt32 rawFlags () const
 
Result setRawFlags (OdUInt32 iRawFlags)
 
 operator const IBulgeSeg2D & () const
 DOM. More...
 
 operator IBulgeSeg2D & ()
 DOM. More...
 
const IBulgeSeg2Dimpl () const
 DOM. More...
 
IBulgeSeg2Dimpl ()
 DOM. More...
 

Detailed Description

2D Segment.

Remarks
Segment2D is a convex 2-D curve given by 2 points and a bulge value If the 2 points coincide, the segment has estCoincident type Otherwise, if bulge==0, the segment is a straight line segment otherwise it is a circular arc, and bulge=tan(Angle/4)

Definition at line 54 of file FMSegment2D.h.

Constructor & Destructor Documentation

◆ Segment2D() [1/6]

FacetModeler::Segment2D::Segment2D ( )

Constructor.

◆ Segment2D() [2/6]

FacetModeler::Segment2D::Segment2D ( SegmentImplClass  eImplClass)
explicit

Constructor.

◆ Segment2D() [3/6]

FacetModeler::Segment2D::Segment2D ( const OdGePoint2d ptA,
const OdGePoint2d ptB,
double  dBulge = 0.0,
OdIntPtr  uMetaData = 0,
OdUInt32  uRawFlags = 0 
)

Constructor.

◆ Segment2D() [4/6]

FacetModeler::Segment2D::Segment2D ( const OdGePoint2d ptA,
const OdGePoint2d ptB,
const OdGePoint2d ptIntermediate 
)

Constructor.

◆ Segment2D() [5/6]

FacetModeler::Segment2D::Segment2D ( const Segment2D rSeg,
SegmentImplClass  eImplClass = esicBulgeSeg2D 
)

Constructor.

◆ Segment2D() [6/6]

FacetModeler::Segment2D::Segment2D ( const IBulgeSeg2D rSeg,
SegmentImplClass  eImplClass = esicBulgeSeg2D 
)
explicit

Constructor.

◆ ~Segment2D()

FacetModeler::Segment2D::~Segment2D ( )

Destructor.

Member Function Documentation

◆ addExtents()

void FacetModeler::Segment2D::addExtents ( OdGeExtents2d extExtents,
double  dTol = 0.0 
) const

Adds extents of this segment (extended by dTol) to the given extents.

◆ arcAngle()

double FacetModeler::Segment2D::arcAngle ( ) const

Returns signed included angle of the arc segment.

Remarks
The returned value belongs to range ( -2*Pi, 2*Pi ).

◆ arcCenter()

OdGePoint2d FacetModeler::Segment2D::arcCenter ( ) const

Returns arc center.

◆ arcRadius()

double FacetModeler::Segment2D::arcRadius ( ) const

Returns arc radius.

◆ arcStartAngle()

double FacetModeler::Segment2D::arcStartAngle ( ) const

Returns starting angle of the arc (direction from center to startPt).

Remarks
The returned value belongs to range [ 0, 2*Pi ).

◆ bulge()

double FacetModeler::Segment2D::bulge ( ) const

Returns bulge value.

◆ deviation()

double FacetModeler::Segment2D::deviation ( ) const

Returns signed deviation from the line.

◆ dirLength()

double FacetModeler::Segment2D::dirLength ( ) const

Return the distance between start and end point.

◆ endPt()

const OdGePoint2d& FacetModeler::Segment2D::endPt ( ) const

Returns end point.

◆ getArcData()

Result FacetModeler::Segment2D::getArcData ( OdGePoint2d ptCenter,
double &  dRadius,
double &  dStartAngle,
double &  dInclAngle 
) const

Returns arc center point, radius and angles.

◆ getArcSeg()

Result FacetModeler::Segment2D::getArcSeg ( OdGeCircArc2d rArc) const

Returns arc segment corresponding to this segment.

Remarks
Only works for arc segments.

◆ getCircleData()

Result FacetModeler::Segment2D::getCircleData ( OdGePoint2d ptCenter,
double &  dRadius 
) const

Returns arc radius and center point.

◆ getDir()

void FacetModeler::Segment2D::getDir ( OdGeVector2d vDir) const

Returns direction from end point to start point.

◆ getLineSeg()

Result FacetModeler::Segment2D::getLineSeg ( OdGeLineSeg2d rLine) const

Returns line segment corresponding to this segment.

Remarks
Only works for line segments.

◆ getParallelSegment()

Result FacetModeler::Segment2D::getParallelSegment ( double  dNormalOffset,
IBulgeSeg2D rParSeg 
) const

Returns parallel segment.

Parameters
dNormalOffset[in] Signed offset along normal vector at each point of original segment.
rParSeg[out] Result.

◆ getPoint()

Result FacetModeler::Segment2D::getPoint ( double  dParam,
OdGePoint2d ptPoint 
) const

Returns point at parameter in range [ 0, 1 ].

◆ getSubSegment()

Result FacetModeler::Segment2D::getSubSegment ( double  dStartParam,
double  dEndParam,
IBulgeSeg2D rSubSeg 
) const

Returns subsegment given by 2 parameters.

Remarks
If (dStartParam > dEndParam) the rSubSeg will have opposite direction.

◆ getTangent()

Result FacetModeler::Segment2D::getTangent ( double  dParam,
OdGeVector2d vTangent 
) const

Returns tangent at parameter in range [ 0, 1 ].

◆ impl() [1/2]

IBulgeSeg2D& FacetModeler::Segment2D::impl ( )
inline

DOM.

Definition at line 404 of file FMSegment2D.h.

◆ impl() [2/2]

const IBulgeSeg2D& FacetModeler::Segment2D::impl ( ) const
inline

DOM.

Definition at line 401 of file FMSegment2D.h.

◆ implClass()

SegmentImplClass FacetModeler::Segment2D::implClass ( ) const

Implementation type.

◆ integrate()

double FacetModeler::Segment2D::integrate ( const OdGePoint2d ptOrigin = OdGePoint2d::kOrigin) const

Returns 2 * signed area of a contour bounded by this segment and 2 lines, connecting the ptOrigin and ends of this segment.

◆ intersect() [1/2]

OdUInt32 FacetModeler::Segment2D::intersect ( const IBulgeSeg2D rSegB,
Intersection pInt1 = 0,
Intersection pInt2 = 0,
const OdGeTol gTol = FMGeGbl::gTol 
) const

Returns number of intersections (0, 1 or something) and Intersection objects.

◆ intersect() [2/2]

OdUInt32 FacetModeler::Segment2D::intersect ( const IBulgeSeg2D rSegB,
OdGePoint2d pPt1,
OdGePoint2d pPt2 = 0,
const OdGeTol gTol = FMGeGbl::gTol 
) const

Returns number of intersections (0, 1 or something) and intersection points.

◆ intersectLine()

OdUInt32 FacetModeler::Segment2D::intersectLine ( const OdGeLine2d rGeLine,
Intersection pInt1 = 0,
Intersection pInt2 = 0,
const OdGeTol gTol = FMGeGbl::gTol 
) const

Intersects this segment with an infinite line.

Returns
The number of intersections.

◆ intersectXRay()

OdUInt32 FacetModeler::Segment2D::intersectXRay ( const OdGePoint2d ptTest,
bool *  pOnSegment = 0,
const OdGeTol gTol = FMGeGbl::gTol 
) const

The method returns number of different intersection points of the segment (including end with minimal Y) with a ray, starting at ptTest and going in the X direction.

Remarks
pOnSegment is set to true, if the test point lies on the segment.

◆ isExplodedArc()

bool FacetModeler::Segment2D::isExplodedArc ( ) const

Returns ecfExplodedArc flag value.

◆ isHidden()

bool FacetModeler::Segment2D::isHidden ( ) const

Returns ecfHidden flag value.

◆ isOn()

bool FacetModeler::Segment2D::isOn ( const OdGePoint2d ptTest,
double *  pParam = 0,
const OdGeTol gTol = FMGeGbl::gTol 
) const

Returns whether the point lies on the segment.

Parameters
ptTest[in] Point to test.
pParam[out] Resulting parameter.
gTol[in] Tolerance.

◆ length()

double FacetModeler::Segment2D::length ( ) const

Returns segment length.

◆ metadata()

OdIntPtr FacetModeler::Segment2D::metadata ( ) const

Returns metadata.

◆ nearestParam()

double FacetModeler::Segment2D::nearestParam ( const OdGePoint2d ptTest,
OdGePoint2d ptNearest = 0 
) const

Returns nearest parameter to the specified point.

Parameters
ptTest[in] Point to test.
ptNearest[out] Nearest point.

◆ operator const IBulgeSeg2D &()

FacetModeler::Segment2D::operator const IBulgeSeg2D & ( ) const
inline

DOM.

Definition at line 395 of file FMSegment2D.h.

◆ operator IBulgeSeg2D &()

FacetModeler::Segment2D::operator IBulgeSeg2D & ( )
inline

DOM.

Definition at line 398 of file FMSegment2D.h.

◆ operator=() [1/2]

Segment2D& FacetModeler::Segment2D::operator= ( const IBulgeSeg2D rSeg)

Copy operator.

◆ operator=() [2/2]

Segment2D& FacetModeler::Segment2D::operator= ( const Segment2D rSeg)

Copy operator.

◆ orientation()

FaceOrientation FacetModeler::Segment2D::orientation ( ) const

Returns orientation.

◆ rawFlags()

OdUInt32 FacetModeler::Segment2D::rawFlags ( ) const

Returns internal flags ( orientation, visibility etc.).

◆ reverse()

Result FacetModeler::Segment2D::reverse ( )

Inverts the segment (makes it going in opposite direction).

◆ set() [1/5]

Result FacetModeler::Segment2D::set ( const IBulgeSeg2D rSeg)

Copy from another segment

◆ set() [2/5]

Result FacetModeler::Segment2D::set ( const OdGeCircArc2d geArc)

Copy from GeCircArc2d and reset metadata.

◆ set() [3/5]

Result FacetModeler::Segment2D::set ( const OdGeLineSeg2d geLine)

Copy from GeLineSeg2d and reset metadata.

◆ set() [4/5]

Result FacetModeler::Segment2D::set ( const OdGePoint2d ptA,
const OdGePoint2d ptB,
const OdGePoint2d ptIntermediate 
)

Update ends and calculate bulge using the intermediate point.

◆ set() [5/5]

Result FacetModeler::Segment2D::set ( const OdGePoint2d ptA,
const OdGePoint2d ptB,
double  dBulge = 0.0,
OdIntPtr  iMetaData = 0,
OdUInt32  iRawFlags = 0 
)

Update ends and bulge.

◆ setExplodedArc()

Result FacetModeler::Segment2D::setExplodedArc ( bool  bExplodedArc = true)

Sets or clears ecfExplodedArc flag.

◆ setHidden()

Result FacetModeler::Segment2D::setHidden ( bool  bHidden = true)

Sets or clears ecfHidden flag.

◆ setMetadata()

Result FacetModeler::Segment2D::setMetadata ( OdIntPtr  iNewData)

Sets metadata.

◆ setOrientation()

Result FacetModeler::Segment2D::setOrientation ( FaceOrientation  eOrientation)

Sets orientation.

◆ setRawFlags()

Result FacetModeler::Segment2D::setRawFlags ( OdUInt32  iRawFlags)

Sets internal flags ( orientation, visibility etc.).

◆ shift()

Result FacetModeler::Segment2D::shift ( const double  dAngle,
const double  dShiftDist 
)

◆ startPt()

const OdGePoint2d& FacetModeler::Segment2D::startPt ( ) const

Returns start point.

◆ transformBy()

Result FacetModeler::Segment2D::transformBy ( const OdGeMatrix2d mTrans)

Transforms segment with specified matrix.

◆ type()

SegmentType FacetModeler::Segment2D::type ( ) const

Returns segment type.


The documentation for this class was generated from the following file: