Toposhape/Part: Transfer in PropoertyTopoShape and related
This commit is contained in:
@@ -1244,6 +1244,40 @@ PropertyComplexGeoData::PropertyComplexGeoData() = default;
|
||||
|
||||
PropertyComplexGeoData::~PropertyComplexGeoData() = default;
|
||||
|
||||
std::string PropertyComplexGeoData::getElementMapVersion(bool) const {
|
||||
auto data = getComplexData();
|
||||
if(!data)
|
||||
return std::string();
|
||||
auto owner = Base::freecad_dynamic_cast<DocumentObject>(getContainer());
|
||||
std::ostringstream ss;
|
||||
if(owner && owner->getDocument()
|
||||
&& owner->getDocument()->getStringHasher()==data->Hasher)
|
||||
ss << "1.";
|
||||
else
|
||||
ss << "0.";
|
||||
ss << data->getElementMapVersion();
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
bool PropertyComplexGeoData::checkElementMapVersion(const char * ver) const
|
||||
{
|
||||
auto data = getComplexData();
|
||||
if(!data)
|
||||
return false;
|
||||
auto owner = Base::freecad_dynamic_cast<DocumentObject>(getContainer());
|
||||
std::ostringstream ss;
|
||||
const char *prefix;
|
||||
if(owner && owner->getDocument()
|
||||
&& owner->getDocument()->getStringHasher() == data->Hasher)
|
||||
prefix = "1.";
|
||||
else
|
||||
prefix = "0.";
|
||||
if (!boost::starts_with(ver, prefix))
|
||||
return true;
|
||||
return data->checkElementMapVersion(ver+2);
|
||||
}
|
||||
|
||||
|
||||
void PropertyComplexGeoData::afterRestore()
|
||||
{
|
||||
auto data = getComplexData();
|
||||
|
||||
Reference in New Issue
Block a user