[Paraview] Adding a Reader
Andy Cedilnik
andy.cedilnik at kitware.com
Wed Nov 2 22:39:06 EST 2005
Hi Dave,
I wrote a explanation on how to import module into ParaView:
http://www.paraview.org/Wiki/ParaView:Extend
Andy
Dave Semeraro wrote:
>
> Hello,
>
> I am trying to add a new reader to paraview. I am using paraview
> version 2.2.1 on a
> Fedora Core 2.0 linux distro. Paraview builds fine. I am following the
> instructions in
> the paraview guide version 1.8 and the instructions in the PVLocal
> directory. I was
> able to compile the "local cone source" example. When I import the
> package into
> paraview it works fine.
>
> As a first step, I wrote a new reader and tested it in VTK. The new
> reader builds a structured points dataset. I then copied the new
> reader .h and .cxx file into the
> PVLocal directory and made the recommended changes in the Cmake and xml
> files. I also included the required config files in my .cxx file. I am
> able to compile the
> new reader and create a shared library but the shared library has an
> undefined
> symbol corresponding to my reader. Paraview does not like that. When I
> try to import the package I get an error. I have included the header
> file for my
> reader and the two xml files with this message. If anyone sees what I
> am doing
> wrong a hint would be greatly appreciated.
>
> Regards,
> Dave
> ------------------------------------------------------------------------
>
> /*
> vtkVOLBReader class
> Dave Semeraro
> October 2005
> NCSA
>
> */
> // .NAME vtkVOLBReader - binary image file reader for VOLB datasets
> // .SECTION Description
> // vtkVOLBReader is a vtkImageReader that reads SDSC MeshViewer
> // input datasets. VOLB data are basically stacks of images in a
> // single 3d file. The header consists of 17 Bytes. The first
> // five bytes are: "VOLB\n" This is followed by the data dimensions
> // in three 4 byte integers. This is followed by the voxel data
> // that consists of 4 byte RGBA values per voxel.
> //
> // .SECTION See Also
> // vtkJPEGReader vtkPNGReader vtkImageReader2 vtkGESignaReader
> #ifndef __vtkVOLBReader_h
> #define __vtkVOLBReader_h
>
> #include "vtkPVLocalConfigure.h"
> #include "vtkStructuredPointsSource.h"
> #include <cstring>
> #include <fstream>
> using std::ifstream;
>
> class VTK_PVLocal_EXPORT vtkVOLBReader : public vtkStructuredPointsSource
> {
> public:
> vtkTypeRevisionMacro(vtkVOLBReader,vtkStructuredPointsSource);
> static vtkVOLBReader *New();
> virtual void PrintSelf(ostream& os, vtkIndent indent);
> // Description:
> // Specify file name of file
> vtkSetStringMacro(FileName);
> vtkGetStringMacro(FileName);
>
>
> // Description:
> // Test whether the file with the given name can be read
> // by this reader.
> virtual int CanReadFile(const char* name);
>
> // Description:
> // Set the byte order of the file. This function sets the
> // expected byte order of the input file. Files written on
> // PC platforms write little endian where most Unix workstations
> // write big endian.
> void SetByteOrderToBigEndian();
> void SetByteOrderToLittleEndian();
> vtkSetMacro(ByteOrder, int);
> vtkGetMacro(ByteOrder, int);
> const char *GetByteOrderAsString();
>
> //BTX
> enum
> {
> FILE_BIG_ENDIAN=0,
> FILE_LITTLE_ENDIAN=1
> };
> //ETX
>
> protected:
> vtkVOLBReader();
> ~vtkVOLBReader();
>
> void ExecuteInformation();
> void Execute();
>
> char* FileName;
> unsigned char *data; // a pointer to an array managed by constructor
> int ByteOrder;
>
> private:
> vtkVOLBReader(const vtkVOLBReader&); // not implemented.
> void operator=(const vtkVOLBReader&); // not implemented.
> };
> #endif
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> ParaView mailing list
> ParaView at paraview.org
> http://www.paraview.org/mailman/listinfo/paraview
>
More information about the ParaView
mailing list