0031668: Visualization - WebGL sample doesn't work on Emscripten 1.39
[occt.git] / src / BRepAlgoAPI / BRepAlgoAPI_Splitter.hxx
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 _BRepAlgoAPI_Splitter_HeaderFile
16 #define _BRepAlgoAPI_Splitter_HeaderFile
17
18 #include <Standard.hxx>
19 #include <Standard_DefineAlloc.hxx>
20 #include <Standard_Handle.hxx>
21
22 #include <BRepAlgoAPI_BuilderAlgo.hxx>
23
24 //! The class contains API level of the **Splitter** algorithm,
25 //! which allows splitting a group of arbitrary shapes by the
26 //! other group of arbitrary shapes.<br>
27 //! The arguments of the operation are divided on two groups:<br>
28 //! *Objects* - shapes that will be split;<br>
29 //! *Tools*   - shapes by which the *Objects* will be split.<br>
30 //! The result of the operation contains only the split parts
31 //! of the shapes from the group of *Objects*.<br>
32 //! The split parts of the shapes from the group of *Tools* are excluded
33 //! from the result.<br>
34 //! The shapes can be split by the other shapes from the same group
35 //! (in case these shapes are interfering).
36 //!
37 //! The class is a General Fuse based algorithm. Thus, all options
38 //! of the General Fuse algorithm such as Fuzzy mode, safe processing mode,
39 //! parallel processing mode, gluing mode and history support are also
40 //! available in this algorithm.<br>
41 //! There is no requirement on the existence of the *Tools* shapes.
42 //! And if there are no *Tools* shapes, the result of the splitting
43 //! operation will be equivalent to the General Fuse result.
44 //!
45 //! The algorithm returns the following Error statuses:<br>
46 //! - 0 - in case of success;<br>
47 //! - *BOPAlgo_AlertTooFewArguments*    - in case there is no enough arguments for the operation;<br>
48 //! - *BOPAlgo_AlertIntersectionFailed* - in case the Intersection of the arguments has failed;<br>
49 //! - *BOPAlgo_AlertBuilderFailed*      - in case the Building of the result has failed.
50 class BRepAlgoAPI_Splitter : public BRepAlgoAPI_BuilderAlgo
51 {
52 public:
53
54   DEFINE_STANDARD_ALLOC
55
56 public: //! @name Constructors
57
58   //! Empty constructor
59   Standard_EXPORT BRepAlgoAPI_Splitter();
60
61   //! Constructor with already prepared intersection tool - PaveFiller
62   Standard_EXPORT BRepAlgoAPI_Splitter(const BOPAlgo_PaveFiller& thePF);
63
64
65 public: //! @name Setters/Getters for the Tools
66
67   //! Sets the Tool arguments
68   void SetTools (const TopTools_ListOfShape& theLS)
69   {
70     myTools = theLS;
71   }
72
73   //! Returns the Tool arguments
74   const TopTools_ListOfShape& Tools() const
75   {
76     return myTools;
77   }
78
79
80 public: //! @name Performing the operation
81
82   //! Performs the Split operation.
83   //! Performs the intersection of the argument shapes (both objects and tools)
84   //! and splits objects by the tools.
85   Standard_EXPORT virtual void Build() Standard_OVERRIDE;
86
87
88 protected: //! @name Fields
89
90   TopTools_ListOfShape myTools; //!< Tool arguments of the operation
91
92 };
93
94 #endif // _BRepAlgoAPI_Splitter_HeaderFile