1 // Copyright (C) 2007-2023 CEA, EDF
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 #include <Basics_OCCTVersion.hxx>
40 //=======================================================================
41 //class : GEOMAlgo_Splitter
43 //=======================================================================
45 * \class GEOMAlgo_Splitter
47 * A class for shapes partitioning
49 class GEOMAlgo_Splitter : public BOPAlgo_Builder
53 GEOMALGOIMPL_EXPORT GEOMAlgo_Splitter();
56 /// \param theAllocator an allocator object
57 GEOMALGOIMPL_EXPORT GEOMAlgo_Splitter(const Handle(NCollection_BaseAllocator)& theAllocator);
59 GEOMALGOIMPL_EXPORT virtual ~GEOMAlgo_Splitter();
62 /// \param theShape a tool shape
63 GEOMALGOIMPL_EXPORT void AddTool(const TopoDS_Shape& theShape);
65 /// Returns list of tool shapes
66 GEOMALGOIMPL_EXPORT const NCollection_List<TopoDS_Shape>& Tools()const;
68 /// Set type of used shapes
69 /// \param aLimit a shape type
70 GEOMALGOIMPL_EXPORT void SetLimit(const TopAbs_ShapeEnum aLimit);
72 /// Returns defined limit type
73 GEOMALGOIMPL_EXPORT TopAbs_ShapeEnum Limit()const;
75 /// Set mode (0 or 1) of limit
76 /// \param aMode the mode value
77 GEOMALGOIMPL_EXPORT void SetLimitMode(const Standard_Integer aMode);
79 /// Returns mode of limit
80 GEOMALGOIMPL_EXPORT Standard_Integer LimitMode()const;
82 /// Clears all tool shapes
83 GEOMALGOIMPL_EXPORT virtual void Clear();
87 /// \param theType a type of limit
88 GEOMALGOIMPL_EXPORT virtual void BuildResult(const TopAbs_ShapeEnum theType);
90 /// Post processing of the calculation
91 #if OCC_VERSION_LARGE < 0x07070000
92 GEOMALGOIMPL_EXPORT virtual void PostTreat();
94 GEOMALGOIMPL_EXPORT virtual void PostTreat(const Message_ProgressRange& theRange);
99 NCollection_List<TopoDS_Shape> myTools;
102 NCollection_Map<TopoDS_Shape> myMapTools;
105 TopAbs_ShapeEnum myLimit;
108 Standard_Integer myLimitMode;