[vtkusers] Converting a Structured Points File to an Unstructured Points/Grid File

Jack teddy.kord at yahoo.co.uk
Fri May 7 14:16:12 EDT 2010


Hi

I have a file with a dataset of structured points. I'd like to convert this to a dataset of unstructured points and/or unstructured grid. How can I do this?

So far, this is what I have: 

int main()
{
//get all data from the file
vtkSmartPointer< vtkStructuredPointsReader> reader = vtkSmartPointer< vtkStructuredPointsReader>:: New();
reader->SetFileName("geometry. vtk");
reader->Update();

vtkStructuredPoints* structuredPoints = reader->GetOutput();

//get the number of points the file contains
 vtkIdType numPoints = structuredPoints-> GetNumberOfPoints();
 
std::cout << "There are " << numPoints << " points." << std::endl;

vtkSmartPointer< vtkUnstructuredGrid> unstructuredGrid = vtkSmartPointer< vtkUnstructuredGrid>::New();

}

It's incomplete and I'm not sure how to proceed.

Thanks in advance.

Theodore



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100507/94906e8b/attachment.htm>


More information about the vtkusers mailing list