[vtkusers] Getting the scalar value from vtkCell
Dominik Szczerba
domi at vision.ee.ethz.ch
Fri Aug 10 09:48:58 EDT 2007
This has been frequently asked here. There is no way to change a cell
color other than to change its scalar value. This is not elegant as you
have to write to your original dataset, supposedly writing down the
overwritten value temporarily and taking care it is written back when
you un-pick. Then, you have to remember that the modified scalar has
still go through a color lookup table to be seen and having it always
e.g. red may not always be that trivial and robust.
I would recommend a different way without modifying the actual data,
like shrinking the element, plotting it edges, or annotating it's nodes etc.
- Dominik
Mark Kobine wrote:
> Hi,
>
> I have some geometry read in from an STL file that contains several
> "solid" sections. These sections are currently coloured automatically
> by vtk based on the scalar value assigned to each section as it is
> read in. I want to change the appearance of one of these sections if
> the user clicks on it in the renderer window.
>
> I'm using vtkCellPicker and from that I can get the selected vtkCell.
> From there is there a way to get the scalar value for that cell?
>
> My approach is to use that scalar to somehow change the appearance of
> all cells with the same scalar value.
>
> Can any one help? Is this a sensible approach?
>
> Many thanks,
> Mark
> _______________________________________________
> 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
--
Dominik Szczerba, Ph.D.
Computer Vision Lab CH-8092 Zurich
http://www.vision.ee.ethz.ch/~domi
More information about the vtkusers
mailing list