Hi Mikhail,
I think mitkPointSetDataInteractor.cpp contains exactly the
functionality that you need
(if you activate pointsetinteraction in Cmake, you will get the
according plugin, to check out the functionality in the workbench).
In mitkPointSetDataInteractor you will see how to get the closest point
of a PointSet from a 3D Position (GetPointIndexByPosition()),
In mitkInteractionPositionEvent a 2D display Coordinate is computed into
the 3D WorldPositions.
I'm not sure what the final goal of selecting a point in the pointset ist,
but if you just want to be able to click on a point and then determine
which one was selected, the easiest way would be the following:
use the PointSet Plugin, and then iterate of you point set and ask
which point has been selected (because the selection-state of each point
is updated during the interaction)
as is done in the function mitk::PointSetDataInteractor::MovePoint :
mitk::PointSet::PointsIterator it, end;
it = m_PointSet->Begin();
end = m_PointSet->End();
while( it != end )
{
int position = it->Index();
if ( m_PointSet->GetSelectInfo(position, timeStep) )//if selected
{
// this point is selected!
}
++it;
}
Regards
Christian
On 05/19/2015 02:26 PM, Pukhlikov Mikhail wrote:
Hello
Is it possible to implement selecting one point from PointSet on 3D
view in multiwidget?
I think it possible to add observer for mousePressEvent
But then will mousePressEvent -> VtkPropRenderer::PickWorldPoint
return exactly the same z position where my point is located so I can
enumerate points and compare if nearest point is clicked?
Thank you.
------------------------------------------------------------------------------
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users