Added center property to Path to deal with rendering rotational axis.

This commit is contained in:
Markus Lampert
2018-05-04 12:09:17 -07:00
committed by Yorik van Havre
parent 1f030de9ac
commit cbd5f297f3
5 changed files with 68 additions and 13 deletions

View File

@@ -111,12 +111,24 @@ void PropertyPath::Save (Base::Writer &writer) const
void PropertyPath::Restore(Base::XMLReader &reader)
{
reader.readElement("Path");
std::string file (reader.getAttribute("file") );
std::string file (reader.getAttribute("file") );
if (!file.empty()) {
// initate a file read
reader.addFile(file.c_str(),this);
}
if (reader.hasAttribute("version")) {
int version = reader.getAttributeAsInteger("version");
if (version >= Toolpath::SchemaVersion) {
reader.readElement("Center");
double x = reader.getAttributeAsFloat("x");
double y = reader.getAttributeAsFloat("y");
double z = reader.getAttributeAsFloat("z");
Base::Vector3d center(x, y, z);
_Path.setCenter(center);
}
}
}
void PropertyPath::SaveDocFile (Base::Writer &) const