CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
FMProfile2D.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 __FMPROFILE2D_H__
25#define __FMPROFILE2D_H__
26
27#include "FMContour2D.h"
28
29namespace FacetModeler
30{
31
36 {
37 public:
42
48 explicit Profile2D(const Contour2D & rSrcCont);
49
55 Profile2D(const Profile2D & rSrc);
56
63 Profile2D& operator = (const Profile2D & rSrc);
64
65 //DOM-IGNORE-BEGIN
67 typedef const Contour2D & const_reference;
69
70 typedef const Contour2D * const_pointer;
71 typedef Contour2D * pointer;
73
74 typedef const Contour2D * const_iterator;
76
77 size_type size() const;
78
79 bool empty() const;
80
82
84
85 const_reference operator [] (size_type iPos) const;
86 reference operator [] (size_type iPos);
87
90
93
96
99 //DOM-IGNORE-END
100
104 void clear();
105
111 void resize(size_type iSize);
112
113 //DOM-IGNORE-BEGIN
114 void reserve(size_type iNewCapacity);
115
118
119 void push_back(const Contour2D & rVal);
120 void push_back(const Profile2D & rProfile);
121
122 void pop_back();
123
124 void erase(size_type iPos);
126 iterator erase(iterator itFirst, iterator itLast);
127
128 void insert(size_type iPos, const Contour2D & rVal);
129 iterator insert(iterator itWhere, const Contour2D & rVal);
130 void insert(iterator itWhere, const_iterator itFirst, const_iterator itLast);
131 //DOM-IGNORE-END
132
138 void swap(Profile2D& rAnother);
139
146 Result addExtents(OdGeExtents2d& extExtents) const;
147
154
158 void reverse();
159
164 const DeviationParams& devDeviation = FMGeGbl::gDefDev);
165
171 void deleteCoincident(const OdGeTol& gTol = FMGeGbl::gTol);
172
179 void mergeSegments(int iMergeFlags = 0, const OdGeTol & gTol = FMGeGbl::gTol);
180
188 Result explode( const DeviationParams& devDeviation = FMGeGbl::gDefDev,
189 OdIntPtr uArcMetadata = 0 ); //FELIX_CHANGE
190
200 const DeviationParams& devDeviation = FMGeGbl::gDefDev,
201 OdIntPtr uArcMetadata = 0 ) const; //FELIX_CHANGE
202
208 double perimeter() const;
209
222 void getAdjustedProfile(double dWidth, double dDepth,
223 bool bAdjustWidth, bool bAdjustDepth,
224 bool bMirrorInX, bool bMirrorInY,
225 double dRotation, Profile2D& rResult) const;
226
233 void fit(const OdGeExtents2d& extBoundingBox,
234 const DeviationParams& devDeviation = FMGeGbl::gDefDev);
235
244 void fit(const OdGeExtents2d& extBoundingBox,
245 bool bFitX, bool bFitY,
246 const DeviationParams& devDeviation = FMGeGbl::gDefDev);
247
260 Result getOffsetProfile(double dOffset, Profile2D& rResult,
261 FilletType eFilletType = eftExtend,
262 const OdGeTol& gTol = FMGeGbl::gTol) const;
263
269 void getHoles(Profile2D& rHolesProfile) const;
270
276 void getWithoutHoles(Profile2D& rNoHolesProfile) const;
277
288 Result getFaces(std::vector<Profile2D>& aFaces) const;
289
300 void split(const OdGeLine2d& lCutter,
301 Profile2D& rRght,
302 Profile2D& rLeft) const;
303
311 //FELIX_CHANGE_BEGIN
313 OdIntPtr uBitsToModify = INT_MAX );
314 //FELIX_CHANGE_END
315
332 static bool PerformOperation(BooleanOperation eOperation,
333 const Profile2D& rArg1, const Profile2D& rArg2,
334 Profile2D& rResult, const OdGeTol& tol = FMGeGbl::gTol);
335
345 const OdGeTol& gTol = FMGeGbl::gTol) const;
346
358 bool isValidRegion(const OdGeTol& gTol = FMGeGbl::gTol) const;
359
365 double signedArea() const;
366
381 const OdGeTol& gTol = FMGeGbl::gTol) const;
382
397 bool contains(const OdGePoint2d& ptTest, bool* pOnBorder = NULL,
398 const OdGeTol& gTol = FMGeGbl::gTol) const;
399
404
409
410 private:
411 //DOM-IGNORE-BEGIN
412 Contour2D* _insertItems(size_type iPos, size_type iCount = 1);
413
414 void _uninsertItems(size_type iPos, size_type iCount = 1);
415 //DOM-IGNORE-END
416
417 OdUInt32 m_iSize; // Current size.
418 OdUInt32 m_iCapacity; // Reserved capacity.
419 Contour2D * m_pContours; // Pointer to the data array.
420 };
421
422 //DOM-IGNORE-BEGIN
423 Result FMGEOMETRY_API GetProfileWithOffsetSegment(const Profile2D& rSrc, Profile2D& rDest, OdUInt32 uContour, OdUInt32 uSegment, double dNormalOffset);
424 //DOM-IGNORE-END
425};
426
427#endif //__FMPROFILE2D_H__
tol
Definition: DimVarDefs.h:2287
#define FMGEOMETRY_API
#define FMGEOMETRY_API_STATIC
unsigned int OdUInt32
ptrdiff_t OdIntPtr
static FMGEOMETRY_API_STATIC const Profile2D kNull
Definition: FMProfile2D.h:403
Result explodeTo(Profile2D &rDestProfile, const DeviationParams &devDeviation=FMGeGbl::gDefDev, OdIntPtr uArcMetadata=0) const
Result regularizeTo(Profile2D &rDest, const OdGeTol &gTol=FMGeGbl::gTol) const
Result getSingleContour(Contour2D &rDest, const OdGeTol &gTol=FMGeGbl::gTol) const
const Contour2D * const_iterator
Definition: FMProfile2D.h:74
void push_back(const Profile2D &rProfile)
bool contains(const OdGePoint2d &ptTest, bool *pOnBorder=NULL, const OdGeTol &gTol=FMGeGbl::gTol) const
void swap(Profile2D &rAnother)
const_iterator begin() const
double signedArea() const
bool hasNonEmptyContours() const
void fit(const OdGeExtents2d &extBoundingBox, const DeviationParams &devDeviation=FMGeGbl::gDefDev)
const_reference back() const
size_type size() const
const_iterator end() const
size_type max_size() const
Result getFaces(std::vector< Profile2D > &aFaces) const
bool isValidRegion(const OdGeTol &gTol=FMGeGbl::gTol) const
Result transformBy(const OdGeMatrix2d &mMatrix, const DeviationParams &devDeviation=FMGeGbl::gDefDev)
Result getOffsetProfile(double dOffset, Profile2D &rResult, FilletType eFilletType=eftExtend, const OdGeTol &gTol=FMGeGbl::gTol) const
Profile2D(const Contour2D &rSrcCont)
void split(const OdGeLine2d &lCutter, Profile2D &rRght, Profile2D &rLeft) const
void getHoles(Profile2D &rHolesProfile) const
void reserve(size_type iNewCapacity)
static bool PerformOperation(BooleanOperation eOperation, const Profile2D &rArg1, const Profile2D &rArg2, Profile2D &rResult, const OdGeTol &tol=FMGeGbl::gTol)
void push_back(const Contour2D &rVal)
Profile2D(const Profile2D &rSrc)
const_reference front() const
void getWithoutHoles(Profile2D &rNoHolesProfile) const
void getAdjustedProfile(double dWidth, double dDepth, bool bAdjustWidth, bool bAdjustDepth, bool bMirrorInX, bool bMirrorInY, double dRotation, Profile2D &rResult) const
iterator insert(iterator itWhere, const Contour2D &rVal)
void deleteCoincident(const OdGeTol &gTol=FMGeGbl::gTol)
void erase(size_type iPos)
void mergeSegments(int iMergeFlags=0, const OdGeTol &gTol=FMGeGbl::gTol)
iterator erase(iterator itFirst, iterator itLast)
void insert(size_type iPos, const Contour2D &rVal)
void resize(size_type iSize)
Result addExtents(OdGeExtents2d &extExtents) const
void fit(const OdGeExtents2d &extBoundingBox, bool bFitX, bool bFitY, const DeviationParams &devDeviation=FMGeGbl::gDefDev)
Contour2D & push_back(ContourImplClass eCC)
const Contour2D * const_pointer
Definition: FMProfile2D.h:70
void insert(iterator itWhere, const_iterator itFirst, const_iterator itLast)
Result setAllMetadata(OdIntPtr uNewData, OdIntPtr uBitsToModify=INT_MAX)
Contour2D & push_back()
Result explode(const DeviationParams &devDeviation=FMGeGbl::gDefDev, OdIntPtr uArcMetadata=0)
double perimeter() const
iterator erase(iterator itWhere)
const Contour2D & const_reference
Definition: FMProfile2D.h:67
size_type capacity() const
Definition: GeTol.h:49
Result FMGEOMETRY_API GetProfileWithOffsetSegment(const Profile2D &rSrc, Profile2D &rDest, OdUInt32 uContour, OdUInt32 uSegment, double dNormalOffset)