[vtkusers] Getting the scalar value from vtkCell

Dominik Szczerba domi at vision.ee.ethz.ch
Mon Aug 13 08:24:10 EDT 2007


Hi Mark,
Please make cc's to the mailing list.
The easiest thing to set up (not necessarily the fastest to perform)
would be to extract the picked selection and use the vtkExtractEdges
filter on it. Then set linewidth to 2 or 3 and color to red in a
corresponding actor.
bye, Dominik

Mark Kobine wrote:
> Hi Dominik,
> 
> Many thanks for the advice.
> 
> If I were to go about plotting the edges of the selected geometry, as
> you suggest, how would I go about this?
> 
> Many thanks,
> Mark
> 
> Dominik Szczerba wrote:
>> 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