c58055ad |
1 | // Created by: Eugeny MALTCHIKOV |
2 | // Copyright (c) 2017 OPEN CASCADE SAS |
3 | // |
4 | // This file is part of Open CASCADE Technology software library. |
5 | // |
6 | // This library is free software; you can redistribute it and/or modify it under |
7 | // the terms of the GNU Lesser General Public License version 2.1 as published |
8 | // by the Free Software Foundation, with special exception defined in the file |
9 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
10 | // distribution for complete text of the license and disclaimer of any warranty. |
11 | // |
12 | // Alternatively, this file may be used under the terms of Open CASCADE |
13 | // commercial license or contractual agreement. |
14 | |
15 | #ifndef _BOPAlgo_Splitter_HeaderFile |
16 | #define _BOPAlgo_Splitter_HeaderFile |
17 | |
18 | #include <Standard.hxx> |
19 | #include <Standard_DefineAlloc.hxx> |
20 | #include <Standard_Handle.hxx> |
21 | |
22 | #include <BOPAlgo_Builder.hxx> |
23 | |
24 | //! The class is a General Fuse (GF) based algorithm.<br> |
25 | //! It provides means to split an arbitrary number of shapes of arbitrary |
26 | //! dimensions by other arbitrary shapes.<br> |
27 | //! The arguments of the operation are divided on two groups - Objects |
28 | //! (shapes that will be split) and Tools (shapes by which the objects will be split).<br> |
29 | //! The result of the operation contains only the split parts of the Objects.<br> |
30 | //! The split parts of the Tools are excluded from the result.<br> |
31 | //! If there are no Tool shapes, the operation will be equivalent to General Fuse.<br> |
32 | //! |
33 | //! All options of the General Fuse algorithm, such as Fuzzy mode, safe mode, parallel |
34 | //! mode, gluing mode and history support are also available in this algorithm.<br> |
35 | //! |
36 | //! The implementation of the algorithm is minimal - only the methods |
37 | //! CheckData() and Perform() have been overridden.<br> |
38 | //! The method BOPAlgo_Builder::BuildResult(), which adds the split parts of the arguments |
39 | //! into result, does not have to be overridden, because its native implementation |
40 | //! performs the necessary actions for the Splitter algorithm - it adds |
41 | //! the split parts of only Objects into result, avoiding the split parts of Tools. |
42 | class BOPAlgo_Splitter : public BOPAlgo_Builder |
43 | { |
44 | public: |
45 | |
46 | DEFINE_STANDARD_ALLOC |
47 | |
48 | //! Empty constructor |
49 | Standard_EXPORT BOPAlgo_Splitter(); |
50 | Standard_EXPORT virtual ~BOPAlgo_Splitter(); |
51 | |
52 | Standard_EXPORT BOPAlgo_Splitter(const BOPCol_BaseAllocator& theAllocator); |
53 | |
54 | //! Clears internal fields and arguments |
55 | Standard_EXPORT virtual void Clear() Standard_OVERRIDE; |
56 | |
57 | //! Adds Tool argument of the operation |
58 | Standard_EXPORT virtual void AddTool(const TopoDS_Shape& theShape); |
59 | |
60 | //! Adds the Tool arguments of the operation |
61 | Standard_EXPORT virtual void SetTools(const BOPCol_ListOfShape& theShapes); |
62 | |
63 | //! Returns the Tool arguments of the operation |
64 | const BOPCol_ListOfShape& Tools() const |
65 | { |
66 | return myTools; |
67 | } |
68 | |
69 | //! Performs the operation |
70 | Standard_EXPORT virtual void Perform() Standard_OVERRIDE; |
71 | |
72 | protected: |
73 | |
74 | //! Checks the input data |
75 | Standard_EXPORT virtual void CheckData() Standard_OVERRIDE; |
76 | |
77 | BOPCol_ListOfShape myTools; |
78 | BOPCol_MapOfShape myMapTools; |
79 | |
80 | private: |
81 | |
82 | }; |
83 | |
84 | #endif // _BOPAlgo_Splitter_HeaderFile |