// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
+#include <BRepCheck_Result.hxx>
#include <BRepCheck.hxx>
-#include <BRepCheck_Result.hxx>
-#include <Standard_NoSuchObject.hxx>
#include <Standard_Type.hxx>
#include <TopoDS_Shape.hxx>
//=======================================================================
//function : BRepCheck_Result
-//purpose :
+//purpose :
//=======================================================================
-BRepCheck_Result::BRepCheck_Result() :
- myMin(Standard_False),myBlind(Standard_False)
+BRepCheck_Result::BRepCheck_Result()
+: myMin (Standard_False),
+ myBlind (Standard_False)
{
+ //
}
-
//=======================================================================
//function : Init
//purpose :
//=======================================================================
//function : SetFailStatus
-//purpose :
+//purpose :
//=======================================================================
-void BRepCheck_Result::SetFailStatus(const TopoDS_Shape& S)
+void BRepCheck_Result::SetFailStatus (const TopoDS_Shape& S)
{
- if(!myMap.IsBound(S)) {
- BRepCheck_ListOfStatus thelist;
- myMap.Bind(S, thelist);
+ Standard_Mutex::Sentry aLock(myMutex.get());
+ Handle(BRepCheck_HListOfStatus) aList;
+ if (!myMap.Find (S, aList))
+ {
+ aList = new BRepCheck_HListOfStatus();
+ myMap.Bind (S, aList);
}
- BRepCheck::Add(myMap(S), BRepCheck_CheckFail);
-}
-
-
-//=======================================================================
-//function : StatusOnShape
-//purpose :
-//=======================================================================
-const BRepCheck_ListOfStatus& BRepCheck_Result::StatusOnShape
- (const TopoDS_Shape& S)
-{
- if (!myMap.IsBound(S)) {
- InContext(S);
- }
- return myMap(S);
+ BRepCheck::Add (*aList, BRepCheck_CheckFail);
}
-
//=======================================================================
//function : InitContextIterator
//purpose :
if (myIter.More() && myIter.Key().IsSame(myShape)) {
myIter.Next();
}
-}
+}
+
+//=======================================================================
+//function : SetParallel
+//purpose :
+//=======================================================================
+void BRepCheck_Result::SetParallel(Standard_Boolean theIsParallel)
+{
+ if (theIsParallel && myMutex.IsNull())
+ {
+ myMutex.reset(new Standard_HMutex());
+ }
+}