Sketcher: SketchGeometryExtension - Do not store ID

===================================================

Currently the ID is a unique number without an specific use and it is
conceived to be taken over by future RT's Sketcher PRs.

Because of this, and not to interfere with RT's implementation, it is
not stored, but will be restored if attribute available.

Unrelated:
Similarly, ExternalGeometryExtension is also there conceived for RT's
future sketcher PRs, but it is not used.
This commit is contained in:
Abdullah Tahiri
2020-12-05 08:08:04 +01:00
committed by abdullahtahiriyo
parent 2c0faabb6f
commit 4aa91f0f26

View File

@@ -61,7 +61,7 @@ void SketchGeometryExtension::Save(Base::Writer &writer) const
if(name.size() > 0)
writer.Stream() << "\" name=\"" << name;
writer.Stream() << "\" id=\"" << Id
writer.Stream() // << "\" id=\"" << Id // This is removed as the stored Id is not used and it may interfere with RT's future implementation
<< "\" internalGeometryType=\"" << (int) InternalGeometryType
<< "\" geometryModeFlags=\"" << GeometryModeFlags.to_string()
<< "\"/>" << std::endl;
@@ -71,7 +71,9 @@ void SketchGeometryExtension::Restore(Base::XMLReader &reader)
{
restoreNameAttribute(reader);
Id = reader.getAttributeAsInteger("id");
if(reader.hasAttribute("id"))
Id = reader.getAttributeAsInteger("id");
InternalGeometryType = (InternalType::InternalType) reader.getAttributeAsInteger("internalGeometryType");
GeometryModeFlags = GeometryModeFlagType(reader.getAttribute("geometryModeFlags"));