CFx SDK Documentation  2023 SP0
FMProfile2D.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2015, 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 Teigha(R) software pursuant to a license
16 // agreement with Open Design Alliance.
17 // Teigha(R) Copyright (C) 2002-2015 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 
32 namespace FacetModeler
33 {
34 
38 class FMGEOMETRY_API Profile2D
39 {
40  public:
45 
49  explicit Profile2D( const Contour2D & rSrcCont );
50 
55 
59  Profile2D(const Profile2D & rSrc );
60 
64  Profile2D& operator = (const Profile2D & rSrc);
65 
69  typedef const Contour2D & const_reference;
71  typedef Contour2D & reference;
73  typedef const Contour2D * const_pointer;
75  typedef Contour2D * pointer;
79  typedef const Contour2D * const_iterator;
81  typedef Contour2D * iterator;
83  size_type size () const;
85  bool empty() const;
87  size_type capacity () const;
89  size_type max_size () const;
91  const_reference operator [] ( size_type iPos ) const;
93  reference operator [] ( size_type iPos );
107  const_iterator end () const;
110 
114  void clear();
115 
119  void resize( size_type iSize );
120 
122  void reserve( size_type iNewCapacity );
128  void push_back( const Contour2D & rVal );
130  void pop_back ( );
132  void erase ( size_type iPos );
134  iterator erase ( iterator itWhere );
136  iterator erase ( iterator itFirst, iterator itLast );
138  void insert( size_type iPos, const Contour2D & rVal );
140  iterator insert( iterator itWhere, const Contour2D & rVal );
142  void insert( iterator itWhere, const_iterator itFirst, const_iterator itLast );
143 
145  void swap( Profile2D& rAnother );
146 
150  Result addExtents( OdGeExtents2d& extExtents ) const;
151 
155  bool hasNonEmptyContours() const;
156 
160  void reverse();
161 
166  const DeviationParams& devDeviation = FMGeGbl::gDefDev );
167 
171  void deleteCoincident( const OdGeTol& gTol = FMGeGbl::gTol );
172 
179  void mergeSegments( int iMergeFlags = 0, const OdGeTol & gTol = FMGeGbl::gTol );
180 
185  OdIntPtr uArcMetadata = 0 ); //FELIX_CHANGE
186 
190  Result explodeTo( Profile2D& rDestProfile,
191  const DeviationParams& devDeviation = FMGeGbl::gDefDev,
192  OdIntPtr uArcMetadata = 0 ) const; //FELIX_CHANGE
193 
197  double perimeter() const;
198 
211  void getAdjustedProfile( double dWidth, double dDepth,
212  bool bAdjustWidth,bool bAdjustDepth,
213  bool bMirrorInX, bool bMirrorInY,
214  double dRotation, Profile2D& rResult ) const;
215 
219  void fit( const OdGeExtents2d& extBoundingBox,
220  const DeviationParams& devDeviation = FMGeGbl::gDefDev );
221 
225  void fit( const OdGeExtents2d& extBoundingBox,
226  bool bFitX, bool bFitY,
227  const DeviationParams& devDeviation = FMGeGbl::gDefDev );
228 
244  Result getOffsetProfile( double dOffset, Profile2D& rResult,
245  FilletType eFilletType = eftExtend,
246  const OdGeTol& gTol = FMGeGbl::gTol ) const;
247 
251  void getHoles( Profile2D& rHolesProfile ) const;
252 
256  void getWithoutHoles( Profile2D& rNoHolesProfile ) const;
257 
266  Result getFaces( std::vector<Profile2D>& aFaces ) const;
267 
271  void split( const OdGeLine2d& lCutter,
272  Profile2D& rRght,
273  Profile2D& rLeft ) const;
274 
278  //FELIX_CHANGE_BEGIN
280  OdIntPtr uBitsToModify = INT_MAX );
281  //FELIX_CHANGE_END
282 
292  static bool PerformOperation( BooleanOperation eOperation,
293  const Profile2D& rArg1, const Profile2D& rArg2, Profile2D& rResult, const OdGeTol& tol = FMGeGbl::gTol );
294 
300  const OdGeTol& gTol = FMGeGbl::gTol ) const;
301 
312  bool isValidRegion( const OdGeTol& gTol = FMGeGbl::gTol ) const;
313 
317  double signedArea() const;
318 
330  const OdGeTol& gTol = FMGeGbl::gTol ) const;
331 
342  /*static void convertFromObject( const OdDbObjectId& idEntity,
343  const OdGeMatrix3d& mOCS, AECGe::Profile2D& rResult );*/
344 
355  bool contains( const OdGePoint2d& ptTest, bool* pOnBorder = 0,
356  const OdGeTol& gTol = FMGeGbl::gTol ) const;
357 
358  private:
360  Contour2D* _insertItems( size_type iPos, size_type iCount = 1 );
362  void _uninsertItems( size_type iPos, size_type iCount = 1 );
363 
364  private:
365  OdUInt32 m_iSize;
366  OdUInt32 m_iCapacity;
367  Contour2D * m_pContours;
368 
369  public:
373  FMGEOMETRY_API_STATIC static const Profile2D kNull;
374 };
375 
376 Result FMGEOMETRY_API GetProfileWithOffsetSegment(const Profile2D& rSrc, Profile2D& rDest, OdUInt32 uContour, OdUInt32 uSegment, double dNormalOffset);
377 
378 }; // namespace AECContours
379 
380 #endif //__FMPROFILE2D_H__
tol
Definition: DimVarDefs.h:2287
unsigned int OdUInt32
ptrdiff_t OdIntPtr
static FMGEOMETRY_API_STATIC const Profile2D kNull
Definition: FMProfile2D.h:373
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
DOM.
Definition: FMProfile2D.h:79
void swap(Profile2D &rAnother)
DOM.
const_iterator begin() const
DOM.
double signedArea() const
bool hasNonEmptyContours() const
void fit(const OdGeExtents2d &extBoundingBox, const DeviationParams &devDeviation=FMGeGbl::gDefDev)
const_reference back() const
DOM.
size_type size() const
DOM.
const_iterator end() const
DOM.
Contour2D & push_back(ContourImplClass eCC)
DOM.
size_type max_size() const
DOM.
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
OdUInt32 size_type
DOM.
Definition: FMProfile2D.h:77
void getHoles(Profile2D &rHolesProfile) const
void reserve(size_type iNewCapacity)
DOM.
static bool PerformOperation(BooleanOperation eOperation, const Profile2D &rArg1, const Profile2D &rArg2, Profile2D &rResult, const OdGeTol &tol=FMGeGbl::gTol)
void push_back(const Contour2D &rVal)
DOM.
Profile2D(const Profile2D &rSrc)
Contour2D & push_back()
DOM.
const_reference front() const
DOM.
void getWithoutHoles(Profile2D &rNoHolesProfile) const
reference back()
DOM.
Contour2D value_type
DOM.
Definition: FMProfile2D.h:67
iterator begin()
DOM.
void getAdjustedProfile(double dWidth, double dDepth, bool bAdjustWidth, bool bAdjustDepth, bool bMirrorInX, bool bMirrorInY, double dRotation, Profile2D &rResult) const
Contour2D * iterator
DOM.
Definition: FMProfile2D.h:81
iterator insert(iterator itWhere, const Contour2D &rVal)
DOM.
void deleteCoincident(const OdGeTol &gTol=FMGeGbl::gTol)
Contour2D & reference
DOM.
Definition: FMProfile2D.h:71
void erase(size_type iPos)
DOM.
void mergeSegments(int iMergeFlags=0, const OdGeTol &gTol=FMGeGbl::gTol)
iterator erase(iterator itFirst, iterator itLast)
DOM.
void insert(size_type iPos, const Contour2D &rVal)
DOM.
void resize(size_type iSize)
Result addExtents(OdGeExtents2d &extExtents) const
reference front()
DOM.
void fit(const OdGeExtents2d &extBoundingBox, bool bFitX, bool bFitY, const DeviationParams &devDeviation=FMGeGbl::gDefDev)
const Contour2D * const_pointer
DOM.
Definition: FMProfile2D.h:73
bool contains(const OdGePoint2d &ptTest, bool *pOnBorder=0, const OdGeTol &gTol=FMGeGbl::gTol) const
void insert(iterator itWhere, const_iterator itFirst, const_iterator itLast)
DOM.
Result setAllMetadata(OdIntPtr uNewData, OdIntPtr uBitsToModify=INT_MAX)
Result explode(const DeviationParams &devDeviation=FMGeGbl::gDefDev, OdIntPtr uArcMetadata=0)
double perimeter() const
iterator erase(iterator itWhere)
DOM.
bool empty() const
DOM.
const Contour2D & const_reference
DOM.
Definition: FMProfile2D.h:69
Contour2D * pointer
DOM.
Definition: FMProfile2D.h:75
size_type capacity() const
DOM.
Definition: GeTol.h:49
Result FMGEOMETRY_API GetProfileWithOffsetSegment(const Profile2D &rSrc, Profile2D &rDest, OdUInt32 uContour, OdUInt32 uSegment, double dNormalOffset)
static FMGEOMETRY_API_STATIC DeviationParams gDefDev
Definition: FMGeometry.h:148
static FMGEOMETRY_API_STATIC OdGeTol gTol
Definition: FMGeometry.h:156