[Paraview] Loading data from ParaView

Berk Geveci berk . geveci at kitware . com
11 Sep 2003 09:51:53 -0400


I didn't have time to write documentation on importing modules
using XML configuration files so far. However, it is really
not that hard. Here is how to do it:

1. Create a directory to put the module descriptions in,
(I have a ${HOME}/etc/paraview directory for ex.)
2. Add a variable called PV_INTERFACE_PATH to your environment
pointing to this directory
(I do "export PV_INTERFACE_PATH=${HOME}/etc/paraview)
3. Create a file with xml extension to describe the reader module.
I have a modules.xml file that looks like:

<ModuleInterfaces>
 
<!- modules skipped ... -->

 <Library name="vtkChomboReaderTCL"/>
 <Module name="ChomboReader" root_name="ChomboReader"
   output="vtkImageData"
   class="vtkPVAdvancedReaderModule" module_type="Reader"
   extensions=".hdf5" file_description="Chombo AMR files">
  <Source class="vtkChomboReader"/>
  <VectorEntry variable="MinimumLevel" type="int"/>
  <VectorEntry variable="MaximumLevel" type="int"/>
  <LabeledToggle variable="UseRealBoxes" trace_name="UseRealBoxes"/>
 </Module>

</ModuleInterfaces>


Here is a brief description:

 <Library name="vtkChomboReaderTCL"/>

This tells ParaView to load a dynamic library that I created.
Essentially, this is built very similarly to any VTK library.
There are instructions on how to build your own library in
the VTK distribution. Make sure that you have TCL wrapping on.
The Library attribute should point to the TCL wrapped library.
If you added your reader to the VTK distribution, this step
is not required.

 <Module name="ChomboReader" root_name="ChomboReader"
   output="vtkImageData"
   class="vtkPVAdvancedReaderModule" module_type="Reader"
   extensions=".hdf5" file_description="Chombo AMR files">

This should be pretty straightforward. The class is usually
either vtkPVReaderModule (for readers that do not require
any user defined parameters, this module loads the file
immediatly after the user click "Open" in the file dialog)
or vtkPVAdvancedReaderModule (for more sophisticated readers
that allow the user to, for example, select arrays to be
loaded before opening the file the first time). Note that
the PLOT3D reader uses a different class since it has a 
special way of handling the initial parameters (it does
not read the whole file until the user gets all the
parameters right and after that all the parameters are
disabled). 
 
  <VectorEntry variable="MinimumLevel" type="int"/>
  <VectorEntry variable="MaximumLevel" type="int"/>
  <LabeledToggle variable="UseRealBoxes" trace_name="UseRealBoxes"/>

A few widgets (parameters) that the user can use the modify
the reader. Note that there has to be a pair of Set/Get
methods for each property ( Set(Get)MinimumLevel, Set(Get)MaximumLevel
etc.)

For more examples, you can look at 
Filters.xml  Manipulators.xml  Readers.xml  Sources.xml  Writers.xml
in the ParaView (1.0 or newer) source distribution (in
ParaView/ParaView/Resources).

-Berk
 

On Thu, 2003-09-11 at 08:58, Michael Gronager wrote:
> Hi Joonsuk Lee,
> 
> I have a student that has actually written a Plot3D function file importer
> for
> VTK.
> If you can use the code you are free to get it.
> 
> Actually we want to integrate it into ParaView as a loader. The docu says
> something about
> using an XML descriptionfile should actully be enough to add a new loader to
> Paraview, however,
> We haven't been able to find an actual pointer to how to do it or even an
> example ...
> 
> Do you (or anyone else) know how to do it?
> 
> Regards,
> 
> Michael
> 
> --
> Michael Gronager, PhD
> Research and Developement, VR-C
> UNI-C
> DTU Building 304
> DK2800 Lyngby
> DENMARK
> 
> Phone:  +45 3587 8889
> Fax:    +45 3587 8990
> Direct: +45 3587 8966
> Mobile: +45 2424 8207
> 
> Email:   mpg at uni-c . dk
> 
> ----- Original Message -----
> From: "Joonsuk Lee" <jlee at ariel . met . tamu . edu>
> To: <paraview at paraview . org>
> Sent: Wednesday, September 10, 2003 9:08 PM
> Subject: [Paraview] Loading data from ParaView
> 
> 
> > Dear All:
> >
> > I am a really beginner in using ParaView.
> > This could be a naive qeustion but
> > please let me know how I can read the
> > data produced by FORTRAN?
> > The file I want to read is function file,
> > not Q file.
> > And also how should I set output format
> > in FORTRAN to be read by ParaView.
> >
> > Thanks in advance.
> >
> > Joonsuk
> > ----------------------------------
> > Joonsuk Lee
> > Department of Atmoshperic Sciences
> > Texas A&M University
> > 3150 TAMU
> > College Station, TX 77843-3150
> > Phone: (979) 845-1680
> > E-mail: jlee at ariel . met . tamu . edu
> >
> >
> > _______________________________________________
> > ParaView mailing list
> > ParaView at paraview . org
> > http://www . paraview . org/mailman/listinfo/paraview
> >
> 
> _______________________________________________
> ParaView mailing list
> ParaView at paraview . org
> http://www . paraview . org/mailman/listinfo/paraview