[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 e649e99ee2
commit c65f049d20
26 changed files with 2450 additions and 218 deletions

View File

@@ -34,7 +34,7 @@
#include <Base/Writer.h>
#include "Application.h"
#include "ComplexGeoData.h"
#include "ElementNamingUtils.h"
#include "Document.h"
#include "DocumentObject.h"
#include "DocumentObjectExtension.h"
@@ -1094,7 +1094,7 @@ DocumentObject *DocumentObject::resolve(const char *subname,
// following it. So finding the last dot will give us the end of the last
// object name.
const char *dot=nullptr;
if(Data::ComplexGeoData::isMappedElement(subname) ||
if(Data::isMappedElement(subname) ||
!(dot=strrchr(subname,'.')) ||
dot == subname)
{
@@ -1117,7 +1117,7 @@ DocumentObject *DocumentObject::resolve(const char *subname,
if(!elementMapChecked) {
elementMapChecked = true;
const char *sub = dot==subname?dot:dot+1;
if(Data::ComplexGeoData::isMappedElement(sub)) {
if(Data::isMappedElement(sub)) {
lastDot = dot;
if(dot==subname)
break;