[vtkusers] subsampling/masking a vtkUnstructuredGrid with user supplied vtkIdList

luca penasa luca.penasa at gmail.com
Tue Mar 22 07:12:24 EDT 2011


Problem solved with this code:

[...]
def GetPointsWithIds(self, list_of_ids):
		ids = vtk.vtkIdTypeArray()
		for i in list_of_ids:
			ids.InsertNextTuple1(i)
		
		node = vtk.vtkSelectionNode()
		node.SetFieldType(1)
		node.SetContentType(4)
		node.SetSelectionList(ids)
			
		selection = vtk.vtkSelection()
		selection.AddNode(node)
			
		extractor = vtk.vtkExtractSelection()
		extractor.SetInput(0, self)
		extractor.SetInput(1, selection)
		extractor.Update()
		
		return extractor.GetOutput()

--
View this message in context: http://vtk.1045678.n5.nabble.com/subsampling-masking-a-vtkUnstructuredGrid-with-user-supplied-vtkIdList-tp4235121p4254004.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list