CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
FacetModeler::Profile2D Class Reference

#include <FMProfile2D.h>

Inheritance diagram for FacetModeler::Profile2D:
FacetModeler::Profile3D

Public Types

typedef Contour2D value_type
 
typedef const Contour2Dconst_reference
 
typedef Contour2Dreference
 
typedef const Contour2Dconst_pointer
 
typedef Contour2Dpointer
 
typedef OdUInt32 size_type
 
typedef const Contour2Dconst_iterator
 
typedef Contour2Diterator
 

Public Member Functions

 Profile2D ()
 
 Profile2D (const Contour2D &rSrcCont)
 
 Profile2D (const Profile2D &rSrc)
 
Profile2Doperator= (const Profile2D &rSrc)
 
size_type size () const
 
bool empty () const
 
size_type capacity () const
 
size_type max_size () const
 
const_reference operator[] (size_type iPos) const
 
reference operator[] (size_type iPos)
 
const_reference front () const
 
reference front ()
 
const_reference back () const
 
reference back ()
 
const_iterator begin () const
 
iterator begin ()
 
const_iterator end () const
 
iterator end ()
 
void clear ()
 
void resize (size_type iSize)
 
void reserve (size_type iNewCapacity)
 
Contour2Dpush_back ()
 
Contour2Dpush_back (ContourImplClass eCC)
 
void push_back (const Contour2D &rVal)
 
void push_back (const Profile2D &rProfile)
 
void pop_back ()
 
void erase (size_type iPos)
 
iterator erase (iterator itWhere)
 
iterator erase (iterator itFirst, iterator itLast)
 
void insert (size_type iPos, const Contour2D &rVal)
 
iterator insert (iterator itWhere, const Contour2D &rVal)
 
void insert (iterator itWhere, const_iterator itFirst, const_iterator itLast)
 
void swap (Profile2D &rAnother)
 
Result addExtents (OdGeExtents2d &extExtents) const
 
bool hasNonEmptyContours () const
 
void reverse ()
 
Result transformBy (const OdGeMatrix2d &mMatrix, const DeviationParams &devDeviation=FMGeGbl::gDefDev)
 
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 (Profile2D &rDestProfile, const DeviationParams &devDeviation=FMGeGbl::gDefDev, OdIntPtr uArcMetadata=0) const
 
double perimeter () const
 
void getAdjustedProfile (double dWidth, double dDepth, bool bAdjustWidth, bool bAdjustDepth, bool bMirrorInX, bool bMirrorInY, double dRotation, Profile2D &rResult) const
 
void fit (const OdGeExtents2d &extBoundingBox, const DeviationParams &devDeviation=FMGeGbl::gDefDev)
 
void fit (const OdGeExtents2d &extBoundingBox, bool bFitX, bool bFitY, const DeviationParams &devDeviation=FMGeGbl::gDefDev)
 
Result getOffsetProfile (double dOffset, Profile2D &rResult, FilletType eFilletType=eftExtend, const OdGeTol &gTol=FMGeGbl::gTol) const
 
void getHoles (Profile2D &rHolesProfile) const
 
void getWithoutHoles (Profile2D &rNoHolesProfile) const
 
Result getFaces (std::vector< Profile2D > &aFaces) const
 
void split (const OdGeLine2d &lCutter, Profile2D &rRght, Profile2D &rLeft) const
 
Result setAllMetadata (OdIntPtr uNewData, OdIntPtr uBitsToModify=INT_MAX)
 
Result regularizeTo (Profile2D &rDest, const OdGeTol &gTol=FMGeGbl::gTol) const
 
bool isValidRegion (const OdGeTol &gTol=FMGeGbl::gTol) const
 
double signedArea () const
 
Result getSingleContour (Contour2D &rDest, const OdGeTol &gTol=FMGeGbl::gTol) const
 
bool contains (const OdGePoint2d &ptTest, bool *pOnBorder=NULL, const OdGeTol &gTol=FMGeGbl::gTol) const
 
 ~Profile2D ()
 

Static Public Member Functions

static bool PerformOperation (BooleanOperation eOperation, const Profile2D &rArg1, const Profile2D &rArg2, Profile2D &rResult, const OdGeTol &tol=FMGeGbl::gTol)
 

Static Public Attributes

static FMGEOMETRY_API_STATIC const Profile2D kNull
 

Detailed Description

Describes a 2D profile.

Definition at line 35 of file FMProfile2D.h.

Member Typedef Documentation

◆ const_iterator

Definition at line 74 of file FMProfile2D.h.

◆ const_pointer

Definition at line 70 of file FMProfile2D.h.

◆ const_reference

Definition at line 67 of file FMProfile2D.h.

◆ iterator

Definition at line 75 of file FMProfile2D.h.

◆ pointer

Definition at line 71 of file FMProfile2D.h.

◆ reference

Definition at line 68 of file FMProfile2D.h.

◆ size_type

Definition at line 72 of file FMProfile2D.h.

◆ value_type

Definition at line 66 of file FMProfile2D.h.

Constructor & Destructor Documentation

◆ Profile2D() [1/3]

FacetModeler::Profile2D::Profile2D ( )

Default constructor.

◆ Profile2D() [2/3]

FacetModeler::Profile2D::Profile2D ( const Contour2D rSrcCont)
explicit

Constructor. Creates a profile object with one specified contour.

Parameters
rSrcCont[in] 2D contour.

◆ Profile2D() [3/3]

FacetModeler::Profile2D::Profile2D ( const Profile2D rSrc)

Copy constructor.

Parameters
rSrc[in] Profile to copy from.

◆ ~Profile2D()

FacetModeler::Profile2D::~Profile2D ( )

Destructor.

Member Function Documentation

◆ addExtents()

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

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

Parameters
extExtents[in/out] Extents to add to.
Returns
eOk if the extents addition succeeded, or a corresponding error type otherwise.

◆ back() [1/2]

reference FacetModeler::Profile2D::back ( )

◆ back() [2/2]

const_reference FacetModeler::Profile2D::back ( ) const

◆ begin() [1/2]

iterator FacetModeler::Profile2D::begin ( )

◆ begin() [2/2]

const_iterator FacetModeler::Profile2D::begin ( ) const

◆ capacity()

size_type FacetModeler::Profile2D::capacity ( ) const

◆ clear()

void FacetModeler::Profile2D::clear ( )

Clears the profile.

◆ contains()

bool FacetModeler::Profile2D::contains ( const OdGePoint2d ptTest,
bool *  pOnBorder = NULL,
const OdGeTol gTol = FMGeGbl::gTol 
) const

Checks whether the specified point lies inside the profile or on its border.

Parameters
ptTest[in] Point to check.
pOnBorder[out] (Optional) true if the point lies on the border of the contour.
gTol[in] Tolerance.
Returns
true if the point lies inside the profile or on its border, or false otherwise.
Remarks
Contours of the profile should be closed. The return value is equal to (iNumCCW - iNumCW > 0), where iNum(C)CW is the number of (C)CW contours containing the point. The default value (e.g., an empty profile) is true.

◆ deleteCoincident()

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

Removes redundant segments with zero length from all contours.

Parameters
gTol[in] Tolerance.

◆ empty()

bool FacetModeler::Profile2D::empty ( ) const

◆ end() [1/2]

iterator FacetModeler::Profile2D::end ( )

◆ end() [2/2]

const_iterator FacetModeler::Profile2D::end ( ) const

◆ erase() [1/3]

iterator FacetModeler::Profile2D::erase ( iterator  itFirst,
iterator  itLast 
)

◆ erase() [2/3]

iterator FacetModeler::Profile2D::erase ( iterator  itWhere)

◆ erase() [3/3]

void FacetModeler::Profile2D::erase ( size_type  iPos)

◆ explode()

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

Explodes all contours.

Parameters
devDeviation[in] Resulting profile.
uArcMetadata[in] (Optional) Metadata to set.
Returns
eOk if the exploding succeeded, or a corresponding error type otherwise.

◆ explodeTo()

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

Explodes all contours.

Parameters
rDestProfile[out] Resulting profile.
devDeviation[in] Deviation parameters.
uArcMetadata[in] (Optional) Metadata to set.
Returns
eOk if the exploding succeeded, or a corresponding error type otherwise.

◆ fit() [1/2]

void FacetModeler::Profile2D::fit ( const OdGeExtents2d extBoundingBox,
bool  bFitX,
bool  bFitY,
const DeviationParams devDeviation = FMGeGbl::gDefDev 
)

Adjusts the profile to a bounding box extents.

Parameters
extBoundingBox[in] Bounding box to fit in.
bFitX[in] true to fit in the X bounds of the box, or false to ignore.
bFitY[in] true to fit in the Y bounds of the box, or false to ignore.
devDeviation[in] Deviation parameters.

◆ fit() [2/2]

void FacetModeler::Profile2D::fit ( const OdGeExtents2d extBoundingBox,
const DeviationParams devDeviation = FMGeGbl::gDefDev 
)

Adjusts the profile to a bounding box extents.

Parameters
extBoundingBox[in] Bounding box to fit in.
devDeviation[in] Deviation parameters.

◆ front() [1/2]

reference FacetModeler::Profile2D::front ( )

◆ front() [2/2]

const_reference FacetModeler::Profile2D::front ( ) const

◆ getAdjustedProfile()

void FacetModeler::Profile2D::getAdjustedProfile ( double  dWidth,
double  dDepth,
bool  bAdjustWidth,
bool  bAdjustDepth,
bool  bMirrorInX,
bool  bMirrorInY,
double  dRotation,
Profile2D rResult 
) const

Gets the adjusted profile.

Parameters
dWidth[in] Width of desired extents.
dDepth[in] Depth of desired extents.
bAdjustWidth[in] Adjusts the width to extents.
bAdjustDepth[in] Adjusts the depth to extents.
bMirrorInX[in] Mirror in X.
bMirrorInY[in] Mirror in Y.
dRotation[in] Rotation around Z axis.
rResult[out] Resulting profile.

◆ getFaces()

Result FacetModeler::Profile2D::getFaces ( std::vector< Profile2D > &  aFaces) const

Gets all profiles. Each of the returned profiles bounds a connected domain and contains one (the first one) big CCW contour and possibly few smaller CW "holes."

Parameters
aFaces[out] Array of resulting faces as std::vector<Profile2D>.
Returns
eOk if the operation succeeded, or a corresponding error type otherwise.
Remarks
This profile should be "regular" (no self-intersections, valid nesting of CCW/CW).

◆ getHoles()

void FacetModeler::Profile2D::getHoles ( Profile2D rHolesProfile) const

Gets all hole contours reversed.

Parameters
rHolesProfile[out] Resulting profile.

◆ getOffsetProfile()

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

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

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

◆ getSingleContour()

Result FacetModeler::Profile2D::getSingleContour ( Contour2D rDest,
const OdGeTol gTol = FMGeGbl::gTol 
) const

Gets the single contour describing the profile with bridges between initial contours.

Parameters
rDest[out] Resulting contour.
gTol[in] Tolerance.
Returns
eOk if the contour calculation succeeded, or a corresponding error type otherwise.
Remarks
The contour is not self-intersecting unless the initial contours intersect.

This profile should be "regular" (no self-intersections and valid nesting of CW/CCW contours).

◆ getWithoutHoles()

void FacetModeler::Profile2D::getWithoutHoles ( Profile2D rNoHolesProfile) const

Gets all non-hole contours as a profile.

Parameters
rNoHolesProfile[out] Resulting profile.

◆ hasNonEmptyContours()

bool FacetModeler::Profile2D::hasNonEmptyContours ( ) const

Checks whether this profile contains at least one non-empty contour.

Returns
true if this profile contains at least one non-empty contour, or false otherwise.

◆ insert() [1/3]

iterator FacetModeler::Profile2D::insert ( iterator  itWhere,
const Contour2D rVal 
)

◆ insert() [2/3]

void FacetModeler::Profile2D::insert ( iterator  itWhere,
const_iterator  itFirst,
const_iterator  itLast 
)

◆ insert() [3/3]

void FacetModeler::Profile2D::insert ( size_type  iPos,
const Contour2D rVal 
)

◆ isValidRegion()

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

Checks whether this profile contains only closed contours and coincides with a directional boundary of an open 2D region.

Parameters
gTol[in] Tolerance.
Returns
false for empty and non-closed contours. false if there are coincident bounds with opposite directions (e.g., O-O shape). false if there are sub-contours with incorrect orientations (e.g., 8 shape). true otherwise.

◆ max_size()

size_type FacetModeler::Profile2D::max_size ( ) const

◆ mergeSegments()

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

Merges adjacent segments for all contours.

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

◆ operator=()

Profile2D & FacetModeler::Profile2D::operator= ( const Profile2D rSrc)

Copy operator.

Parameters
rSrc[in] Profile to copy from.
Returns
Reference to the resulting profile.

◆ operator[]() [1/2]

reference FacetModeler::Profile2D::operator[] ( size_type  iPos)

◆ operator[]() [2/2]

const_reference FacetModeler::Profile2D::operator[] ( size_type  iPos) const

◆ PerformOperation()

static bool FacetModeler::Profile2D::PerformOperation ( BooleanOperation  eOperation,
const Profile2D rArg1,
const Profile2D rArg2,
Profile2D rResult,
const OdGeTol tol = FMGeGbl::gTol 
)
static

Performs a boolean operation on 2D profiles.

Parameters
eOperation[in] Operation type from BooleanOperation enum.
rArg1[in] First profile.
rArg2[in] Second profile.
rResult[out] Resulting profile.
tol[in] Tolerance.
Returns
true if the boolean operation succeeded, or false otherwise.
Remarks
Each argument is a set of points on the plane, not necessary convex or connected. All contours must be non-selfintersecting and closed. Segments in contours usually go counterclockwise, otherwise they are counted as holes in other contours. The method performs the operation on arguments and returns true if the operation is successful.

◆ perimeter()

double FacetModeler::Profile2D::perimeter ( ) const

Gets the perimeter of the profile.

Returns
The perimeter of the profile.

◆ pop_back()

void FacetModeler::Profile2D::pop_back ( )

◆ push_back() [1/4]

Contour2D & FacetModeler::Profile2D::push_back ( )

◆ push_back() [2/4]

void FacetModeler::Profile2D::push_back ( const Contour2D rVal)

◆ push_back() [3/4]

void FacetModeler::Profile2D::push_back ( const Profile2D rProfile)

◆ push_back() [4/4]

Contour2D & FacetModeler::Profile2D::push_back ( ContourImplClass  eCC)

◆ regularizeTo()

Result FacetModeler::Profile2D::regularizeTo ( Profile2D rDest,
const OdGeTol gTol = FMGeGbl::gTol 
) const

Removes self-intersecting parts oriented clockwise and leaves counter-clockwise parts intact.

Parameters
rDest[out] Resulting contour.
gTol[in] Tolerance.
Returns
eOk if the contour regularization succeeded, or a corresponding error type otherwise.

◆ reserve()

void FacetModeler::Profile2D::reserve ( size_type  iNewCapacity)

◆ resize()

void FacetModeler::Profile2D::resize ( size_type  iSize)

Resizes the profile.

Parameters
iSize[in] New size.

◆ reverse()

void FacetModeler::Profile2D::reverse ( )

Reverses all contours.

◆ setAllMetadata()

Result FacetModeler::Profile2D::setAllMetadata ( OdIntPtr  uNewData,
OdIntPtr  uBitsToModify = INT_MAX 
)

Updates metadata for all segments in all contours.

Parameters
uNewData[in] New value of metadata to set.
uBitsToModify[in] Bit mask to set.
Returns
eOk if the update succeeded, or a corresponding error type otherwise.

◆ signedArea()

double FacetModeler::Profile2D::signedArea ( ) const

Gets the signed area.

Returns
Signed area value.

◆ size()

size_type FacetModeler::Profile2D::size ( ) const

◆ split()

void FacetModeler::Profile2D::split ( const OdGeLine2d lCutter,
Profile2D rRght,
Profile2D rLeft 
) const

Splits the profile with a line.

Parameters
lCutter[in] Cut line.
rRght[out] Right resulting profile.
rLeft[out] Left resulting profile.
Remarks
The left side is the half-plane of the profile, which is located to the left of the straight line direction.

◆ swap()

void FacetModeler::Profile2D::swap ( Profile2D rAnother)

Swaps all data of this profile with the specified one.

Parameters
rAnother[in] Profile to swap with.

◆ transformBy()

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

Transforms all contours.

Member Data Documentation

◆ kNull

FMGEOMETRY_API_STATIC const Profile2D FacetModeler::Profile2D::kNull
static

An empty static profile.

Definition at line 403 of file FMProfile2D.h.


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