[vtkusers] how to change the color of single picked cell

vidyadhar vidyadhar at lucidindia.net
Wed Mar 16 07:47:23 EST 2005


Hi,
I do not know if your polydata is have cell data. If it does not, you can
create scalar cell data. To begin with it can have one fixed value for all
cells. As you get valid cellids, reset earlier cell scalar to default and
change picked cell's scalar to different fixed value. You could even use
bitarray as scalar data type. You will be using vtkPolyDataMapper for
creating actor. This mapper has two methods which are of use here -
SetColorModeToMapScalars and SetScalarModeToUseCellData. You may find the
mappers default color LUT unsatisfactory in which case you can provide your
own LUT for this purpose.
HTH
Vidyadhar
----- Original Message -----
From: "Tracy" <flypureau at hotmail.com>
To: "vtkuser" <vtkusers at vtk.org>
Sent: Wednesday, March 16, 2005 1:38 PM
Subject: [vtkusers] how to change the color of single picked cell


> Hi Everyone,
>
> My application is to display a 3D model with a group of PolyData cells.
> This model is represented by an actor. "vtkCellPicker" is used to select a
> specific cell . My question is how to change the colour of the single
> selected
> cell without any influence to the rest when the cursor is over this cell.
>
> Any suggestion?
>
> Thanks in advance.
>
> Regards
> Tracy
>
>




More information about the vtkusers mailing list