From 84a65a53effbe92348fe2d0b3b49c39936b584d0 Mon Sep 17 00:00:00 2001 From: wmayer Date: Wed, 26 Aug 2015 18:58:59 +0200 Subject: [PATCH] + remove method View3DInventor::dumpSelection --- src/Gui/ApplicationPy.cpp | 4 ---- src/Gui/View3DInventor.cpp | 27 --------------------------- src/Gui/View3DInventor.h | 1 - src/Gui/View3DPy.cpp | 22 ---------------------- src/Gui/View3DPy.h | 1 - 5 files changed, 55 deletions(-) diff --git a/src/Gui/ApplicationPy.cpp b/src/Gui/ApplicationPy.cpp index cae2b288b8..b927b05ec1 100644 --- a/src/Gui/ApplicationPy.cpp +++ b/src/Gui/ApplicationPy.cpp @@ -411,10 +411,6 @@ PyObject* Application::sExport(PyObject * /*self*/, PyObject *args,PyObject * /* return 0; } else { - QString cmd = QString::fromLatin1( - "Gui.getDocument(\"%1\").mdiViewsOfType('Gui::View3DInventor')[0].dumpSelection(\"%2\")" - ).arg(QLatin1String(doc->getName())).arg(fi.absoluteFilePath()); - Base::Interpreter().runString(cmd.toUtf8()); } } else if (ext == QLatin1String("pdf")) { diff --git a/src/Gui/View3DInventor.cpp b/src/Gui/View3DInventor.cpp index 9f9b5501c7..6aa73ee595 100644 --- a/src/Gui/View3DInventor.cpp +++ b/src/Gui/View3DInventor.cpp @@ -881,33 +881,6 @@ void View3DInventor::dump(const char* filename) _viewer->dumpToFile(_viewer->getSceneGraph(), filename, false); } -void View3DInventor::dumpSelection(const char* filename) -{ - if (!_pcDocument) - return; - - SoSeparator* sep = new SoSeparator(); - sep->ref(); - - std::vector sel = Selection().getSelectionEx(); - for (std::vector::iterator it = sel.begin(); it != sel.end(); ++it) { - App::DocumentObject* obj = it->getObject(); - Gui::ViewProvider* vp = _pcDocument->getViewProvider(obj); - if (vp) - sep->addChild(vp->getRoot()); - } - - SoGetPrimitiveCountAction action; - action.setCanApproximate(true); - action.apply(sep); - - if ( action.getTriangleCount() > 100000 || action.getPointCount() > 30000 || action.getLineCount() > 10000 ) - _viewer->dumpToFile(sep, filename, true); - else - _viewer->dumpToFile(sep, filename, false); - sep->unref(); -} - void View3DInventor::windowStateChanged(MDIView* view) { bool canStartTimer = false; diff --git a/src/Gui/View3DInventor.h b/src/Gui/View3DInventor.h index 7c71b2fe92..b0053e9063 100644 --- a/src/Gui/View3DInventor.h +++ b/src/Gui/View3DInventor.h @@ -113,7 +113,6 @@ public Q_SLOTS: void restoreOverrideCursor(); void dump(const char* filename); - void dumpSelection(const char* filename); protected Q_SLOTS: void stopAnimating(); diff --git a/src/Gui/View3DPy.cpp b/src/Gui/View3DPy.cpp index 0dae3aef84..ebe47611ec 100644 --- a/src/Gui/View3DPy.cpp +++ b/src/Gui/View3DPy.cpp @@ -98,7 +98,6 @@ void View3DInventorPy::init_type() add_varargs_method("setAnimationEnabled",&View3DInventorPy::setAnimationEnabled,"setAnimationEnabled()"); add_varargs_method("isAnimationEnabled",&View3DInventorPy::isAnimationEnabled,"isAnimationEnabled()"); add_varargs_method("dump",&View3DInventorPy::dump,"dump()"); - add_varargs_method("dumpSelection",&View3DInventorPy::dumpSelection,"dumpSelection()"); add_varargs_method("dumpNode",&View3DInventorPy::dumpNode,"dumpNode(node)"); add_varargs_method("setStereoType",&View3DInventorPy::setStereoType,"setStereoType()"); add_varargs_method("getStereoType",&View3DInventorPy::getStereoType,"getStereoType()"); @@ -1001,27 +1000,6 @@ Py::Object View3DInventorPy::dump(const Py::Tuple& args) } } -Py::Object View3DInventorPy::dumpSelection(const Py::Tuple& args) -{ - char* filename; - if (!PyArg_ParseTuple(args.ptr(), "s", &filename)) - throw Py::Exception(); - - try { - _view->dumpSelection(filename); - return Py::None(); - } - catch (const Base::Exception& e) { - throw Py::Exception(e.what()); - } - catch (const std::exception& e) { - throw Py::Exception(e.what()); - } - catch(...) { - throw Py::Exception("Unknown C++ exception"); - } -} - Py::Object View3DInventorPy::dumpNode(const Py::Tuple& args) { PyObject* object; diff --git a/src/Gui/View3DPy.h b/src/Gui/View3DPy.h index 83d7af5074..f0f451e18e 100644 --- a/src/Gui/View3DPy.h +++ b/src/Gui/View3DPy.h @@ -65,7 +65,6 @@ public: Py::Object setAnimationEnabled(const Py::Tuple&); Py::Object isAnimationEnabled(const Py::Tuple&); Py::Object dump(const Py::Tuple&); - Py::Object dumpSelection(const Py::Tuple&); Py::Object dumpNode(const Py::Tuple&); Py::Object setStereoType(const Py::Tuple&); Py::Object getStereoType(const Py::Tuple&);