CFx SDK Documentation  2020SP3
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  OdUInt32 uArcMetadata = 0 );
186 
190  Result explodeTo( Profile2D& rDestProfile,
191  const DeviationParams& devDeviation = FMGeGbl::gDefDev,
192  OdUInt32 uArcMetadata = 0 ) const;
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 
279  OdUInt32 uBitsToModify = UINT_MAX );
280 
290  static bool PerformOperation( BooleanOperation eOperation,
291  const Profile2D& rArg1, const Profile2D& rArg2, Profile2D& rResult, const OdGeTol& tol = FMGeGbl::gTol );
292 
298  const OdGeTol& gTol = FMGeGbl::gTol ) const;
299 
310  bool isValidRegion( const OdGeTol& gTol = FMGeGbl::gTol ) const;
311 
315  double signedArea() const;
316 
328  const OdGeTol& gTol = FMGeGbl::gTol ) const;
329 
340  /*static void convertFromObject( const OdDbObjectId& idEntity,
341  const OdGeMatrix3d& mOCS, AECGe::Profile2D& rResult );*/
342 
353  bool contains( const OdGePoint2d& ptTest, bool* pOnBorder = 0,
354  const OdGeTol& gTol = FMGeGbl::gTol ) const;
355 
356  private:
358  Contour2D* _insertItems( size_type iPos, size_type iCount = 1 );
360  void _uninsertItems( size_type iPos, size_type iCount = 1 );
361 
362  private:
363  OdUInt32 m_iSize;
364  OdUInt32 m_iCapacity;
365  Contour2D * m_pContours;
366 
367  public:
371  FMGEOMETRY_API_STATIC static const Profile2D kNull;
372 };
373 
374 Result FMGEOMETRY_API GetProfileWithOffsetSegment(const Profile2D& rSrc, Profile2D& rDest, OdUInt32 uContour, OdUInt32 uSegment, double dNormalOffset);
375 
376 }; // namespace AECContours
377 
378 #endif //__FMPROFILE2D_H__
FacetModeler::Profile2D::push_back
Contour2D & push_back()
DOM.
FacetModeler::Profile2D::getFaces
Result getFaces(std::vector< Profile2D > &aFaces) const
FacetModeler::FMGeGbl::gTol
static FMGEOMETRY_API_STATIC OdGeTol gTol
Definition: FMGeometry.h:156
FacetModeler::Profile2D::empty
bool empty() const
DOM.
FacetModeler::Profile2D::deleteCoincident
void deleteCoincident(const OdGeTol &gTol=FMGeGbl::gTol)
FacetModeler::Profile2D::const_reference
const Contour2D & const_reference
DOM.
Definition: FMProfile2D.h:69
FacetModeler::Profile2D::mergeSegments
void mergeSegments(int iMergeFlags=0, const OdGeTol &gTol=FMGeGbl::gTol)
FacetModeler::Profile2D::push_back
Contour2D & push_back(ContourImplClass eCC)
DOM.
FacetModeler::Profile2D::reserve
void reserve(size_type iNewCapacity)
DOM.
FacetModeler::Profile2D::Profile2D
Profile2D(const Profile2D &rSrc)
tol
tol
Definition: DimVarDefs.h:2287
FacetModeler::Contour2D
Definition: FMContour2D.h:75
FacetModeler::Profile2D::size_type
OdUInt32 size_type
DOM.
Definition: FMProfile2D.h:77
FacetModeler
Definition: FMContour2D.h:35
FacetModeler::Profile2D::max_size
size_type max_size() const
DOM.
FacetModeler::Profile2D::regularizeTo
Result regularizeTo(Profile2D &rDest, const OdGeTol &gTol=FMGeGbl::gTol) const
FacetModeler::GetProfileWithOffsetSegment
Result FMGEOMETRY_API GetProfileWithOffsetSegment(const Profile2D &rSrc, Profile2D &rDest, OdUInt32 uContour, OdUInt32 uSegment, double dNormalOffset)
FacetModeler::Profile2D::Profile2D
Profile2D(const Contour2D &rSrcCont)
FacetModeler::Profile2D::end
const_iterator end() const
DOM.
FacetModeler::Profile2D::push_back
void push_back(const Contour2D &rVal)
DOM.
FacetModeler::Profile2D::erase
iterator erase(iterator itWhere)
DOM.
OdGeExtents2d
Definition: GeExtents2d.h:43
OdUInt32
unsigned int OdUInt32
Definition: OdPlatformSettings.h:783
FacetModeler::Profile2D::getOffsetProfile
Result getOffsetProfile(double dOffset, Profile2D &rResult, FilletType eFilletType=eftExtend, const OdGeTol &gTol=FMGeGbl::gTol) const
FacetModeler::Profile2D::Profile2D
Profile2D()
FacetModeler::Profile2D::contains
bool contains(const OdGePoint2d &ptTest, bool *pOnBorder=0, const OdGeTol &gTol=FMGeGbl::gTol) const
FacetModeler::Profile2D::swap
void swap(Profile2D &rAnother)
DOM.
FacetModeler::Profile2D::setAllMetadata
Result setAllMetadata(OdUInt32 uNewData, OdUInt32 uBitsToModify=UINT_MAX)
FacetModeler::Profile2D::PerformOperation
static bool PerformOperation(BooleanOperation eOperation, const Profile2D &rArg1, const Profile2D &rArg2, Profile2D &rResult, const OdGeTol &tol=FMGeGbl::gTol)
FacetModeler::Profile2D::erase
void erase(size_type iPos)
DOM.
FacetModeler::Profile2D::erase
iterator erase(iterator itFirst, iterator itLast)
DOM.
FacetModeler::eftExtend
@ eftExtend
Definition: FMContoursBase.h:211
FacetModeler::Profile2D::signedArea
double signedArea() const
OdGeLine2d
Definition: GeLine2d.h:43
FacetModeler::Profile2D::split
void split(const OdGeLine2d &lCutter, Profile2D &rRght, Profile2D &rLeft) const
FacetModeler::Profile2D::back
const_reference back() const
DOM.
FacetModeler::Profile2D::perimeter
double perimeter() const
FacetModeler::Profile2D::fit
void fit(const OdGeExtents2d &extBoundingBox, const DeviationParams &devDeviation=FMGeGbl::gDefDev)
FacetModeler::Profile2D::getAdjustedProfile
void getAdjustedProfile(double dWidth, double dDepth, bool bAdjustWidth, bool bAdjustDepth, bool bMirrorInX, bool bMirrorInY, double dRotation, Profile2D &rResult) const
FacetModeler::FilletType
FilletType
Definition: FMContoursBase.h:202
FacetModeler::Profile2D::front
reference front()
DOM.
FacetModeler::Profile2D::insert
void insert(iterator itWhere, const_iterator itFirst, const_iterator itLast)
DOM.
FacetModeler::Profile2D::fit
void fit(const OdGeExtents2d &extBoundingBox, bool bFitX, bool bFitY, const DeviationParams &devDeviation=FMGeGbl::gDefDev)
FMContour2D.h
FacetModeler::Profile2D::const_pointer
const Contour2D * const_pointer
DOM.
Definition: FMProfile2D.h:73
FacetModeler::Profile2D::clear
void clear()
FacetModeler::Profile2D::kNull
static FMGEOMETRY_API_STATIC const Profile2D kNull
Definition: FMProfile2D.h:371
FacetModeler::Profile2D::reference
Contour2D & reference
DOM.
Definition: FMProfile2D.h:71
FacetModeler::Profile2D::transformBy
Result transformBy(const OdGeMatrix2d &mMatrix, const DeviationParams &devDeviation=FMGeGbl::gDefDev)
FacetModeler::Profile2D::hasNonEmptyContours
bool hasNonEmptyContours() const
FacetModeler::Profile2D::insert
iterator insert(iterator itWhere, const Contour2D &rVal)
DOM.
FacetModeler::Profile2D::getHoles
void getHoles(Profile2D &rHolesProfile) const
FacetModeler::Result
Result
Definition: FMContoursBase.h:44
FacetModeler::Profile2D::value_type
Contour2D value_type
DOM.
Definition: FMProfile2D.h:67
FacetModeler::Profile2D::resize
void resize(size_type iSize)
FacetModeler::Profile2D::explode
Result explode(const DeviationParams &devDeviation=FMGeGbl::gDefDev, OdUInt32 uArcMetadata=0)
FacetModeler::Profile2D::isValidRegion
bool isValidRegion(const OdGeTol &gTol=FMGeGbl::gTol) const
FacetModeler::DeviationParams
Definition: FMGeometry.h:43
FacetModeler::FMGeGbl::gDefDev
static FMGEOMETRY_API_STATIC DeviationParams gDefDev
Definition: FMGeometry.h:148
FacetModeler::ContourImplClass
ContourImplClass
DOM.
Definition: FMContoursBase.h:219
OdGeMatrix2d
Definition: GeMatrix2d.h:73
FacetModeler::Profile2D::insert
void insert(size_type iPos, const Contour2D &rVal)
DOM.
FacetModeler::Profile2D::pointer
Contour2D * pointer
DOM.
Definition: FMProfile2D.h:75
FacetModeler::Profile2D::getSingleContour
Result getSingleContour(Contour2D &rDest, const OdGeTol &gTol=FMGeGbl::gTol) const
FacetModeler::Profile2D::const_iterator
const Contour2D * const_iterator
DOM.
Definition: FMProfile2D.h:79
FacetModeler::Profile2D::iterator
Contour2D * iterator
DOM.
Definition: FMProfile2D.h:81
FacetModeler::Profile2D::begin
iterator begin()
DOM.
FacetModeler::Profile2D
Definition: FMProfile2D.h:39
FacetModeler::Profile2D::size
size_type size() const
DOM.
FacetModeler::Profile2D::begin
const_iterator begin() const
DOM.
FacetModeler::Profile2D::explodeTo
Result explodeTo(Profile2D &rDestProfile, const DeviationParams &devDeviation=FMGeGbl::gDefDev, OdUInt32 uArcMetadata=0) const
FacetModeler::Profile2D::end
iterator end()
DOM.
FacetModeler::Profile2D::~Profile2D
~Profile2D()
FacetModeler::Profile2D::pop_back
void pop_back()
DOM.
OdGeTol
Definition: GeTol.h:49
FacetModeler::Profile2D::getWithoutHoles
void getWithoutHoles(Profile2D &rNoHolesProfile) const
FacetModeler::Profile2D::capacity
size_type capacity() const
DOM.
FacetModeler::BooleanOperation
BooleanOperation
Definition: FMGeometry.h:56
FacetModeler::Profile2D::reverse
void reverse()
FacetModeler::Profile2D::addExtents
Result addExtents(OdGeExtents2d &extExtents) const
FacetModeler::Profile2D::front
const_reference front() const
DOM.
FacetModeler::Profile2D::back
reference back()
DOM.
OdGePoint2d
Definition: GePoint2d.h:60