diff --git a/src/Mod/PartDesign/App/DatumPoint.cpp b/src/Mod/PartDesign/App/DatumPoint.cpp index 297d562769..5a65f09a64 100644 --- a/src/Mod/PartDesign/App/DatumPoint.cpp +++ b/src/Mod/PartDesign/App/DatumPoint.cpp @@ -99,12 +99,12 @@ void Point::onChanged(const App::Property* prop) Superclass::onChanged(prop); } -void Point::Restore(Base::XMLReader& r) +void Point::onDocumentRestored() { - Superclass::Restore(r); //fix for #0002758 Datum point moves to (0,0,0) when reopening the file. //recreate shape, as the restored one has old Placement burned into it. this->makeShape(); + Superclass::onDocumentRestored(); } void Point::makeShape() @@ -114,7 +114,9 @@ void Point::makeShape() BRepBuilderAPI_MakeVertex builder(gp_Pnt(0,0,0)); if (!builder.IsDone()) return; - Shape.setValue(builder.Shape()); + Part::TopoShape tshape(builder.Shape()); + tshape.setPlacement(this->Placement.getValue()); + Shape.setValue(tshape); } Base::Vector3d Point::getPoint() diff --git a/src/Mod/PartDesign/App/DatumPoint.h b/src/Mod/PartDesign/App/DatumPoint.h index 19dfdbeb41..e00cf6434e 100644 --- a/src/Mod/PartDesign/App/DatumPoint.h +++ b/src/Mod/PartDesign/App/DatumPoint.h @@ -50,9 +50,11 @@ public: protected: virtual void onChanged(const App::Property* prop); - virtual void Restore(Base::XMLReader& r); + virtual void onDocumentRestored() override; + private: void makeShape(); + }; } //namespace PartDesign