Skip to content

Commit

Permalink
Gui: expose ViewerPy.redraw() method
Browse files Browse the repository at this point in the history
  • Loading branch information
DeepSOIC authored and yorikvanhavre committed May 8, 2017
1 parent 73f2307 commit 1137d5e
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 @@ -176,6 +176,7 @@ void View3DInventorPy::init_type()
"'addFinishCallback','addStartCallback','addMotionCallback','addValueChangedCallback'\n");
add_varargs_method("setActiveObject", &View3DInventorPy::setActiveObject, "setActiveObject(name,object)\nadd or set a new active object");
add_varargs_method("getActiveObject", &View3DInventorPy::getActiveObject, "getActiveObject(name)\nreturns the active object for the given type");
add_varargs_method("redraw", &View3DInventorPy::redraw, "redraw(): renders the scene on screen (useful for animations)");

}

Expand Down Expand Up @@ -2242,3 +2243,11 @@ Py::Object View3DInventorPy::getActiveObject(const Py::Tuple& args)

return Py::Object(obj->getPyObject());
}

Py::Object View3DInventorPy::redraw(const Py::Tuple& args)
{
if (!PyArg_ParseTuple(args.ptr(), ""))
throw Py::Exception();
_view->getViewer()->redraw();
return Py::None();
}
1 change: 1 addition & 0 deletions src/Gui/View3DPy.h
Expand Up @@ -105,6 +105,7 @@ class View3DInventorPy : public Py::PythonExtension<View3DInventorPy>
Py::Object removeDraggerCallback(const Py::Tuple&);
Py::Object setActiveObject(const Py::Tuple&);
Py::Object getActiveObject(const Py::Tuple&);
Py::Object redraw(const Py::Tuple&);

private:
static void eventCallback(void * ud, SoEventCallback * n);
Expand Down

0 comments on commit 1137d5e

Please sign in to comment.