[vtk-developers] Particle reader

Andrew Maclean a.maclean at cas.edu.au
Sun Apr 24 20:01:34 EDT 2005


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

















More information about the vtk-developers mailing list