[vtkusers] Getting Scalar values through PointPicker

Darshan Pai vtk_darshan at yahoo.com
Sun Dec 4 21:51:14 EST 2005


Use the GetPointId function to get Pointid of the picked point
   
  Use to pointId to get Scalar value. U can use the 
   
  

Prathap M Nair <prathap.nair at elec.qmul.ac.uk> wrote:
          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)
   
   
_______________________________________________
This is the private VTK discussion list. 
Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers
  


		
---------------------------------
 Yahoo! Personals
 Single? There's someone we'd like you to meet.
 Lots of someones, actually. Yahoo! Personals
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20051204/a9865959/attachment.htm>


More information about the vtkusers mailing list