- Handle(GEOM_Object) Vector_Z = myBasicOperations->MakeVectorDXDYDZ(0, 0, 1);
- Vector_Z->GetLastFunction()->SetDescription("");
-
- // Useful values
- double aSize = 2*(theL1 + theL2);
- double aR1Ext = theR1 + theW1;
- double aR2Ext = theR2 + theW2;
- double theVertCylinderRadius = aR2Ext + theW + theRF;
- double theHoriCylinderRadius = aR1Ext + theH + theRF;
-
- // Common edges on internal cylinder
- Handle(GEOM_Object) box_i = my3DPrimOperations->MakeBoxDXDYDZ(theR2, theR2, theR1);
- box_i->GetLastFunction()->SetDescription("");
- box_i = myTransformOperations->TranslateDXDYDZ(box_i, -theR2, -theR2, 0);
- box_i->GetLastFunction()->SetDescription("");
-
- Handle(GEOM_Function) aFunction = theShape->GetLastFunction();
- TCollection_AsciiString theDesc = aFunction->GetDescription();
- Handle(TColStd_HSequenceOfTransient) edges_i =
- myShapesOperations->GetShapesOnBox(box_i, theShape, TopAbs_EDGE, GEOMAlgo_ST_IN);
- // Recover previous description to get rid of Propagate dump
- aFunction->SetDescription(theDesc);
- if (edges_i.IsNull() || edges_i->Length() == 0) {
- SetErrorCode("Internal edges not found");
- return false;
- }
- for (int i=1; i<=edges_i->Length();i++) {
- Handle(GEOM_Object) anObj = Handle(GEOM_Object)::DownCast(edges_i->Value(i));
- anObj->GetLastFunction()->SetDescription("");
- }
- arete_intersect_int = Handle(GEOM_Object)::DownCast(edges_i->Value(1));
-
- // search for vertices located on both internal pipes
- aFunction = theShape->GetLastFunction();
- theDesc = aFunction->GetDescription();
- Handle(TColStd_HSequenceOfTransient) vertices_i =
- myShapesOperations->GetShapesOnBox(box_i, theShape, TopAbs_VERTEX, GEOMAlgo_ST_ONIN);
- // Recover previous description to get rid of Propagate dump
- aFunction->SetDescription(theDesc);
- if (vertices_i.IsNull() || vertices_i->Length() == 0) {
- SetErrorCode("Internal vertices not found");
- return false;
- }
-
- for (int i = 1; i <= vertices_i->Length(); i++) {
- Handle(GEOM_Object) v = Handle(GEOM_Object)::DownCast(vertices_i->Value(i));
- v->GetLastFunction()->SetDescription("");
- TopoDS_Vertex aVertex = TopoDS::Vertex(v->GetValue());
- gp_Pnt aP = BRep_Tool::Pnt(aVertex);
- if (Abs(aP.X()) <= Precision::Confusion()) {
- if (Abs(aP.Y()) - theR2 <= Precision::Confusion())
- vi1 = v;
- } else if (Abs(aP.Y()) <= Precision::Confusion()) {
- if (Abs(aP.X()) - theR1 <= Precision::Confusion())
- vi2 = v;
- }
- }
-
- std::list<Handle(GEOM_Object)> theShapes;
-
- if (isNormal) {
- Handle(GEOM_Object) ve1, ve2;
-
- Handle(GEOM_Object) box_e = my3DPrimOperations->MakeBoxDXDYDZ(aR2Ext, aR2Ext, aR1Ext);
- box_e->GetLastFunction()->SetDescription("");
- box_e = myTransformOperations->TranslateDXDYDZ(box_e, -aR2Ext, -aR2Ext, 0);
- box_e->GetLastFunction()->SetDescription("");
- // Common edges on external cylinder
- aFunction = theShape->GetLastFunction();
- theDesc = aFunction->GetDescription();
- Handle(TColStd_HSequenceOfTransient) edges_e =
- myShapesOperations->GetShapesOnBox(box_e, theShape, TopAbs_EDGE, GEOMAlgo_ST_IN);
+ try {
+#if OCC_VERSION_LARGE > 0x06010000
+ OCC_CATCH_SIGNALS;
+#endif
+ Handle(GEOM_Object) Vector_Z = myBasicOperations->MakeVectorDXDYDZ(0, 0, 1);
+ Vector_Z->GetLastFunction()->SetDescription("");
+
+ // Useful values
+ double aSize = 2*(theL1 + theL2);
+ double aR1Ext = theR1 + theW1;
+ double aR2Ext = theR2 + theW2;
+ double theVertCylinderRadius = aR2Ext + theW + theRF;
+ double theHoriCylinderRadius = aR1Ext + theH + theRF;
+
+ // Common edges on internal cylinder
+ Handle(GEOM_Object) box_i = my3DPrimOperations->MakeBoxDXDYDZ(theR2, theR2, theR1);
+ box_i->GetLastFunction()->SetDescription("");
+ box_i = myTransformOperations->TranslateDXDYDZ(box_i, -theR2, -theR2, 0);
+ box_i->GetLastFunction()->SetDescription("");
+
+ Handle(GEOM_Function) aFunction = theShape->GetLastFunction();
+ TCollection_AsciiString theDesc = aFunction->GetDescription();
+ Handle(TColStd_HSequenceOfTransient) edges_i =
+ myShapesOperations->GetShapesOnBox(box_i, theShape, TopAbs_EDGE, GEOMAlgo_ST_IN);