[Paraview] How does paraview pass multiple filenames to reader plugin?

Moreland, Kenneth kmorel at sandia.gov
Tue Sep 17 10:46:50 EDT 2013


The convention for making a reader that accepts multiple files is to first implement a pair of methods in the reader to add file names one at a time and another method to reset the list of file names. Here is some example declarations that would be in the reader's header file.

  // Description:
  // Adds names of files to be read. The files are read in the order
  // they are added.
  virtual void AddFileName(const char* fname);

  // Description:
  // Remove all file names.
  virtual void RemoveAllFileNames();

Then in your reader xml file of the SourceProxy declare a StringVectorProperty with a FileListDomain. Here is an example of that.

      <StringVectorProperty animateable="0"
                            clean_command="RemoveAllFileNames"
                            command="AddFileName"
                            name="FileNames"
                            number_of_elements="0"
                            panel_visibility="never"
                            repeat_command="1">
        <FileListDomain name="files" />
        <Documentation>The list of files to be read by the
        reader.</Documentation>
      </StringVectorProperty>

-Ken

From: 庞庆源 <pangqingyuan1991 at gmail.com<mailto:pangqingyuan1991 at gmail.com>>
Date: Tuesday, September 17, 2013 5:23 AM
To: paraview <paraview at paraview.org<mailto:paraview at paraview.org>>
Subject: [EXTERNAL] [Paraview] How does paraview pass multiple filenames to reader plugin?

I have read some source of paraview plugin.All of them  define a char pointer such as:
char *FileName;
and have two macro:
 vtkSetStringMacro(FileName);
 vtkGetStringMacro(FileName);
But paraview can choose multiple files once.And I would like to get the filenames.So what should I do?Can someone give me a simple example?
--
庞庆源<mailto:pangqingyuan1991 at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20130917/929271cf/attachment-0001.htm>


More information about the ParaView mailing list