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 4564e4f4a4
commit fa4bebf2e0
141 changed files with 2198 additions and 2208 deletions

View File

@@ -57,7 +57,7 @@ int HyperbolaPy::PyInit(PyObject* args, PyObject* kwds)
{
char* keywords_n[] = {NULL};
if (PyArg_ParseTupleAndKeywords(args, kwds, "", keywords_n)) {
Handle_Geom_Hyperbola hyperbola = Handle_Geom_Hyperbola::DownCast(getGeomHyperbolaPtr()->handle());
Handle(Geom_Hyperbola) hyperbola = Handle(Geom_Hyperbola)::DownCast(getGeomHyperbolaPtr()->handle());
hyperbola->SetMajorRadius(2.0);
hyperbola->SetMinorRadius(1.0);
return 0;
@@ -68,9 +68,9 @@ int HyperbolaPy::PyInit(PyObject* args, PyObject* kwds)
PyObject *pHypr;
if (PyArg_ParseTupleAndKeywords(args, kwds, "O!",keywords_e, &(HyperbolaPy::Type), &pHypr)) {
HyperbolaPy* pHyperbola = static_cast<HyperbolaPy*>(pHypr);
Handle_Geom_Hyperbola Hypr1 = Handle_Geom_Hyperbola::DownCast
Handle(Geom_Hyperbola) Hypr1 = Handle(Geom_Hyperbola)::DownCast
(pHyperbola->getGeomHyperbolaPtr()->handle());
Handle_Geom_Hyperbola Hypr2 = Handle_Geom_Hyperbola::DownCast
Handle(Geom_Hyperbola) Hypr2 = Handle(Geom_Hyperbola)::DownCast
(this->getGeomHyperbolaPtr()->handle());
Hypr2->SetHypr(Hypr1->Hypr());
return 0;
@@ -94,7 +94,7 @@ int HyperbolaPy::PyInit(PyObject* args, PyObject* kwds)
return -1;
}
Handle_Geom_Hyperbola hyperbola = Handle_Geom_Hyperbola::DownCast(getGeomHyperbolaPtr()->handle());
Handle(Geom_Hyperbola) hyperbola = Handle(Geom_Hyperbola)::DownCast(getGeomHyperbolaPtr()->handle());
hyperbola->SetHypr(me.Value()->Hypr());
return 0;
}
@@ -114,7 +114,7 @@ int HyperbolaPy::PyInit(PyObject* args, PyObject* kwds)
return -1;
}
Handle_Geom_Hyperbola hyperbola = Handle_Geom_Hyperbola::DownCast(getGeomHyperbolaPtr()->handle());
Handle(Geom_Hyperbola) hyperbola = Handle(Geom_Hyperbola)::DownCast(getGeomHyperbolaPtr()->handle());
hyperbola->SetHypr(me.Value()->Hypr());
return 0;
}
@@ -129,44 +129,44 @@ int HyperbolaPy::PyInit(PyObject* args, PyObject* kwds)
Py::Float HyperbolaPy::getMajorRadius(void) const
{
Handle_Geom_Hyperbola hyperbola = Handle_Geom_Hyperbola::DownCast(getGeomHyperbolaPtr()->handle());
Handle(Geom_Hyperbola) hyperbola = Handle(Geom_Hyperbola)::DownCast(getGeomHyperbolaPtr()->handle());
return Py::Float(hyperbola->MajorRadius());
}
void HyperbolaPy::setMajorRadius(Py::Float arg)
{
Handle_Geom_Hyperbola hyperbola = Handle_Geom_Hyperbola::DownCast(getGeomHyperbolaPtr()->handle());
Handle(Geom_Hyperbola) hyperbola = Handle(Geom_Hyperbola)::DownCast(getGeomHyperbolaPtr()->handle());
hyperbola->SetMajorRadius((double)arg);
}
Py::Float HyperbolaPy::getMinorRadius(void) const
{
Handle_Geom_Hyperbola hyperbola = Handle_Geom_Hyperbola::DownCast(getGeomHyperbolaPtr()->handle());
Handle(Geom_Hyperbola) hyperbola = Handle(Geom_Hyperbola)::DownCast(getGeomHyperbolaPtr()->handle());
return Py::Float(hyperbola->MinorRadius());
}
void HyperbolaPy::setMinorRadius(Py::Float arg)
{
Handle_Geom_Hyperbola hyperbola = Handle_Geom_Hyperbola::DownCast(getGeomHyperbolaPtr()->handle());
Handle(Geom_Hyperbola) hyperbola = Handle(Geom_Hyperbola)::DownCast(getGeomHyperbolaPtr()->handle());
hyperbola->SetMinorRadius((double)arg);
}
Py::Float HyperbolaPy::getFocal(void) const
{
Handle_Geom_Hyperbola hyperbola = Handle_Geom_Hyperbola::DownCast(getGeomHyperbolaPtr()->handle());
Handle(Geom_Hyperbola) hyperbola = Handle(Geom_Hyperbola)::DownCast(getGeomHyperbolaPtr()->handle());
return Py::Float(hyperbola->Focal());
}
Py::Object HyperbolaPy::getFocus1(void) const
{
Handle_Geom_Hyperbola hyperbola = Handle_Geom_Hyperbola::DownCast(getGeomHyperbolaPtr()->handle());
Handle(Geom_Hyperbola) hyperbola = Handle(Geom_Hyperbola)::DownCast(getGeomHyperbolaPtr()->handle());
gp_Pnt loc = hyperbola->Focus1();
return Py::Vector(Base::Vector3d(loc.X(), loc.Y(), loc.Z()));
}
Py::Object HyperbolaPy::getFocus2(void) const
{
Handle_Geom_Hyperbola hyperbola = Handle_Geom_Hyperbola::DownCast(getGeomHyperbolaPtr()->handle());
Handle(Geom_Hyperbola) hyperbola = Handle(Geom_Hyperbola)::DownCast(getGeomHyperbolaPtr()->handle());
gp_Pnt loc = hyperbola->Focus2();
return Py::Vector(Base::Vector3d(loc.X(), loc.Y(), loc.Z()));
}