move addDisplayMode from ViewProviderPythonFeaturePy to ViewProviderPy

This commit is contained in:
wmayer
2016-11-08 16:41:36 +01:00
parent ff2a361928
commit 5c19fe2e74
4 changed files with 33 additions and 34 deletions

View File

@@ -28,7 +28,12 @@
<UserDocu>Check if the object is visible</UserDocu>
</Documentation>
</Methode>
<Methode Name="listDisplayModes">
<Methode Name="addDisplayMode">
<Documentation>
<UserDocu>Add a new display mode to the view provider</UserDocu>
</Documentation>
</Methode>
<Methode Name="listDisplayModes">
<Documentation>
<UserDocu>Show a list of all display modes</UserDocu>
</Documentation>
@@ -83,4 +88,4 @@
<Parameter Name="IV" Type="String" />
</Attribute>
</PythonExport>
</GenerateModel>
</GenerateModel>

View File

@@ -37,8 +37,8 @@
#include "WidgetFactory.h"
// inclusion of the generated files (generated out of ViewProviderPy2.xml)
#include "ViewProviderPy.h"
#include "ViewProviderPy.cpp"
#include <Gui/ViewProviderPy.h>
#include <Gui/ViewProviderPy.cpp>
#include <Base/Interpreter.h>
#include <Base/Matrix.h>
#include <Base/MatrixPy.h>
@@ -82,6 +82,29 @@ PyObject* ViewProviderPy::isVisible(PyObject *args)
} PY_CATCH;
}
PyObject* ViewProviderPy::addDisplayMode(PyObject * args)
{
char* mode;
PyObject* obj;
if (!PyArg_ParseTuple(args, "Os", &obj, &mode))
return NULL;
void* ptr = 0;
try {
Base::Interpreter().convertSWIGPointerObj("pivy.coin","SoNode *", obj, &ptr, 0);
}
catch (const Base::Exception& e) {
PyErr_SetString(PyExc_RuntimeError, e.what());
return 0;
}
PY_TRY {
SoNode* node = reinterpret_cast<SoNode*>(ptr);
getViewProviderPtr()->addDisplayMaskMode(node,mode);
Py_Return;
} PY_CATCH;
}
PyObject* ViewProviderPy::listDisplayModes(PyObject *args)
{
if (!PyArg_ParseTuple(args, "")) // convert args: Python->C

View File

@@ -13,11 +13,6 @@
<Author Licence="LGPL" Name="Werner Mayer" EMail="wmayer@users.sourceforge.net" />
<UserDocu>This is the view provider class for Python features</UserDocu>
</Documentation>
<Methode Name="addDisplayMode">
<Documentation>
<UserDocu>Add a new display mode to the view provider</UserDocu>
</Documentation>
</Methode>
<Methode Name="addProperty">
<Documentation>
<UserDocu>
@@ -41,4 +36,4 @@
</Documentation>
</Methode>
</PythonExport>
</GenerateModel>
</GenerateModel>

View File

@@ -22,7 +22,6 @@
#include "PreCompiled.h"
#ifndef _PreComp_
# include <Inventor/nodes/SoNode.h>
#endif
#include "Gui/ViewProviderPythonFeature.h"
@@ -40,29 +39,6 @@ std::string ViewProviderPythonFeaturePy::representation(void) const
return "<ViewProviderPythonFeature object>";
}
PyObject* ViewProviderPythonFeaturePy::addDisplayMode(PyObject * args)
{
char* mode;
PyObject* obj;
if (!PyArg_ParseTuple(args, "Os", &obj, &mode))
return NULL;
void* ptr = 0;
try {
Base::Interpreter().convertSWIGPointerObj("pivy.coin","SoNode *", obj, &ptr, 0);
}
catch (const Base::Exception& e) {
PyErr_SetString(PyExc_RuntimeError, e.what());
return 0;
}
PY_TRY {
SoNode* node = reinterpret_cast<SoNode*>(ptr);
getViewProviderPythonFeaturePtr()->addDisplayMaskMode(node,mode);
Py_Return;
} PY_CATCH;
}
PyObject* ViewProviderPythonFeaturePy::addProperty(PyObject *args)
{
char *sType,*sName=0,*sGroup=0,*sDoc=0;