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:
Peter Lama
2017-04-17 20:33:29 -04:00
committed by wmayer
parent ea3d86b735
commit a75a98ef27
141 changed files with 2198 additions and 2208 deletions

View File

@@ -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());
}
}