[vtkusers] How to read a text file into VTK
Emmanuel Teguetio
emmadoctor at yahoo.fr
Mon Dec 11 09:34:39 EST 2006
Ok..i thought it was something similar i did.but unfortunatly its different.in the text i readed,there were extra informations how vertices are connected to each other.
"Kevin H. Hobbs" <hobbsk at ohiou.edu> a écrit : On Mon, 2006-12-11 at 14:29 +0100, Emmanuel Teguetio wrote:
> hallo kevin..
> could you sent your text file please?
Could you please keep the conversation on the list.
I convert files that look like this :
20.5826 26.7372 10.9694
20.8055 27.3885 10.9694
20.8055 27.457 10.9694
20.8226 27.5427 10.9694
20.8397 27.6627 10.9694
20.8397 27.7313 10.9694
20.8397 27.817 10.9694
20.8397 27.8855 10.9694
20.7883 28.0055 10.9694
20.7712 28.0741 10.9694
into polygon vertexes with this code :
#include "vtkParticleReader.h"
#include "vtkXMLPolyDataWriter.h"
int main( int argc, char * argv[] )
{
char * in_file_name = argv[1];
char * out_file_name = argv[2];
// Particle Reader
vtkParticleReader * reader = vtkParticleReader::New();
reader->SetFileName( in_file_name );
// PolyData Writer
vtkXMLPolyDataWriter * writer = vtkXMLPolyDataWriter::New();
writer->SetFileName( out_file_name );
writer->SetInputConnection( reader->GetOutputPort() );
writer->Update();
writer->Delete();
reader->Delete();
return 0;
}
---------------------------------
Yahoo! Mail réinvente le mail ! Découvrez le nouveau Yahoo! Mail et son interface révolutionnaire.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20061211/5e6ed435/attachment.htm>
More information about the vtkusers
mailing list