Part/Toponaming: clang-tidy cleanup of cache calls

This commit is contained in:
Chris Hennes
2023-12-23 11:39:57 -06:00
committed by Chris Hennes
parent 58e53c1b22
commit 2dc5e8de5b
3 changed files with 6 additions and 25 deletions

View File

@@ -79,14 +79,14 @@ public:
/// Inverse of location
TopLoc_Location locationInverse;
struct AncestorInfo
struct PartExport AncestorInfo
{
bool initialized = false;
TopTools_IndexedDataMapOfShapeListOfShape shapes;
};
/// Class for caching the ancestor and children shapes mapping
class Ancestry
class PartExport Ancestry
{
private:
TopoShapeCache* owner = nullptr;

View File

@@ -138,22 +138,21 @@ int TopoShape::findShape(const TopoDS_Shape& subshape) const
return _cache->findShape(_Shape, subshape);
}
static const std::string _SubShape("SubShape");
TopoDS_Shape TopoShape::findShape(const char* name) const
{
if (!name) {
return TopoDS_Shape();
return {};
}
Data::MappedElement res = getElementName(name);
if (!res.index) {
return TopoDS_Shape();
return {};
}
auto idx = shapeTypeAndIndex(name);
if (!idx.second) {
return TopoDS_Shape();
if (idx.second == 0) {
return {};
}
initCache();
return _cache->findShape(_Shape, idx.first, idx.second);