Toposhape/Part:: fix, relocate and test element methods in ComplexGeoData and TopoShape

This commit is contained in:
bgbsww
2024-02-28 15:56:45 -05:00
parent 5e532494ca
commit 834bbff6b0
11 changed files with 273 additions and 105 deletions

View File

@@ -5002,23 +5002,22 @@ bool TopoShape::isSame(const Data::ComplexGeoData &_other) const
&& Hasher == other.Hasher
&& _Shape.IsEqual(other._Shape);
}
void TopoShape::cacheRelatedElements(const Data::MappedName &name,
bool sameType,
HistoryTraceType sameType,
const QVector<Data::MappedElement> & names) const
{
INIT_SHAPE_CACHE();
_Cache->insertRelation(ShapeRelationKey(name,sameType), names);
initCache();
_cache->insertRelation(ShapeRelationKey(name,sameType), names);
}
bool TopoShape::getRelatedElementsCached(const Data::MappedName &name,
bool sameType,
HistoryTraceType sameType,
QVector<Data::MappedElement> &names) const
{
if(!_Cache)
if(!_cache)
return false;
auto it = _Cache->relations.find(ShapeRelationKey(name,sameType));
if(it == _Cache->relations.end())
auto it = _cache->relations.find(ShapeRelationKey(name,sameType));
if(it == _cache->relations.end())
return false;
names = it->second;
return true;