[vtk-developers] Particle reader

Mathieu Malaterre mathieu.malaterre at kitware.com
Mon Apr 25 09:24:32 EDT 2005


Andrew,

	This is a very nice contribution, unfortunately as J. Platt suggested 
this is very confusing for user. Let say I know I have a Particle file, 
but then which vtk filter should I instanciate the test one of the 
binary one ? This is especially true in application where we rely on 
file extension to instanceiate the filter to read the file.

	As you say if the old Particle reader does not do something then let's 
replace it with your filter as long as we can read all the old particles 
files. As an example you can look at the STL reader it handle both 
binary and ASCII type file. A more complex example is the EnSight reader 
which handle all possible trype and style make it very easy for the user.

My 2 cents
Mathieu

Andrew Maclean wrote:
> 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