From e2938e7b62f3f9cbceeda6d522b3715498996941 Mon Sep 17 00:00:00 2001 From: Chris Hennes Date: Sat, 4 Nov 2023 11:07:52 -0500 Subject: [PATCH] App/Toponaming: Add TNP code to PropertyComplexGeoData --- src/App/PropertyGeo.cpp | 17 +++++++++++++++++ src/App/PropertyGeo.h | 2 ++ 2 files changed, 19 insertions(+) diff --git a/src/App/PropertyGeo.cpp b/src/App/PropertyGeo.cpp index a72364f265..220aba8e9a 100644 --- a/src/App/PropertyGeo.cpp +++ b/src/App/PropertyGeo.cpp @@ -36,6 +36,8 @@ #include #include +#include "ComplexGeoData.h" +#include "Document.h" #include "PropertyGeo.h" #include "Placement.h" #include "ObjectIdentifier.h" @@ -1241,3 +1243,18 @@ TYPESYSTEM_SOURCE_ABSTRACT(App::PropertyComplexGeoData , App::PropertyGeometry) PropertyComplexGeoData::PropertyComplexGeoData() = default; PropertyComplexGeoData::~PropertyComplexGeoData() = default; + +void PropertyComplexGeoData::afterRestore() +{ + auto data = getComplexData(); + if (data && data->isRestoreFailed()) { + data->resetRestoreFailure(); + auto owner = Base::freecad_dynamic_cast(getContainer()); + if (owner && + owner->getDocument() && + !owner->getDocument()->testStatus(App::Document::PartialDoc)) { + owner->getDocument()->addRecomputeObject(owner); + } + } + PropertyGeometry::afterRestore(); +} \ No newline at end of file diff --git a/src/App/PropertyGeo.h b/src/App/PropertyGeo.h index 829e251f98..c55339e63a 100644 --- a/src/App/PropertyGeo.h +++ b/src/App/PropertyGeo.h @@ -541,6 +541,8 @@ public: virtual const Data::ComplexGeoData* getComplexData() const = 0; Base::BoundBox3d getBoundingBox() const override = 0; //@} + + void afterRestore() override; }; } // namespace App