#3214 Use template function to get referencing objects of specified type

This commit is contained in:
Magne Sjaastad
2018-08-15 12:55:45 +02:00
parent 97c3b9efea
commit 59f9d189e5
8 changed files with 45 additions and 58 deletions

View File

@@ -744,16 +744,16 @@ void RimIntersection::appendPointToPolyLine(const cvf::Vec3d& point)
//--------------------------------------------------------------------------------------------------
Rim2dIntersectionView* RimIntersection::correspondingIntersectionView()
{
std::vector<caf::PdmObjectHandle*> objects;
this->objectsWithReferringPtrFields(objects);
Rim2dIntersectionView* isectView = nullptr;
for (auto obj : objects)
std::vector<Rim2dIntersectionView*> objects;
this->objectsWithReferringPtrFieldsOfType(objects);
for (auto isectView : objects)
{
isectView = dynamic_cast<Rim2dIntersectionView*>(obj);
if (isectView) break;
if (isectView)
{
return isectView;
}
}
return isectView;
return nullptr;
}