1 // Copyright (C) 2007-2020 CEA/DEN, EDF R&D
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.
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.
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
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #ifndef GEOMAlgo_Splitter_HeaderFile
21 #define GEOMAlgo_Splitter_HeaderFile
23 #include <GeomAlgoImpl.h>
25 #include <Standard.hxx>
26 #include <Standard_Macro.hxx>
27 #include <Standard_Boolean.hxx>
28 #include <Standard_Integer.hxx>
30 #include <NCollection_BaseAllocator.hxx>
32 #include <TopAbs_ShapeEnum.hxx>
34 #include <TopoDS_Shape.hxx>
36 #include <BOPAlgo_Builder.hxx>
38 //=======================================================================
39 //class : GEOMAlgo_Splitter
41 //=======================================================================
43 * \class GEOMAlgo_Splitter
45 * A class for shapes partitioning
47 class GEOMAlgo_Splitter : public BOPAlgo_Builder
51 GEOMALGOIMPL_EXPORT GEOMAlgo_Splitter();
54 /// \param theAllocator an allocator object
55 GEOMALGOIMPL_EXPORT GEOMAlgo_Splitter(const Handle(NCollection_BaseAllocator)& theAllocator);
57 GEOMALGOIMPL_EXPORT virtual ~GEOMAlgo_Splitter();
60 /// \param theShape a tool shape
61 GEOMALGOIMPL_EXPORT void AddTool(const TopoDS_Shape& theShape);
63 /// Returns list of tool shapes
64 GEOMALGOIMPL_EXPORT const NCollection_List<TopoDS_Shape>& Tools()const;
66 /// Set type of used shapes
67 /// \param aLimit a shape type
68 GEOMALGOIMPL_EXPORT void SetLimit(const TopAbs_ShapeEnum aLimit);
70 /// Returns defined limit type
71 GEOMALGOIMPL_EXPORT TopAbs_ShapeEnum Limit()const;
73 /// Set mode (0 or 1) of limit
74 /// \param aMode the mode value
75 GEOMALGOIMPL_EXPORT void SetLimitMode(const Standard_Integer aMode);
77 /// Returns mode of limit
78 GEOMALGOIMPL_EXPORT Standard_Integer LimitMode()const;
80 /// Clears all tool shapes
81 GEOMALGOIMPL_EXPORT virtual void Clear();
85 /// \param theType a type of limit
86 GEOMALGOIMPL_EXPORT virtual void BuildResult(const TopAbs_ShapeEnum theType);
88 /// Post processing of the calculation
89 GEOMALGOIMPL_EXPORT virtual void PostTreat();
93 NCollection_List<TopoDS_Shape> myTools;
96 NCollection_Map<TopoDS_Shape> myMapTools;
99 TopAbs_ShapeEnum myLimit;
102 Standard_Integer myLimitMode;