e2b5c05bc314b4f7415338b8877e99d3409d346d
[occt.git] / src / BRepAlgoAPI / BRepAlgoAPI_Algo.cxx
1 // Created by: Peter KURNEV
2 // Copyright (c) 2014 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
16 #include <BRepAlgoAPI_Algo.hxx>
17 #include <Message_ProgressIndicator.hxx>
18 #include <NCollection_BaseAllocator.hxx>
19 #include <Standard_NotImplemented.hxx>
20 #include <TopoDS_Shape.hxx>
21
22 //=======================================================================
23 // function: 
24 // purpose: 
25 //=======================================================================
26 BRepAlgoAPI_Algo::BRepAlgoAPI_Algo()
27 :
28   myAllocator(NCollection_BaseAllocator::CommonBaseAllocator()),
29   myErrorStatus(1),
30   myWarningStatus(0),
31   myRunParallel(Standard_False)
32 {}
33 //=======================================================================
34 // function: 
35 // purpose: 
36 //=======================================================================
37 BRepAlgoAPI_Algo::BRepAlgoAPI_Algo
38   (const Handle(NCollection_BaseAllocator)& theAllocator)
39 :
40   myAllocator(theAllocator),
41   myErrorStatus(1),
42   myWarningStatus(0),
43   myRunParallel(Standard_False)
44 {}
45
46 //=======================================================================
47 // function: ~
48 // purpose: 
49 //=======================================================================
50 BRepAlgoAPI_Algo::~BRepAlgoAPI_Algo()
51 {
52 }
53 //=======================================================================
54 //function : Allocator
55 //purpose  : 
56 //=======================================================================
57 const Handle(NCollection_BaseAllocator)& BRepAlgoAPI_Algo::Allocator()const
58 {
59   return myAllocator;
60 }
61 //=======================================================================
62 // function: ErrorStatus
63 // purpose: 
64 //=======================================================================
65 Standard_Integer BRepAlgoAPI_Algo::ErrorStatus()const
66 {
67   return myErrorStatus;
68 }
69 //=======================================================================
70 // function: WarningStatus
71 // purpose: 
72 //=======================================================================
73 Standard_Integer BRepAlgoAPI_Algo::WarningStatus()const
74 {
75   return myWarningStatus;
76 }
77 //=======================================================================
78 //function : SetRunParallel
79 //purpose  : 
80 //=======================================================================
81 void BRepAlgoAPI_Algo::SetRunParallel(const Standard_Boolean theFlag)
82 {
83   myRunParallel=theFlag;
84 }
85 //=======================================================================
86 //function : RunParallel
87 //purpose  : 
88 //=======================================================================
89 Standard_Boolean BRepAlgoAPI_Algo::RunParallel()const
90 {
91   return myRunParallel;
92 }
93 //=======================================================================
94 //function : SetProgressIndicator
95 //purpose  : 
96 //=======================================================================
97 void BRepAlgoAPI_Algo::SetProgressIndicator
98   (const Handle(Message_ProgressIndicator)& theObj)
99 {
100   if (!theObj.IsNull()) {
101     myProgressIndicator=theObj;
102   }
103 }
104 //=======================================================================
105 //function : UserBreak
106 //purpose  : 
107 //=======================================================================
108 void BRepAlgoAPI_Algo::UserBreak() const
109 {
110   if (myProgressIndicator.IsNull()) {
111     return;
112   }
113   if (myProgressIndicator->UserBreak()) {
114     Standard_NotImplemented::Raise("");
115   }
116
117 //=======================================================================
118 //function : Shape
119 //purpose  : 
120 //=======================================================================
121 const TopoDS_Shape& BRepAlgoAPI_Algo::Shape()
122 {
123   return myShape;
124 }
125 //=======================================================================
126 //function : Clear
127 //purpose  : 
128 //=======================================================================
129 void BRepAlgoAPI_Algo::Clear()
130 {
131 }
132 //  myErrorStatus
133 //
134 // 1 - object is just initialized