[vtkusers] Getting Scalar values through PointPicker

Prathap M Nair prathap.nair at elec.qmul.ac.uk
Sat Dec 3 08:23:50 EST 2005


Hi,

I am trying to retrieve the scalar values associated with picked points in my polydata object. I use PointPicker to pick the points and have a class "CallBack1" associated with the picker as Observer to the EndPickEvent. I have used the class before and everything works fine to get the picked coordinates, but I have trouble now accessing the scalar array within the class.

Extract of the callback class:

void CMyCallback1:: Execute(vtkObject *caller, unsigned long, void*)
{
     vtkWin32RenderWindowInteractor *iren = reinterpret_cast<vtkWin32RenderWindowInteractor*>(caller);
     vtkPointPicker *picker = (vtkPointPicker *)iren->GetPicker();
     
     vtkDoubleArray *shapeind1 = (vtkDoubleArray *) picker->GetMapper()->GetInput()->GetPointData()->GetArray("Shape_Index");
     vtkDoubleArray *curvind1 =  (vtkDoubleArray *) picker->GetActor()->GetMapper()->GetInput()->GetPointData()->GetArray("Curve_Index");
     if (picker->GetPointId() != -1)
    {
        ..........
     }
}

If I use "picker->GetMapper()->GetInput()->GetPointData()->GetArray("Shape_Index");", I get the following error while compiling,
error C2039: 'GetInput' : is not a member of 'vtkAbstractMapper3D'
        c:\vtk\vtk42\rendering\vtkabstractmapper3d.h(40) : see declaration of 'vtkAbstractMapper3D'

If I use "picker->GetActor()->GetMapper()->GetInput()->GetPointData()->GetArray("Curve_Index");", I get unhandled exception errors.

Is there any other way of getting the associated scalar value or getting the pointer to the polydata?
Any help/suggestion would be appreciated.

Thanks in Advance.

Regards,
Prathap


---------------------------------------------------------

Prathap M Nair

Research Student
Multimedia and Vision Lab
Queen Mary, University of London
Mile End Road, London E1 4NS (UK)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20051203/05a80f66/attachment.htm>


More information about the vtkusers mailing list