[vtk-developers] Particle reader

John Biddiscombe biddisco at cscs.ch
Mon Apr 25 01:13:33 EDT 2005


I'll commit some classes I've got. Essentially, they are
vtkCSVReader (csv = Comma separated values, abstract base class)
vtkCSVPolyDataReader (concrete)
vtkCSVStructuredPointsReader (concrete)

I've used them for years to get data that's just stuffed into text files 
usually, a list of points delimeted by come char and in the case of 
polydata, lists of vertices (Excel spreadsheet data etc). Structured points, 
usually terrain data. They can be built on and improved to handle different 
combinations/orders of data etc. Very simple stuff, but probably just what 
you need to get started.

JB

----- Original Message ----- 
From: "Andrew Maclean" <a.maclean at cas.edu.au>
To: "'John Platt'" <jcplatt at lineone.net>
Cc: <vtk-developers at vtk.org>
Sent: Monday, April 25, 2005 2:01 AM
Subject: RE: [vtk-developers] Particle reader


> 1) Discovering the file type is complex particularly with text files -
> because it is more generic, you can't guarantee that a particular file is 
> of
> type text on all systems.
> 2) I thought about using SetMode() and initially it seemed a good idea but 
> I
> discarded it because I felt that classes should reflect their 
> functionality
> more closely. Their functionalities really are different - 
> vtkParticleReader
> can handle pieces from a file - it doesn't have to read the whole file at
> once - this is because the file is binary and there is a direct 
> correlation
> between the data and size. I prefer simpler classes that perform a more
> focused function but this is a personal preference. Also it means that
> people have to remember to set the mode to text as binary would have to be
> the default. Ideally I would like to see something like
> vtkBinaryParticleReader and vtkTextParticleReader.
>
> Andrew
>
>
> -----Original Message-----
> From: John Platt [mailto:jcplatt at lineone.net]
> Sent: Monday, 25 April 2005 09:44
> To: 'Andrew Maclean'
> Cc: vtk-developers at vtk.org
> Subject: RE: [vtk-developers] Particle reader
>
> Hi Andrew,
>
> Thanks. I am playing devils advocate here, so why not a SetMode()for
> binary/text on vtkParticleReader or try to discover the file type
> automatically?
>
> John.
>
> -----Original Message-----
> From: Andrew Maclean [mailto:a.maclean at cas.edu.au]
> Sent: 25 April 2005 00:04
> To: 'John Platt'
> Cc: vtk-developers at vtk.org
> Subject: RE: [vtk-developers] Particle reader
>
> Hi John,
>
> vtkParticleReader is for reading binary formatted data only. I have used
> it
> once or twice.
>
> Andrew
>
>
> -----Original Message-----
> From: John Platt [mailto:jcplatt at lineone.net]
> Sent: Monday, 25 April 2005 06:42
> To: 'Andrew Maclean'
> Cc: vtk-developers at vtk.org
> Subject: RE: [vtk-developers] Particle reader
>
> Hi Andrew,
>
> Quite by accident I came across vtkParticleReader. I have never used
> this and I haven't looked in detail at your reader but it would be
> useful to highlight the differences.
>
> John.
>
> -----Original Message-----
> From: vtk-developers-bounces at vtk.org
> [mailto:vtk-developers-bounces at vtk.org] On Behalf Of Andrew Maclean
> Sent: 24 April 2005 03:58
> To: vtk-developers at vtk.org
> Subject: [vtk-developers] Particle reader
>
> A lot of us have particle data e.g ASCII files of data in the form
> x,y,x,v
> where v is some scalar value.
>
> This arises when you output data from sources that can't generate the
> vtk
> formats. For example Matlab and our own sources such as radar and GPS
> data.
>
> So do you think it would be a good idea to add a simple particle reader
> for
> ASCII data to VTK? I also think this would be useful in ParaView.
>
> If so, what would be a suitable name? (I am thinking of
> vtkParticleReaderText ). Perhaps someone working at VTK should suggest a
> name.
>
> If someone wants to critique and test the above class I will be
> perfectly
> happy to contribute it. I'll add some documentation etc.
>
> Things to note:
> 1) I am using vtkSmartPointer. This seems to work nicely.
> 2) I am using sstream and algorithm in the implementation files (*.cxx).
> Will 2) in particular cause any problems in VTK?
>
>
>
> Andrew
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> _______________________________________________
> vtk-developers mailing list
> vtk-developers at vtk.org
> http://www.vtk.org/mailman/listinfo/vtk-developers
> 





More information about the vtk-developers mailing list