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:
@@ -60,7 +60,7 @@ int OffsetSurfacePy::PyInit(PyObject* args, PyObject* /*kwd*/)
|
||||
return -1;
|
||||
|
||||
GeometryPy* pcGeo = static_cast<GeometryPy*>(pGeom);
|
||||
Handle_Geom_Surface surf = Handle_Geom_Surface::DownCast
|
||||
Handle(Geom_Surface) surf = Handle(Geom_Surface)::DownCast
|
||||
(pcGeo->getGeometryPtr()->handle());
|
||||
if (surf.IsNull()) {
|
||||
PyErr_SetString(PyExc_TypeError, "geometry is not a surface");
|
||||
@@ -68,12 +68,12 @@ int OffsetSurfacePy::PyInit(PyObject* args, PyObject* /*kwd*/)
|
||||
}
|
||||
|
||||
try {
|
||||
Handle_Geom_OffsetSurface surf2 = new Geom_OffsetSurface(surf, offset);
|
||||
Handle(Geom_OffsetSurface) surf2 = new Geom_OffsetSurface(surf, offset);
|
||||
getGeomOffsetSurfacePtr()->setHandle(surf2);
|
||||
return 0;
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
Handle_Standard_Failure e = Standard_Failure::Caught();
|
||||
Handle(Standard_Failure) e = Standard_Failure::Caught();
|
||||
PyErr_SetString(PartExceptionOCCError, e->GetMessageString());
|
||||
return -1;
|
||||
}
|
||||
@@ -81,19 +81,19 @@ int OffsetSurfacePy::PyInit(PyObject* args, PyObject* /*kwd*/)
|
||||
|
||||
Py::Float OffsetSurfacePy::getOffsetValue(void) const
|
||||
{
|
||||
Handle_Geom_OffsetSurface surf = Handle_Geom_OffsetSurface::DownCast(getGeometryPtr()->handle());
|
||||
Handle(Geom_OffsetSurface) surf = Handle(Geom_OffsetSurface)::DownCast(getGeometryPtr()->handle());
|
||||
return Py::Float(surf->Offset());
|
||||
}
|
||||
|
||||
void OffsetSurfacePy::setOffsetValue(Py::Float arg)
|
||||
{
|
||||
Handle_Geom_OffsetSurface surf = Handle_Geom_OffsetSurface::DownCast(getGeometryPtr()->handle());
|
||||
Handle(Geom_OffsetSurface) surf = Handle(Geom_OffsetSurface)::DownCast(getGeometryPtr()->handle());
|
||||
surf->SetOffsetValue((double)arg);
|
||||
}
|
||||
|
||||
Py::Object OffsetSurfacePy::getBasisSurface(void) const
|
||||
{
|
||||
Handle_Geom_OffsetSurface surf = Handle_Geom_OffsetSurface::DownCast
|
||||
Handle(Geom_OffsetSurface) surf = Handle(Geom_OffsetSurface)::DownCast
|
||||
(getGeometryPtr()->handle());
|
||||
if (surf.IsNull()) {
|
||||
throw Py::TypeError("geometry is not a surface");
|
||||
@@ -108,19 +108,19 @@ void OffsetSurfacePy::setBasisSurface(Py::Object arg)
|
||||
PyObject* p = arg.ptr();
|
||||
if (PyObject_TypeCheck(p, &(GeometryPy::Type))) {
|
||||
GeometryPy* pcGeo = static_cast<GeometryPy*>(p);
|
||||
Handle_Geom_Surface surf = Handle_Geom_Surface::DownCast
|
||||
Handle(Geom_Surface) surf = Handle(Geom_Surface)::DownCast
|
||||
(pcGeo->getGeometryPtr()->handle());
|
||||
if (surf.IsNull()) {
|
||||
throw Py::TypeError("geometry is not a surface");
|
||||
}
|
||||
|
||||
try {
|
||||
Handle_Geom_OffsetSurface surf2 = Handle_Geom_OffsetSurface::DownCast
|
||||
Handle(Geom_OffsetSurface) surf2 = Handle(Geom_OffsetSurface)::DownCast
|
||||
(getGeometryPtr()->handle());
|
||||
surf2->SetBasisSurface(surf);
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
Handle_Standard_Failure e = Standard_Failure::Caught();
|
||||
Handle(Standard_Failure) e = Standard_Failure::Caught();
|
||||
throw Py::Exception(e->GetMessageString());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user