+ save Brep in binary format for recovery files
This commit is contained in:
@@ -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();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user