1 // Created by: Peter KURNEV
2 // Copyright (c) 2010-2014 OPEN CASCADE SAS
3 // Copyright (c) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
4 // Copyright (c) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT,
5 // EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
7 // This file is part of Open CASCADE Technology software library.
9 // This library is free software; you can redistribute it and/or modify it under
10 // the terms of the GNU Lesser General Public License version 2.1 as published
11 // by the Free Software Foundation, with special exception defined in the file
12 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
13 // distribution for complete text of the license and disclaimer of any warranty.
15 // Alternatively, this file may be used under the terms of Open CASCADE
16 // commercial license or contractual agreement.
19 #include <BOPAlgo_Algo.hxx>
20 #include <Message_ProgressIndicator.hxx>
21 #include <NCollection_BaseAllocator.hxx>
22 #include <Standard_NotImplemented.hxx>
23 #include <Standard_ProgramError.hxx>
27 Standard_Boolean myGlobalRunParallel = Standard_False;
30 //=======================================================================
33 //=======================================================================
34 void BOPAlgo_Algo::SetParallelMode(Standard_Boolean theNewMode)
36 myGlobalRunParallel = theNewMode;
39 //=======================================================================
42 //=======================================================================
43 Standard_Boolean BOPAlgo_Algo::GetParallelMode()
45 return myGlobalRunParallel;
49 //=======================================================================
52 //=======================================================================
53 BOPAlgo_Algo::BOPAlgo_Algo()
55 myAllocator(NCollection_BaseAllocator::CommonBaseAllocator()),
58 myRunParallel(myGlobalRunParallel)
60 //=======================================================================
63 //=======================================================================
64 BOPAlgo_Algo::BOPAlgo_Algo
65 (const Handle(NCollection_BaseAllocator)& theAllocator)
67 myAllocator(theAllocator),
70 myRunParallel(myGlobalRunParallel)
73 //=======================================================================
76 //=======================================================================
77 BOPAlgo_Algo::~BOPAlgo_Algo()
80 //=======================================================================
81 //function : Allocator
83 //=======================================================================
84 const Handle(NCollection_BaseAllocator)& BOPAlgo_Algo::Allocator()const
88 //=======================================================================
89 // function: CheckData
91 //=======================================================================
92 void BOPAlgo_Algo::CheckData()
96 //=======================================================================
97 // function: CheckResult
99 //=======================================================================
100 void BOPAlgo_Algo::CheckResult()
104 //=======================================================================
105 // function: ErrorStatus
107 //=======================================================================
108 Standard_Integer BOPAlgo_Algo::ErrorStatus()const
110 return myErrorStatus;
112 //=======================================================================
113 // function: WarningStatus
115 //=======================================================================
116 Standard_Integer BOPAlgo_Algo::WarningStatus()const
118 return myWarningStatus;
120 //=======================================================================
121 //function : SetRunParallel
123 //=======================================================================
124 void BOPAlgo_Algo::SetRunParallel(const Standard_Boolean theFlag)
126 myRunParallel=theFlag;
128 //=======================================================================
129 //function : RunParallel
131 //=======================================================================
132 Standard_Boolean BOPAlgo_Algo::RunParallel()const
134 return myRunParallel;
136 //=======================================================================
137 //function : SetProgressIndicator
139 //=======================================================================
140 void BOPAlgo_Algo::SetProgressIndicator
141 (const Handle(Message_ProgressIndicator)& theObj)
143 if (!theObj.IsNull()) {
144 myProgressIndicator=theObj;
147 //=======================================================================
148 //function : UserBreak
150 //=======================================================================
151 void BOPAlgo_Algo::UserBreak() const
153 if (myProgressIndicator.IsNull()) {
156 if (myProgressIndicator->UserBreak()) {
157 Standard_NotImplemented::Raise("");
162 // 1 - object is just initialized