[vtkusers] some questions about cells, file formats, etc

nuno.jf nunofernandes7 at gmail.com
Tue Dec 20 11:58:54 EST 2011


Dear Users,

I have a few questions I'd like to ask so I can understand better some
features related to vtk.

1) *What exactly is a cell, and how is it generated?*

I have a wrl file containig points and color. I converted that file to
vtkPolyData, and now I have a vtkPolyData file containing points (scalars)
and vertices. From what I know, those vertices serve to represent topology,
the cells. So, how were the vertices defined from the points I already had
on the wrl file? Where they generated randomly? And, if the vertices are
related to cells, there shouldn't be defined the attribute data related to
cells (cell_data)? Or is it represented implicitly? 

2)After converting the wrl file to vtkPolyData, I applied a set of filters
and I got an Unstructured Grid. Before writing any output I selected a set
of points and containing cells from the unstructured grid and I converted
them to vtkPolyData:

	vtkSelectionNode *selectionNode = vtkSelectionNode::New();
	selectionNode->SetFieldType(vtkSelectionNode::POINT);
	selectionNode->SetContentType(vtkSelectionNode::INDICES);
	selectionNode->SetSelectionList(ids);
	selectionNode->GetProperties()->Set(vtkSelectionNode::CONTAINING_CELLS(),
1);

	vtkSelection *selection = vtkSelection::New();
	selection->AddNode(selectionNode);
 
	vtkExtractSelection *extractSelection = vtkExtractSelection::New();
 	extractSelection->SetInput(0, polydata);
	extractSelection->SetInput(1, selection);
	extractSelection->Update();
		
	selectionNode->GetProperties()->Set(vtkSelectionNode::INVERSE(), 1);
//invert the selection
	extractSelection->Update();
	
	vtkUnstructuredGrid *notSelected = vtkUnstructuredGrid::New();
	notSelected->ShallowCopy(extractSelection->GetOutput());
	
	vtkDataSetSurfaceFilter *surfaceFilter = vtkDataSetSurfaceFilter::New();
	surfaceFilter->SetInput(notSelected);
	surfaceFilter->Update(); 
 
	vtkPolyData *polydata2 = surfaceFilter->GetOutput();
	polydata2 -> Update(); 

The resulting vtkPolyData file contains points (scalars), vertices,
cell_data and field_data. 
Why do I have cell_data and field_data explicitly represented in the output
file? 
Both cell_data and field_data were already defined in the input file, right?
And, (sorry for so many questions) what exactly is field_data?

Any help is appreciated!
Thank you very much.
Nuno


--
View this message in context: http://vtk.1045678.n5.nabble.com/some-questions-about-cells-file-formats-etc-tp5089451p5089451.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list