Gui: expose functions to Python to add and remove a manipulator
This commit is contained in:
@@ -348,6 +348,9 @@ public:
|
||||
static PyObject* sAddDocObserver (PyObject *self,PyObject *args);
|
||||
static PyObject* sRemoveDocObserver (PyObject *self,PyObject *args);
|
||||
|
||||
static PyObject* sAddWbManipulator (PyObject *self,PyObject *args);
|
||||
static PyObject* sRemoveWbManipulator (PyObject *self,PyObject *args);
|
||||
|
||||
static PyObject* sListUserEditModes (PyObject *self,PyObject *args);
|
||||
static PyObject* sGetUserEditMode (PyObject *self,PyObject *args);
|
||||
static PyObject* sSetUserEditMode (PyObject *self,PyObject *args);
|
||||
|
||||
@@ -66,6 +66,7 @@
|
||||
#include "WidgetFactory.h"
|
||||
#include "Workbench.h"
|
||||
#include "WorkbenchManager.h"
|
||||
#include "WorkbenchManipulatorPython.h"
|
||||
#include "Inventor/MarkerBitmaps.h"
|
||||
#include "Language/Translator.h"
|
||||
|
||||
@@ -357,6 +358,18 @@ PyMethodDef Application::Methods[] = {
|
||||
"Remove an added document observer.\n"
|
||||
"\n"
|
||||
"obj : object"},
|
||||
{"addWorkbenchManipulator", (PyCFunction) Application::sAddWbManipulator, METH_VARARGS,
|
||||
"addWorkbenchManipulator(obj) -> None\n"
|
||||
"\n"
|
||||
"Add a workbench manipulator to modify a workbench when it is activated.\n"
|
||||
"\n"
|
||||
"obj : object"},
|
||||
{"removeWorkbenchManipulator", (PyCFunction) Application::sRemoveWbManipulator, METH_VARARGS,
|
||||
"removeWorkbenchManipulator(obj) -> None\n"
|
||||
"\n"
|
||||
"Remove an added workbench manipulator.\n"
|
||||
"\n"
|
||||
"obj : object"},
|
||||
{"listUserEditModes", (PyCFunction) Application::sListUserEditModes, METH_VARARGS,
|
||||
"listUserEditModes() -> list\n"
|
||||
"\n"
|
||||
@@ -1533,6 +1546,32 @@ PyObject* Application::sRemoveDocObserver(PyObject * /*self*/, PyObject *args)
|
||||
PY_CATCH;
|
||||
}
|
||||
|
||||
PyObject* Application::sAddWbManipulator(PyObject * /*self*/, PyObject *args)
|
||||
{
|
||||
PyObject* o;
|
||||
if (!PyArg_ParseTuple(args, "O",&o))
|
||||
return nullptr;
|
||||
|
||||
PY_TRY {
|
||||
WorkbenchManipulatorPython::installManipulator(Py::Object(o));
|
||||
Py_Return;
|
||||
}
|
||||
PY_CATCH;
|
||||
}
|
||||
|
||||
PyObject* Application::sRemoveWbManipulator(PyObject * /*self*/, PyObject *args)
|
||||
{
|
||||
PyObject* o;
|
||||
if (!PyArg_ParseTuple(args, "O",&o))
|
||||
return nullptr;
|
||||
|
||||
PY_TRY {
|
||||
WorkbenchManipulatorPython::removeManipulator(Py::Object(o));
|
||||
Py_Return;
|
||||
}
|
||||
PY_CATCH;
|
||||
}
|
||||
|
||||
PyObject* Application::sCoinRemoveAllChildren(PyObject * /*self*/, PyObject *args)
|
||||
{
|
||||
PyObject *pynode;
|
||||
|
||||
Reference in New Issue
Block a user