[vtk-developers] vtkPicker, vtkCellPicker, vtkPointPicker and vtkCompositePolyDataMapper
A.Buykx at dianafea.com
Tue Dec 13 15:39:16 EST 2016
What would be a good way to extend the pickers for picking composite data? Is it sufficient for all use cases of composite data set picking to store the vtkDataObject and flat index of a picked composite data set, and set the vtkDataSet to zero? That ought to be pretty easy to implement and it would be sufficient I think for our use. Are there other approaches that should be considered?
From: David Gobbi [david.gobbi at gmail.com]
Sent: Tuesday, December 13, 2016 12:58 AM
To: Andreas Buykx
Cc: vtk-developers at vtk.org
Subject: Re: [vtk-developers] vtkPicker, vtkCellPicker, vtkPointPicker and vtkCompositePolyDataMapper
I think that a remedial fix would be to add a check in vtkPointPicker::IntersectWithLine() so that it returns VTK_DOUBLE_MAX if "input" is NULL. Likewise, the vtkCellPicker::IntersectXXWithLine() methods can return VTK_DOUBLE_MAX if the mapper input is NULL. This won't make multi-block data pickable, but at least it stop the pickers from crashing the program.
Then, after that remedial fix is done, the picker could be modified to detect and pick multi-block data.
On Mon, Dec 12, 2016 at 4:50 AM, Andreas Buykx <A.Buykx at dianafea.com<mailto:A.Buykx at dianafea.com>> wrote:
I have pipelines that process vtkMultiBlockDataSet and I want to map those using vtkCompositePolyDataMapper. This works fine, except that picking the rendered composite data set causes a crash. This is because vtkPicker, vtkCellPicker and vtkPointPicker assume that vtkMapper always maps a vtkDataSet which is not true in this case. Specifically vtkCellPicker::IntersectActorWithLine and vtkPointPicker::IntersectWithLine will crash, and since vtkPicker::DataSet may get set to 0, any callers fo vtkPicker::GetDataSet that expect a non-null data set will run into problems as well. AFAIK there is no picker implementation that works well with composite data sets, is there?
This issue is a blocker for me to integrate vtkCompositePolyDataMapper, so I am going to fix this either by patching our own VTK build or contributing a change to VTK. To do this the right way (I prefer to contribute), I would like some advice/steer on how to fix this issue.
A minimally invasive approach would be to add members to vtkPicker to store a vtkDataObject and a flat index of the picked dataset, and set those in case the mapper contains a composite dataset. The IntersectWithLine methods would have to be refactored to allow iterating over the blocks of a vtkDataObject.
DIANA FEA BV
Software Developers and Analysis Consultants for Civil and Geotechnical Engineering
Delftechpark 19a, 2628XJ, Delft, The Netherlands
Tel: +31 88 34262 15 (Direct) │ Tel: +31 88 34262 00 (Switchboard) │ Fax: +31 88 34262 99
Powered by www.kitware.com<http://www.kitware.com>
Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
Search the list archives at: http://markmail.org/search/?q=vtk-developers
Follow this link to subscribe/unsubscribe:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the vtk-developers