CFx SDK Documentation  2022 SP0
FMProfile2DBool.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 __FMPROFILE2DBOOL_H__
25 #define __FMPROFILE2DBOOL_H__
26 
27 #include "FMProfile2D.h"
28 
30 
35 {
36  class Intersector;
37 };
38 
42 namespace FacetModeler
43 {
44 
56 class FMGEOMETRY_API Profile2DBool
57 {
58  public:
63  {
64  eoUnknown = 0,
65  eoOR, // union
66  eoAND, // intersection
67  eoSUB, // difference
68  eoXOR, // exclusive or = union minus intersection
69  eoLastOper
70  };
71 
79  class ArgStub
80  {
81  public:
82  ArgStub( const Contour2D & rC2D, OdUInt32 uPriority = 0 )
83  : m_pProfile(0), m_pContour(&rC2D.impl()), m_uPriority(uPriority) { }
84  ArgStub( const IContour2D & rIC2D, OdUInt32 uPriority = 0 )
85  : m_pProfile(0), m_pContour(&rIC2D), m_uPriority(uPriority) { }
86  ArgStub( const Profile2D & rP2D, OdUInt32 uPriority = 0 )
87  : m_pProfile(&rP2D), m_pContour(0), m_uPriority(uPriority) { }
88 
89  inline const IContour2D * contour() const { return m_pContour; }
90  inline const Profile2D * profile() const { return m_pProfile; }
91  inline OdUInt32 priority() const { return m_uPriority; }
92 
93  ArgStub& setPriority(OdUInt32 uNewP) { m_uPriority = uNewP; return *this; }
94 
95  bool isEmpty() const;
96 
97  bool isSame (const ArgStub& rOther) const;
98 
99  void copyTo (Profile2D& rResult) const;
100 
102 
103  private:
104  const IContour2D * m_pContour;
105  const Profile2D * m_pProfile;
106  OdUInt32 m_uPriority;
107  };
108 
109  public:
114 
119 
124 
125 
141  Operations eOper,
142  ArgStub rArg1,
143  ArgStub rArg2,
144  Profile2D& rResult );
145 
163  Operations eOper,
164  ArgStub rLinesArg,
165  ArgStub rRegionArg,
166  Profile2D& rResult,
167  bool bRegionIsOpen = false );
168 
185  Operations eOper,
186  ArgStub rArg1,
187  ArgStub rArg2,
188  Profile2D& rResult );
189 
200  Result pushRegion( ArgStub rArg, bool bSaveCopy = true );
201 
215 
243  ArgStub rSource,
244  ArgStub rStencilRegion,
245  Profile2D& rResult,
246  OdUInt32 uMask,
247  OdUInt32 uInBits,
248  OdUInt32 uOutBits = 0,
249  OdUInt32 uBoundaryBits = 0
250  );
251 
252  private:
253  OdGeTol m_gTol;
255  };
256 };
257 
258 #endif //__FMPROFILE2DBOOL_H__
unsigned int OdUInt32
bool isSame(const ArgStub &rOther) const
ArgStub & setPriority(OdUInt32 uNewP)
ArgStub(const Contour2D &rC2D, OdUInt32 uPriority=0)
const IContour2D * contour() const
const Profile2D * profile() const
ArgStub(const Profile2D &rP2D, OdUInt32 uPriority=0)
void copyTo(Profile2D &rResult) const
ArgStub(const IContour2D &rIC2D, OdUInt32 uPriority=0)
Result stencilFlags(ArgStub rSource, ArgStub rStencilRegion, Profile2D &rResult, OdUInt32 uMask, OdUInt32 uInBits, OdUInt32 uOutBits=0, OdUInt32 uBoundaryBits=0)
Profile2DBool & reset(const OdGeTol &gTol=FMGeGbl::gTol)
Result evalRegions(Operations eOper, ArgStub rArg1, ArgStub rArg2, Profile2D &rResult)
Result evalLines(Operations eOper, ArgStub rArg1, ArgStub rArg2, Profile2D &rResult)
Profile2DBool(const OdGeTol &gTol=FMGeGbl::gTol)
Result pushRegion(ArgStub rArg, bool bSaveCopy=true)
Result evalLinesRegion(Operations eOper, ArgStub rLinesArg, ArgStub rRegionArg, Profile2D &rResult, bool bRegionIsOpen=false)
Result evalPushedRegions(Operations eOper, Profile2D &rResult)
Definition: GeTol.h:49
static FMGEOMETRY_API_STATIC OdGeTol gTol
Definition: FMGeometry.h:156