[Toponaming] create ElementMap class (#9175)

* Copypaste ElementMap
* Add MappedNameRef
* Fix missing include
* Copypaste `findTagInElementName`
* fix error introduced _somewhere_
* refactor toponaming constants
* Move `findTagInElementName` in `MappedName`
* reintroduce workaround to compile ElementMap
* Added missing functions copied from complexgeodata
* fix last compile errors, reorder and format files
* remove recursive refs to ComplexGeoData
* Add more comments
* fixed comments and added tests
* added FIXME, make functions private, misc fixes
* Move static functions from complexGeoData to PostfixStringReferences. Rename to ElementNamingUtils
* Fix broken includes due to previous change
* Revert constants from string to const char*
* added childmap tests and made hasher public
* Make functions private
* Added remaining tests
* removed bool return from `erase` functions
* fix missing appexport

Co-authored-by: John Dupuy <jdupuy98@gmail.com>
This commit is contained in:
Pesc0
2023-06-15 16:05:24 +02:00
committed by GitHub
parent 32d8029780
commit 4a8d3853ba
26 changed files with 2450 additions and 218 deletions

View File

@@ -27,7 +27,7 @@
#include "GeoFeature.h"
#include "GeoFeatureGroupExtension.h"
#include "ComplexGeoData.h"
#include "ElementNamingUtils.h"
using namespace App;
@@ -101,7 +101,7 @@ DocumentObject *GeoFeature::resolveElement(DocumentObject *obj, const char *subn
return nullptr;
if(!subname)
subname = "";
const char *element = Data::ComplexGeoData::findElementName(subname);
const char *element = Data::findElementName(subname);
if(_element) *_element = element;
auto sobj = obj->getSubObject(subname);
if(!sobj)
@@ -114,7 +114,7 @@ DocumentObject *GeoFeature::resolveElement(DocumentObject *obj, const char *subn
return nullptr;
if(!element || !element[0]) {
if(append)
elementName.second = Data::ComplexGeoData::oldElementName(subname);
elementName.second = Data::oldElementName(subname);
return sobj;
}
@@ -122,7 +122,7 @@ DocumentObject *GeoFeature::resolveElement(DocumentObject *obj, const char *subn
if(!append)
elementName.second = element;
else
elementName.second = Data::ComplexGeoData::oldElementName(subname);
elementName.second = Data::oldElementName(subname);
return sobj;
}
if(!append)