From 0bc67229435c2aa9afdf8350f05d315970e80159 Mon Sep 17 00:00:00 2001 From: "Zheng, Lei" Date: Sat, 24 Aug 2019 10:19:54 +0800 Subject: [PATCH] Gui: add View3DPy.hasClippingPlane() --- src/Gui/View3DPy.cpp | 9 +++++++++ src/Gui/View3DPy.h | 1 + 2 files changed, 10 insertions(+) diff --git a/src/Gui/View3DPy.cpp b/src/Gui/View3DPy.cpp index 2d292187af..6205f6ede3 100644 --- a/src/Gui/View3DPy.cpp +++ b/src/Gui/View3DPy.cpp @@ -191,6 +191,8 @@ void View3DInventorPy::init_type() "beforeEditing: whether to insert the clipping node before or after editing root node\n" "noManip: whether to create a manipulator\n" "pla: clipping plane placement"); + add_varargs_method("hasClippingPlane",&View3DInventorPy::hasClippingPlane, + "hasClippingPlane(): check whether ths clipping plane is active"); } View3DInventorPy::View3DInventorPy(View3DInventor *vi) @@ -2549,3 +2551,10 @@ Py::Object View3DInventorPy::toggleClippingPlane(const Py::Tuple& args, const Py PyObject_IsTrue(noManip),pla); return Py::None(); } + +Py::Object View3DInventorPy::hasClippingPlane(const Py::Tuple& args) +{ + if (!PyArg_ParseTuple(args.ptr(), "")) + throw Py::Exception(); + return Py::Boolean(_view->getViewer()->hasClippingPlane()); +} diff --git a/src/Gui/View3DPy.h b/src/Gui/View3DPy.h index f249fef890..9cb03ebe14 100644 --- a/src/Gui/View3DPy.h +++ b/src/Gui/View3DPy.h @@ -131,6 +131,7 @@ public: Py::Object redraw(const Py::Tuple&); Py::Object setName(const Py::Tuple&); Py::Object toggleClippingPlane(const Py::Tuple& args, const Py::Dict &); + Py::Object hasClippingPlane(const Py::Tuple& args); View3DInventor* getView3DIventorPtr() {return _view;}