diff --git a/src/Mod/Part/App/AppPart.cpp b/src/Mod/Part/App/AppPart.cpp index e65b78b469..afefb26e12 100644 --- a/src/Mod/Part/App/AppPart.cpp +++ b/src/Mod/Part/App/AppPart.cpp @@ -68,6 +68,7 @@ #include "ArcOfCirclePy.h" #include "ArcOfEllipsePy.h" #include "ArcOfParabolaPy.h" +#include "ArcOfHyperbolaPy.h" #include "BezierCurvePy.h" #include "BSplineCurvePy.h" #include "HyperbolaPy.h" @@ -176,6 +177,7 @@ void PartExport initPart() Base::Interpreter().addType(&Part::ArcOfCirclePy ::Type,partModule,"ArcOfCircle"); Base::Interpreter().addType(&Part::ArcOfEllipsePy ::Type,partModule,"ArcOfEllipse"); Base::Interpreter().addType(&Part::ArcOfParabolaPy ::Type,partModule,"ArcOfParabola"); + Base::Interpreter().addType(&Part::ArcOfHyperbolaPy ::Type,partModule,"ArcOfHyperbola"); Base::Interpreter().addType(&Part::BezierCurvePy ::Type,partModule,"BezierCurve"); Base::Interpreter().addType(&Part::BSplineCurvePy ::Type,partModule,"BSplineCurve"); Base::Interpreter().addType(&Part::OffsetCurvePy ::Type,partModule,"OffsetCurve"); @@ -267,6 +269,7 @@ void PartExport initPart() Part::GeomArcOfCircle ::init(); Part::GeomArcOfEllipse ::init(); Part::GeomArcOfParabola ::init(); + Part::GeomArcOfHyperbola ::init(); Part::GeomEllipse ::init(); Part::GeomHyperbola ::init(); Part::GeomParabola ::init(); diff --git a/src/Mod/Part/App/ArcOfHyperbolaPy.xml b/src/Mod/Part/App/ArcOfHyperbolaPy.xml new file mode 100644 index 0000000000..205d725d2b --- /dev/null +++ b/src/Mod/Part/App/ArcOfHyperbolaPy.xml @@ -0,0 +1,54 @@ + + + + + + Describes a portion of an hyperbola + + + + The major radius of the hyperbola. + + + + + + The minor radius of the hyperbola. + + + + + + The angle between the X axis and the major axis of the hyperbola. + + + + + + Center of the hyperbola. + + + + + + The axis direction of the hyperbola + + + + + + The internal hyperbola representation + + + + + diff --git a/src/Mod/Part/App/ArcOfHyperbolaPyImp.cpp b/src/Mod/Part/App/ArcOfHyperbolaPyImp.cpp new file mode 100644 index 0000000000..2005c40054 --- /dev/null +++ b/src/Mod/Part/App/ArcOfHyperbolaPyImp.cpp @@ -0,0 +1,233 @@ +/*************************************************************************** + * Copyright (c) 2014 Abdullah Tahiri +# include +# include +# include +# include +#endif + +#include "Mod/Part/App/Geometry.h" +#include "ArcOfHyperbolaPy.h" +#include "ArcOfHyperbolaPy.cpp" +#include "HyperbolaPy.h" +#include "OCCError.h" + +#include +#include + +using namespace Part; + +extern const char* gce_ErrorStatusText(gce_ErrorType et); + +// returns a string which represents the object e.g. when printed in python +std::string ArcOfHyperbolaPy::representation(void) const +{ + Handle_Geom_TrimmedCurve trim = Handle_Geom_TrimmedCurve::DownCast + (getGeomArcOfHyperbolaPtr()->handle()); + Handle_Geom_Hyperbola hyperbola = Handle_Geom_Hyperbola::DownCast(trim->BasisCurve()); + + gp_Ax1 axis = hyperbola->Axis(); + gp_Dir dir = axis.Direction(); + gp_Pnt loc = axis.Location(); + Standard_Real fMajRad = hyperbola->MajorRadius(); + Standard_Real fMinRad = hyperbola->MinorRadius(); + Standard_Real u1 = trim->FirstParameter(); + Standard_Real u2 = trim->LastParameter(); + + gp_Dir normal = hyperbola->Axis().Direction(); + gp_Dir xdir = hyperbola->XAxis().Direction(); + + gp_Ax2 xdirref(loc, normal); // this is a reference XY for the hyperbola + + Standard_Real fAngleXU = -xdir.AngleWithRef(xdirref.XDirection(),normal); + + + std::stringstream str; + str << "ArcOfHyperbola ("; + str << "MajorRadius : " << fMajRad << ", "; + str << "MinorRadius : " << fMinRad << ", "; + str << "AngleXU : " << fAngleXU << ", "; + str << "Position : (" << loc.X() << ", "<< loc.Y() << ", "<< loc.Z() << "), "; + str << "Direction : (" << dir.X() << ", "<< dir.Y() << ", "<< dir.Z() << "), "; + str << "Parameter : (" << u1 << ", " << u2 << ")"; + str << ")"; + + return str.str(); +} + +PyObject *ArcOfHyperbolaPy::PyMake(struct _typeobject *, PyObject *, PyObject *) // Python wrapper +{ + // create a new instance of ArcOfHyperbolaPy and the Twin object + return new ArcOfHyperbolaPy(new GeomArcOfHyperbola); +} + +// constructor method +int ArcOfHyperbolaPy::PyInit(PyObject* args, PyObject* kwds) +{ + PyObject* o; + double u1, u2; + PyObject *sense=Py_True; + if (PyArg_ParseTuple(args, "O!dd|O!", &(Part::HyperbolaPy::Type), &o, &u1, &u2, &PyBool_Type, &sense)) { + try { + Handle_Geom_Hyperbola hyperbola = Handle_Geom_Hyperbola::DownCast + (static_cast(o)->getGeomHyperbolaPtr()->handle()); + GC_MakeArcOfHyperbola arc(hyperbola->Hypr(), u1, u2, PyObject_IsTrue(sense) ? Standard_True : Standard_False); + if (!arc.IsDone()) { + PyErr_SetString(PartExceptionOCCError, gce_ErrorStatusText(arc.Status())); + return -1; + } + + getGeomArcOfHyperbolaPtr()->setHandle(arc.Value()); + return 0; + } + catch (Standard_Failure) { + Handle_Standard_Failure e = Standard_Failure::Caught(); + PyErr_SetString(PartExceptionOCCError, e->GetMessageString()); + return -1; + } + catch (...) { + PyErr_SetString(PartExceptionOCCError, "creation of arc failed"); + return -1; + } + } + + // All checks failed + PyErr_SetString(PyExc_TypeError, + "ArcOfHyperbola constructor expects an hyperbola curve and a parameter range"); + return -1; +} + +Py::Float ArcOfHyperbolaPy::getMajorRadius(void) const +{ + return Py::Float(getGeomArcOfHyperbolaPtr()->getMajorRadius()); +} + +void ArcOfHyperbolaPy::setMajorRadius(Py::Float arg) +{ + getGeomArcOfHyperbolaPtr()->setMajorRadius((double)arg); +} + +Py::Float ArcOfHyperbolaPy::getMinorRadius(void) const +{ + return Py::Float(getGeomArcOfHyperbolaPtr()->getMinorRadius()); +} + +void ArcOfHyperbolaPy::setMinorRadius(Py::Float arg) +{ + getGeomArcOfHyperbolaPtr()->setMinorRadius((double)arg); +} + +Py::Float ArcOfHyperbolaPy::getAngleXU(void) const +{ + return Py::Float(getGeomArcOfHyperbolaPtr()->getAngleXU()); +} + +void ArcOfHyperbolaPy::setAngleXU(Py::Float arg) +{ + getGeomArcOfHyperbolaPtr()->setAngleXU((double)arg); +} + +Py::Object ArcOfHyperbolaPy::getCenter(void) const +{ + return Py::Vector(getGeomArcOfHyperbolaPtr()->getCenter()); +} + +void ArcOfHyperbolaPy::setCenter(Py::Object arg) +{ + PyObject* p = arg.ptr(); + if (PyObject_TypeCheck(p, &(Base::VectorPy::Type))) { + Base::Vector3d loc = static_cast(p)->value(); + getGeomArcOfHyperbolaPtr()->setCenter(loc); + } + else if (PyObject_TypeCheck(p, &PyTuple_Type)) { + Base::Vector3d loc = Base::getVectorFromTuple(p); + getGeomArcOfHyperbolaPtr()->setCenter(loc); + } + else { + std::string error = std::string("type must be 'Vector', not "); + error += p->ob_type->tp_name; + throw Py::TypeError(error); + } +} + +Py::Object ArcOfHyperbolaPy::getAxis(void) const +{ + Handle_Geom_TrimmedCurve trim = Handle_Geom_TrimmedCurve::DownCast + (getGeomArcOfHyperbolaPtr()->handle()); + Handle_Geom_Hyperbola hyperbola = Handle_Geom_Hyperbola::DownCast(trim->BasisCurve()); + gp_Ax1 axis = hyperbola->Axis(); + gp_Dir dir = axis.Direction(); + return Py::Vector(Base::Vector3d(dir.X(), dir.Y(), dir.Z())); +} + +void ArcOfHyperbolaPy::setAxis(Py::Object arg) +{ + PyObject* p = arg.ptr(); + Base::Vector3d val; + if (PyObject_TypeCheck(p, &(Base::VectorPy::Type))) { + val = static_cast(p)->value(); + } + else if (PyTuple_Check(p)) { + val = Base::getVectorFromTuple(p); + } + else { + std::string error = std::string("type must be 'Vector', not "); + error += p->ob_type->tp_name; + throw Py::TypeError(error); + } + + Handle_Geom_TrimmedCurve trim = Handle_Geom_TrimmedCurve::DownCast + (getGeomArcOfHyperbolaPtr()->handle()); + Handle_Geom_Hyperbola hyperbola = Handle_Geom_Hyperbola::DownCast(trim->BasisCurve()); + try { + gp_Ax1 axis; + axis.SetLocation(hyperbola->Location()); + axis.SetDirection(gp_Dir(val.x, val.y, val.z)); + hyperbola->SetAxis(axis); + } + catch (Standard_Failure) { + throw Py::Exception("cannot set axis"); + } +} + +Py::Object ArcOfHyperbolaPy::getHyperbola(void) const +{ + Handle_Geom_TrimmedCurve trim = Handle_Geom_TrimmedCurve::DownCast + (getGeomArcOfHyperbolaPtr()->handle()); + Handle_Geom_Hyperbola hyperbola = Handle_Geom_Hyperbola::DownCast(trim->BasisCurve()); + return Py::Object(new HyperbolaPy(new GeomHyperbola(hyperbola)), true); +} + +PyObject *ArcOfHyperbolaPy::getCustomAttributes(const char* attr) const +{ + return 0; +} + +int ArcOfHyperbolaPy::setCustomAttributes(const char* attr, PyObject *obj) +{ + return 0; +} diff --git a/src/Mod/Part/App/ArcPyImp.cpp b/src/Mod/Part/App/ArcPyImp.cpp index 8c3e72810c..3604d750e3 100644 --- a/src/Mod/Part/App/ArcPyImp.cpp +++ b/src/Mod/Part/App/ArcPyImp.cpp @@ -33,6 +33,11 @@ # include # include # include +# include +# include +# include +# include +# include #endif @@ -41,6 +46,7 @@ #include "CirclePy.h" #include "EllipsePy.h" #include "ParabolaPy.h" +#include "HyperbolaPy.h" #include "OCCError.h" #include @@ -164,6 +170,32 @@ int ArcPy::PyInit(PyObject* args, PyObject* /*kwd*/) } } + PyErr_Clear(); + + if (PyArg_ParseTuple(args, "O!dd|O!", &(Part::HyperbolaPy::Type), &o, &u1, &u2, &PyBool_Type, &sense)) { + try { + Handle_Geom_Hyperbola hyperbola = Handle_Geom_Hyperbola::DownCast + (static_cast(o)->getGeomHyperbolaPtr()->handle()); + GC_MakeArcOfHyperbola arc(hyperbola->Hypr(), u1, u2, PyObject_IsTrue(sense) ? Standard_True : Standard_False); + if (!arc.IsDone()) { + PyErr_SetString(PartExceptionOCCError, gce_ErrorStatusText(arc.Status())); + return -1; + } + + getGeomTrimmedCurvePtr()->setHandle(arc.Value()); + return 0; + } + catch (Standard_Failure) { + Handle_Standard_Failure e = Standard_Failure::Caught(); + PyErr_SetString(PartExceptionOCCError, e->GetMessageString()); + return -1; + } + catch (...) { + PyErr_SetString(PartExceptionOCCError, "creation of arc failed"); + return -1; + } + } + // All checks failed PyErr_SetString(PyExc_TypeError, "Arc constructor expects a conic curve and a parameter range"); return -1; diff --git a/src/Mod/Part/App/CMakeLists.txt b/src/Mod/Part/App/CMakeLists.txt index 4ae68b91d5..068e4eb882 100644 --- a/src/Mod/Part/App/CMakeLists.txt +++ b/src/Mod/Part/App/CMakeLists.txt @@ -44,6 +44,7 @@ generate_from_xml(CirclePy) generate_from_xml(ArcOfEllipsePy) generate_from_xml(EllipsePy) generate_from_xml(HyperbolaPy) +generate_from_xml(ArcOfHyperbolaPy) generate_from_xml(ParabolaPy) generate_from_xml(OffsetCurvePy) generate_from_xml(GeometryPy) @@ -158,6 +159,8 @@ SET(Python_SRCS EllipsePyImp.cpp HyperbolaPy.xml HyperbolaPyImp.cpp + ArcOfHyperbolaPy.xml + ArcOfHyperbolaPyImp.cpp ParabolaPy.xml ParabolaPyImp.cpp OffsetCurvePy.xml diff --git a/src/Mod/Part/App/Geometry.cpp b/src/Mod/Part/App/Geometry.cpp index 561d09835c..c25f84e661 100644 --- a/src/Mod/Part/App/Geometry.cpp +++ b/src/Mod/Part/App/Geometry.cpp @@ -82,6 +82,8 @@ # include # include # include +# include +# include # include # include # include @@ -98,6 +100,7 @@ #include "BezierCurvePy.h" #include "BSplineCurvePy.h" #include "HyperbolaPy.h" +#include "ArcOfHyperbolaPy.h" #include "OffsetCurvePy.h" #include "ParabolaPy.h" #include "BezierSurfacePy.h" @@ -1313,16 +1316,441 @@ Geometry *GeomHyperbola::clone(void) const return newHyp; } +Base::Vector3d GeomHyperbola::getCenter(void) const +{ + Handle_Geom_Hyperbola h = Handle_Geom_Hyperbola::DownCast(handle()); + gp_Ax1 axis = h->Axis(); + const gp_Pnt& loc = axis.Location(); + return Base::Vector3d(loc.X(),loc.Y(),loc.Z()); +} + +void GeomHyperbola::setCenter(const Base::Vector3d& Center) +{ + gp_Pnt p1(Center.x,Center.y,Center.z); + Handle_Geom_Hyperbola h = Handle_Geom_Hyperbola::DownCast(handle()); + + try { + h->SetLocation(p1); + } + catch (Standard_Failure) { + Handle_Standard_Failure e = Standard_Failure::Caught(); + throw Base::Exception(e->GetMessageString()); + } +} + +double GeomHyperbola::getMajorRadius(void) const +{ + Handle_Geom_Hyperbola h = Handle_Geom_Hyperbola::DownCast(handle()); + return h->MajorRadius(); +} + +void GeomHyperbola::setMajorRadius(double Radius) +{ + Handle_Geom_Hyperbola h = Handle_Geom_Hyperbola::DownCast(handle()); + + try { + h->SetMajorRadius(Radius); + } + catch (Standard_Failure) { + Handle_Standard_Failure e = Standard_Failure::Caught(); + throw Base::Exception(e->GetMessageString()); + } +} + +double GeomHyperbola::getMinorRadius(void) const +{ + Handle_Geom_Hyperbola h = Handle_Geom_Hyperbola::DownCast(handle()); + return h->MinorRadius(); +} + +void GeomHyperbola::setMinorRadius(double Radius) +{ + Handle_Geom_Hyperbola h = Handle_Geom_Hyperbola::DownCast(handle()); + + try { + h->SetMinorRadius(Radius); + } + catch (Standard_Failure) { + Handle_Standard_Failure e = Standard_Failure::Caught(); + throw Base::Exception(e->GetMessageString()); + } +} + +double GeomHyperbola::getAngleXU(void) const +{ + gp_Pnt center = this->myCurve->Axis().Location(); + gp_Dir normal = this->myCurve->Axis().Direction(); + gp_Dir xdir = this->myCurve->XAxis().Direction(); + + gp_Ax2 xdirref(center, normal); // this is a reference system, might be CCW or CW depending on the creation method + + return -xdir.AngleWithRef(xdirref.XDirection(),normal); +} + +void GeomHyperbola::setAngleXU(double angle) +{ + try { + gp_Pnt center = this->myCurve->Axis().Location(); + gp_Dir normal = this->myCurve->Axis().Direction(); + + gp_Ax1 normaxis(center, normal); + + gp_Ax2 xdirref(center, normal); + + xdirref.Rotate(normaxis,angle); + + this->myCurve->SetPosition(xdirref); + + } + catch (Standard_Failure) { + Handle_Standard_Failure e = Standard_Failure::Caught(); + throw Base::Exception(e->GetMessageString()); + } +} + // Persistence implementer -unsigned int GeomHyperbola::getMemSize (void) const {assert(0); return 0;/* not implemented yet */} -void GeomHyperbola::Save (Base::Writer &/*writer*/) const {assert(0); /* not implemented yet */} -void GeomHyperbola::Restore (Base::XMLReader &/*reader*/) {assert(0); /* not implemented yet */} +unsigned int GeomHyperbola::getMemSize (void) const +{ + return sizeof(Geom_Hyperbola); +} + +void GeomHyperbola::Save(Base::Writer& writer) const +{ + // save the attributes of the father class + GeomCurve::Save(writer); + + gp_Pnt center = this->myCurve->Axis().Location(); + gp_Dir normal = this->myCurve->Axis().Direction(); + gp_Dir xdir = this->myCurve->XAxis().Direction(); + + gp_Ax2 xdirref(center, normal); // this is a reference XY for the ellipse + + double AngleXU = -xdir.AngleWithRef(xdirref.XDirection(),normal); + + writer.Stream() + << writer.ind() + << "myCurve->MajorRadius() << "\" " + << "MinorRadius=\"" << this->myCurve->MinorRadius() << "\" " + << "AngleXU=\"" << AngleXU << "\" " + << "/>" << endl; +} + +void GeomHyperbola::Restore(Base::XMLReader& reader) +{ + // read the attributes of the father class + GeomCurve::Restore(reader); + + double CenterX,CenterY,CenterZ,NormalX,NormalY,NormalZ,MajorRadius,MinorRadius,AngleXU; + // read my Element + reader.readElement("Hyperbola"); + // get the value of my Attribute + CenterX = reader.getAttributeAsFloat("CenterX"); + CenterY = reader.getAttributeAsFloat("CenterY"); + CenterZ = reader.getAttributeAsFloat("CenterZ"); + NormalX = reader.getAttributeAsFloat("NormalX"); + NormalY = reader.getAttributeAsFloat("NormalY"); + NormalZ = reader.getAttributeAsFloat("NormalZ"); + MajorRadius = reader.getAttributeAsFloat("MajorRadius"); + MinorRadius = reader.getAttributeAsFloat("MinorRadius"); + AngleXU = reader.getAttributeAsFloat("AngleXU"); + + // set the read geometry + gp_Pnt p1(CenterX,CenterY,CenterZ); + gp_Dir norm(NormalX,NormalY,NormalZ); + + gp_Ax1 normaxis(p1,norm); + + gp_Ax2 xdir(p1, norm); + + xdir.Rotate(normaxis,AngleXU); + + try { + GC_MakeHyperbola mc(xdir, MajorRadius, MinorRadius); + if (!mc.IsDone()) + throw Base::Exception(gce_ErrorStatusText(mc.Status())); + + this->myCurve = mc.Value(); + } + catch (Standard_Failure) { + Handle_Standard_Failure e = Standard_Failure::Caught(); + throw Base::Exception(e->GetMessageString()); + } +} PyObject *GeomHyperbola::getPyObject(void) { return new HyperbolaPy((GeomHyperbola*)this->clone()); } +// ------------------------------------------------- +TYPESYSTEM_SOURCE(Part::GeomArcOfHyperbola,Part::GeomCurve); + +GeomArcOfHyperbola::GeomArcOfHyperbola() +{ + gp_Ax2 ax2 = gp_Ax2(); + Handle_Geom_Hyperbola h = new Geom_Hyperbola(gp_Hypr(ax2, 1,1)); + this->myCurve = new Geom_TrimmedCurve(h, h->FirstParameter(),h->LastParameter()); +} + +GeomArcOfHyperbola::GeomArcOfHyperbola(const Handle_Geom_Hyperbola& h) +{ + this->myCurve = new Geom_TrimmedCurve(h, h->FirstParameter(),h->LastParameter()); +} + +GeomArcOfHyperbola::~GeomArcOfHyperbola() +{ +} + +void GeomArcOfHyperbola::setHandle(const Handle_Geom_TrimmedCurve& c) +{ + Handle_Geom_Hyperbola basis = Handle_Geom_Hyperbola::DownCast(c->BasisCurve()); + if (basis.IsNull()) + Standard_Failure::Raise("Basis curve is not an hyperbola"); + this->myCurve = Handle_Geom_TrimmedCurve::DownCast(c->Copy()); +} + +const Handle_Geom_Geometry& GeomArcOfHyperbola::handle() const +{ + return myCurve; +} + +Geometry *GeomArcOfHyperbola::clone(void) const +{ + GeomArcOfHyperbola* copy = new GeomArcOfHyperbola(); + copy->setHandle(this->myCurve); + copy->Construction = this->Construction; + return copy; +} + +Base::Vector3d GeomArcOfHyperbola::getStartPoint() const +{ + gp_Pnt pnt = this->myCurve->StartPoint(); + return Base::Vector3d(pnt.X(), pnt.Y(), pnt.Z()); +} + +Base::Vector3d GeomArcOfHyperbola::getEndPoint() const +{ + gp_Pnt pnt = this->myCurve->EndPoint(); + return Base::Vector3d(pnt.X(), pnt.Y(), pnt.Z()); +} + +Base::Vector3d GeomArcOfHyperbola::getCenter(void) const +{ + Handle_Geom_Hyperbola h = Handle_Geom_Hyperbola::DownCast(myCurve->BasisCurve()); + gp_Ax1 axis = h->Axis(); + const gp_Pnt& loc = axis.Location(); + return Base::Vector3d(loc.X(),loc.Y(),loc.Z()); +} + +void GeomArcOfHyperbola::setCenter(const Base::Vector3d& Center) +{ + gp_Pnt p1(Center.x,Center.y,Center.z); + Handle_Geom_Hyperbola h = Handle_Geom_Hyperbola::DownCast(myCurve->BasisCurve()); + + try { + h->SetLocation(p1); + } + catch (Standard_Failure) { + Handle_Standard_Failure e = Standard_Failure::Caught(); + throw Base::Exception(e->GetMessageString()); + } +} + +double GeomArcOfHyperbola::getMajorRadius(void) const +{ + Handle_Geom_Hyperbola h = Handle_Geom_Hyperbola::DownCast(myCurve->BasisCurve()); + return h->MajorRadius(); +} + +void GeomArcOfHyperbola::setMajorRadius(double Radius) +{ + Handle_Geom_Hyperbola h = Handle_Geom_Hyperbola::DownCast(myCurve->BasisCurve()); + + try { + h->SetMajorRadius(Radius); + } + catch (Standard_Failure) { + Handle_Standard_Failure e = Standard_Failure::Caught(); + throw Base::Exception(e->GetMessageString()); + } +} + +double GeomArcOfHyperbola::getMinorRadius(void) const +{ + Handle_Geom_Hyperbola h = Handle_Geom_Hyperbola::DownCast(myCurve->BasisCurve()); + return h->MinorRadius(); +} + +void GeomArcOfHyperbola::setMinorRadius(double Radius) +{ + Handle_Geom_Hyperbola h = Handle_Geom_Hyperbola::DownCast(myCurve->BasisCurve()); + + try { + h->SetMinorRadius(Radius); + } + catch (Standard_Failure) { + Handle_Standard_Failure e = Standard_Failure::Caught(); + throw Base::Exception(e->GetMessageString()); + } +} + +double GeomArcOfHyperbola::getAngleXU(void) const +{ + Handle_Geom_Hyperbola h = Handle_Geom_Hyperbola::DownCast(myCurve->BasisCurve()); + + gp_Pnt center = h->Axis().Location(); + gp_Dir normal = h->Axis().Direction(); + gp_Dir xdir = h->XAxis().Direction(); + + gp_Ax2 xdirref(center, normal); // this is a reference system, might be CCW or CW depending on the creation method + + return -xdir.AngleWithRef(xdirref.XDirection(),normal); + +} + +void GeomArcOfHyperbola::setAngleXU(double angle) +{ + Handle_Geom_Hyperbola h = Handle_Geom_Hyperbola::DownCast(myCurve->BasisCurve()); + + try { + gp_Pnt center = h->Axis().Location(); + gp_Dir normal = h->Axis().Direction(); + + gp_Ax1 normaxis(center, normal); + + gp_Ax2 xdirref(center, normal); + + xdirref.Rotate(normaxis,angle); + + h->SetPosition(xdirref); + + } + catch (Standard_Failure) { + Handle_Standard_Failure e = Standard_Failure::Caught(); + throw Base::Exception(e->GetMessageString()); + } +} + +void GeomArcOfHyperbola::getRange(double& u, double& v) const +{ + u = myCurve->FirstParameter(); + v = myCurve->LastParameter(); +} + +void GeomArcOfHyperbola::setRange(double u, double v) +{ + try { + myCurve->SetTrim(u, v); + } + catch (Standard_Failure) { + Handle_Standard_Failure e = Standard_Failure::Caught(); + throw Base::Exception(e->GetMessageString()); + } +} + +// Persistence implementer +unsigned int GeomArcOfHyperbola::getMemSize (void) const +{ + return sizeof(Geom_Hyperbola) + 2 *sizeof(double); +} + +void GeomArcOfHyperbola::Save(Base::Writer &writer) const +{ + // save the attributes of the father class + GeomCurve::Save(writer); + + Handle_Geom_Hyperbola h = Handle_Geom_Hyperbola::DownCast(this->myCurve->BasisCurve()); + + gp_Pnt center = h->Axis().Location(); + gp_Dir normal = h->Axis().Direction(); + gp_Dir xdir = h->XAxis().Direction(); + + gp_Ax2 xdirref(center, normal); // this is a reference XY for the ellipse + + double AngleXU = -xdir.AngleWithRef(xdirref.XDirection(),normal); + + writer.Stream() + << writer.ind() + << "MajorRadius() << "\" " + << "MinorRadius=\"" << h->MinorRadius() << "\" " + << "AngleXU=\"" << AngleXU << "\" " + << "StartAngle=\"" << this->myCurve->FirstParameter() << "\" " + << "EndAngle=\"" << this->myCurve->LastParameter() << "\" " + << "/>" << endl; +} + +void GeomArcOfHyperbola::Restore(Base::XMLReader &reader) +{ + // read the attributes of the father class + GeomCurve::Restore(reader); + + double CenterX,CenterY,CenterZ,NormalX,NormalY,NormalZ,MajorRadius,MinorRadius,AngleXU,StartAngle,EndAngle; + // read my Element + reader.readElement("ArcOfHyperbola"); + // get the value of my Attribute + CenterX = reader.getAttributeAsFloat("CenterX"); + CenterY = reader.getAttributeAsFloat("CenterY"); + CenterZ = reader.getAttributeAsFloat("CenterZ"); + NormalX = reader.getAttributeAsFloat("NormalX"); + NormalY = reader.getAttributeAsFloat("NormalY"); + NormalZ = reader.getAttributeAsFloat("NormalZ"); + MajorRadius = reader.getAttributeAsFloat("MajorRadius"); + MinorRadius = reader.getAttributeAsFloat("MinorRadius"); + AngleXU = reader.getAttributeAsFloat("AngleXU"); + StartAngle = reader.getAttributeAsFloat("StartAngle"); + EndAngle = reader.getAttributeAsFloat("EndAngle"); + + + // set the read geometry + gp_Pnt p1(CenterX,CenterY,CenterZ); + gp_Dir norm(NormalX,NormalY,NormalZ); + + gp_Ax1 normaxis(p1,norm); + + gp_Ax2 xdir(p1, norm); + + xdir.Rotate(normaxis,AngleXU); + + try { + GC_MakeHyperbola mc(xdir, MajorRadius, MinorRadius); + if (!mc.IsDone()) + throw Base::Exception(gce_ErrorStatusText(mc.Status())); + + GC_MakeArcOfHyperbola ma(mc.Value()->Hypr(), StartAngle, EndAngle, 1); + if (!ma.IsDone()) + throw Base::Exception(gce_ErrorStatusText(ma.Status())); + + Handle_Geom_TrimmedCurve tmpcurve = ma.Value(); + Handle_Geom_Hyperbola tmphyperbola = Handle_Geom_Hyperbola::DownCast(tmpcurve->BasisCurve()); + Handle_Geom_Hyperbola hyperbola = Handle_Geom_Hyperbola::DownCast(this->myCurve->BasisCurve()); + + hyperbola->SetHypr(tmphyperbola->Hypr()); + this->myCurve->SetTrim(tmpcurve->FirstParameter(), tmpcurve->LastParameter()); + } + catch (Standard_Failure) { + Handle_Standard_Failure e = Standard_Failure::Caught(); + throw Base::Exception(e->GetMessageString()); + } +} + +PyObject *GeomArcOfHyperbola::getPyObject(void) +{ + return new ArcOfHyperbolaPy(static_cast(this->clone())); +} // ------------------------------------------------- TYPESYSTEM_SOURCE(Part::GeomParabola,Part::GeomCurve); diff --git a/src/Mod/Part/App/Geometry.h b/src/Mod/Part/App/Geometry.h index 6bccc24940..0924b99530 100644 --- a/src/Mod/Part/App/Geometry.h +++ b/src/Mod/Part/App/Geometry.h @@ -307,6 +307,15 @@ public: GeomHyperbola(const Handle_Geom_Hyperbola&); virtual ~GeomHyperbola(); virtual Geometry *clone(void) const; + + Base::Vector3d getCenter(void) const; + void setCenter(const Base::Vector3d& Center); + double getMajorRadius(void) const; + void setMajorRadius(double Radius); + double getMinorRadius(void) const; + void setMinorRadius(double Radius); + double getAngleXU(void) const; + void setAngleXU(double angle); // Persistence implementer --------------------- virtual unsigned int getMemSize(void) const; @@ -321,6 +330,44 @@ private: Handle_Geom_Hyperbola myCurve; }; +class PartExport GeomArcOfHyperbola : public GeomCurve +{ + TYPESYSTEM_HEADER(); +public: + GeomArcOfHyperbola(); + GeomArcOfHyperbola(const Handle_Geom_Hyperbola&); + virtual ~GeomArcOfHyperbola(); + virtual Geometry *clone(void) const; + + Base::Vector3d getStartPoint() const; + Base::Vector3d getEndPoint() const; + + Base::Vector3d getCenter(void) const; + void setCenter(const Base::Vector3d& Center); + double getMajorRadius(void) const; + void setMajorRadius(double Radius); + double getMinorRadius(void) const; + void setMinorRadius(double Radius); + double getAngleXU(void) const; + void setAngleXU(double angle); + + void getRange(double& u, double& v) const; + void setRange(double u, double v); + + // Persistence implementer --------------------- + virtual unsigned int getMemSize(void) const; + virtual void Save(Base::Writer &/*writer*/) const; + virtual void Restore(Base::XMLReader &/*reader*/); + // Base implementer ---------------------------- + virtual PyObject *getPyObject(void); + + void setHandle(const Handle_Geom_TrimmedCurve&); + const Handle_Geom_Geometry& handle() const; + +private: + Handle_Geom_TrimmedCurve myCurve; +}; + class PartExport GeomParabola : public GeomCurve { TYPESYSTEM_HEADER(); diff --git a/src/Mod/Part/App/HyperbolaPy.xml b/src/Mod/Part/App/HyperbolaPy.xml index dbb69e0328..0f851aa2fe 100644 --- a/src/Mod/Part/App/HyperbolaPy.xml +++ b/src/Mod/Part/App/HyperbolaPy.xml @@ -1,80 +1,39 @@ - + - - Describes a hyperbola in 3D space - To create a hyperbola there are several ways: + Describes an hyperbola in 3D space + To create an hyperbola there are several ways: Part.Hyperbola() - Creates a hyperbola with major radius 2 and minor radius 1 with the + Creates an hyperbola with major radius 2 and minor radius 1 with the center in (0,0,0) Part.Hyperbola(Hyperbola) Create a copy of the given hyperbola Part.Hyperbola(S1,S2,Center) - Creates a hyperbola centered on the point Center, where + Creates an hyperbola centered on the point Center, where the plane of the hyperbola is defined by Center, S1 and S2, its major axis is defined by Center and S1, its major radius is the distance between Center and S1, and its minor radius is the distance between S2 and the major axis. Part.Hyperbola(Center,MajorRadius,MinorRadius) - Creates a hyperbola with major and minor radii MajorRadius and + Creates an hyperbola with major and minor radii MajorRadius and MinorRadius, and located in the plane defined by Center and the normal (0,0,1) - - - Computes the eccentricity of this hyperbola, which is a value greater than 1. -The eccentricity is: -e = f / MajorRadius -where f is the focal distance of this hyperbola. - - - - - - The focal distance is the distance between -the center and a focus of the hyperbola - - - - - - The first focus is on the positive side of the -'X Axis' (major axis) of the hyperbola; -the second focus is on the negative side. - - - - - - The first focus is on the positive side of the -'X Axis' (major axis) of the hyperbola; -the second focus is on the negative side. - - - - - - Compute the parameter of this hyperbola -which is the distance between its focus -and its directrix. This distance is twice the focal length. - - - - The major radius of the hyperbola. @@ -87,11 +46,46 @@ and its directrix. This distance is twice the focal length. - + + + The angle between the X axis and the major axis of the hyperbola. + + + + - Location of the hyperbola + The eccentricity of the hyperbola. - + + + + + The focal distance of the hyperbola. + + + + + + The first focus is on the positive side of the major axis of the hyperbola; +the second focus is on the negative side. + + + + + + + The first focus is on the positive side of the major axis of the hyperbola; +the second focus is on the negative side. + + + + + + + + Center of the hyperbola. + + diff --git a/src/Mod/Part/App/HyperbolaPyImp.cpp b/src/Mod/Part/App/HyperbolaPyImp.cpp index 6688fd4c98..6aa87784fb 100644 --- a/src/Mod/Part/App/HyperbolaPyImp.cpp +++ b/src/Mod/Part/App/HyperbolaPyImp.cpp @@ -23,13 +23,13 @@ #include "PreCompiled.h" #ifndef _PreComp_ +# include # include # include -# include #endif -#include #include +#include #include "OCCError.h" #include "Geometry.h" @@ -57,9 +57,9 @@ int HyperbolaPy::PyInit(PyObject* args, PyObject* kwds) { char* keywords_n[] = {NULL}; if (PyArg_ParseTupleAndKeywords(args, kwds, "", keywords_n)) { - Handle_Geom_Hyperbola hypr = Handle_Geom_Hyperbola::DownCast(getGeometryPtr()->handle()); - hypr->SetMajorRadius(2.0); - hypr->SetMinorRadius(1.0); + Handle_Geom_Hyperbola hyperbola = Handle_Geom_Hyperbola::DownCast(getGeomHyperbolaPtr()->handle()); + hyperbola->SetMajorRadius(2.0); + hyperbola->SetMinorRadius(1.0); return 0; } @@ -67,11 +67,11 @@ int HyperbolaPy::PyInit(PyObject* args, PyObject* kwds) PyErr_Clear(); PyObject *pHypr; if (PyArg_ParseTupleAndKeywords(args, kwds, "O!",keywords_e, &(HyperbolaPy::Type), &pHypr)) { - HyperbolaPy* pH = static_cast(pHypr); + HyperbolaPy* pHyperbola = static_cast(pHypr); Handle_Geom_Hyperbola Hypr1 = Handle_Geom_Hyperbola::DownCast - (pH->getGeometryPtr()->handle()); + (pHyperbola->getGeomHyperbolaPtr()->handle()); Handle_Geom_Hyperbola Hypr2 = Handle_Geom_Hyperbola::DownCast - (this->getGeometryPtr()->handle()); + (this->getGeomHyperbolaPtr()->handle()); Hypr2->SetHypr(Hypr1->Hypr()); return 0; } @@ -86,16 +86,16 @@ int HyperbolaPy::PyInit(PyObject* args, PyObject* kwds) Base::Vector3d v1 = static_cast(pV1)->value(); Base::Vector3d v2 = static_cast(pV2)->value(); Base::Vector3d v3 = static_cast(pV3)->value(); - GC_MakeHyperbola mh(gp_Pnt(v1.x,v1.y,v1.z), - gp_Pnt(v2.x,v2.y,v2.z), - gp_Pnt(v3.x,v3.y,v3.z)); - if (!mh.IsDone()) { - PyErr_SetString(PartExceptionOCCError, gce_ErrorStatusText(mh.Status())); + GC_MakeHyperbola me(gp_Pnt(v1.x,v1.y,v1.z), + gp_Pnt(v2.x,v2.y,v2.z), + gp_Pnt(v3.x,v3.y,v3.z)); + if (!me.IsDone()) { + PyErr_SetString(PartExceptionOCCError, gce_ErrorStatusText(me.Status())); return -1; } - Handle_Geom_Hyperbola hyperb = Handle_Geom_Hyperbola::DownCast(getGeometryPtr()->handle()); - hyperb->SetHypr(mh.Value()->Hypr()); + Handle_Geom_Hyperbola hyperbola = Handle_Geom_Hyperbola::DownCast(getGeomHyperbolaPtr()->handle()); + hyperbola->SetHypr(me.Value()->Hypr()); return 0; } @@ -107,15 +107,15 @@ int HyperbolaPy::PyInit(PyObject* args, PyObject* kwds) &(Base::VectorPy::Type), &pV, &major, &minor)) { Base::Vector3d c = static_cast(pV)->value(); - GC_MakeHyperbola mh(gp_Ax2(gp_Pnt(c.x,c.y,c.z), gp_Dir(0.0,0.0,1.0)), + GC_MakeHyperbola me(gp_Ax2(gp_Pnt(c.x,c.y,c.z), gp_Dir(0.0,0.0,1.0)), major, minor); - if (!mh.IsDone()) { - PyErr_SetString(PartExceptionOCCError, gce_ErrorStatusText(mh.Status())); + if (!me.IsDone()) { + PyErr_SetString(PartExceptionOCCError, gce_ErrorStatusText(me.Status())); return -1; } - Handle_Geom_Hyperbola hyperb = Handle_Geom_Hyperbola::DownCast(getGeometryPtr()->handle()); - hyperb->SetHypr(mh.Value()->Hypr()); + Handle_Geom_Hyperbola hyperbola = Handle_Geom_Hyperbola::DownCast(getGeomHyperbolaPtr()->handle()); + hyperbola->SetHypr(me.Value()->Hypr()); return 0; } @@ -127,90 +127,111 @@ int HyperbolaPy::PyInit(PyObject* args, PyObject* kwds) return -1; } +Py::Float HyperbolaPy::getMajorRadius(void) const +{ + 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()); + hyperbola->SetMajorRadius((double)arg); +} + +Py::Float HyperbolaPy::getMinorRadius(void) const +{ + 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()); + hyperbola->SetMinorRadius((double)arg); +} + +Py::Float HyperbolaPy::getAngleXU(void) const +{ + Handle_Geom_Hyperbola hyperbola = Handle_Geom_Hyperbola::DownCast(getGeomHyperbolaPtr()->handle()); + + gp_Pnt center = hyperbola->Axis().Location(); + gp_Dir normal = hyperbola->Axis().Direction(); + gp_Dir xdir = hyperbola->XAxis().Direction(); + + gp_Ax2 xdirref(center, normal); // this is a reference system, might be CCW or CW depending on the creation method + + return Py::Float(-xdir.AngleWithRef(xdirref.XDirection(),normal)); + +} + +void HyperbolaPy::setAngleXU(Py::Float arg) +{ + Handle_Geom_Hyperbola hyperbola = Handle_Geom_Hyperbola::DownCast(getGeomHyperbolaPtr()->handle()); + + + gp_Pnt center = hyperbola->Axis().Location(); + gp_Dir normal = hyperbola->Axis().Direction(); + + gp_Ax1 normaxis(center, normal); + + gp_Ax2 xdirref(center, normal); + + xdirref.Rotate(normaxis,arg); + + hyperbola->SetPosition(xdirref); + +} + Py::Float HyperbolaPy::getEccentricity(void) const { - Handle_Geom_Hyperbola curve = Handle_Geom_Hyperbola::DownCast(getGeometryPtr()->handle()); - return Py::Float(curve->Eccentricity()); + Handle_Geom_Hyperbola hyperbola = Handle_Geom_Hyperbola::DownCast(getGeomHyperbolaPtr()->handle()); + return Py::Float(hyperbola->Eccentricity()); } Py::Float HyperbolaPy::getFocal(void) const { - Handle_Geom_Hyperbola curve = Handle_Geom_Hyperbola::DownCast(getGeometryPtr()->handle()); - return Py::Float(curve->Focal()); + Handle_Geom_Hyperbola hyperbola = Handle_Geom_Hyperbola::DownCast(getGeomHyperbolaPtr()->handle()); + return Py::Float(hyperbola->Focal()); } Py::Object HyperbolaPy::getFocus1(void) const { - Handle_Geom_Hyperbola c = Handle_Geom_Hyperbola::DownCast - (getGeometryPtr()->handle()); - gp_Pnt loc = c->Focus1(); + 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 c = Handle_Geom_Hyperbola::DownCast - (getGeometryPtr()->handle()); - gp_Pnt loc = c->Focus2(); + 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())); } -Py::Float HyperbolaPy::getParameter(void) const +Py::Object HyperbolaPy::getCenter(void) const { - Handle_Geom_Hyperbola curve = Handle_Geom_Hyperbola::DownCast(getGeometryPtr()->handle()); - return Py::Float(curve->Parameter()); -} - -Py::Float HyperbolaPy::getMajorRadius(void) const -{ - Handle_Geom_Hyperbola curve = Handle_Geom_Hyperbola::DownCast(getGeometryPtr()->handle()); - return Py::Float(curve->MajorRadius()); -} - -void HyperbolaPy::setMajorRadius(Py::Float arg) -{ - Handle_Geom_Hyperbola curve = Handle_Geom_Hyperbola::DownCast(getGeometryPtr()->handle()); - curve->SetMajorRadius((double)arg); -} - -Py::Float HyperbolaPy::getMinorRadius(void) const -{ - Handle_Geom_Hyperbola curve = Handle_Geom_Hyperbola::DownCast(getGeometryPtr()->handle()); - return Py::Float(curve->MinorRadius()); -} - -void HyperbolaPy::setMinorRadius(Py::Float arg) -{ - Handle_Geom_Hyperbola curve = Handle_Geom_Hyperbola::DownCast(getGeometryPtr()->handle()); - curve->SetMinorRadius((double)arg); -} - -Py::Object HyperbolaPy::getLocation(void) const -{ - Handle_Geom_Hyperbola c = Handle_Geom_Hyperbola::DownCast - (getGeometryPtr()->handle()); - gp_Pnt loc = c->Location(); + Handle_Geom_Hyperbola hyperbola = Handle_Geom_Hyperbola::DownCast(getGeomHyperbolaPtr()->handle()); + gp_Pnt loc = hyperbola->Location(); return Py::Vector(Base::Vector3d(loc.X(), loc.Y(), loc.Z())); } -void HyperbolaPy::setLocation(Py::Object arg) +void HyperbolaPy::setCenter(Py::Object arg) { PyObject* p = arg.ptr(); if (PyObject_TypeCheck(p, &(Base::VectorPy::Type))) { Base::Vector3d loc = static_cast(p)->value(); - Handle_Geom_Hyperbola c = Handle_Geom_Hyperbola::DownCast - (getGeometryPtr()->handle()); - c->SetLocation(gp_Pnt(loc.x, loc.y, loc.z)); + Handle_Geom_Hyperbola hyperbola = Handle_Geom_Hyperbola::DownCast(getGeomHyperbolaPtr()->handle()); + hyperbola->SetLocation(gp_Pnt(loc.x, loc.y, loc.z)); } else if (PyTuple_Check(p)) { - gp_Pnt loc; Py::Tuple tuple(arg); + gp_Pnt loc; loc.SetX((double)Py::Float(tuple.getItem(0))); loc.SetY((double)Py::Float(tuple.getItem(1))); loc.SetZ((double)Py::Float(tuple.getItem(2))); - Handle_Geom_Hyperbola c = Handle_Geom_Hyperbola::DownCast - (getGeometryPtr()->handle()); - c->SetLocation(loc); + Handle_Geom_Hyperbola hyperbola = Handle_Geom_Hyperbola::DownCast(getGeomHyperbolaPtr()->handle()); + hyperbola->SetLocation(loc); } else { std::string error = std::string("type must be 'Vector', not "); @@ -221,41 +242,34 @@ void HyperbolaPy::setLocation(Py::Object arg) Py::Object HyperbolaPy::getAxis(void) const { - Handle_Geom_Hyperbola c = Handle_Geom_Hyperbola::DownCast - (getGeometryPtr()->handle()); - gp_Dir dir = c->Axis().Direction(); + Handle_Geom_Hyperbola hyperbola = Handle_Geom_Hyperbola::DownCast(getGeomHyperbolaPtr()->handle()); + gp_Ax1 axis = hyperbola->Axis(); + gp_Dir dir = axis.Direction(); return Py::Vector(Base::Vector3d(dir.X(), dir.Y(), dir.Z())); } void HyperbolaPy::setAxis(Py::Object arg) { - Standard_Real dir_x, dir_y, dir_z; - PyObject *p = arg.ptr(); + PyObject* p = arg.ptr(); + Base::Vector3d val; if (PyObject_TypeCheck(p, &(Base::VectorPy::Type))) { - Base::Vector3d v = static_cast(p)->value(); - dir_x = v.x; - dir_y = v.y; - dir_z = v.z; + val = static_cast(p)->value(); } else if (PyTuple_Check(p)) { - Py::Tuple tuple(arg); - dir_x = (double)Py::Float(tuple.getItem(0)); - dir_y = (double)Py::Float(tuple.getItem(1)); - dir_z = (double)Py::Float(tuple.getItem(2)); + val = Base::getVectorFromTuple(p); } else { - std::string error = std::string("type must be 'Vector' or tuple, not "); + std::string error = std::string("type must be 'Vector', not "); error += p->ob_type->tp_name; throw Py::TypeError(error); } + Handle_Geom_Hyperbola hyperbola = Handle_Geom_Hyperbola::DownCast(getGeomHyperbolaPtr()->handle()); try { - Handle_Geom_Hyperbola this_curv = Handle_Geom_Hyperbola::DownCast - (this->getGeometryPtr()->handle()); gp_Ax1 axis; - axis.SetLocation(this_curv->Location()); - axis.SetDirection(gp_Dir(dir_x, dir_y, dir_z)); - this_curv->SetAxis(axis); + axis.SetLocation(hyperbola->Location()); + axis.SetDirection(gp_Dir(val.x, val.y, val.z)); + hyperbola->SetAxis(axis); } catch (Standard_Failure) { throw Py::Exception("cannot set axis"); @@ -271,5 +285,3 @@ int HyperbolaPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/) { return 0; } - - diff --git a/src/Mod/Part/App/OpenCascadeAll.h b/src/Mod/Part/App/OpenCascadeAll.h index 7e5630ede4..8f40ff73e0 100644 --- a/src/Mod/Part/App/OpenCascadeAll.h +++ b/src/Mod/Part/App/OpenCascadeAll.h @@ -173,6 +173,7 @@ #include #include #include +#include #include #include #include