remove useless methods startEditing/finishEditing/isEditing from Python wrapper of view provider
add attribute to access document from view provider
This commit is contained in:
@@ -24,5 +24,11 @@
|
||||
</Documentation>
|
||||
<Parameter Name="Object" Type="Object" />
|
||||
</Attribute>
|
||||
<Attribute Name="Document" ReadOnly="true">
|
||||
<Documentation>
|
||||
<UserDocu>Return the document the view provider is part of</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="Document" Type="Object" />
|
||||
</Attribute>
|
||||
</PythonExport>
|
||||
</GenerateModel>
|
||||
|
||||
@@ -27,7 +27,8 @@
|
||||
# include <sstream>
|
||||
#endif
|
||||
|
||||
#include "Gui/ViewProviderDocumentObject.h"
|
||||
#include <Gui/ViewProviderDocumentObject.h>
|
||||
#include <Gui/Document.h>
|
||||
#include <App/DocumentObject.h>
|
||||
|
||||
// inclusion of the generated files (generated out of ViewProviderDocumentObjectPy.xml)
|
||||
@@ -61,6 +62,12 @@ Py::Object ViewProviderDocumentObjectPy::getObject(void) const
|
||||
return Py::Object(obj->getPyObject(), true); // do not inc'ref twice
|
||||
}
|
||||
|
||||
Py::Object ViewProviderDocumentObjectPy::getDocument(void) const
|
||||
{
|
||||
Document* doc = getViewProviderDocumentObjectPtr()->getDocument();
|
||||
return Py::asObject(doc->getPyObject()); // do not inc'ref twice
|
||||
}
|
||||
|
||||
PyObject *ViewProviderDocumentObjectPy::getCustomAttributes(const char* /*attr*/) const
|
||||
{
|
||||
return 0;
|
||||
|
||||
@@ -65,21 +65,6 @@
|
||||
<UserDocu>Return a string representation of the Inventor node</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="startEditing">
|
||||
<Documentation>
|
||||
<UserDocu>Start the editing mode (default=0)</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="finishEditing">
|
||||
<Documentation>
|
||||
<UserDocu>Finish editing mode</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="isEditing">
|
||||
<Documentation>
|
||||
<UserDocu>Returns True if the view provider is in editing mode, False otherwise</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="setTransformation">
|
||||
<Documentation>
|
||||
<UserDocu>Set a transformation on the Inventor node</UserDocu>
|
||||
|
||||
@@ -203,33 +203,6 @@ PyObject* ViewProviderPy::toString(PyObject *args)
|
||||
} PY_CATCH;
|
||||
}
|
||||
|
||||
PyObject* ViewProviderPy::startEditing(PyObject *args)
|
||||
{
|
||||
int mode=0;
|
||||
if (!PyArg_ParseTuple(args, "|i", &mode)) // convert args: Python->C
|
||||
return NULL; // NULL triggers exception
|
||||
bool edit = getViewProviderPtr()->startEditing(mode);
|
||||
Py::Boolean ok(edit);
|
||||
return Py::new_reference_to(ok);
|
||||
}
|
||||
|
||||
PyObject* ViewProviderPy::finishEditing(PyObject *args)
|
||||
{
|
||||
if (!PyArg_ParseTuple(args, "")) // convert args: Python->C
|
||||
return NULL; // NULL triggers exception
|
||||
getViewProviderPtr()->finishEditing();
|
||||
Py_Return;
|
||||
}
|
||||
|
||||
PyObject* ViewProviderPy::isEditing(PyObject *args)
|
||||
{
|
||||
if (!PyArg_ParseTuple(args, "")) // convert args: Python->C
|
||||
return NULL; // NULL triggers exception
|
||||
bool edit = getViewProviderPtr()->isEditing();
|
||||
Py::Boolean ok(edit);
|
||||
return Py::new_reference_to(ok);
|
||||
}
|
||||
|
||||
PyObject* ViewProviderPy::setTransformation(PyObject *args)
|
||||
{
|
||||
PyObject* p;
|
||||
|
||||
Reference in New Issue
Block a user