diff --git a/src/Mod/Part/App/ArcOfConicPy.xml b/src/Mod/Part/App/ArcOfConicPy.xml index 57450e686a..487afdc330 100644 --- a/src/Mod/Part/App/ArcOfConicPy.xml +++ b/src/Mod/Part/App/ArcOfConicPy.xml @@ -1,14 +1,14 @@ - diff --git a/src/Mod/Part/App/ArcPy.xml b/src/Mod/Part/App/ArcPy.xml index 1cea410f70..833b23453b 100644 --- a/src/Mod/Part/App/ArcPy.xml +++ b/src/Mod/Part/App/ArcPy.xml @@ -1,14 +1,14 @@ - diff --git a/src/Mod/Part/App/BSplineCurvePy.xml b/src/Mod/Part/App/BSplineCurvePy.xml index fa1602a4ea..740b841710 100644 --- a/src/Mod/Part/App/BSplineCurvePy.xml +++ b/src/Mod/Part/App/BSplineCurvePy.xml @@ -1,14 +1,14 @@ diff --git a/src/Mod/Part/App/BezierCurvePy.xml b/src/Mod/Part/App/BezierCurvePy.xml index ef5b190427..466b89c40c 100644 --- a/src/Mod/Part/App/BezierCurvePy.xml +++ b/src/Mod/Part/App/BezierCurvePy.xml @@ -1,14 +1,14 @@ diff --git a/src/Mod/Part/App/BezierCurvePyImp.cpp b/src/Mod/Part/App/BezierCurvePyImp.cpp index 975f2fab2e..fe0b132bff 100644 --- a/src/Mod/Part/App/BezierCurvePyImp.cpp +++ b/src/Mod/Part/App/BezierCurvePyImp.cpp @@ -47,7 +47,7 @@ std::string BezierCurvePy::representation(void) const PyObject *BezierCurvePy::PyMake(struct _typeobject *, PyObject *, PyObject *) // Python wrapper { - // create a new instance of BezierCurvePy and the Twin object + // create a new instance of BezierCurvePy and the Twin object return new BezierCurvePy(new GeomBezierCurve); } @@ -347,21 +347,21 @@ Py::Long BezierCurvePy::getDegree(void) const { Handle(Geom_BezierCurve) curve = Handle(Geom_BezierCurve)::DownCast (getGeometryPtr()->handle()); - return Py::Long(curve->Degree()); + return Py::Long(curve->Degree()); } Py::Long BezierCurvePy::getMaxDegree(void) const { Handle(Geom_BezierCurve) curve = Handle(Geom_BezierCurve)::DownCast (getGeometryPtr()->handle()); - return Py::Long(curve->MaxDegree()); + return Py::Long(curve->MaxDegree()); } Py::Long BezierCurvePy::getNbPoles(void) const { Handle(Geom_BezierCurve) curve = Handle(Geom_BezierCurve)::DownCast (getGeometryPtr()->handle()); - return Py::Long(curve->NbPoles()); + return Py::Long(curve->NbPoles()); } Py::Object BezierCurvePy::getStartPoint(void) const @@ -387,5 +387,5 @@ PyObject *BezierCurvePy::getCustomAttributes(const char* /*attr*/) const int BezierCurvePy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/) { - return 0; + return 0; } diff --git a/src/Mod/Part/App/BoundedCurvePy.xml b/src/Mod/Part/App/BoundedCurvePy.xml new file mode 100644 index 0000000000..143625e064 --- /dev/null +++ b/src/Mod/Part/App/BoundedCurvePy.xml @@ -0,0 +1,37 @@ + + + + + + + The abstract class BoundedCurve is the root class of all bounded curve objects. + + + + + + Returns the starting point of the bounded curve. + + + + + + + + Returns the end point of the bounded curve. + + + + + + diff --git a/src/Mod/Part/App/BoundedCurvePyImp.cpp b/src/Mod/Part/App/BoundedCurvePyImp.cpp new file mode 100644 index 0000000000..1e0b65acb2 --- /dev/null +++ b/src/Mod/Part/App/BoundedCurvePyImp.cpp @@ -0,0 +1,77 @@ +/*************************************************************************** + * Copyright (c) 2009 Werner Mayer * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + + +#include "PreCompiled.h" +#ifndef _PreComp_ +# include +#endif + +#include +#include + +#include "Geometry.h" +#include "BoundedCurvePy.h" +#include "BoundedCurvePy.cpp" + + +using namespace Part; + +// returns a string which represents the object e.g. when printed in python +std::string BoundedCurvePy::representation(void) const +{ + return ""; +} + +PyObject *BoundedCurvePy::PyMake(struct _typeobject *, PyObject *, PyObject *) // Python wrapper +{ + // never create such objects with the constructor + PyErr_SetString(PyExc_RuntimeError, + "You cannot create an instance of the abstract class 'BoundedCurve'."); + return 0; +} + +// constructor method +int BoundedCurvePy::PyInit(PyObject* /*args*/, PyObject* /*kwd*/) +{ + return 0; +} + +Py::Object BoundedCurvePy::getStartPoint(void) const +{ + return Py::Vector(getGeomBoundedCurvePtr()->getStartPoint()); +} + +Py::Object BoundedCurvePy::getEndPoint(void) const +{ + return Py::Vector(getGeomBoundedCurvePtr()->getEndPoint()); +} + +PyObject *BoundedCurvePy::getCustomAttributes(const char* /*attr*/) const +{ + return 0; +} + +int BoundedCurvePy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/) +{ + return 0; +} diff --git a/src/Mod/Part/App/CMakeLists.txt b/src/Mod/Part/App/CMakeLists.txt index 0c731fedd8..7d5c53a353 100644 --- a/src/Mod/Part/App/CMakeLists.txt +++ b/src/Mod/Part/App/CMakeLists.txt @@ -52,6 +52,7 @@ generate_from_xml(ParabolaPy) generate_from_xml(OffsetCurvePy) generate_from_xml(GeometryPy) generate_from_xml(GeometryCurvePy) +generate_from_xml(BoundedCurvePy) generate_from_xml(GeometrySurfacePy) generate_from_xml(LinePy) generate_from_xml(LineSegmentPy) @@ -211,6 +212,8 @@ SET(Python_SRCS GeometryPyImp.cpp GeometryCurvePy.xml GeometryCurvePyImp.cpp + BoundedCurvePy.xml + BoundedCurvePyImp.cpp GeometrySurfacePy.xml GeometrySurfacePyImp.cpp LinePy.xml diff --git a/src/Mod/Part/App/LineSegmentPy.xml b/src/Mod/Part/App/LineSegmentPy.xml index bcecd6add5..f15a47a74d 100644 --- a/src/Mod/Part/App/LineSegmentPy.xml +++ b/src/Mod/Part/App/LineSegmentPy.xml @@ -1,14 +1,14 @@ -