0028786: Refactoring of the Warning/Error reporting system of Boolean Operations...
[occt.git] / src / BOPAlgo / BOPAlgo_WireSplitter.hxx
1 // Created by: Peter KURNEV
2 // Copyright (c) 1999-2012 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_WireSplitter_HeaderFile
16 #define _BOPAlgo_WireSplitter_HeaderFile
17
18 #include <Standard.hxx>
19 #include <Standard_DefineAlloc.hxx>
20 #include <Standard_Handle.hxx>
21
22 #include <BOPAlgo_PWireEdgeSet.hxx>
23 #include <BOPTools_ListOfConnexityBlock.hxx>
24 #include <BOPAlgo_Algo.hxx>
25 #include <BOPCol_BaseAllocator.hxx>
26 #include <BOPCol_ListOfShape.hxx>
27 #include <BOPTools_ConnexityBlock.hxx>
28 #include <IntTools_Context.hxx>
29 class BOPAlgo_WireEdgeSet;
30 class TopoDS_Wire;
31 class TopoDS_Face;
32
33
34 //! The class is to build loops from the given set of edges.
35 //!
36 //! It returns the following Error statuses
37 //! - *BOPAlgo_AlertNullInputShapes* - in case there no input edges to build the loops.
38 //!
39 class BOPAlgo_WireSplitter  : public BOPAlgo_Algo
40 {
41 public:
42
43   DEFINE_STANDARD_ALLOC
44
45   
46   Standard_EXPORT BOPAlgo_WireSplitter();
47   Standard_EXPORT virtual ~BOPAlgo_WireSplitter();
48   
49   Standard_EXPORT BOPAlgo_WireSplitter(const BOPCol_BaseAllocator& theAllocator);
50   
51   Standard_EXPORT void SetWES (const BOPAlgo_WireEdgeSet& theWES);
52   
53   Standard_EXPORT BOPAlgo_WireEdgeSet& WES();
54
55   //! Sets the context for the algorithm
56   Standard_EXPORT void SetContext(const Handle(IntTools_Context)& theContext);
57
58   //! Returns the context
59   Standard_EXPORT const Handle(IntTools_Context)& Context();
60
61   Standard_EXPORT virtual void Perform() Standard_OVERRIDE;
62   
63   static void MakeWire(BOPCol_ListOfShape& theLE, TopoDS_Wire& theW);
64   
65   Standard_EXPORT static void SplitBlock (const TopoDS_Face& theF,
66                                           BOPTools_ConnexityBlock& theCB,
67                                           const Handle(IntTools_Context)& theContext);
68
69 protected:
70
71   Standard_EXPORT virtual void CheckData() Standard_OVERRIDE;
72   
73   Standard_EXPORT void MakeConnexityBlocks();
74   
75   Standard_EXPORT void MakeWires();
76
77   BOPAlgo_PWireEdgeSet myWES;
78   BOPTools_ListOfConnexityBlock myLCB;
79   Handle(IntTools_Context) myContext;
80
81 };
82
83 #include <BOPAlgo_WireSplitter.lxx>
84
85 #endif // _BOPAlgo_WireSplitter_HeaderFile