<div dir="ltr"><div><div><div><div><div>Alex,<br></div>Thanks for your suggestion. I am now trying to convert everything (both grid sources and line sources) to vtkPolyData and append to vtkAppendPolydata.<br><br></div>However how do I do the equivalent of polydata->GetCellData()->GetGlobalIds()->GetTuple1( 0 );<br>
</div>for a vtkAppendPolydata.<br><br></div>I want to recognize what object I picked from the vtkAppendPolydata.<br><br></div>Thanks<br>Bhanu<br><div><div><div><div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Thu, Sep 12, 2013 at 8:49 PM, Alex Malyushytskyy <span dir="ltr"><<a href="mailto:alexmalvtk@gmail.com" target="_blank">alexmalvtk@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr"><div><div><div><div class="im">>> The grid cells are from vtkunstructured grid separate from the lines I was talking about.<br>They are different sources. The grid cells have global Ids and I used to be able to pick using the vtkCellpicker just fine.<br>
<br></div>vtkCellPicker works with dataset which has cell data, it knows nothing about sources.<br></div><div>It does not make sense to have two, all you need is to be able to recognise from the number you get which object was picked.<br>
</div><div><br></div><div><br></div><div>Polydata also has cell data <br></div>polydata->GetCellData()->GetGlobalIds()->GetTuple1( 0 ); <br>so above line works for polydata too<br><br></div>You can add ids to polydata before (from the top of my head in this case all polys you combine have to have it defined , otherwise information may be lost) <br>
or after appending.<span class=""><font color="#888888"><br><br></font></span></div><span class=""><font color="#888888">Alex<br><div><div><div><br></div></div></div></font></span></div><div class=""><div class="h5"><div class="gmail_extra">
<br><br><div class="gmail_quote">On Thu, Sep 12, 2013 at 5:30 PM, Bhanu Hariharan <span dir="ltr"><<a href="mailto:bhanu@petrotel.com" target="_blank">bhanu@petrotel.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div>Alex,<br><br></div>The grid cells are from vtkunstructured grid separate from the lines I was talking about.<br>
</div>They are different sources. The grid cells have global Ids and I used to be able to pick using the vtkCellpicker just fine.<br>
</div><div>Now I want the lines added as vtkpolydata to be pickable too. <br><br></div>I am still unclear if I can use same VTKCELLPicker (the one for grid cells added using vtkgrid) for picking both cells and the lines.<br>
</div>I turned on the PickableOn for both actors.<br><br></div>Regards,<br></div>Bhanu<br><div><div><br><br><div><div><br></div></div></div></div></div><div><div><div class="gmail_extra"><br><br>
<div class="gmail_quote">On Thu, Sep 12, 2013 at 5:29 PM, Alex Malyushytskyy <span dir="ltr"><<a href="mailto:alexmalvtk@gmail.com" target="_blank">alexmalvtk@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div>Bhanu,<br><br>First of all we are talking about polydata (vtkPolyData) where your data is stored, not grid , not vtkLineSource.<br>
</div>vtkLineSource is just a source which generates polydata cells which represent the line,<br>
</div><div>but it does not matter how they were generated.<br><br></div><div><br>You append polydata which represent the line to existing polydata.<br><br></div><div>If you had first polydata with 10 triangles (cells) and second with 3 lines (cells)</div>
<div>result of appending will have 10 triangles followed by 2 lines.<br><br></div><div>So it is relatively easy to find out where cell data which comes from second polydata begins (11th to 13 cells ). <br></div><div>But you are free to use any approach you want to recognize objects.<br>
<br></div><div>For example <br></div><div>If you set global IDs to both polydata before appending, such arrays should be preserved(appended) and you can use the same approach <br></div><div>If your source creates multiple cells as polydata output and you want to be able recognize all cells as a single object you might use custom arrays which would <br>
</div><div>help you to find the relations.<br></div><div>( in above example set 1 to each cell from 1st polydata, 2 for second )<br><br></div><div>Hope this helps,<br></div><div> Alex<br></div><br></div><div>
<div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Thu, Sep 12, 2013 at 8:48 AM, Bhanu Hariharan <span dir="ltr"><<a href="mailto:bhanu@petrotel.com" target="_blank">bhanu@petrotel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr"><div><div><div><div><div>Thanks Alex. It would be very helpful if you could please clarify a bit more. <br></div><div><br>My display already has a grid of cells and a vtkCellPicker to pick cells in the grid. And I use Picker->GetCellId() to get the cell picked. I map the cell id returned using Picker->GetCellId() to a global cell id using something like<br>
<br>pickerdataset->GetCellData()->GetGlobalIds()->GetTuple1(m_pidCellID); <br><br><br></div><div>In the same display I also have Multiple Lines added first to vtkPolydata using<br></div><div><br>do for each Line<br>
<br> ids->InsertId( linenumber, someId);<br></div><div> Lines->InsertNextCell (ids); <br><br></div><div> mypolydata->SetPoints(mypoints);<br> mypolydata->SetLines(Lines); //Lines is the vtkCellArray<br>
<br></div><div> myAppendPolyData->AddInput (mypolydata);<br></div><div>end do<br><br></div><div>mymapper ->SetInput( myAppendPolyData->GetOutput());<br><br><br></div><div>My question is<br></div><div>1. Can I use the same vtkCellPicker to pick both grid cells and Lines or should I declare 2 different vtkCellPickers<br>
</div>Picker1 and Picker 2 .<br><br></div>2. Will the Picker for Lines be used the same WAY as Picker for grid cells.<br></div>That is Can I do Picker->GetCellIId to get the Line Number? And then map to back to some Global Line ID?<br>
<br><br></div>Thanks for your patience and I look forward to your suggestion.<span><font color="#888888"><br><br></font></span></div><span><font color="#888888">Bhanu<br></font></span><div><div>
<div><div><div><br></div><div><br><div><div class="gmail_extra"><br><br><div class="gmail_quote"><div>On Wed, Sep 11, 2013 at 7:46 PM, Alex Malyushytskyy <span dir="ltr"><<a href="mailto:alexmalvtk@gmail.com" target="_blank">alexmalvtk@gmail.com</a>></span> wrote:<br>
</div><div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><br>vtkPropPicker works only with actors.<br></div>
vtkCellPicker will allow you to identify which cell was picked in polydata<br>
<br><a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/Picking/CellPicking" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/Cxx/Picking/CellPicking</a><br>
<br><br></div>Alex<br><div><div><br></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div>On Wed, Sep 11, 2013 at 9:50 AM, Bhanu Hariharan <span dir="ltr"><<a href="mailto:bhanu@petrotel.com" target="_blank">bhanu@petrotel.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div><div dir="ltr"><div><div>Hello,<br><br><br>I was wondering if someone can help me on how to pick Lines added to a vtkAppendPolyData.<br>
</div>before adding to Mapper and Actor.<br><br></div>I saw some example where a linesource was added directly to Mapper and Actor. <br>
<br><div>But I have several lines and having an actor for each one will slow things down considerably. So I use vtkAppendPolyData and add all line sources to it. I then pass the vtkAppendPolyData thorugh a vtktransform and vtktube filter before adding to mapper and actor.<br>
<br></div><div>Can someone please tell me if its possible to use vtkPropPicker or VtkPicker with vtkAppendPolyData.<br></div><div>Also once picked how can I tell which line was picked. Can I assign a global Id to each line?<br>
<br></div><div>Thanks,<br>Bhanu<br> </div><div><br></div></div>
<br>
</div></div><div><hr></div><font size="1"><span style="color:rgb(31,73,125)"><b>DISCLAIMER</b>: </span><font color="#1f497d"><span>This e-mail and any files transmitted with it ("Message") is intended only for the use of the recipient(s) named above and may contain confidential information. You are hereby notified that the taking of any action in reliance upon, or any review, retransmission, dissemination, distribution, printing or copying of this Message or any part thereof by anyone other than the intended recipient(s) is strictly prohibited. If you have received this Message in error, you should delete this Message immediately and advise the sender by return e-mail. Opinions, conclusions and other information in this Message that do not relate to the official business of PETROTEL or its affiliated Companies shall be understood as neither given nor endorsed by PETROTEL or any of its affiliated companies.</span></font></font><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><br>
<br></blockquote></div><br></div>
</blockquote></div></div></div><br></div></div></div></div></div></div></div></div><div><div>
<br>
<div><hr></div><font size="1"><span style="color:rgb(31,73,125)"><b>DISCLAIMER</b>: </span><font color="#1f497d"><span>This e-mail and any files transmitted with it ("Message") is intended only for the use of the recipient(s) named above and may contain confidential information. You are hereby notified that the taking of any action in reliance upon, or any review, retransmission, dissemination, distribution, printing or copying of this Message or any part thereof by anyone other than the intended recipient(s) is strictly prohibited. If you have received this Message in error, you should delete this Message immediately and advise the sender by return e-mail. Opinions, conclusions and other information in this Message that do not relate to the official business of PETROTEL or its affiliated Companies shall be understood as neither given nor endorsed by PETROTEL or any of its affiliated companies.</span></font></font></div>
</div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
<br>
<div><hr></div><font size="1"><span style="color:rgb(31,73,125)"><b>DISCLAIMER</b>: </span><font color="#1f497d"><span>This e-mail and any files transmitted with it ("Message") is intended only for the use of the recipient(s) named above and may contain confidential information. You are hereby notified that the taking of any action in reliance upon, or any review, retransmission, dissemination, distribution, printing or copying of this Message or any part thereof by anyone other than the intended recipient(s) is strictly prohibited. If you have received this Message in error, you should delete this Message immediately and advise the sender by return e-mail. Opinions, conclusions and other information in this Message that do not relate to the official business of PETROTEL or its affiliated Companies shall be understood as neither given nor endorsed by PETROTEL or any of its affiliated companies.</span></font></font></div>
</div></blockquote></div><br></div>
</div></div></blockquote></div><br></div></div></div></div></div></div></div></div>
<br>
<div><hr></div><font size="1"><span style="color:rgb(31,73,125);background-color:rgb(255,255,255)"><b>DISCLAIMER</b>: </span><font color="#1f497d"><span style="background-color:rgb(255,255,255)">This e-mail and any files transmitted with it ("Message") is intended only for the use of the recipient(s) named above and may contain confidential information. You are hereby notified that the taking of any action in reliance upon, or any review, retransmission, dissemination, distribution, printing or copying of this Message or any part thereof by anyone other than the intended recipient(s) is strictly prohibited. If you have received this Message in error, you should delete this Message immediately and advise the sender by return e-mail. Opinions, conclusions and other information in this Message that do not relate to the official business of PETROTEL or its affiliated Companies shall be understood as neither given nor endorsed by PETROTEL or any of its affiliated companies.</span></font></font>