Use OCCT Handle macro for Handle_ classes
This is the result of running OCCT's upgrade script provided with OCCT 7.0. See https://www.opencascade.com/content/freecad-occt710-and-windows-rtti-data-missing#comment-form and https://www.forum.freecadweb.org/viewtopic.php?f=4&t=21405&start=120#p169019 for why this is necessary for OCCT >= 7.1
This commit is contained in:
@@ -119,7 +119,7 @@ App::DocumentObjectExecReturn *Chamfer::execute(void)
|
||||
return App::DocumentObject::StdReturn;
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
Handle_Standard_Failure e = Standard_Failure::Caught();
|
||||
Handle(Standard_Failure) e = Standard_Failure::Caught();
|
||||
return new App::DocumentObjectExecReturn(e->GetMessageString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,14 +171,14 @@ App::DocumentObjectExecReturn *Draft::execute(void)
|
||||
// Edge is linear
|
||||
// Find midpoint of edge and create auxiliary plane through midpoint normal to edge
|
||||
gp_Pnt pm = c.Value((c.FirstParameter() + c.LastParameter()) / 2.0);
|
||||
Handle_Geom_Plane aux = new Geom_Plane(pm, gp_Dir(p2.X() - p1.X(), p2.Y() - p1.Y(), p2.Z() - p1.Z()));
|
||||
Handle(Geom_Plane) aux = new Geom_Plane(pm, gp_Dir(p2.X() - p1.X(), p2.Y() - p1.Y(), p2.Z() - p1.Z()));
|
||||
// Intersect plane with face. Is there no easier way?
|
||||
BRepAdaptor_Surface adapt(TopoDS::Face(face), Standard_False);
|
||||
Handle_Geom_Surface sf = adapt.Surface().Surface();
|
||||
Handle(Geom_Surface) sf = adapt.Surface().Surface();
|
||||
GeomAPI_IntSS intersector(aux, sf, Precision::Confusion());
|
||||
if (!intersector.IsDone())
|
||||
continue;
|
||||
Handle_Geom_Curve icurve = intersector.Line(1);
|
||||
Handle(Geom_Curve) icurve = intersector.Line(1);
|
||||
if (!icurve->IsKind(STANDARD_TYPE(Geom_Line)))
|
||||
continue;
|
||||
// TODO: How to extract the line from icurve without creating an edge first?
|
||||
@@ -306,7 +306,7 @@ App::DocumentObjectExecReturn *Draft::execute(void)
|
||||
return App::DocumentObject::StdReturn;
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
Handle_Standard_Failure e = Standard_Failure::Caught();
|
||||
Handle(Standard_Failure) e = Standard_Failure::Caught();
|
||||
return new App::DocumentObjectExecReturn(e->GetMessageString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ App::DocumentObjectExecReturn *Fillet::execute(void)
|
||||
return App::DocumentObject::StdReturn;
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
Handle_Standard_Failure e = Standard_Failure::Caught();
|
||||
Handle(Standard_Failure) e = Standard_Failure::Caught();
|
||||
return new App::DocumentObjectExecReturn(e->GetMessageString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ App::DocumentObjectExecReturn *Groove::execute(void)
|
||||
return App::DocumentObject::StdReturn;
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
Handle_Standard_Failure e = Standard_Failure::Caught();
|
||||
Handle(Standard_Failure) e = Standard_Failure::Caught();
|
||||
if (std::string(e->GetMessageString()) == "TopoDS::Face")
|
||||
return new App::DocumentObjectExecReturn("Could not create face from sketch.\n"
|
||||
"Intersecting sketch entities in a sketch are not allowed.");
|
||||
|
||||
@@ -215,7 +215,7 @@ App::DocumentObjectExecReturn *Loft::execute(void)
|
||||
return App::DocumentObject::StdReturn;
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
Handle_Standard_Failure e = Standard_Failure::Caught();
|
||||
Handle(Standard_Failure) e = Standard_Failure::Caught();
|
||||
return new App::DocumentObjectExecReturn(e->GetMessageString());
|
||||
}
|
||||
catch (...) {
|
||||
|
||||
@@ -234,7 +234,7 @@ App::DocumentObjectExecReturn *Pad::execute(void)
|
||||
return App::DocumentObject::StdReturn;
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
Handle_Standard_Failure e = Standard_Failure::Caught();
|
||||
Handle(Standard_Failure) e = Standard_Failure::Caught();
|
||||
if (std::string(e->GetMessageString()) == "TopoDS::Face")
|
||||
return new App::DocumentObjectExecReturn("Could not create face from sketch.\n"
|
||||
"Intersecting sketch entities or multiple faces in a sketch are not allowed.");
|
||||
|
||||
@@ -322,7 +322,7 @@ App::DocumentObjectExecReturn *Pipe::execute(void)
|
||||
return App::DocumentObject::StdReturn;
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
Handle_Standard_Failure e = Standard_Failure::Caught();
|
||||
Handle(Standard_Failure) e = Standard_Failure::Caught();
|
||||
return new App::DocumentObjectExecReturn(e->GetMessageString());
|
||||
}
|
||||
catch (...) {
|
||||
|
||||
@@ -204,7 +204,7 @@ App::DocumentObjectExecReturn *Pocket::execute(void)
|
||||
return App::DocumentObject::StdReturn;
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
Handle_Standard_Failure e = Standard_Failure::Caught();
|
||||
Handle(Standard_Failure) e = Standard_Failure::Caught();
|
||||
if (std::string(e->GetMessageString()) == "TopoDS::Face" &&
|
||||
(std::string(Type.getValueAsString()) == "UpToFirst" || std::string(Type.getValueAsString()) == "UpToFace"))
|
||||
return new App::DocumentObjectExecReturn("Could not create face from sketch.\n"
|
||||
|
||||
@@ -143,7 +143,7 @@ App::DocumentObjectExecReturn* FeaturePrimitive::execute(const TopoDS_Shape& pri
|
||||
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
Handle_Standard_Failure e = Standard_Failure::Caught();
|
||||
Handle(Standard_Failure) e = Standard_Failure::Caught();
|
||||
return new App::DocumentObjectExecReturn(e->GetMessageString());
|
||||
}
|
||||
|
||||
@@ -202,7 +202,7 @@ App::DocumentObjectExecReturn* Box::execute(void)
|
||||
return FeaturePrimitive::execute(mkBox.Shape());
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
Handle_Standard_Failure e = Standard_Failure::Caught();
|
||||
Handle(Standard_Failure) e = Standard_Failure::Caught();
|
||||
return new App::DocumentObjectExecReturn(e->GetMessageString());
|
||||
}
|
||||
}
|
||||
@@ -250,7 +250,7 @@ App::DocumentObjectExecReturn* Cylinder::execute(void)
|
||||
return FeaturePrimitive::execute(mkCylr.Shape());
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
Handle_Standard_Failure e = Standard_Failure::Caught();
|
||||
Handle(Standard_Failure) e = Standard_Failure::Caught();
|
||||
return new App::DocumentObjectExecReturn(e->GetMessageString());
|
||||
}
|
||||
|
||||
@@ -300,7 +300,7 @@ App::DocumentObjectExecReturn* Sphere::execute(void)
|
||||
return FeaturePrimitive::execute(mkSphere.Shape());
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
Handle_Standard_Failure e = Standard_Failure::Caught();
|
||||
Handle(Standard_Failure) e = Standard_Failure::Caught();
|
||||
return new App::DocumentObjectExecReturn(e->GetMessageString());
|
||||
}
|
||||
|
||||
@@ -356,7 +356,7 @@ App::DocumentObjectExecReturn* Cone::execute(void)
|
||||
return FeaturePrimitive::execute(mkCone.Shape());
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
Handle_Standard_Failure e = Standard_Failure::Caught();
|
||||
Handle(Standard_Failure) e = Standard_Failure::Caught();
|
||||
return new App::DocumentObjectExecReturn(e->GetMessageString());
|
||||
}
|
||||
|
||||
@@ -438,7 +438,7 @@ App::DocumentObjectExecReturn* Ellipsoid::execute(void)
|
||||
return FeaturePrimitive::execute(mkTrsf.Shape());
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
Handle_Standard_Failure e = Standard_Failure::Caught();
|
||||
Handle(Standard_Failure) e = Standard_Failure::Caught();
|
||||
return new App::DocumentObjectExecReturn(e->GetMessageString());
|
||||
}
|
||||
|
||||
@@ -501,7 +501,7 @@ App::DocumentObjectExecReturn* Torus::execute(void)
|
||||
return FeaturePrimitive::execute(mkTorus.Solid());
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
Handle_Standard_Failure e = Standard_Failure::Caught();
|
||||
Handle(Standard_Failure) e = Standard_Failure::Caught();
|
||||
return new App::DocumentObjectExecReturn(e->GetMessageString());
|
||||
}
|
||||
|
||||
@@ -567,7 +567,7 @@ App::DocumentObjectExecReturn* Prism::execute(void)
|
||||
return FeaturePrimitive::execute(mkPrism.Shape());
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
Handle_Standard_Failure e = Standard_Failure::Caught();
|
||||
Handle(Standard_Failure) e = Standard_Failure::Caught();
|
||||
return new App::DocumentObjectExecReturn(e->GetMessageString());
|
||||
}
|
||||
|
||||
@@ -654,7 +654,7 @@ App::DocumentObjectExecReturn* Wedge::execute(void)
|
||||
return FeaturePrimitive::execute(mkSolid.Solid());
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
Handle_Standard_Failure e = Standard_Failure::Caught();
|
||||
Handle(Standard_Failure) e = Standard_Failure::Caught();
|
||||
return new App::DocumentObjectExecReturn(e->GetMessageString());
|
||||
}
|
||||
|
||||
|
||||
@@ -165,7 +165,7 @@ App::DocumentObjectExecReturn *Revolution::execute(void)
|
||||
return App::DocumentObject::StdReturn;
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
Handle_Standard_Failure e = Standard_Failure::Caught();
|
||||
Handle(Standard_Failure) e = Standard_Failure::Caught();
|
||||
if (std::string(e->GetMessageString()) == "TopoDS::Face")
|
||||
return new App::DocumentObjectExecReturn("Could not create face from sketch.\n"
|
||||
"Intersecting sketch entities in a sketch are not allowed.");
|
||||
|
||||
@@ -289,7 +289,7 @@ App::DocumentObjectExecReturn *Transformed::execute(void)
|
||||
} catch (Standard_Failure) {
|
||||
// Note: Ignoring this failure is probably pointless because if the intersection check fails, the later
|
||||
// fuse operation of the transformation result will also fail
|
||||
Handle_Standard_Failure e = Standard_Failure::Caught();
|
||||
Handle(Standard_Failure) e = Standard_Failure::Caught();
|
||||
std::string msg("Transformation: Intersection check failed");
|
||||
if (e->GetMessageString() != NULL)
|
||||
msg += std::string(": '") + e->GetMessageString() + "'";
|
||||
|
||||
Reference in New Issue
Block a user