[vtkusers] change the color of the"picked" cell

Tracy flypureau at hotmail.com
Tue Mar 15 20:03:11 EST 2005


Hi Dr  Ingo,

Thanks for your quick and helpful reply. Based on your suggestion,
my code works now.

But I also got another question:

How to change the colour of the "picked" cell which is implemented by 
vtkCellPicker?
I work with a 3D vtkPolyData model.

Thanks in advance.

Tracy

----- Original Message ----- 
From: "de Boer Ingo" <I.deBoer at polytec.de>
To: "Tracy" <flypureau at hotmail.com>; "vtkuser" <vtkusers at vtk.org>
Sent: Tuesday, March 15, 2005 6:19 PM
Subject: RE: [vtkusers] vtk picking


Hi Tracy,

you get "-1" because you didn't start the picker callback.
with StartPickCallback. Look at the lines of vtkInteractorStyle.cxx:
Search for "'p'". This is what happens, when you press "p". Your
version works with LeftButtonPressEvent when you press "p" before
you press the left mouse button.

The easiest way for you would be to write your own interactor.

greets
  Ingo

---
Dr.-Ing. Ingo H. de Boer

Polytec GmbH
Polytec-Platz 1-7, 76337 Waldbronn, Germany
phone: ++49 7243 604 106
fax  : ++49 7243 604 255


> It is my first time to use vtkCellPicker and the related classes.
> Unfortunately, I
> never get any code works well for me regardless of writing by myself
> or downloading from Internet. One example is from
> http://public.kitware.com/pipermail/vtkusers/2004-April/073344.html,
> but it looks that "vtkCommand::EndPickEvent" doesn't show any effect,
> if I use "LeftButtonPressEvent" instead of "EndPickEvent" ,
> the printed
> value is always "-1" ,which means I never picked any point.
> Anybody can tell me why?



More information about the vtkusers mailing list