Skip to content

Commit

Permalink
Gui: add View3DPy.hasClippingPlane()
Browse files Browse the repository at this point in the history
  • Loading branch information
realthunder authored and wwmayer committed Aug 30, 2019
1 parent 66a7197 commit 4efbe3c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Gui/View3DPy.cpp
Expand Up @@ -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)
Expand Down Expand Up @@ -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());
}
1 change: 1 addition & 0 deletions src/Gui/View3DPy.h
Expand Up @@ -131,6 +131,7 @@ class View3DInventorPy : public Py::PythonExtension<View3DInventorPy>
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;}

Expand Down

0 comments on commit 4efbe3c

Please sign in to comment.