mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-01-22 16:10:37 +05:00
Added some try catch
This commit is contained in:
parent
acd45e23fa
commit
5eca4e749b
@ -249,14 +249,14 @@ bool GEOMImpl_IAdvancedOperations::MakeGroups(Handle(GEOM_Object) theShape, int
|
||||
|
||||
gp_Trsf aTrsfInv = aTrsf.Inverted();
|
||||
|
||||
int expectedGroups = 0;
|
||||
if (shapeType == TSHAPE_BASIC)
|
||||
if (Abs(theR2+theW2-theR1-theW1) <= Precision::Approximation())
|
||||
expectedGroups = 10;
|
||||
else
|
||||
expectedGroups = 11;
|
||||
else if (shapeType == TSHAPE_CHAMFER || shapeType == TSHAPE_FILLET)
|
||||
expectedGroups = 12;
|
||||
// int expectedGroups = 0;
|
||||
// if (shapeType == TSHAPE_BASIC)
|
||||
// if (Abs(theR2+theW2-theR1-theW1) <= Precision::Approximation())
|
||||
// expectedGroups = 10;
|
||||
// else
|
||||
// expectedGroups = 11;
|
||||
// else if (shapeType == TSHAPE_CHAMFER || shapeType == TSHAPE_FILLET)
|
||||
// expectedGroups = 12;
|
||||
|
||||
double aR1Ext = theR1 + theW1;
|
||||
double aR2Ext = theR2 + theW2;
|
||||
@ -634,7 +634,12 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t
|
||||
Handle(GEOM_Object) wire_t, wire_t2, face_t, face_t2;
|
||||
Handle(GEOM_Object) chan_racc;
|
||||
Handle(GEOM_Object) vi1, vi2;
|
||||
Handle(GEOM_Object) Te3;
|
||||
|
||||
try {
|
||||
#if OCC_VERSION_LARGE > 0x06010000
|
||||
OCC_CATCH_SIGNALS;
|
||||
#endif
|
||||
Handle(GEOM_Object) Vector_Z = myBasicOperations->MakeVectorDXDYDZ(0, 0, 1);
|
||||
Vector_Z->GetLastFunction()->SetDescription("");
|
||||
|
||||
@ -744,35 +749,18 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t
|
||||
}
|
||||
}
|
||||
Handle(GEOM_Object) edge_e1, edge_e2;
|
||||
try {
|
||||
#if OCC_VERSION_LARGE > 0x06010000
|
||||
OCC_CATCH_SIGNALS;
|
||||
#endif
|
||||
|
||||
edge_e1 = myBasicOperations->MakeLineTwoPnt(ve1, vi1);
|
||||
if (edge_e1.IsNull()) {
|
||||
SetErrorCode("Edge 1 could not be built");
|
||||
return false;
|
||||
}
|
||||
} catch (Standard_Failure) {
|
||||
Handle(Standard_Failure) aFail = Standard_Failure::Caught();
|
||||
SetErrorCode(aFail->GetMessageString());
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
#if OCC_VERSION_LARGE > 0x06010000
|
||||
OCC_CATCH_SIGNALS;
|
||||
#endif
|
||||
edge_e2 = myBasicOperations->MakeLineTwoPnt(ve2, vi2);
|
||||
if (edge_e2.IsNull()) {
|
||||
SetErrorCode("Edge 2 could not be built");
|
||||
return false;
|
||||
}
|
||||
} catch (Standard_Failure) {
|
||||
Handle(Standard_Failure) aFail = Standard_Failure::Caught();
|
||||
SetErrorCode(aFail->GetMessageString());
|
||||
return false;
|
||||
}
|
||||
|
||||
edge_e1->GetLastFunction()->SetDescription("");
|
||||
edge_e2->GetLastFunction()->SetDescription("");
|
||||
@ -1027,7 +1015,7 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t
|
||||
if (!isNormal)
|
||||
theTools->Append(face_t2);
|
||||
|
||||
Handle(GEOM_Object) Te3 = myBooleanOperations->MakePartition
|
||||
Te3 = myBooleanOperations->MakePartition
|
||||
(partitionShapes, theTools, theKeepInside, theRemoveInside,
|
||||
TopAbs_SOLID, false, theMaterials, 0, false);
|
||||
if (Te3.IsNull()) {
|
||||
@ -1047,6 +1035,11 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t
|
||||
}
|
||||
TopoDS_Shape aShape = Te3->GetValue();
|
||||
theShape->GetLastFunction()->SetValue(aShape);
|
||||
} catch (Standard_Failure) {
|
||||
Handle(Standard_Failure) aFail = Standard_Failure::Caught();
|
||||
SetErrorCode(aFail->GetMessageString());
|
||||
return false;
|
||||
}
|
||||
|
||||
SetErrorCode(OK);
|
||||
return true;
|
||||
@ -1176,18 +1169,18 @@ GEOMImpl_IAdvancedOperations::MakePipeTShape(double theR1, double theW1, double
|
||||
SetErrorCode("TShape driver failed");
|
||||
return NULL;
|
||||
}
|
||||
} catch (Standard_Failure) {
|
||||
Handle(Standard_Failure) aFail = Standard_Failure::Caught();
|
||||
SetErrorCode(aFail->GetMessageString());
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (theHexMesh) {
|
||||
if (!MakePipeTShapePartition(aShape, theR1, theW1, theL1, theR2, theW2, theL2))
|
||||
return NULL;
|
||||
if (!MakePipeTShapeMirrorAndGlue(aShape, theR1, theW1, theL1, theR2, theW2, theL2))
|
||||
return NULL;
|
||||
}
|
||||
} catch (Standard_Failure) {
|
||||
Handle(Standard_Failure) aFail = Standard_Failure::Caught();
|
||||
SetErrorCode(aFail->GetMessageString());
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
Handle(TColStd_HSequenceOfTransient) aSeq = new TColStd_HSequenceOfTransient;
|
||||
aSeq->Append(aShape);
|
||||
|
Loading…
Reference in New Issue
Block a user