Annotations : Remove check on priority

For performance reasons, priority was checked before dyncast. This does not work now for unknown reasons.
This commit is contained in:
Magne Sjaastad
2019-01-02 14:39:39 +01:00
parent c5dc9da4bd
commit fe75265053

View File

@@ -1154,18 +1154,15 @@ void RiuViewerCommands::handleTextPicking(int winPosX, int winPosY, cvf::HitItem
for (size_t pIdx = 0; pIdx < partCollection.size(); ++pIdx)
{
if (partCollection[pIdx]->priority() == RivPartPriority::PartType::Text) // Just trying to avoid dyncasting all drawables
DrawableText* textDrawable = dynamic_cast<DrawableText*>(partCollection[pIdx]->drawable());
if (textDrawable)
{
DrawableText* textDrawable = dynamic_cast<DrawableText*> (partCollection[pIdx]->drawable());
if (textDrawable)
cvf::Vec3d ppoint;
if (textDrawable->rayIntersect(*ray, *(m_viewer->mainCamera()), &ppoint))
{
cvf::Vec3d ppoint;
if (textDrawable->rayIntersect(*ray, *( m_viewer->mainCamera()), &ppoint))
{
cvf::ref<HitItem> hitItem = new HitItem(0, ppoint);
hitItem->setPart(partCollection[pIdx].p());
hitItems->add(hitItem.p());
}
cvf::ref<HitItem> hitItem = new HitItem(0, ppoint);
hitItem->setPart(partCollection[pIdx].p());
hitItems->add(hitItem.p());
}
}
}