+ save Brep in binary format for recovery files

This commit is contained in:
wmayer
2015-09-16 22:58:47 +02:00
parent dffaebd346
commit 22b7fb660c
7 changed files with 151 additions and 81 deletions

View File

@@ -34,6 +34,7 @@
#include <Base/Console.h>
#include <Base/Interpreter.h>
#include <Base/GeometryPyCXX.h>
#include <Base/Reader.h>
#include <Base/VectorPy.h>
#include <CXX/Extensions.hxx>
#include <CXX/Objects.hxx>
@@ -194,6 +195,8 @@ public:
{
add_varargs_method("interactiveFilletArc",&SandboxModuleGui::interactiveFilletArc,
"Interactive fillet arc");
add_varargs_method("xmlReader",&SandboxModuleGui::xmlReader,
"Read XML");
initialize("This module is the SandboxGui module"); // register with Python
}
@@ -223,6 +226,16 @@ private:
}
return Py::None();
}
Py::Object xmlReader(const Py::Tuple& args)
{
std::string file = static_cast<std::string>(Py::String(args[0]));
App::Document* doc = App::GetApplication().newDocument();
std::ifstream str(file.c_str(), std::ios::in);
Base::XMLReader reader(file.c_str(), str);
doc->Restore(reader);
return Py::None();
}
};