[vtkusers] How to improve speed of extract selection using mouse

chytu chyt_n_ya at yahoo.com
Tue Nov 29 11:04:49 EST 2011


Hi,

I want to select a portion of a polyData mesh (both vertices and edges)
using mouse and perform operations on it (like filling holes) later. This is
what I am trying to do:
 1. Select points using mouse as in
VTK/Examples/Cxx/Picking/HighlightSelectedPoints
 2. Extract the polydata from ids given by Step-1 using
VTK/Examples/Cxx/PolyData/ExtractSelectionCells

This is the code that I am using (attached full version here:
http://vtk.1045678.n5.nabble.com/file/n5032847/selectSubMesh.cpp
selectSubMesh.cpp )

 - Subclass vtkInteractorStyleRubberBandPick to give vertex ids of points
selected using mouse
 - // Extract the selected and non-selected portions in the mesh
	vtkSmartPointer<vtkSelectionNode> selectionNode =
			vtkSmartPointer<vtkSelectionNode>::New();
	selectionNode->SetFieldType(vtkSelectionNode::POINT);
	selectionNode->SetContentType(vtkSelectionNode::INDICES);
	selectionNode->SetSelectionList(selectionIds);
	selectionNode->GetProperties()->Set(vtkSelectionNode::CONTAINING_CELLS(),
1);

But this process is very slow. It takes 3 minutes to extract ~2000 points
selected using mouse and if I select more points, the time increases to
hours. 

Is this the right way to do this? I am sure there are ways to speed up this
process. Can anyone tell me how to speed up to get this working on large
sets of points?

Thanks,
Chytu.

TL;DR: How to quickly pick up a subset of mesh using mouse?


--
View this message in context: http://vtk.1045678.n5.nabble.com/How-to-improve-speed-of-extract-selection-using-mouse-tp5032847p5032847.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list