diff --git a/idl/gepetto/viewer/graphical-interface.idl b/idl/gepetto/viewer/graphical-interface.idl index 99a71d45e031f6b010d01ac0f97359dbb709b9cc..1e5de671a9262b1adbdcf92748ed61f9c62c6cce 100644 --- a/idl/gepetto/viewer/graphical-interface.idl +++ b/idl/gepetto/viewer/graphical-interface.idl @@ -225,6 +225,8 @@ typedef double Color [4]; /// Stop the running capture of a window. boolean stopCapture (in unsigned long windowId) raises (Error); + + boolean writeNodeFile (in unsigned long windowId, in string filename) raises (Error); }; }; }; diff --git a/src/graphical-interface.impl.cpp b/src/graphical-interface.impl.cpp index 1506a3ba2547910ad22b30ef70414f1915d26047..4b42c2eb98a9d61928e89861bfd8a4894bdeecf5 100644 --- a/src/graphical-interface.impl.cpp +++ b/src/graphical-interface.impl.cpp @@ -844,6 +844,23 @@ namespace graphics { throw Error (exc.what ()); } } + + bool GraphicalInterface::writeNodeFile (const WindowID windowId, const char* filename) + throw (Error) + { + try { + if (windowId >= 0 || windowId < windowManagers_.size ()) { + return windowManagers_[windowId]->writeNodeFile (std::string (filename)); + } + else { + std::cout << "Window ID " << windowId + << " doesn't exist." << std::endl; + return false; + } + } catch (const std::exception& exc) { + throw Error (exc.what ()); + } + } } //end namespace impl } //end namespace corbaServer } //end namespace graphics diff --git a/src/graphical-interface.impl.hh b/src/graphical-interface.impl.hh index 32cbe26a647393f31e2f699df90a6d51c20d611b..628b1e007a96de871c609123a21562ed2c8b2794 100644 --- a/src/graphical-interface.impl.hh +++ b/src/graphical-interface.impl.hh @@ -136,6 +136,7 @@ public: virtual bool startCapture (const WindowID windowId, const char* filename, const char* extension) throw (Error); virtual bool stopCapture (const WindowID windowId) throw (Error); + virtual bool writeNodeFile (const WindowID windowId, const char* filename) throw (Error); }; // end of class } /* namespace impl */