Hi Federico,

this sounds to me as something that might be useful in general and could be contributed back to MITK (even though my node picking pull request has been lying around for almost a year I think). So if I were you, I would modify my MITK fork by changing mitk::Surface itself and adding something like vtkCellLocator* GetCellLocator(int time = 0) which would create a cell locator upon request from SurfaceVtkMapper3D if a certain property is set in the node.

Rostislav.

On 15/09/2015 15:35, Kislinskiy, Stefan wrote:

Hi,

I’m not familiar with the mechanics of vtkCellLocator/vtkCellPicker, but from a code design perspective, subclassing the mapper could be a possibility. You should be able to set your own mapper with mitk::DataNode::SetMapper(). However, I would not recommend that, as it would involve a lot of extra code for the actual thing you are trying to achieve. Is it possible in your case to write a filter for that purpose which is located between the surface and the mapper? You might have manually call Modified() on the DataNode which holds the connected surface though.

Best,

Stefan

*From:*Federico Milano [mailto:fmil...@gmail.com]
*Sent:* Samstag, 12. September 2015 22:43
*To:* mitk-users@lists.sourceforge.net
*Subject:* [mitk-users] Accelerating 3D picking

Hi. I'm working with surfaces that have a very large quantity of cells. I'm doing a lot of picking (for interaction) on them. The problem is that picking with the vtkCellPicker is very slow if not optimized with vtkCellLocators. But the vtkCellLocators added to the vtkCellPicker have to be always in sync with the PolyDataMappers used by the scene renderer. Right now I'm keeping a list of surfaces added to the vtkCellPicker in my plugin. In this implementation, the vtkCellLocators are updated only when some plugin operation is triggered. I don't really like this so much.

Where do you recommend me to store the vtkCellLocator to be able to update it when the vtkPolyData is updates? Do you recommend me to subclass the SurfaceMapper3D and add code there to manage the vtkCellLocator?

Thanks in advance,

Federico



------------------------------------------------------------------------------


_______________________________________________
mitk-users mailing list
mitk-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mitk-users

------------------------------------------------------------------------------
Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
Get real-time metrics from all of your servers, apps and tools
in one place.
SourceForge users - Click here to start your Free Trial of Datadog now!
http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
_______________________________________________
mitk-users mailing list
mitk-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to