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:
@@ -136,7 +136,7 @@ private:
|
||||
}
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
Handle_Standard_Failure e = Standard_Failure::Caught();
|
||||
Handle(Standard_Failure) e = Standard_Failure::Caught();
|
||||
throw Py::Exception(Part::PartExceptionOCCError, e->GetMessageString());
|
||||
}
|
||||
|
||||
@@ -194,7 +194,7 @@ private:
|
||||
}
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
Handle_Standard_Failure e = Standard_Failure::Caught();
|
||||
Handle(Standard_Failure) e = Standard_Failure::Caught();
|
||||
throw Py::Exception(Part::PartExceptionOCCError, e->GetMessageString());
|
||||
}
|
||||
|
||||
@@ -258,7 +258,7 @@ private:
|
||||
edgeList = DrawProjectSplit::getEdgesForWalker(shape,scale,dir);
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
Handle_Standard_Failure e = Standard_Failure::Caught();
|
||||
Handle(Standard_Failure) e = Standard_Failure::Caught();
|
||||
throw Py::Exception(Part::PartExceptionOCCError, e->GetMessageString());
|
||||
}
|
||||
|
||||
|
||||
@@ -261,7 +261,7 @@ bool DrawProjectSplit::isOnEdge(TopoDS_Edge e, TopoDS_Vertex v, double& param, b
|
||||
} else if (dist < Precision::Confusion()) {
|
||||
const gp_Pnt pt = BRep_Tool::Pnt(v); //have to duplicate method 3 to get param
|
||||
BRepAdaptor_Curve adapt(e);
|
||||
const Handle_Geom_Curve c = adapt.Curve().Curve();
|
||||
const Handle(Geom_Curve) c = adapt.Curve().Curve();
|
||||
double maxDist = 0.000001; //magic number. less than this gives false positives.
|
||||
//bool found =
|
||||
(void) GeomLib_Tool::Parameter(c,pt,maxDist,param); //already know point it on curve
|
||||
@@ -334,7 +334,7 @@ std::vector<TopoDS_Edge> DrawProjectSplit::split1Edge(TopoDS_Edge e, std::vector
|
||||
}
|
||||
|
||||
BRepAdaptor_Curve adapt(e);
|
||||
Handle_Geom_Curve c = adapt.Curve().Curve();
|
||||
Handle(Geom_Curve) c = adapt.Curve().Curve();
|
||||
double first = BRepLProp_CurveTool::FirstParameter(adapt);
|
||||
double last = BRepLProp_CurveTool::LastParameter(adapt);
|
||||
if (first > last) {
|
||||
|
||||
@@ -249,7 +249,7 @@ App::DocumentObjectExecReturn *DrawViewDetail::execute(void)
|
||||
extractFaces();
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
Handle_Standard_Failure e4 = Standard_Failure::Caught();
|
||||
Handle(Standard_Failure) e4 = Standard_Failure::Caught();
|
||||
Base::Console().Log("LOG - DVD::execute - extractFaces failed for %s - %s **\n",getNameInDocument(),e4->GetMessageString());
|
||||
return new App::DocumentObjectExecReturn(e4->GetMessageString());
|
||||
}
|
||||
@@ -258,7 +258,7 @@ App::DocumentObjectExecReturn *DrawViewDetail::execute(void)
|
||||
#endif //#if MOD_TECHDRAW_HANDLE_FACES
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
Handle_Standard_Failure e1 = Standard_Failure::Caught();
|
||||
Handle(Standard_Failure) e1 = Standard_Failure::Caught();
|
||||
Base::Console().Log("LOG - DVD::execute - base shape failed for %s - %s **\n",getNameInDocument(),e1->GetMessageString());
|
||||
return new App::DocumentObjectExecReturn(e1->GetMessageString());
|
||||
}
|
||||
|
||||
@@ -154,7 +154,7 @@ App::DocumentObjectExecReturn *DrawViewMulti::execute(void)
|
||||
#endif //#if MOD_TECHDRAW_HANDLE_FACES
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
Handle_Standard_Failure e1 = Standard_Failure::Caught();
|
||||
Handle(Standard_Failure) e1 = Standard_Failure::Caught();
|
||||
Base::Console().Log("LOG - DVM::execute - projection failed for %s - %s **\n",getNameInDocument(),e1->GetMessageString());
|
||||
return new App::DocumentObjectExecReturn(e1->GetMessageString());
|
||||
}
|
||||
|
||||
@@ -192,7 +192,7 @@ App::DocumentObjectExecReturn *DrawViewPart::execute(void)
|
||||
extractFaces();
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
Handle_Standard_Failure e4 = Standard_Failure::Caught();
|
||||
Handle(Standard_Failure) e4 = Standard_Failure::Caught();
|
||||
Base::Console().Log("LOG - DVP::execute - extractFaces failed for %s - %s **\n",getNameInDocument(),e4->GetMessageString());
|
||||
return new App::DocumentObjectExecReturn(e4->GetMessageString());
|
||||
}
|
||||
|
||||
@@ -265,7 +265,7 @@ App::DocumentObjectExecReturn *DrawViewSection::execute(void)
|
||||
#endif //#if MOD_TECHDRAW_HANDLE_FACES
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
Handle_Standard_Failure e1 = Standard_Failure::Caught();
|
||||
Handle(Standard_Failure) e1 = Standard_Failure::Caught();
|
||||
Base::Console().Log("LOG - DVS::execute - base shape failed for %s - %s **\n",getNameInDocument(),e1->GetMessageString());
|
||||
return new App::DocumentObjectExecReturn(e1->GetMessageString());
|
||||
}
|
||||
@@ -296,7 +296,7 @@ App::DocumentObjectExecReturn *DrawViewSection::execute(void)
|
||||
sectionFaces = newFaces;
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
Handle_Standard_Failure e2 = Standard_Failure::Caught();
|
||||
Handle(Standard_Failure) e2 = Standard_Failure::Caught();
|
||||
Base::Console().Log("LOG - DVS::execute - failed building section faces for %s - %s **\n",getNameInDocument(),e2->GetMessageString());
|
||||
return new App::DocumentObjectExecReturn(e2->GetMessageString());
|
||||
}
|
||||
|
||||
@@ -216,7 +216,7 @@ BaseGeom* BaseGeom::baseFactory(TopoDS_Edge edge)
|
||||
}
|
||||
} break;
|
||||
case GeomAbs_BezierCurve: {
|
||||
Handle_Geom_BezierCurve bez = adapt.Bezier();
|
||||
Handle(Geom_BezierCurve) bez = adapt.Bezier();
|
||||
//if (bez->Degree() < 4) {
|
||||
result = new BezierSegment(edge);
|
||||
//}
|
||||
@@ -401,7 +401,7 @@ Generic::Generic(const TopoDS_Edge &e)
|
||||
BRepLib::BuildCurve3d(occEdge);
|
||||
|
||||
TopLoc_Location location;
|
||||
Handle_Poly_Polygon3D polygon = BRep_Tool::Polygon3D(occEdge, location);
|
||||
Handle(Poly_Polygon3D) polygon = BRep_Tool::Polygon3D(occEdge, location);
|
||||
|
||||
if (!polygon.IsNull()) {
|
||||
const TColgp_Array1OfPnt &nodes = polygon->Nodes();
|
||||
@@ -429,7 +429,7 @@ BSpline::BSpline(const TopoDS_Edge &e)
|
||||
geomType = BSPLINE;
|
||||
BRepAdaptor_Curve c(e);
|
||||
occEdge = e;
|
||||
Handle_Geom_BSplineCurve spline = c.BSpline();
|
||||
Handle(Geom_BSplineCurve) spline = c.BSpline();
|
||||
bool fail = false;
|
||||
double f,l;
|
||||
gp_Pnt s,m,ePt;
|
||||
@@ -440,7 +440,7 @@ BSpline::BSpline(const TopoDS_Edge &e)
|
||||
if (spline->Degree() > 3) { //if spline is too complex, approximate it
|
||||
Standard_Real tol3D = 0.001; //1/1000 of a mm? screen can't resolve this
|
||||
Standard_Integer maxDegree = 3, maxSegment = 10;
|
||||
Handle_BRepAdaptor_HCurve hCurve = new BRepAdaptor_HCurve(c);
|
||||
Handle(BRepAdaptor_HCurve) hCurve = new BRepAdaptor_HCurve(c);
|
||||
// approximate the curve using a tolerance
|
||||
//Approx_Curve3d approx(hCurve, tol3D, GeomAbs_C2, maxSegment, maxDegree); //gives degree == 5 ==> too many poles ==> buffer overrun
|
||||
Approx_Curve3d approx(hCurve, tol3D, GeomAbs_C0, maxSegment, maxDegree);
|
||||
@@ -478,7 +478,7 @@ BSpline::BSpline(const TopoDS_Edge &e)
|
||||
} else {
|
||||
for (Standard_Integer i = 1; i <= crt.NbArcs(); ++i) {
|
||||
BezierSegment tempSegment;
|
||||
Handle_Geom_BezierCurve bezier = crt.Arc(i);
|
||||
Handle(Geom_BezierCurve) bezier = crt.Arc(i);
|
||||
if (bezier->Degree() > 3) {
|
||||
Base::Console().Log("Geometry::BSpline - converted curve degree > 3\n");
|
||||
}
|
||||
@@ -499,7 +499,7 @@ bool BSpline::isLine()
|
||||
{
|
||||
bool result = false;
|
||||
BRepAdaptor_Curve c(occEdge);
|
||||
Handle_Geom_BSplineCurve spline = c.BSpline();
|
||||
Handle(Geom_BSplineCurve) spline = c.BSpline();
|
||||
if (spline->NbPoles() == 2) {
|
||||
result = true;
|
||||
}
|
||||
@@ -511,7 +511,7 @@ BezierSegment::BezierSegment(const TopoDS_Edge &e)
|
||||
geomType = BEZIER;
|
||||
occEdge = e;
|
||||
BRepAdaptor_Curve c(e);
|
||||
Handle_Geom_BezierCurve bez = c.Bezier();
|
||||
Handle(Geom_BezierCurve) bez = c.Bezier();
|
||||
poles = bez->NbPoles();
|
||||
degree = bez->Degree();
|
||||
if (poles > 4) {
|
||||
|
||||
@@ -154,7 +154,7 @@ void GeometryObject::projectShape(const TopoDS_Shape& input,
|
||||
|
||||
auto start = chrono::high_resolution_clock::now();
|
||||
|
||||
Handle_HLRBRep_Algo brep_hlr = NULL;
|
||||
Handle(HLRBRep_Algo) brep_hlr = NULL;
|
||||
try {
|
||||
brep_hlr = new HLRBRep_Algo();
|
||||
brep_hlr->Add(input, m_isoCount);
|
||||
|
||||
Reference in New Issue
Block a user