Salome HOME
updated copyright message
[modules/shaper.git] / src / GeomAlgoImpl / GEOMAlgo_Splitter.hxx
1 // Copyright (C) 2007-2023  CEA, EDF
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #ifndef GEOMAlgo_Splitter_HeaderFile
21 #define GEOMAlgo_Splitter_HeaderFile
22
23 #include <GeomAlgoImpl.h>
24
25 #include <Standard.hxx>
26 #include <Standard_Macro.hxx>
27 #include <Standard_Boolean.hxx>
28 #include <Standard_Integer.hxx>
29
30 #include <NCollection_BaseAllocator.hxx>
31
32 #include <TopAbs_ShapeEnum.hxx>
33
34 #include <TopoDS_Shape.hxx>
35
36 #include <BOPAlgo_Builder.hxx>
37
38 #include <Basics_OCCTVersion.hxx>
39
40 //=======================================================================
41 //class    : GEOMAlgo_Splitter
42 //purpose  :
43 //=======================================================================
44 /*!
45  * \class GEOMAlgo_Splitter
46  * \ingroup DataAlgo
47  * A class for shapes partitioning
48  */
49  class GEOMAlgo_Splitter : public BOPAlgo_Builder
50 {
51  public:
52   /// Constructor
53   GEOMALGOIMPL_EXPORT GEOMAlgo_Splitter();
54
55   /// Constructor
56   /// \param theAllocator an allocator object
57   GEOMALGOIMPL_EXPORT GEOMAlgo_Splitter(const Handle(NCollection_BaseAllocator)& theAllocator);
58   
59   GEOMALGOIMPL_EXPORT virtual ~GEOMAlgo_Splitter();
60
61   /// Add a tool shape
62   /// \param theShape a tool shape
63   GEOMALGOIMPL_EXPORT void AddTool(const TopoDS_Shape& theShape);
64
65   /// Returns list of tool shapes
66   GEOMALGOIMPL_EXPORT const NCollection_List<TopoDS_Shape>& Tools()const;
67
68   /// Set type of used shapes
69   /// \param aLimit a shape type
70   GEOMALGOIMPL_EXPORT void SetLimit(const TopAbs_ShapeEnum aLimit);
71
72   /// Returns defined limit type
73   GEOMALGOIMPL_EXPORT TopAbs_ShapeEnum Limit()const;
74
75   /// Set mode (0 or 1) of limit
76   /// \param aMode the mode value
77   GEOMALGOIMPL_EXPORT void SetLimitMode(const Standard_Integer aMode);
78
79   /// Returns mode of limit
80   GEOMALGOIMPL_EXPORT Standard_Integer LimitMode()const;
81
82   /// Clears all tool shapes
83   GEOMALGOIMPL_EXPORT virtual void Clear();
84
85  protected:
86    /// Build result.
87    /// \param theType a type of limit
88   GEOMALGOIMPL_EXPORT virtual void BuildResult(const TopAbs_ShapeEnum theType);
89
90   /// Post processing of the calculation
91 #if OCC_VERSION_LARGE < 0x07070000
92   GEOMALGOIMPL_EXPORT virtual void PostTreat();
93 #else
94   GEOMALGOIMPL_EXPORT virtual void PostTreat(const Message_ProgressRange& theRange);
95 #endif
96   
97  protected:
98    /// List of tools
99   NCollection_List<TopoDS_Shape> myTools;
100
101   /// Map of tools
102   NCollection_Map<TopoDS_Shape> myMapTools;
103
104   /// A limit type
105   TopAbs_ShapeEnum myLimit;   
106
107   /// A limit mode
108   Standard_Integer myLimitMode;  
109 };
110
111 #endif