CFx SDK Documentation  2022 SP0
Public Member Functions | Static Public Attributes | List of all members
FacetModeler::Contour2D Class Reference

#include <FMContour2D.h>

Inheritance diagram for FacetModeler::Contour2D:
FacetModeler::CachedContour2D FacetModeler::Contour3D

Public Member Functions

 Contour2D ()
 
 Contour2D (ContourImplClass eImplClass)
 
 Contour2D (const IBulgeSeg2D &rSrcSeg, ContourImplClass eImplClass=ecicSimple)
 
 Contour2D (const Contour2D &rSrcCont, ContourImplClass eImplClass=ecicSimple)
 
 Contour2D (const IContour2D &rSrcCont, ContourImplClass eImplClass=ecicSimple)
 DOM. More...
 
 Contour2D (const OdGeExtents2d &ext)
 
 ~Contour2D ()
 
Contour2Doperator= (const Contour2D &rSrcCont)
 
Contour2Doperator= (const IContour2D &rSrcCont)
 DOM. More...
 
Contour2DcloneFrom (const IContour2D &rSrcCont)
 
Contour2Dreset (ContourImplClass eImplClass=ecicUnknown)
 
ContourImplClass implClass () const
 
void swap (Contour2D &rAnother)
 
bool isClosed () const
 
bool isEndsEqual (const OdGeTol &gTol=FMGeGbl::gTol) const
 
void setClosed (bool bClosed=true)
 
bool isEmpty () const
 
OdUInt32 numVerts () const
 
OdUInt32 numSegments () const
 
bool hasArcs () const
 
SegmentType segmentType (OdUInt32 iIndex) const
 
Result getSegmentAt (OdUInt32 iIndex, Segment2D &rSegment) const
 
Result getSegmentAt (OdUInt32 iIndex, OdGePoint2d &ptStart, OdGePoint2d &ptEnd, double &dBulge) const
 
Result getLineSegAt (OdUInt32 iIndex, OdGeLineSeg2d &geLine) const
 
Result getArcSegAt (OdUInt32 iIndex, OdGeCircArc2d &geArc) const
 
Result getPointAt (OdUInt32 iIndex, OdGePoint2d &ptPoint) const
 
Result getBulgeAt (OdUInt32 iIndex, double &dBulge) const
 
Result getVertexAt (OdUInt32 iIndex, OdGePoint2d *pPoint, double *pBulge=0, OdIntPtr *pMetadata=0, OdUInt32 *puRawFlags=0) const
 
Result getInternalAngleAt (OdUInt32 iIndex, double &dAngle) const
 
Result setPointAt (OdUInt32 iIndex, const OdGePoint2d &ptPoint)
 
Result setBulgeAt (OdUInt32 iIndex, double dBulge)
 
Result setVertexAt (OdUInt32 iIndex, const OdGePoint2d &ptPoint, double dBulge)
 
void reserveVertices (OdUInt32 iReservedSize)
 
OdIntPtr metadataAt (OdUInt32 iIndex) const
 
Result setMetadataAt (OdUInt32 iIndex, OdIntPtr iNewData)
 
Result setAllMetadata (OdIntPtr iNewData, OdIntPtr iBitsToModify=(OdIntPtr) -1)
 
bool isHiddenAt (OdUInt32 iIndex) const
 
Result setHiddenAt (OdUInt32 iIndex, bool bHidden=true)
 
FaceOrientation orientationAt (OdUInt32 iIndex) const
 
Result setOrientationAt (OdUInt32 iIndex, FaceOrientation eOrientation)
 
bool threatAsSmoothCurveAt (OdUInt32 iIndex) const
 
void setThreatAsSmoothCurveAt (OdUInt32 iIndex, bool bSmooth)
 
bool isExplodedArcAt (OdUInt32 iIndex) const
 
Result setExplodedArcAt (OdUInt32 iIndex, bool bExplodedArc=true)
 
OdUInt32 rawFlagsAt (OdUInt32 iIndex) const
 
Result setRawFlagsAt (OdUInt32 iIndex, OdUInt32 iRawFlags)
 
Result addVertexAt (OdUInt32 iIndex, const OdGePoint2d &ptStart, double dBulge=0.0, OdIntPtr uMetadata=0, OdUInt32 uRawFlags=0)
 
Result appendVertex (const OdGePoint2d &ptStart, double dBulge=0.0, OdIntPtr uMetadata=0, OdUInt32 uRawFlags=0)
 
Result appendVertex (const OdGePoint2d &ptStart, const OdGePoint2d &ptMid, OdIntPtr uMetadata=0, OdUInt32 uRawFlags=0)
 
Result appendVertices (const OdGePoint2dArray &vecSource)
 
Result appendSegment (const Segment2D &rSeg, bool bShiftToHit=false)
 
Result appendContour (const Contour2D &rCont, bool bCloseGap=false, double dMaxGap=1e99)
 
Result removeVertexAt (OdUInt32 iIndex)
 
double startParam () const
 
double endParam () const
 
Result getStartPoint (OdGePoint2d &ptPoint) const
 
Result getEndPoint (OdGePoint2d &ptPoint) const
 
double length () const
 
Result getTangent (double dParam, OdGeVector2d &vTangent) const
 
Result getTangentAtDist (double dDist, OdGeVector2d &vTangent) const
 
Result getPoint (double dParam, OdGePoint2d &ptPoint) const
 
Result getPointAtDist (double dDist, OdGePoint2d &ptPoint) const
 
Result getDistAtParam (double dParam, double &dDist) const
 
Result getParamAtDist (double dDist, double &dParam) const
 
Result getNormalizedParam (double &dParam) const
 
Result getNormalizedDist (double &dDist) const
 
bool areEqualParams (double dParam1, double dParam2, double dParamTol=1e-10) const
 
bool areEqualDists (double dDist1, double dDist2, double dTol=1e-6) const
 
Result addExtents (OdGeExtents2d &extExtents) const
 
double area () const
 
double signedArea () const
 
bool isConvex () const
 
bool isCCW () const
 
void makeCCW (bool bCCW=true)
 
bool isOn (const OdGePoint2d &ptTest, double *pParam=0, const OdGeTol &gTol=FMGeGbl::gTol) const
 
double nearestParam (const OdGePoint2d &ptTest, OdGePoint2d *ptNearest=0) const
 
bool contains (const OdGePoint2d &ptPoint, bool *pOnBorder=0, const OdGeTol &gTol=FMGeGbl::gTol) const
 
bool isSelfIntersecting (const OdGeTol &gTol=FMGeGbl::gTol, bool bExcludeTouch=false) const
 
bool isValidRegion (const OdGeTol &gTol=FMGeGbl::gTol) const
 
bool isInsideContour (const Contour2D &c2dOuter, bool fAllowBordersTouch=false, const OdGeTol &gTol=FMGeGbl::gTol) const
 
OdUInt32 intersect (const Segment2D &rSegB, std::vector< Intersection > &vecPoints, const OdGeTol &gTol=FMGeGbl::gTol) const
 
OdUInt32 intersect (const Contour2D &rContB, std::vector< Intersection > &vecPoints, const OdGeTol &gTol=FMGeGbl::gTol) const
 
OdUInt32 intersectLine (const OdGeLine2d &rLine, std::vector< Intersection > &vecPoints, const OdGeTol &gTol=FMGeGbl::gTol) const
 
Result transformBy (const OdGeMatrix2d &mMatrix, const DeviationParams &devDeviation=FMGeGbl::gDefDev)
 
void reverse ()
 
void deleteCoincident (const OdGeTol &gTol=FMGeGbl::gTol)
 
void mergeSegments (int iMergeFlags=0, const OdGeTol &gTol=FMGeGbl::gTol)
 
Result explode (const DeviationParams &devDeviation=FMGeGbl::gDefDev, OdIntPtr uArcMetadata=0)
 
Result explodeTo (Contour2D &rDestCont, const DeviationParams &devDeviation=FMGeGbl::gDefDev, OdIntPtr uArcMetadata=0) const
 
OdUInt32 createVertexAt (double dParam, const OdGeTol &gTol=FMGeGbl::gTol)
 
OdUInt32 createVertexAtDist (double dDist, const OdGeTol &gTol=FMGeGbl::gTol)
 
Result createVerticesAt (const std::vector< double > &vecParams, const OdGeTol &gTol=FMGeGbl::gTol)
 
Result getSubContour (double dStartParam, double dEndParam, Contour2D &rSubContour, const OdGeTol &gTol=FMGeGbl::gTol) const
 
Result getOffsetProfile (double dOffset, Profile2D &rResult, FilletType eFilletType=eftExtend, const OdGeTol &gTol=FMGeGbl::gTol) const
 
Result getProfileByOffsets (const std::vector< double > &adOffset, Profile2D &rResult, const OdGeTol &gTol=FMGeGbl::gTol) const
 
bool traverse (Contour2DTraversingReactor &reactor) const
 
void getGeomExtens (OdGeExtents2d &extens)
 
 operator const IContour2D & () const
 DOM. More...
 
 operator IContour2D & ()
 DOM. More...
 
const IContour2Dimpl () const
 DOM. More...
 
IContour2Dimpl ()
 DOM. More...
 

Static Public Attributes

static FMGEOMETRY_API_STATIC const Contour2D kNull
 

Detailed Description

Representation of 2D Contour.

Remarks
Contour2D may contain linear and circular segments.

There are 3 ways to pick some (non-vertex) point on the contour: a) use an integer index to get a segment and then use parameter on the segment (GeLine or GeArc). b) use a distance along the curve from the starting point. c) use a "parameter" value.

The last way is the fastest (and preferred in most cases) because of the "parameter" structure: dParam = startParam() + iIndex * (dOffsetOnSegment/dSegmentLength)

So the point given by parameter value can be found at constant time.

Definition at line 74 of file FMContour2D.h.

Constructor & Destructor Documentation

◆ Contour2D() [1/6]

FacetModeler::Contour2D::Contour2D ( )

Creates contour of eSimple implementation type.

◆ Contour2D() [2/6]

FacetModeler::Contour2D::Contour2D ( ContourImplClass  eImplClass)
explicit

Creates contour of specified implementation type.

Parameters
eImplClass[in] Implementation type.

◆ Contour2D() [3/6]

FacetModeler::Contour2D::Contour2D ( const IBulgeSeg2D rSrcSeg,
ContourImplClass  eImplClass = ecicSimple 
)
explicit

Creates contour and initializes it with specified segment.

◆ Contour2D() [4/6]

FacetModeler::Contour2D::Contour2D ( const Contour2D rSrcCont,
ContourImplClass  eImplClass = ecicSimple 
)

Creates contour and initializes it with specified contour.

Remarks
By default the copy has simple implementation type.

◆ Contour2D() [5/6]

FacetModeler::Contour2D::Contour2D ( const IContour2D rSrcCont,
ContourImplClass  eImplClass = ecicSimple 
)
explicit

DOM.

◆ Contour2D() [6/6]

FacetModeler::Contour2D::Contour2D ( const OdGeExtents2d ext)

Creates rectangular contour and initializes it with extens points

◆ ~Contour2D()

FacetModeler::Contour2D::~Contour2D ( )

Destructor.

Member Function Documentation

◆ addExtents()

Result FacetModeler::Contour2D::addExtents ( OdGeExtents2d extExtents) const

Appends the extents of the contour to the specified extents structure.

◆ addVertexAt()

Result FacetModeler::Contour2D::addVertexAt ( OdUInt32  iIndex,
const OdGePoint2d ptStart,
double  dBulge = 0.0,
OdIntPtr  uMetadata = 0,
OdUInt32  uRawFlags = 0 
)

Adds a vertex at the specified index.

Remarks
The index should not be greater than the number of vertices in contour.

If it is equal to numVerts(), a new vertex will be appended to the array, otherwise it`ll be inserted before the old iIndex vertex.

◆ appendContour()

Result FacetModeler::Contour2D::appendContour ( const Contour2D rCont,
bool  bCloseGap = false,
double  dMaxGap = 1e99 
)

Appends contour to the end of this contour.

Remarks
Returns erPointNotOnThis if rCont.startPoint is not equal to the end of this (open) contour

If bCloseGap is true, a segment, connecting the points is inserted and the return code is erWarnPointNotOnThis.

◆ appendSegment()

Result FacetModeler::Contour2D::appendSegment ( const Segment2D rSeg,
bool  bShiftToHit = false 
)

Appends segment to the end of this contour.

Remarks
Returns erPointNotOnThis if rSeg.startPt() is not equal to the end of this (open) contour if bShiftToHit is true, the rSeg is shifted and the return code is erWarnPointNotOnThis

If the contour is closed, the last (closing) segment is wiped out.

◆ appendVertex() [1/2]

Result FacetModeler::Contour2D::appendVertex ( const OdGePoint2d ptStart,
const OdGePoint2d ptMid,
OdIntPtr  uMetadata = 0,
OdUInt32  uRawFlags = 0 
)

Appends a new vertex to the end of contour.

◆ appendVertex() [2/2]

Result FacetModeler::Contour2D::appendVertex ( const OdGePoint2d ptStart,
double  dBulge = 0.0,
OdIntPtr  uMetadata = 0,
OdUInt32  uRawFlags = 0 
)

Appends a new vertex to the end of contour.

Remarks
The bulge value relates to the segment starting at this point.

◆ appendVertices()

Result FacetModeler::Contour2D::appendVertices ( const OdGePoint2dArray vecSource)

Appends vertex data to this contour.

◆ area()

double FacetModeler::Contour2D::area ( ) const

Returns non-negative area of the contour.

Remarks
For open contours the first and last vertices are considered to be connected with a straight line.

◆ areEqualDists()

bool FacetModeler::Contour2D::areEqualDists ( double  dDist1,
double  dDist2,
double  dTol = 1e-6 
) const

Returns true if the distances are equal (after normalization).

Remarks
The result is useless unless both distances are valid.

◆ areEqualParams()

bool FacetModeler::Contour2D::areEqualParams ( double  dParam1,
double  dParam2,
double  dParamTol = 1e-10 
) const

Returns true if the parameters are valid and equal (after normalization).

Remarks
The result is useless unless both parameter are valid.

◆ cloneFrom()

Contour2D& FacetModeler::Contour2D::cloneFrom ( const IContour2D rSrcCont)

Copies the contents of the specified contour.

Remarks
The implementation type may change.

◆ contains()

bool FacetModeler::Contour2D::contains ( const OdGePoint2d ptPoint,
bool *  pOnBorder = 0,
const OdGeTol gTol = FMGeGbl::gTol 
) const

Returns whether the point is located inside contour.

Parameters
ptPoint[in] Point to test.
pOnBorder[out] Filled with true if point is located on contour.
gTol[in] Tolerance.
Returns
Returns true if the point lies inside contour.

◆ createVertexAt()

OdUInt32 FacetModeler::Contour2D::createVertexAt ( double  dParam,
const OdGeTol gTol = FMGeGbl::gTol 
)

Adds a vertex corresponding to the specified parameter into the contour.

Parameters
dParam[in] Parameter on contour.
gTol[in] Tolerance.
Returns
Index of created (or found) point.
Remarks
If vertex at specified parameter exists than method does nothing.

Insertion or removal of a vertex at dParam invalidates all parameters greater than floor(dParam).

◆ createVertexAtDist()

OdUInt32 FacetModeler::Contour2D::createVertexAtDist ( double  dDist,
const OdGeTol gTol = FMGeGbl::gTol 
)

Adds a vertex corresponding to the specified distance into the contour.

Parameters
dDist[in] Distance on contour.
gTol[in] Tolerance.
Returns
Index of created (or found) point.
Remarks
If vertex at specified parameter exists than method does nothing.

◆ createVerticesAt()

Result FacetModeler::Contour2D::createVerticesAt ( const std::vector< double > &  vecParams,
const OdGeTol gTol = FMGeGbl::gTol 
)

Adds vertices at the specified parameters into the contour

Parameters
vecParams[in] Array of parameters.
gTol[in] Tolerance.
Remarks
If some vertices already exist this method doesn't create them.

◆ deleteCoincident()

void FacetModeler::Contour2D::deleteCoincident ( const OdGeTol gTol = FMGeGbl::gTol)

Removes redundant segments with zero length.

◆ endParam()

double FacetModeler::Contour2D::endParam ( ) const

Returns end contour parameter.

◆ explode()

Result FacetModeler::Contour2D::explode ( const DeviationParams devDeviation = FMGeGbl::gDefDev,
OdIntPtr  uArcMetadata = 0 
)

Explodes all arc segments to lines. Sets uArcMetadata flag on exploded segments.

◆ explodeTo()

Result FacetModeler::Contour2D::explodeTo ( Contour2D rDestCont,
const DeviationParams devDeviation = FMGeGbl::gDefDev,
OdIntPtr  uArcMetadata = 0 
) const

Explodes all arc segments to lines. Sets uArcMetadata flag on exploded segments.

◆ getArcSegAt()

Result FacetModeler::Contour2D::getArcSegAt ( OdUInt32  iIndex,
OdGeCircArc2d geArc 
) const

Returns linear segment by index.

◆ getBulgeAt()

Result FacetModeler::Contour2D::getBulgeAt ( OdUInt32  iIndex,
double &  dBulge 
) const

Returns bulge value for segment with specified index.

◆ getDistAtParam()

Result FacetModeler::Contour2D::getDistAtParam ( double  dParam,
double &  dDist 
) const

Returns distance at parameter.

◆ getEndPoint()

Result FacetModeler::Contour2D::getEndPoint ( OdGePoint2d ptPoint) const

Returns end point of the contour.

Remarks
If the contour is empty than contour has no end point.

◆ getGeomExtens()

void FacetModeler::Contour2D::getGeomExtens ( OdGeExtents2d extens)

Returns geometry extens

◆ getInternalAngleAt()

Result FacetModeler::Contour2D::getInternalAngleAt ( OdUInt32  iIndex,
double &  dAngle 
) const

Returns internal angle of vertex by specified index.

◆ getLineSegAt()

Result FacetModeler::Contour2D::getLineSegAt ( OdUInt32  iIndex,
OdGeLineSeg2d geLine 
) const

Returns linear segment by index.

◆ getNormalizedDist()

Result FacetModeler::Contour2D::getNormalizedDist ( double &  dDist) const

Converts distance to [0, length] range.

Returns
eOk if dParam is valid.
Remarks
Works for closed contours.

◆ getNormalizedParam()

Result FacetModeler::Contour2D::getNormalizedParam ( double &  dParam) const

Converts parameter to [start param, end param] range.

Returns
eOk if dParam is valid.
Remarks
Works for closed contours.

◆ getOffsetProfile()

Result FacetModeler::Contour2D::getOffsetProfile ( double  dOffset,
Profile2D rResult,
FilletType  eFilletType = eftExtend,
const OdGeTol gTol = FMGeGbl::gTol 
) const

Return the profile that is shifted in normal direction from this closed(!) contour. E.g. counter-clockwise circle is extended, if dOffset is negative. It is contracted, if dOffset is positive and small enough, and it becomes empty, if dOffset > radius

Parameters
dOffset[in] Signed offset along normal direction. Positive offset is to inside for CCW contours.
rResult[out] Resulting profile.
eFilletType[in] Gap filling strategy for the segments sliding apart
tTol[in] Tolerance.
Returns
Success status.

◆ getParamAtDist()

Result FacetModeler::Contour2D::getParamAtDist ( double  dDist,
double &  dParam 
) const

Returns parameter at distance.

◆ getPoint()

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

Returns point at parameter.

◆ getPointAt()

Result FacetModeler::Contour2D::getPointAt ( OdUInt32  iIndex,
OdGePoint2d ptPoint 
) const

Returns point by index.

◆ getPointAtDist()

Result FacetModeler::Contour2D::getPointAtDist ( double  dDist,
OdGePoint2d ptPoint 
) const

Returns point at distance.

◆ getProfileByOffsets()

Result FacetModeler::Contour2D::getProfileByOffsets ( const std::vector< double > &  adOffset,
Profile2D rResult,
const OdGeTol gTol = FMGeGbl::gTol 
) const

◆ getSegmentAt() [1/2]

Result FacetModeler::Contour2D::getSegmentAt ( OdUInt32  iIndex,
OdGePoint2d ptStart,
OdGePoint2d ptEnd,
double &  dBulge 
) const

Returns segment paramters by index.

◆ getSegmentAt() [2/2]

Result FacetModeler::Contour2D::getSegmentAt ( OdUInt32  iIndex,
Segment2D rSegment 
) const

Returns segment by index.

◆ getStartPoint()

Result FacetModeler::Contour2D::getStartPoint ( OdGePoint2d ptPoint) const

Returns start point of the contour.

Remarks
If the contour is empty than contour has no start point.

◆ getSubContour()

Result FacetModeler::Contour2D::getSubContour ( double  dStartParam,
double  dEndParam,
Contour2D rSubContour,
const OdGeTol gTol = FMGeGbl::gTol 
) const

Returns sub-contour given by 2 parameters.

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

◆ getTangent()

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

Returns tangent at parameter.

◆ getTangentAtDist()

Result FacetModeler::Contour2D::getTangentAtDist ( double  dDist,
OdGeVector2d vTangent 
) const

Returns tangent at distance.

◆ getVertexAt()

Result FacetModeler::Contour2D::getVertexAt ( OdUInt32  iIndex,
OdGePoint2d pPoint,
double *  pBulge = 0,
OdIntPtr pMetadata = 0,
OdUInt32 puRawFlags = 0 
) const

Returns vertex data by specified index.

◆ hasArcs()

bool FacetModeler::Contour2D::hasArcs ( ) const

Returns true, if the contour contains at least one arc

◆ impl() [1/2]

IContour2D& FacetModeler::Contour2D::impl ( )
inline

DOM.

Definition at line 822 of file FMContour2D.h.

◆ impl() [2/2]

const IContour2D& FacetModeler::Contour2D::impl ( ) const
inline

DOM.

Definition at line 818 of file FMContour2D.h.

◆ implClass()

ContourImplClass FacetModeler::Contour2D::implClass ( ) const

Returns the implementation type.

◆ intersect() [1/2]

OdUInt32 FacetModeler::Contour2D::intersect ( const Contour2D rContB,
std::vector< Intersection > &  vecPoints,
const OdGeTol gTol = FMGeGbl::gTol 
) const

Calculates all intersections with specified contour and appends the result to vecPoints.

Parameters
rContB[in] Contour this contour is intersected with.
vecPoints[out] Intersection container the result is appended to.
gTol[in] Tolerance.
Returns
The number of intersections.

◆ intersect() [2/2]

OdUInt32 FacetModeler::Contour2D::intersect ( const Segment2D rSegB,
std::vector< Intersection > &  vecPoints,
const OdGeTol gTol = FMGeGbl::gTol 
) const

Calculates all intersections with specified segment and appends the result to vecPoints.

Parameters
rSegB[in] Segment this contour is intersected with.
vecPoints[out] Intersection container the result is appended to.
gTol[in] Tolerance.
Returns
The number of intersections.

◆ intersectLine()

OdUInt32 FacetModeler::Contour2D::intersectLine ( const OdGeLine2d rLine,
std::vector< Intersection > &  vecPoints,
const OdGeTol gTol = FMGeGbl::gTol 
) const

Calculates all intersections with specified line and appends the result to vecPoints.

Parameters
rLine[in] Line this contour is intersected with.
vecPoints[out] Intersection container the result is appended to.
gTol[in] Tolerance.
Returns
The number of intersections.

◆ isCCW()

bool FacetModeler::Contour2D::isCCW ( ) const

Returns true if the contour has counter-clockwise orientation.

Remarks
The area of the contour is positive for counter-clockwise contour and negative for clockwise contour.

◆ isClosed()

bool FacetModeler::Contour2D::isClosed ( ) const

Returns true if the contour is closed, false otherwise.

◆ isConvex()

bool FacetModeler::Contour2D::isConvex ( ) const

Returns true if contour is convex and false otherwise

◆ isEmpty()

bool FacetModeler::Contour2D::isEmpty ( ) const

Returns true if contour has no vertices.

◆ isEndsEqual()

bool FacetModeler::Contour2D::isEndsEqual ( const OdGeTol gTol = FMGeGbl::gTol) const

◆ isExplodedArcAt()

bool FacetModeler::Contour2D::isExplodedArcAt ( OdUInt32  iIndex) const

Returns true if the segment with specified index is a part of an exploded arc.

◆ isHiddenAt()

bool FacetModeler::Contour2D::isHiddenAt ( OdUInt32  iIndex) const

Returns true if the segment with specified index in hidden.

◆ isInsideContour()

bool FacetModeler::Contour2D::isInsideContour ( const Contour2D c2dOuter,
bool  fAllowBordersTouch = false,
const OdGeTol gTol = FMGeGbl::gTol 
) const

◆ isOn()

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

Returns whether the point is located on contour.

Parameters
ptTest[in] Point to test.
pParam[out] Resulting parameter.
gTol[in] Tolerance.
Returns
Returns true if the point lies on contour.

◆ isSelfIntersecting()

bool FacetModeler::Contour2D::isSelfIntersecting ( const OdGeTol gTol = FMGeGbl::gTol,
bool  bExcludeTouch = false 
) const

Returns whether the contour intersects itself.

Remarks
Runs in O( N * log(N) ) time at the average.

Returns true if and only if there exists a pair of intersecting segments and the shortest distance along the contour between the intersections is greater than tolerance. E.g. The method returns true for 8 - shaped contour regardless of central intersection type (touch or crossing). The method returns false for O - shaped closed contour, but returns true for the open one.

◆ isValidRegion()

bool FacetModeler::Contour2D::isValidRegion ( const OdGeTol gTol = FMGeGbl::gTol) const

Returns whether this contour is closed and coincides with a directional boundary of some open 2D-region.

Remarks
  • returns false for empty and for non-closed contours;
  • returns false, if there are coincident bounds with opposite directions (e.g. O-O shape);
  • returns false, if there are sub-contours with incorrect orientation (e.g. 8 shape)
  • returns true otherwise

◆ length()

double FacetModeler::Contour2D::length ( ) const

Returns the length of the contour.

◆ makeCCW()

void FacetModeler::Contour2D::makeCCW ( bool  bCCW = true)

Makes contour counter-clockwise or clockwise.

◆ mergeSegments()

void FacetModeler::Contour2D::mergeSegments ( int  iMergeFlags = 0,
const OdGeTol gTol = FMGeGbl::gTol 
)

Merges adjacent segments.

Parameters
iMergeFlags[in] combination of AECGe::FilletType flags (emfMergeArcs,emfIgnoreMetadata,emfMergeOrigin)
gTol[in] Tolerance.

◆ metadataAt()

OdIntPtr FacetModeler::Contour2D::metadataAt ( OdUInt32  iIndex) const

Returns metadata for the specified segment.

Remarks
By default metadata value is 0.

◆ nearestParam()

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

Returns nearest parameter on contour.

Parameters
ptTest[in] Point to test.
ptNearest[out] Nearest point on contour.
Returns
Nearest parameter on contour.

◆ numSegments()

OdUInt32 FacetModeler::Contour2D::numSegments ( ) const

Returns the number of segments.

Remarks
It is less than or equal (if the contour is closed) to the number of vertices.

◆ numVerts()

OdUInt32 FacetModeler::Contour2D::numVerts ( ) const

Returns the number of vertices.

◆ operator const IContour2D &()

FacetModeler::Contour2D::operator const IContour2D & ( ) const
inline

DOM.

Definition at line 810 of file FMContour2D.h.

◆ operator IContour2D &()

FacetModeler::Contour2D::operator IContour2D & ( )
inline

DOM.

Definition at line 814 of file FMContour2D.h.

◆ operator=() [1/2]

Contour2D& FacetModeler::Contour2D::operator= ( const Contour2D rSrcCont)

Creates a copy of specified contour.

Remarks
The implementation type remains intact.

◆ operator=() [2/2]

Contour2D& FacetModeler::Contour2D::operator= ( const IContour2D rSrcCont)

DOM.

◆ orientationAt()

FaceOrientation FacetModeler::Contour2D::orientationAt ( OdUInt32  iIndex) const

Returns segment orientation.

◆ rawFlagsAt()

OdUInt32 FacetModeler::Contour2D::rawFlagsAt ( OdUInt32  iIndex) const

Returns all built-in flags (orientation, visibility etc.) for the specified segment.

Remarks
By default flags value is 0.

◆ removeVertexAt()

Result FacetModeler::Contour2D::removeVertexAt ( OdUInt32  iIndex)

Removes a vertex and corresponding segment.

Remarks
Bulge values of the other segments are left intact.

◆ reserveVertices()

void FacetModeler::Contour2D::reserveVertices ( OdUInt32  iReservedSize)

Sets capacity of the contour data to the specified vertex number.

◆ reset()

Contour2D& FacetModeler::Contour2D::reset ( ContourImplClass  eImplClass = ecicUnknown)

Clears the contents of the contour.

Parameters
eImplClass[in] Implementation type.
Remarks
By default the implementation type will not change. Contour will be made open.

◆ reverse()

void FacetModeler::Contour2D::reverse ( )

Reverses the contour.

◆ segmentType()

SegmentType FacetModeler::Contour2D::segmentType ( OdUInt32  iIndex) const

Returns the type of the segment that begins at the specified vertex.

Remarks
If the index is out of range estUnknown is returned Otherwise one of estArc, estLine, estCoincident is returned

◆ setAllMetadata()

Result FacetModeler::Contour2D::setAllMetadata ( OdIntPtr  iNewData,
OdIntPtr  iBitsToModify = (OdIntPtr) -1 
)

Updates metadata for all segments.

◆ setBulgeAt()

Result FacetModeler::Contour2D::setBulgeAt ( OdUInt32  iIndex,
double  dBulge 
)

Sets bulge by index.

◆ setClosed()

void FacetModeler::Contour2D::setClosed ( bool  bClosed = true)

Makes the contour closed (open).

◆ setExplodedArcAt()

Result FacetModeler::Contour2D::setExplodedArcAt ( OdUInt32  iIndex,
bool  bExplodedArc = true 
)

Sets or clears ecfExplodedArc flag at specified segment.

◆ setHiddenAt()

Result FacetModeler::Contour2D::setHiddenAt ( OdUInt32  iIndex,
bool  bHidden = true 
)

Sets or clears ecfHidden flag at specified segment.

◆ setMetadataAt()

Result FacetModeler::Contour2D::setMetadataAt ( OdUInt32  iIndex,
OdIntPtr  iNewData 
)

Sets metadata for the specified segment.

Remarks
By default metadata value is 0.

◆ setOrientationAt()

Result FacetModeler::Contour2D::setOrientationAt ( OdUInt32  iIndex,
FaceOrientation  eOrientation 
)

Sets segment orientation.

◆ setPointAt()

Result FacetModeler::Contour2D::setPointAt ( OdUInt32  iIndex,
const OdGePoint2d ptPoint 
)

Sets point by index.

◆ setRawFlagsAt()

Result FacetModeler::Contour2D::setRawFlagsAt ( OdUInt32  iIndex,
OdUInt32  iRawFlags 
)

Updates all built-in flags (orientation, visibility etc.) for the specified segment.

◆ setThreatAsSmoothCurveAt()

void FacetModeler::Contour2D::setThreatAsSmoothCurveAt ( OdUInt32  iIndex,
bool  bSmooth 
)

Sets "smooth" flag value. It used to create smooth surfases when generating extrusion or revolution body.

◆ setVertexAt()

Result FacetModeler::Contour2D::setVertexAt ( OdUInt32  iIndex,
const OdGePoint2d ptPoint,
double  dBulge 
)

Sets point and bulge by index.

◆ signedArea()

double FacetModeler::Contour2D::signedArea ( ) const

Returns signed area of the contour

◆ startParam()

double FacetModeler::Contour2D::startParam ( ) const
inline

Returns start contour parameter.

Definition at line 422 of file FMContour2D.h.

◆ swap()

void FacetModeler::Contour2D::swap ( Contour2D rAnother)

Swaps the contents of the contour.

◆ threatAsSmoothCurveAt()

bool FacetModeler::Contour2D::threatAsSmoothCurveAt ( OdUInt32  iIndex) const

Returns "smooth" flag value. It used to create smooth surfases when generating extrusion or revolution body.

◆ transformBy()

Result FacetModeler::Contour2D::transformBy ( const OdGeMatrix2d mMatrix,
const DeviationParams devDeviation = FMGeGbl::gDefDev 
)

Transforms the contour.

◆ traverse()

bool FacetModeler::Contour2D::traverse ( Contour2DTraversingReactor reactor) const

Traverses the contour.

Member Data Documentation

◆ kNull

FMGEOMETRY_API_STATIC const Contour2D FacetModeler::Contour2D::kNull
static

An empty static contour

Definition at line 832 of file FMContour2D.h.


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