[prev in list] [next in list] [prev in thread] [next in thread] 

List:       vtkusers
Subject:    Re: [vtkusers] Pickable vtkPolyData
From:       Jothybasu Selvaraj <jothybasu () gmail ! com>
Date:       2011-11-30 15:27:26
Message-ID: CAKuw5X0eUvopbGF5UJrCSZcU0bQhnEPKmJFN=ZNGGMH5zar6ZA () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


vtkDataSetSurfaceFilter will avoid this

"The side effect of vtkTriangleFilter is that it breaks the single cell
into multiples which causes lines to be drawn across the interior of the
polygon."

Jothy

On Wed, Nov 30, 2011 at 3:18 PM, Scott Johnson <Scott.Johnson@neuwave.com>wrote:

> Thanks for the pointer Jothy.  I haven’t tried that one yet.****
>
> ** **
>
> It does work if I have 2 representations of the contour in 2 separate
> actors.  One is a series of line cells and the other is a polygon set to
> surface and an opacity of 0.01.  If the opacity is 0.0, the pick doesn’t
> find it.  I’d just like to avoid the redundancy.****
>
> ** **
>
>                                 -- Scott****
>
> ** **
>
> *From:* Jothybasu Selvaraj [mailto:jothybasu@gmail.com]
> *Sent:* Wednesday, November 30, 2011 4:11 AM
> *To:* Scott Johnson
> *Cc:* vtkusers@vtk.org
> *Subject:* Re: [vtkusers] Pickable vtkPolyData****
>
> ** **
>
> Instead of passing it through a vtkTriangleFilter, have you tried passing
> through the vtkDataSetSurfaceFilter and setting he representation to
> wireframe?
>
> I once had this problem, when I was trying to display a beam.
>
> Jothy****
>
> On Tue, Nov 29, 2011 at 4:01 PM, Scott Johnson <Scott.Johnson@neuwave.com>
> wrote:****
>
> Hello,****
>
>  ****
>
> I’ve been developing a capability to interactively create contours on
> image slices with ActiViz 5.6.1 on Windows 7 x64.****
>
>  ****
>
> During the initial definition of the contour the representation is stored
> in a vtkPolyData built up by defining Line cells.  When the editing is
> completed the contour is closed by defining a line from the last to the
> first point.  The entire pipeline for display looks like:****
>
>  ****
>
> vtkPolyData -> vtkPolyDataMapper -> vtkActor -> …****
>
>  ****
>
> The problem comes when I try to pick the contour.  I’d like to click
> within the closed polygon defined by the lines and be notified of the
> pick.  However, since the vtkPolyData is made of lines the pick doesn’t
> seem to recognize it.  I’ve used different prop pickers (i.e. vtkPropPicker
> and vtkCellPicker) all failing.  I decided that I had to define the cell in
> the vtkPolyData as a Polygon rather than lines for the pick to be
> recognized.  This solved the picking problem.  In order to correctly
> display the boundaries of the polygonal cell I had to pass the vtkPolyData
> through a vtkTriangleFilter.****
>
>  ****
>
> Now I want the display to be an outline of the polygon cell without any
> interior shading.  The side effect of vtkTriangleFilter is that it breaks
> the single cell into multiples which causes lines to be drawn across the
> interior of the polygon.  This is undesirable.  I’ve tried using different
> representations for the actor, but Wireframe and Surface don’t look right.
> ****
>
>  ****
>
> After all that, is there a way to display the contour as an outline and
> have it pickable?  Right now I’m leaning toward having 2 actors, one with
> the lines and one with the polygon, but make the polygon actor
> transparent.  However I’d like to avoid the overhead.****
>
>  ****
>
> Thanks****
>
>  ****
>
>                                 -- Scott****
>
>  ****
>
>
> _______________________________________________
> 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****
>
>
>
>
> -- ****
>
> Jothy****
>
> ** **
>



-- 
Jothy

[Attachment #5 (text/html)]

<div dir="ltr">vtkDataSetSurfaceFilter will avoid this<br><br>&quot;The side effect \
of vtkTriangleFilter is that it breaks the single cell  into multiples which causes \
lines to be drawn across the interior of the  polygon.&quot;<br><br>Jothy<br><br><div \
class="gmail_quote">On Wed, Nov 30, 2011 at 3:18 PM, Scott Johnson <span \
dir="ltr">&lt;<a href="mailto:Scott.Johnson@neuwave.com">Scott.Johnson@neuwave.com</a>&gt;</span> \
wrote:<br> <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px \
#ccc solid;padding-left:1ex;"><div link="blue" vlink="purple" lang="EN-US"><div><p \
class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Thanks \
for the pointer Jothy.  I haven’t tried that one yet.<u></u><u></u></span></p> <p \
class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> \
<u></u></span></p><p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">It \
does work if I have 2 representations of the contour in 2 separate actors.  One is a \
series of line cells and the other is a polygon set to surface and an opacity of \
0.01.  If the opacity is 0.0, the pick doesn’t find it.  I’d just like to avoid the \
redundancy.<u></u><u></u></span></p> <p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> \
<u></u></span></p><p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"> \
-- Scott<u></u><u></u></span></p> <p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> \
<u></u></span></p><p class="MsoNormal"><b><span \
style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">From:</span></b><span \
style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"> \
Jothybasu Selvaraj [mailto:<a href="mailto:jothybasu@gmail.com" \
target="_blank">jothybasu@gmail.com</a>] <br> <b>Sent:</b> Wednesday, November 30, \
2011 4:11 AM<br><b>To:</b> Scott Johnson<br><b>Cc:</b> <a \
href="mailto:vtkusers@vtk.org" \
target="_blank">vtkusers@vtk.org</a><br><b>Subject:</b> Re: [vtkusers] Pickable \
vtkPolyData<u></u><u></u></span></p> <div><div class="h5"><p \
class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal" \
style="margin-bottom:12.0pt">Instead of passing it through a vtkTriangleFilter, have \
you tried passing through the vtkDataSetSurfaceFilter and setting he representation \
to wireframe?<br> <br>I once had this problem, when I was trying to display a \
beam.<br><br>Jothy<u></u><u></u></p><div><p class="MsoNormal">On Tue, Nov 29, 2011 at \
4:01 PM, Scott Johnson &lt;<a href="mailto:Scott.Johnson@neuwave.com" \
target="_blank">Scott.Johnson@neuwave.com</a>&gt; wrote:<u></u><u></u></p> \
<div><div><p class="MsoNormal">Hello,<u></u><u></u></p><p class="MsoNormal"> \
<u></u><u></u></p><p class="MsoNormal">I’ve been developing a capability to \
interactively create contours on image slices with ActiViz 5.6.1 on Windows 7 \
x64.<u></u><u></u></p> <p class="MsoNormal"> <u></u><u></u></p><p \
class="MsoNormal">During the initial definition of the contour the representation is \
stored in a vtkPolyData built up by defining Line cells.  When the editing is \
completed the contour is closed by defining a line from the last to the first point.  \
The entire pipeline for display looks like:<u></u><u></u></p> <p class="MsoNormal"> \
<u></u><u></u></p><p class="MsoNormal" style="margin-left:.5in">vtkPolyData -&gt; \
vtkPolyDataMapper -&gt; vtkActor -&gt; …<u></u><u></u></p><p class="MsoNormal"> \
<u></u><u></u></p><p class="MsoNormal"> The problem comes when I try to pick the \
contour.  I’d like to click within the closed polygon defined by the lines and be \
notified of the pick.  However, since the vtkPolyData is made of lines the pick \
doesn’t seem to recognize it.  I’ve used different prop pickers (i.e. vtkPropPicker \
and vtkCellPicker) all failing.  I decided that I had to define the cell in the \
vtkPolyData as a Polygon rather than lines for the pick to be recognized.  This \
solved the picking problem.  In order to correctly display the boundaries of the \
polygonal cell I had to pass the vtkPolyData through a \
vtkTriangleFilter.<u></u><u></u></p> <p class="MsoNormal"> <u></u><u></u></p><p \
class="MsoNormal">Now I want the display to be an outline of the polygon cell without \
any interior shading.  The side effect of vtkTriangleFilter is that it breaks the \
single cell into multiples which causes lines to be drawn across the interior of the \
polygon.  This is undesirable.  I’ve tried using different representations for the \
actor, but Wireframe and Surface don’t look right.<u></u><u></u></p> <p \
class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal">After all that, is there a \
way to display the contour as an outline and have it pickable?  Right now I’m leaning \
toward having 2 actors, one with the lines and one with the polygon, but make the \
polygon actor transparent.  However I’d like to avoid the overhead.<u></u><u></u></p> \
<p class="MsoNormal"> <u></u><u></u></p><p \
class="MsoNormal">Thanks<u></u><u></u></p><p class="MsoNormal"><span \
style="color:#888888"> <u></u><u></u></span></p><p class="MsoNormal"><span \
style="color:#888888">                                -- \
Scott<u></u><u></u></span></p> <p class="MsoNormal"><span style="color:#888888"> \
<u></u><u></u></span></p></div></div><p class="MsoNormal" \
style="margin-bottom:12.0pt"><br>_______________________________________________<br>Powered \
by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br> <br>Visit \
other Kitware open-source projects at <a \
href="http://www.kitware.com/opensource/opensource.html" \
target="_blank">http://www.kitware.com/opensource/opensource.html</a><br><br>Please \
keep messages on-topic and check the VTK FAQ at: <a \
href="http://www.vtk.org/Wiki/VTK_FAQ" \
target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br> <br>Follow this link to \
subscribe/unsubscribe:<br><a href="http://www.vtk.org/mailman/listinfo/vtkusers" \
target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><u></u><u></u></p></div><p \
class="MsoNormal"><br><br clear="all"> <br>-- <u></u><u></u></p><div><p \
class="MsoNormal">Jothy<u></u><u></u></p></div><p class="MsoNormal"><u></u> \
<u></u></p></div></div></div></div></div></blockquote></div><br><br \
clear="all"><br>-- <br><div dir="ltr">Jothy<br> </div><br>
</div>



_______________________________________________
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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic