[vtkusers] Picking and Annotation

David Doria daviddoria+vtk at gmail.com
Thu Jan 28 17:22:36 EST 2010


On Thu, Jan 28, 2010 at 12:14 PM, David Gobbi <david.gobbi at gmail.com> wrote:
> Try vtkDataSetSurfaceFilter or one of the vtkGeometryFilters.
>
>   David
>
>
> On Thu, Jan 28, 2010 at 9:20 AM, Rakesh Patil <rakeshthp at in.com> wrote:
>>
>> Is there anyway to convert unstructured grid to polydata..?? coz what i am
>> using here is unstructured grid. And the output of any filter is polydata.
>>
>> ---------- Original message ----------
>> From:Karthik Krishnan< karthik.krishnan at kitware.com >
>> Date: 27 Jan 10 22:42:37
>> Subject: Re: [vtkusers] Picking and Annotation
>> To: Rakesh Patil
>>
>> On Wed, Jan 27, 2010 at 12:00 PM, Rakesh Patil wrote:
>>>
>>> HI..
>>>
>>> Thanks to all for your replies..
>>>
>>> To David Gobbi,
>>> I want it just to highlight the cell so that next time again when user
>>> clicks some other cell,
>>> then, the current cell, which is highlighted ( or which is black), should
>>> become white and
>>> the newly selected cell, must be highlighted.
>>>
>>> I also thought the same thing, but, later on i thought, that we need to
>>> use
>>> two actors. and
>>> i guess, it can be done with one.. So just to find whether there is any
>>> possibility that this task
>>> can be achieved by using single actor or not,
>>
>> Yes it can, by adding a dataarray containing scalars for cell data.
>> And then having the polydata colored by cell data. But this is a
>> terrible overkill to color just one cell. You should really use 2
>> actors.
>>
>>> i posted my question.
>>> Nevertheless, i'll tr to implement this first.
>>>
>>> Thanks.
>>>
>>> ---------- Original message ----------
>>> From:Karthik Krishnan< karthik.krishnan at kitware.com >
>>> Date: 27 Jan 10 22:07:21
>>> Subject: Re: [vtkusers] Picking and Annotation
>>> To: Rakesh Patil
>>>
>>> And be prepared to handle z fighting issues.. using one of the
>>> standard ways.. also see
>>> vtkMapper::ResolveCoinicidentTopologyToPolygonOffset
>>>
>>> On Wed, Jan 27, 2010 at 10:27 AM, David Gobbi wrote:
>>>> Hi Rakesh,
>>>&g t;
>>>> The method that you use to annotate the cell will depend on whether
>>>> you want to permanently color the cell, or whether you just want to
>>>> highlight it.
>>>>
>>>> If you just want to highlight the cell, then the best thing to do is
>>>> make a new polydata, set its color to black, and then add the picked
>>>> cell to the new polydata. Then add this new polydata to an actor and
>>>> add the new actor to the renderer so that it will render the black
>>>> cell over the original cell. Use the vtkGenericCell as an
>>>> intermediate for getting the cell from the original polydata and
>>>> adding it to the new polydata.
>>>>
>>>> By doing things this way, you would leave the original polydata
>>>> unchanged, and create a new "annotation" actor that has your picked< br>>
>>>> cells. I'm not sure if this is would meet your needs, but it would be
>>>> a straightforward way of visualizing the cell pick.
>>>>
>>>> David
>>>>
>>>>
>>>> On Wed, Jan 27, 2010 at 7:01 AM, Rakesh Patil wrote:
>>>>> Hello,
>>>>>
>>>>> I want to implement picking. With the help of an example,
>>>>> annotatePick.tcl,
>>>>> i'm able pick a cell, but annotation is not possible..
>>>>>
>>>>> I am displaying a triangular mesh. And when the user clicks on any of
>>>>> the
>>>>> cell of the mesh, i need that particular cell to be filled with black.
>>>>> Only
>>>>> that particular cell has to be annotated as a filled black color.
>>>>>
>>>>> Is it possible..?? After picking i'm getting cellid, of the cell which
>>>>> is
>>>>> selected. How can i do the annotation..??
>>>>>
>>>>> Thanks in advance
>>>>>
>>>>> Regards
>>>>>
>>>>>
>>>>> D ear vtkusers ! Ge t Yourself a cool, short @in.com Email ID now!
>>>>> _______________________________________________
>>>>> Powered by www.kitware.com
>>>>>
>>>>> Visit other Kitware open-source projects at
>>>>> http://www.kitware.com/opensource/opensource.html
>>>>>
>>>>> Please keep messages on-topic and check the VTK FAQ at:
>>>>> http://www.vtk.org/Wiki/VTK_FAQ
>>>>>
>>>>> Follow this link to subscribe/unsubscribe:
>>>>> http://www.vtk.org/mailman/listinfo/vtkusers
>>>>>
>>>>>
>>>> _________________ ______________________________
>>>> Powered by www.kitware.com
>>>>
>>>> Visit other Kitware open-source projects at
>>>> http://www.kitware.com/opensource/opensource.html
>>>>
>>>> Please keep messages on-topic and check the VTK FAQ at:
>>>> http://www.vtk.org/Wiki/VTK_FAQ
>>>>
>>>> Follow this link to subscribe/unsubscribe:
>>>> http://www.vtk.org/mailman/listinfo/vtkusers

Here are shell examples of what David G. mentioned:

http://www.vtk.org/Wiki/VTK/Examples/DataSetSurfaceFilter
http://www.vtk.org/Wiki/VTK/Examples/GeometryFilter

If you figure out the difference or have a good example of either
please let me know or post it on the wiki.

Thanks,

David



More information about the vtkusers mailing list