Toposhape/Part: element methods in ComplexGeoData and TopoShape

This commit is contained in:
Zheng, Lei
2024-02-27 15:33:21 -05:00
committed by bgbsww
parent cd0d58cfe9
commit 5e532494ca
4 changed files with 120 additions and 0 deletions

View File

@@ -4084,6 +4084,7 @@ TopoShape &TopoShape::makeRefine(const TopoShape &shape, const char *op, RefineF
return *this;
}
// TODO: Does the toponaming branch version of this method need to be here?
bool TopoShape::findPlane(gp_Pln &pln, double tol) const {
if(_Shape.IsNull())
return false;

View File

@@ -5003,4 +5003,25 @@ bool TopoShape::isSame(const Data::ComplexGeoData &_other) const
&& _Shape.IsEqual(other._Shape);
}
void TopoShape::cacheRelatedElements(const Data::MappedName &name,
bool sameType,
const QVector<Data::MappedElement> & names) const
{
INIT_SHAPE_CACHE();
_Cache->insertRelation(ShapeRelationKey(name,sameType), names);
}
bool TopoShape::getRelatedElementsCached(const Data::MappedName &name,
bool sameType,
QVector<Data::MappedElement> &names) const
{
if(!_Cache)
return false;
auto it = _Cache->relations.find(ShapeRelationKey(name,sameType));
if(it == _Cache->relations.end())
return false;
names = it->second;
return true;
}
} // namespace Part