Part: modernize C++11
* use nullptr
This commit is contained in:
@@ -94,7 +94,7 @@ PyObject *GeometryCurvePy::PyMake(struct _typeobject *, PyObject *, PyObject *)
|
||||
// never create such objects with the constructor
|
||||
PyErr_SetString(PyExc_RuntimeError,
|
||||
"You cannot create an instance of the abstract class 'GeometryCurve'.");
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// constructor method
|
||||
@@ -113,7 +113,7 @@ PyObject* GeometryCurvePy::toShape(PyObject *args)
|
||||
u=c->FirstParameter();
|
||||
v=c->LastParameter();
|
||||
if (!PyArg_ParseTuple(args, "|dd", &u,&v))
|
||||
return 0;
|
||||
return nullptr;
|
||||
BRepBuilderAPI_MakeEdge mkBuilder(c, u, v);
|
||||
TopoDS_Shape sh = mkBuilder.Shape();
|
||||
return new TopoShapeEdgePy(new TopoShape(sh));
|
||||
@@ -121,11 +121,11 @@ PyObject* GeometryCurvePy::toShape(PyObject *args)
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
PyErr_SetString(PartExceptionOCCError, "Geometry is not a curve");
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
PyObject* GeometryCurvePy::discretize(PyObject *args, PyObject *kwds)
|
||||
@@ -135,7 +135,7 @@ PyObject* GeometryCurvePy::discretize(PyObject *args, PyObject *kwds)
|
||||
Handle(Geom_Curve) c = Handle(Geom_Curve)::DownCast(g);
|
||||
if (c.IsNull()) {
|
||||
PyErr_SetString(PartExceptionOCCError, "Geometry is not a curve");
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
GeomAdaptor_Curve adapt(c);
|
||||
@@ -159,19 +159,19 @@ PyObject* GeometryCurvePy::discretize(PyObject *args, PyObject *kwds)
|
||||
}
|
||||
else {
|
||||
PyErr_SetString(PyExc_TypeError, "Either int or float expected");
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// use Number kwds
|
||||
static char* kwds_numPoints[] = {"Number","First","Last",NULL};
|
||||
static char* kwds_numPoints[] = {"Number","First","Last",nullptr};
|
||||
PyErr_Clear();
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "i|dd", kwds_numPoints, &numPoints, &first, &last)) {
|
||||
uniformAbscissaPoints = true;
|
||||
}
|
||||
else {
|
||||
// use Abscissa kwds
|
||||
static char* kwds_Distance[] = {"Distance","First","Last",NULL};
|
||||
static char* kwds_Distance[] = {"Distance","First","Last",nullptr};
|
||||
PyErr_Clear();
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "d|dd", kwds_Distance, &distance, &first, &last)) {
|
||||
uniformAbscissaDistance = true;
|
||||
@@ -198,12 +198,12 @@ PyObject* GeometryCurvePy::discretize(PyObject *args, PyObject *kwds)
|
||||
}
|
||||
else {
|
||||
PyErr_SetString(PartExceptionOCCError, "Discretization of curve failed");
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
// use Deflection kwds
|
||||
static char* kwds_Deflection[] = {"Deflection","First","Last",NULL};
|
||||
static char* kwds_Deflection[] = {"Deflection","First","Last",nullptr};
|
||||
PyErr_Clear();
|
||||
double deflection;
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "d|dd", kwds_Deflection, &deflection, &first, &last)) {
|
||||
@@ -220,12 +220,12 @@ PyObject* GeometryCurvePy::discretize(PyObject *args, PyObject *kwds)
|
||||
}
|
||||
else {
|
||||
PyErr_SetString(PartExceptionOCCError, "Discretization of curve failed");
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
// use TangentialDeflection kwds
|
||||
static char* kwds_TangentialDeflection[] = {"Angular","Curvature","First","Last","Minimum",NULL};
|
||||
static char* kwds_TangentialDeflection[] = {"Angular","Curvature","First","Last","Minimum",nullptr};
|
||||
PyErr_Clear();
|
||||
double angular;
|
||||
double curvature;
|
||||
@@ -244,12 +244,12 @@ PyObject* GeometryCurvePy::discretize(PyObject *args, PyObject *kwds)
|
||||
}
|
||||
else {
|
||||
PyErr_SetString(PartExceptionOCCError, "Discretization of curve failed");
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
// use QuasiNumber kwds
|
||||
static char* kwds_QuasiNumPoints[] = {"QuasiNumber","First","Last",NULL};
|
||||
static char* kwds_QuasiNumPoints[] = {"QuasiNumber","First","Last",nullptr};
|
||||
PyErr_Clear();
|
||||
int quasiNumPoints;
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "i|dd", kwds_QuasiNumPoints, &quasiNumPoints, &first, &last)) {
|
||||
@@ -266,12 +266,12 @@ PyObject* GeometryCurvePy::discretize(PyObject *args, PyObject *kwds)
|
||||
}
|
||||
else {
|
||||
PyErr_SetString(PartExceptionOCCError, "Discretization of curve failed");
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
// use QuasiDeflection kwds
|
||||
static char* kwds_QuasiDeflection[] = {"QuasiDeflection","First","Last",NULL};
|
||||
static char* kwds_QuasiDeflection[] = {"QuasiDeflection","First","Last",nullptr};
|
||||
PyErr_Clear();
|
||||
double quasiDeflection;
|
||||
if (PyArg_ParseTupleAndKeywords(args, kwds, "d|dd", kwds_QuasiDeflection, &quasiDeflection, &first, &last)) {
|
||||
@@ -288,17 +288,17 @@ PyObject* GeometryCurvePy::discretize(PyObject *args, PyObject *kwds)
|
||||
}
|
||||
else {
|
||||
PyErr_SetString(PartExceptionOCCError, "Discretization of curve failed");
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
PyErr_SetString(PartExceptionOCCError, e.what());
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
PyErr_SetString(PartExceptionOCCError,"Wrong arguments");
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
PyObject* GeometryCurvePy::length(PyObject *args)
|
||||
@@ -311,7 +311,7 @@ PyObject* GeometryCurvePy::length(PyObject *args)
|
||||
double v=c->LastParameter();
|
||||
double t=Precision::Confusion();
|
||||
if (!PyArg_ParseTuple(args, "|ddd", &u,&v,&t))
|
||||
return 0;
|
||||
return nullptr;
|
||||
GeomAdaptor_Curve adapt(c);
|
||||
double len = GCPnts_AbscissaPoint::Length(adapt,u,v,t);
|
||||
return PyFloat_FromDouble(len);
|
||||
@@ -319,11 +319,11 @@ PyObject* GeometryCurvePy::length(PyObject *args)
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
PyErr_SetString(PartExceptionOCCError, "Geometry is not a curve");
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
PyObject* GeometryCurvePy::parameterAtDistance(PyObject *args)
|
||||
@@ -335,7 +335,7 @@ PyObject* GeometryCurvePy::parameterAtDistance(PyObject *args)
|
||||
double abscissa;
|
||||
double u = 0;
|
||||
if (!PyArg_ParseTuple(args, "d|d", &abscissa,&u))
|
||||
return 0;
|
||||
return nullptr;
|
||||
GeomAdaptor_Curve adapt(c);
|
||||
GCPnts_AbscissaPoint abscissaPoint(adapt,abscissa,u);
|
||||
double parm = abscissaPoint.Parameter();
|
||||
@@ -344,11 +344,11 @@ PyObject* GeometryCurvePy::parameterAtDistance(PyObject *args)
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
PyErr_SetString(PartExceptionOCCError, "Geometry is not a curve");
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
PyObject* GeometryCurvePy::getD0(PyObject *args)
|
||||
@@ -489,18 +489,18 @@ PyObject* GeometryCurvePy::value(PyObject *args)
|
||||
if (!c.IsNull()) {
|
||||
double u;
|
||||
if (!PyArg_ParseTuple(args, "d", &u))
|
||||
return 0;
|
||||
return nullptr;
|
||||
gp_Pnt p = c->Value(u);
|
||||
return new Base::VectorPy(Base::Vector3d(p.X(),p.Y(),p.Z()));
|
||||
}
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
PyErr_SetString(PartExceptionOCCError, "Geometry is not a curve");
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
PyObject* GeometryCurvePy::tangent(PyObject *args)
|
||||
@@ -511,7 +511,7 @@ PyObject* GeometryCurvePy::tangent(PyObject *args)
|
||||
if (!c.IsNull()) {
|
||||
double u;
|
||||
if (!PyArg_ParseTuple(args, "d", &u))
|
||||
return 0;
|
||||
return nullptr;
|
||||
gp_Dir dir;
|
||||
Py::Tuple tuple(1);
|
||||
GeomLProp_CLProps prop(c,u,2,Precision::Confusion());
|
||||
@@ -525,11 +525,11 @@ PyObject* GeometryCurvePy::tangent(PyObject *args)
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
PyErr_SetString(PartExceptionOCCError, "Geometry is not a curve");
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
PyObject* GeometryCurvePy::normal(PyObject *args)
|
||||
@@ -540,7 +540,7 @@ PyObject* GeometryCurvePy::normal(PyObject *args)
|
||||
if (!c.IsNull()) {
|
||||
double u;
|
||||
if (!PyArg_ParseTuple(args, "d", &u))
|
||||
return 0;
|
||||
return nullptr;
|
||||
gp_Dir dir;
|
||||
GeomLProp_CLProps prop(c,u,2,Precision::Confusion());
|
||||
prop.Normal(dir);
|
||||
@@ -549,11 +549,11 @@ PyObject* GeometryCurvePy::normal(PyObject *args)
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
PyErr_SetString(PartExceptionOCCError, "Geometry is not a curve");
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
PyObject* GeometryCurvePy::curvature(PyObject *args)
|
||||
@@ -564,7 +564,7 @@ PyObject* GeometryCurvePy::curvature(PyObject *args)
|
||||
if (!c.IsNull()) {
|
||||
double u;
|
||||
if (!PyArg_ParseTuple(args, "d", &u))
|
||||
return 0;
|
||||
return nullptr;
|
||||
GeomLProp_CLProps prop(c,u,2,Precision::Confusion());
|
||||
double C = prop.Curvature();
|
||||
return Py::new_reference_to(Py::Float(C));
|
||||
@@ -572,11 +572,11 @@ PyObject* GeometryCurvePy::curvature(PyObject *args)
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
PyErr_SetString(PartExceptionOCCError, "Geometry is not a curve");
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
PyObject* GeometryCurvePy::centerOfCurvature(PyObject *args)
|
||||
@@ -587,7 +587,7 @@ PyObject* GeometryCurvePy::centerOfCurvature(PyObject *args)
|
||||
if (!c.IsNull()) {
|
||||
double u;
|
||||
if (!PyArg_ParseTuple(args, "d", &u))
|
||||
return 0;
|
||||
return nullptr;
|
||||
GeomLProp_CLProps prop(c,u,2,Precision::Confusion());
|
||||
gp_Pnt V ;
|
||||
prop.CentreOfCurvature(V);
|
||||
@@ -596,11 +596,11 @@ PyObject* GeometryCurvePy::centerOfCurvature(PyObject *args)
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
PyErr_SetString(PartExceptionOCCError, "Geometry is not a curve");
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
PyObject* GeometryCurvePy::parameter(PyObject *args)
|
||||
@@ -608,7 +608,7 @@ PyObject* GeometryCurvePy::parameter(PyObject *args)
|
||||
try {
|
||||
PyObject *p;
|
||||
if (!PyArg_ParseTuple(args, "O!", &(Base::VectorPy::Type), &p))
|
||||
return 0;
|
||||
return nullptr;
|
||||
Base::Vector3d v = Py::Vector(p, false).toVector();
|
||||
|
||||
double u;
|
||||
@@ -618,18 +618,18 @@ PyObject* GeometryCurvePy::parameter(PyObject *args)
|
||||
}
|
||||
catch (Base::CADKernelError& e) {
|
||||
PyErr_SetString(PartExceptionOCCError, e.what());
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
PyErr_SetString(PartExceptionOCCError, "Geometry is not a curve");
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
PyObject* GeometryCurvePy::makeRuledSurface(PyObject *args)
|
||||
{
|
||||
PyObject* curve;
|
||||
if (!PyArg_ParseTuple(args, "O!", &(Part::GeometryCurvePy::Type), &curve))
|
||||
return 0;
|
||||
return nullptr;
|
||||
|
||||
try {
|
||||
Handle(Geom_Curve) aCrv1 = Handle(Geom_Curve)::DownCast(getGeometryPtr()->handle());
|
||||
@@ -638,7 +638,7 @@ PyObject* GeometryCurvePy::makeRuledSurface(PyObject *args)
|
||||
Handle(Geom_Surface) aSurf = GeomFill::Surface (aCrv1, aCrv2);
|
||||
if (aSurf.IsNull()) {
|
||||
PyErr_SetString(PartExceptionOCCError, "Failed to create ruled surface");
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
// check the result surface type
|
||||
if (aSurf->IsKind(STANDARD_TYPE(Geom_RectangularTrimmedSurface))) {
|
||||
@@ -654,12 +654,12 @@ PyObject* GeometryCurvePy::makeRuledSurface(PyObject *args)
|
||||
else {
|
||||
PyErr_Format(PyExc_NotImplementedError, "Ruled surface is of type '%s'",
|
||||
aSurf->DynamicType()->Name());
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -668,7 +668,7 @@ PyObject* GeometryCurvePy::intersect2d(PyObject *args)
|
||||
PyObject *c,*p;
|
||||
if (!PyArg_ParseTuple(args, "O!O!", &(Part::GeometryCurvePy::Type), &c,
|
||||
&(Part::PlanePy::Type), &p))
|
||||
return 0;
|
||||
return nullptr;
|
||||
|
||||
try {
|
||||
Handle(Geom_Curve) self = Handle(Geom_Curve)::DownCast(getGeometryPtr()->handle());
|
||||
@@ -708,7 +708,7 @@ PyObject* GeometryCurvePy::intersect2d(PyObject *args)
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -722,18 +722,18 @@ PyObject* GeometryCurvePy::toBSpline(PyObject * args)
|
||||
u=c->FirstParameter();
|
||||
v=c->LastParameter();
|
||||
if (!PyArg_ParseTuple(args, "|dd", &u,&v))
|
||||
return 0;
|
||||
return nullptr;
|
||||
GeomBSplineCurve* spline = getGeomCurvePtr()->toBSpline(u, v);
|
||||
return new BSplineCurvePy(spline);
|
||||
}
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
PyErr_SetString(PartExceptionOCCError, "Geometry is not a curve");
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
PyObject* GeometryCurvePy::toNurbs(PyObject * args)
|
||||
@@ -746,18 +746,18 @@ PyObject* GeometryCurvePy::toNurbs(PyObject * args)
|
||||
u=c->FirstParameter();
|
||||
v=c->LastParameter();
|
||||
if (!PyArg_ParseTuple(args, "|dd", &u,&v))
|
||||
return 0;
|
||||
return nullptr;
|
||||
GeomBSplineCurve* spline = getGeomCurvePtr()->toNurbs(u, v);
|
||||
return new BSplineCurvePy(spline);
|
||||
}
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
PyErr_SetString(PartExceptionOCCError, "Geometry is not a curve");
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
PyObject* GeometryCurvePy::trim(PyObject * args)
|
||||
@@ -770,17 +770,17 @@ PyObject* GeometryCurvePy::trim(PyObject * args)
|
||||
u=c->FirstParameter();
|
||||
v=c->LastParameter();
|
||||
if (!PyArg_ParseTuple(args, "|dd", &u,&v))
|
||||
return 0;
|
||||
return nullptr;
|
||||
return Py::new_reference_to(makeTrimmedCurvePy(c,u,v));
|
||||
}
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
PyErr_SetString(PartExceptionOCCError, "Geometry is not a curve");
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
PyObject* GeometryCurvePy::approximateBSpline(PyObject *args)
|
||||
@@ -789,7 +789,7 @@ PyObject* GeometryCurvePy::approximateBSpline(PyObject *args)
|
||||
int maxSegment, maxDegree;
|
||||
char* order = "C2";
|
||||
if (!PyArg_ParseTuple(args, "dii|s", &tolerance, &maxSegment, &maxDegree, &order))
|
||||
return 0;
|
||||
return nullptr;
|
||||
|
||||
GeomAbs_Shape absShape;
|
||||
std::string str = order;
|
||||
@@ -820,16 +820,16 @@ PyObject* GeometryCurvePy::approximateBSpline(PyObject *args)
|
||||
std::stringstream str;
|
||||
str << "Maximum error (" << approx.MaxError() << ") is outside tolerance";
|
||||
PyErr_SetString(PyExc_RuntimeError, str.str().c_str());
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
else {
|
||||
PyErr_SetString(PyExc_RuntimeError, "Approximation of curve failed");
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -904,11 +904,11 @@ PyObject* GeometryCurvePy::continuityWith(PyObject *args)
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
PyErr_SetString(PartExceptionOCCError, "Geometry is not a curve");
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Py::String GeometryCurvePy::getContinuity(void) const
|
||||
@@ -959,7 +959,7 @@ Py::Float GeometryCurvePy::getLastParameter(void) const
|
||||
|
||||
PyObject *GeometryCurvePy::getCustomAttributes(const char* /*attr*/) const
|
||||
{
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
int GeometryCurvePy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
|
||||
@@ -977,12 +977,12 @@ PyObject* GeometryCurvePy::intersectCS(PyObject *args)
|
||||
PyObject *p;
|
||||
double prec = Precision::Confusion();
|
||||
if (!PyArg_ParseTuple(args, "O!|d", &(Part::GeometrySurfacePy::Type), &p, &prec))
|
||||
return 0;
|
||||
return nullptr;
|
||||
Handle(Geom_Surface) surf = Handle(Geom_Surface)::DownCast(static_cast<GeometryPy*>(p)->getGeometryPtr()->handle());
|
||||
GeomAPI_IntCS intersector(curve, surf);
|
||||
if (!intersector.IsDone()) {
|
||||
PyErr_SetString(PyExc_RuntimeError, "Intersection of curve and surface failed");
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Py::List points;
|
||||
@@ -1004,11 +1004,11 @@ PyObject* GeometryCurvePy::intersectCS(PyObject *args)
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
PyErr_SetString(PyExc_RuntimeError, e.GetMessageString());
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
PyErr_SetString(PyExc_TypeError, "Geometry is not a curve");
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
PyObject* GeometryCurvePy::intersectCC(PyObject *args)
|
||||
@@ -1016,7 +1016,7 @@ PyObject* GeometryCurvePy::intersectCC(PyObject *args)
|
||||
PyObject *p;
|
||||
double prec = Precision::Confusion();
|
||||
if (!PyArg_ParseTuple(args, "O!|d", &(Part::GeometryCurvePy::Type), &p, &prec))
|
||||
return 0;
|
||||
return nullptr;
|
||||
|
||||
GeomCurve* curve1 = getGeomCurvePtr();
|
||||
GeomCurve* curve2 = static_cast<GeometryCurvePy*>(p)->getGeomCurvePtr();
|
||||
@@ -1037,7 +1037,7 @@ PyObject* GeometryCurvePy::intersectCC(PyObject *args)
|
||||
}
|
||||
catch (Base::Exception& e) {
|
||||
PyErr_SetString(PyExc_RuntimeError, e.what());
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1059,16 +1059,16 @@ PyObject* GeometryCurvePy::intersect(PyObject *args)
|
||||
if (PyArg_ParseTuple(args, "O!|d", &(Part::GeometrySurfacePy::Type), &p, &prec))
|
||||
return intersectCS(args);
|
||||
else
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
PyErr_SetString(PyExc_RuntimeError, e.GetMessageString());
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
PyErr_SetString(PyExc_TypeError, "Geometry is not a curve");
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Py::Object GeometryCurvePy::getRotation(void) const
|
||||
@@ -1085,7 +1085,7 @@ Py::Object GeometryCurvePy::getRotation(void) const
|
||||
PyObject* GeometryCurvePy::reverse(PyObject *args)
|
||||
{
|
||||
if (!PyArg_ParseTuple(args, ""))
|
||||
return 0;
|
||||
return nullptr;
|
||||
try {
|
||||
Handle(Geom_Geometry) g = getGeometryPtr()->handle();
|
||||
Handle(Geom_Curve) c = Handle(Geom_Curve)::DownCast(g);
|
||||
@@ -1093,7 +1093,7 @@ PyObject* GeometryCurvePy::reverse(PyObject *args)
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
PyErr_SetString(PyExc_RuntimeError, e.GetMessageString());
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
Py_Return;
|
||||
}
|
||||
@@ -1102,7 +1102,7 @@ PyObject* GeometryCurvePy::reversedParameter(PyObject *args)
|
||||
{
|
||||
double p;
|
||||
if (!PyArg_ParseTuple(args, "d", &p))
|
||||
return 0;
|
||||
return nullptr;
|
||||
try {
|
||||
Handle(Geom_Geometry) g = getGeometryPtr()->handle();
|
||||
Handle(Geom_Curve) c = Handle(Geom_Curve)::DownCast(g);
|
||||
@@ -1111,14 +1111,14 @@ PyObject* GeometryCurvePy::reversedParameter(PyObject *args)
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
PyErr_SetString(PyExc_RuntimeError, e.GetMessageString());
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
PyObject* GeometryCurvePy::isPeriodic(PyObject *args)
|
||||
{
|
||||
if (!PyArg_ParseTuple(args, ""))
|
||||
return 0;
|
||||
return nullptr;
|
||||
try {
|
||||
Handle(Geom_Geometry) g = getGeometryPtr()->handle();
|
||||
Handle(Geom_Curve) c = Handle(Geom_Curve)::DownCast(g);
|
||||
@@ -1127,14 +1127,14 @@ PyObject* GeometryCurvePy::isPeriodic(PyObject *args)
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
PyErr_SetString(PyExc_RuntimeError, e.GetMessageString());
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
PyObject* GeometryCurvePy::period(PyObject *args)
|
||||
{
|
||||
if (!PyArg_ParseTuple(args, ""))
|
||||
return 0;
|
||||
return nullptr;
|
||||
try {
|
||||
Handle(Geom_Geometry) g = getGeometryPtr()->handle();
|
||||
Handle(Geom_Curve) c = Handle(Geom_Curve)::DownCast(g);
|
||||
@@ -1143,14 +1143,14 @@ PyObject* GeometryCurvePy::period(PyObject *args)
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
PyErr_SetString(PyExc_RuntimeError, e.GetMessageString());
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
PyObject* GeometryCurvePy::isClosed(PyObject *args)
|
||||
{
|
||||
if (!PyArg_ParseTuple(args, ""))
|
||||
return 0;
|
||||
return nullptr;
|
||||
try {
|
||||
Handle(Geom_Geometry) g = getGeometryPtr()->handle();
|
||||
Handle(Geom_Curve) c = Handle(Geom_Curve)::DownCast(g);
|
||||
@@ -1159,6 +1159,6 @@ PyObject* GeometryCurvePy::isClosed(PyObject *args)
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
PyErr_SetString(PyExc_RuntimeError, e.GetMessageString());
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user