| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| |
|
| | #include <Base/Console.h> |
| | #include <Base/Vector3D.h> |
| | #include <Base/VectorPy.h> |
| |
|
| | #include "DrawBrokenView.h" |
| | #include "DrawViewPart.h" |
| | |
| | #include <Mod/TechDraw/App/DrawViewPartPy.h> |
| | #include <Mod/TechDraw/App/DrawBrokenViewPy.h> |
| | #include <Mod/TechDraw/App/DrawBrokenViewPy.cpp> |
| |
|
| |
|
| | using namespace TechDraw; |
| |
|
| | |
| | std::string DrawBrokenViewPy::representation() const |
| | { |
| | return std::string("<DrawBrokenView object>"); |
| | } |
| |
|
| | PyObject* DrawBrokenViewPy::mapPoint3dToView(PyObject *args) |
| | { |
| | PyObject* pPoint3d = nullptr; |
| | if (!PyArg_ParseTuple(args, "O!", &(Base::VectorPy::Type), &pPoint3d)) { |
| | return nullptr; |
| | } |
| |
|
| | DrawBrokenView* dvp = getDrawBrokenViewPtr(); |
| | Base::Vector3d point3d = static_cast<Base::VectorPy*>(pPoint3d)->value(); |
| | Base::Vector3d point2d = dvp->mapPoint3dToView(point3d); |
| |
|
| | return new Base::VectorPy(new Base::Vector3d(point2d)); |
| | } |
| |
|
| | PyObject* DrawBrokenViewPy::mapPoint2dFromView(PyObject *args) |
| | { |
| | PyObject* pPoint2d = nullptr; |
| | if (!PyArg_ParseTuple(args, "O!", &(Base::VectorPy::Type), &pPoint2d)) { |
| | return nullptr; |
| | } |
| |
|
| | DrawBrokenView* dvp = getDrawBrokenViewPtr(); |
| | Base::Vector3d pointIn = static_cast<Base::VectorPy*>(pPoint2d)->value(); |
| | Base::Vector3d pointOut = dvp->mapPoint2dFromView(pointIn); |
| |
|
| | return new Base::VectorPy(new Base::Vector3d(pointOut)); |
| | } |
| |
|
| | PyObject* DrawBrokenViewPy::getCompressedCenter(PyObject *args) |
| | { |
| | if (!PyArg_ParseTuple(args, "")) { |
| | return nullptr; |
| | } |
| |
|
| | DrawBrokenView* dvp = getDrawBrokenViewPtr(); |
| | Base::Vector3d pointOut = dvp->getCompressedCentroid(); |
| | return new Base::VectorPy(new Base::Vector3d(pointOut)); |
| | } |
| |
|
| |
|
| | PyObject *DrawBrokenViewPy::getCustomAttributes(const char* ) const |
| | { |
| | return nullptr; |
| | } |
| |
|
| | int DrawBrokenViewPy::setCustomAttributes(const char* , PyObject* ) |
| | { |
| | return 0; |
| | } |
| |
|