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