[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

@@ -48,7 +48,7 @@
#endif
#include <boost/range.hpp>
#include <App/ComplexGeoData.h>
#include <App/ElementNamingUtils.h>
#include <App/Document.h>
#include <Base/BoundBoxPy.h>
#include <Base/MatrixPy.h>
@@ -635,7 +635,7 @@ public:
break;
}
// new style mapped sub-element
if(Data::ComplexGeoData::isMappedElement(dot+1))
if(Data::isMappedElement(dot+1))
break;
auto next = strchr(dot+1,'.');
if(!next) {
@@ -1031,7 +1031,7 @@ void LinkView::setLinkViewObject(ViewProviderDocumentObject *vpd,
subInfo.clear();
for(const auto &sub : subs) {
if(sub.empty()) continue;
const char *subelement = Data::ComplexGeoData::findElementName(sub.c_str());
const char *subelement = Data::findElementName(sub.c_str());
std::string subname = sub.substr(0,subelement-sub.c_str());
auto it = subInfo.find(subname);
if(it == subInfo.end()) {