Export object dependencies to graphviz file

This commit is contained in:
wmayer
2012-06-12 19:03:29 +02:00
parent 6621c00c10
commit 9170bfe045
7 changed files with 131 additions and 3 deletions

View File

@@ -92,6 +92,25 @@ PyObject* DocumentPy::restore(PyObject * args)
Py_Return;
}
PyObject* DocumentPy::exportGraphviz(PyObject * args)
{
char* fn=0;
if (!PyArg_ParseTuple(args, "|s",&fn)) // convert args: Python->C
return NULL; // NULL triggers exception
if (fn) {
Base::FileInfo fi(fn);
Base::ofstream str(fi);
getDocumentPtr()->exportGraphviz(str);
str.close();
Py_Return;
}
else {
std::stringstream str;
getDocumentPtr()->exportGraphviz(str);
return PyString_FromString(str.str().c_str());
}
}
PyObject* DocumentPy::addObject(PyObject *args)
{
char *sType,*sName=0;