[vtkusers] Pick From vtkLineSource added to vtkAppendPolyData
Bhanu Hariharan
bhanu at petrotel.com
Thu Sep 12 11:48:47 EDT 2013
Thanks Alex. It would be very helpful if you could please clarify a bit
more.
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
pickerdataset->GetCellData()->GetGlobalIds()->GetTuple1(m_pidCellID);
In the same display I also have Multiple Lines added first to vtkPolydata
using
do for each Line
ids->InsertId( linenumber, someId);
Lines->InsertNextCell (ids);
mypolydata->SetPoints(mypoints);
mypolydata->SetLines(Lines); //Lines is the vtkCellArray
myAppendPolyData->AddInput (mypolydata);
end do
mymapper ->SetInput( myAppendPolyData->GetOutput());
My question is
1. Can I use the same vtkCellPicker to pick both grid cells and Lines or
should I declare 2 different vtkCellPickers
Picker1 and Picker 2 .
2. Will the Picker for Lines be used the same WAY as Picker for grid cells.
That is Can I do Picker->GetCellIId to get the Line Number? And then map to
back to some Global Line ID?
Thanks for your patience and I look forward to your suggestion.
Bhanu
On Wed, Sep 11, 2013 at 7:46 PM, Alex Malyushytskyy <alexmalvtk at gmail.com>wrote:
>
> vtkPropPicker works only with actors.
> vtkCellPicker will allow you to identify which cell was picked in polydata
>
> http://www.vtk.org/Wiki/VTK/Examples/Cxx/Picking/CellPicking
>
>
> Alex
>
>
>
> On Wed, Sep 11, 2013 at 9:50 AM, Bhanu Hariharan <bhanu at petrotel.com>wrote:
>
>> Hello,
>>
>>
>> I was wondering if someone can help me on how to pick Lines added to a
>> vtkAppendPolyData.
>> before adding to Mapper and Actor.
>>
>> I saw some example where a linesource was added directly to Mapper and
>> Actor.
>>
>> 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.
>>
>> Can someone please tell me if its possible to use vtkPropPicker or
>> VtkPicker with vtkAppendPolyData.
>> Also once picked how can I tell which line was picked. Can I assign a
>> global Id to each line?
>>
>> Thanks,
>> Bhanu
>>
>>
>> ------------------------------
>> *DISCLAIMER*: 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.
>> _______________________________________________
>> 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
>>
>>
>
--
------------------------------
*DISCLAIMER*: 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130912/89ddf03a/attachment.htm>
More information about the vtkusers
mailing list