// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-#include <Basics_OCCTVersion.hxx>
-
#include <GEOMImpl_IMeasureOperations.hxx>
#include <GEOMImpl_IMeasure.hxx>
#include <GEOMImpl_MeasureDriver.hxx>
#include <BOPCol_ListOfShape.hxx>
#include <BOPDS_DS.hxx>
#include <BOPDS_MapOfPassKey.hxx>
-#if OCC_VERSION_LARGE > 0x07010000
#include <BOPDS_MapOfPair.hxx>
#include <BOPDS_Pair.hxx>
-#endif
#include <BRepBndLib.hxx>
#include <BRepBuilderAPI_Copy.hxx>
#include <BRepCheck_ListIteratorOfListOfStatus.hxx>
#include <BRepClass_FaceClassifier.hxx>
#include <BRepExtrema_DistShapeShape.hxx>
#include <BRepExtrema_ShapeProximity.hxx>
-#if OCC_VERSION_LARGE > 0x06090000
#include <BRepExtrema_SelfIntersection.hxx>
#include <BRepExtrema_MapOfIntegerPackedMapOfInteger.hxx>
-#endif
#include <BRepGProp.hxx>
#include <BRepTools.hxx>
#include <BRep_Tool.hxx>
aDirZ.Coord(Zx, Zy, Zz);
aDirX.Coord(Xx, Xy, Xz);
}
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
+ catch (Standard_Failure& aFail) {
+ SetErrorCode(aFail.GetMessageString());
return;
}
return NULL;
}
}
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
+ catch (Standard_Failure& aFail) {
+ SetErrorCode(aFail.GetMessageString());
return NULL;
}
return NULL;
}
}
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
+ catch (Standard_Failure& aFail) {
+ SetErrorCode(aFail.GetMessageString());
return NULL;
}
return NULL;
}
}
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
+ catch (Standard_Failure& aFail) {
+ SetErrorCode(aFail.GetMessageString());
return NULL;
}
}
}
}
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
+ catch (Standard_Failure& aFail) {
+ SetErrorCode(aFail.GetMessageString());
return;
}
GProp_PrincipalProps Pr = System.PrincipalProperties();
Pr.Moments(Ix,Iy,Iz);
}
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
+ catch (Standard_Failure& aFail) {
+ SetErrorCode(aFail.GetMessageString());
return;
}
B.Get(Xmin, Ymin, Zmin, Xmax, Ymax, Zmax);
}
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
+ catch (Standard_Failure& aFail) {
+ SetErrorCode(aFail.GetMessageString());
return;
}
return NULL;
}
}
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
+ catch (Standard_Failure& aFail) {
+ SetErrorCode(aFail.GetMessageString());
return NULL;
}
VertMin = T;
}
}
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
+ catch (Standard_Failure& aFail) {
+ SetErrorCode(aFail.GetMessageString());
return;
}
FillErrors(ana, aShape, theErrors);
}
}
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
+ catch (Standard_Failure& aFail) {
+ SetErrorCode(aFail.GetMessageString());
return false;
}
// 1. Launch the checker
aCSI.Perform();
-#if OCC_VERSION_LARGE > 0x07010001
Standard_Boolean iErr = aCSI.HasErrors();
-#else
- Standard_Integer iErr = aCSI.ErrorStatus();
-#endif
//
Standard_Integer aNbS, n1, n2;
-#if OCC_VERSION_LARGE > 0x07010000
BOPDS_MapIteratorOfMapOfPair aItMPK;
-#else
- BOPDS_MapIteratorMapOfPassKey aItMPK;
-#endif
//
// 2. Take the shapes from DS
const BOPDS_DS& aDS = aCSI.DS();
aNbS=aDS.NbShapes();
//
// 3. Get the pairs of interfered shapes
-#if OCC_VERSION_LARGE > 0x07010000
const BOPDS_MapOfPair& aMPK=aDS.Interferences();
-#else
- const BOPDS_MapOfPassKey& aMPK=aDS.Interferences();
-#endif
aItMPK.Initialize(aMPK);
for (; aItMPK.More(); aItMPK.Next()) {
-#if OCC_VERSION_LARGE > 0x07010000
const BOPDS_Pair& aPK=aItMPK.Value();
aPK.Indices(n1, n2);
-#else
- const BOPDS_PassKey& aPK=aItMPK.Value();
- aPK.Ids(n1, n2);
-#endif
//
if (n1 > aNbS || n2 > aNbS){
return false; // Error
TopTools_IndexedMapOfShape anIndices;
TopExp::MapShapes(aScopy, anIndices);
-#if OCC_VERSION_LARGE > 0x06090000
// Checker of fast interferences
BRepExtrema_SelfIntersection aTool(aScopy, (theTolerance <= 0.) ? 0.0 : theTolerance);
if (aTool.IsDone())
SetErrorCode(OK);
-#endif
return theIntersections->IsEmpty();
}
aBSP.Perform();
// 2. Get sets of IDs of overlapped faces
-#if OCC_VERSION_LARGE > 0x06090000
for (BRepExtrema_MapOfIntegerPackedMapOfInteger::Iterator anIt1 (aBSP.OverlapSubShapes1()); anIt1.More(); anIt1.Next())
-#else
- for (BRepExtrema_OverlappedSubShapes::Iterator anIt1 (aBSP.OverlapSubShapes1()); anIt1.More(); anIt1.Next())
-#endif
{
const TopoDS_Shape& aS1 = aBSP.GetSubShape1(anIt1.Key());
theIntersections1->Append(anIndices1.FindIndex(aS1));
}
-#if OCC_VERSION_LARGE > 0x06090000
for (BRepExtrema_MapOfIntegerPackedMapOfInteger::Iterator anIt2 (aBSP.OverlapSubShapes2()); anIt2.More(); anIt2.Next())
-#else
- for (BRepExtrema_OverlappedSubShapes::Iterator anIt2 (aBSP.OverlapSubShapes2()); anIt2.More(); anIt2.Next())
-#endif
{
const TopoDS_Shape& aS2 = aBSP.GetSubShape2(anIt2.Key());
theIntersections2->Append(anIndices2.FindIndex(aS2));
Astr = Astr + " SOLID : " + TCollection_AsciiString(nbFlatType[TopAbs_SOLID]) + "\n";
}
}
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
+ catch (Standard_Failure& aFail) {
+ SetErrorCode(aFail.GetMessageString());
return Astr;
}
return MinDist;
}
}
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
+ catch (Standard_Failure& aFail) {
+ SetErrorCode(aFail.GetMessageString());
return MinDist;
}
}
}
}
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
+ catch (Standard_Failure& aFail) {
+ SetErrorCode(aFail.GetMessageString());
return nbSolutions;
}
SetErrorCode(OK);
}
- catch (Standard_Failure)
+ catch (Standard_Failure& aFail)
{
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode( aFail->GetMessageString() );
+ SetErrorCode( aFail.GetMessageString() );
}
}
SetErrorCode(OK);
}
- catch (Standard_Failure)
+ catch (Standard_Failure& aFail)
{
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
+ SetErrorCode(aFail.GetMessageString());
}
return anAngle;
SetErrorCode(OK);
}
- catch (Standard_Failure)
+ catch (Standard_Failure& aFail)
{
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
+ SetErrorCode(aFail.GetMessageString());
}
return anAngle;
aRes = fabs(Prop.Curvature());
SetErrorCode(OK);
}
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
+ catch (Standard_Failure& aFail) {
+ SetErrorCode(aFail.GetMessageString());
return aRes;
}
SetErrorCode(OK);
}
}
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
+ catch (Standard_Failure& aFail) {
+ SetErrorCode(aFail.GetMessageString());
return aRes;
}
SetErrorCode(OK);
}
}
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
+ catch (Standard_Failure& aFail) {
+ SetErrorCode(aFail.GetMessageString());
return aRes;
}