[Paraview] How does paraview pass multiple filenames to reader plugin?
Moreland, Kenneth
kmorel at sandia.gov
Wed Sep 18 09:57:50 EDT 2013
The instructions I gave are for if you are programming your own reader for a ParaView plugin. If you are using an existing reader and cannot or do not want to change the software, the easiest thing to do is probably to load in the group as you are to get those 10 objects in the Pipeline Browser. Then select all of those objects and apply the Group Datasets filter. You can then apply further filters to that group an it will be applied to all data.
-Ken
From: 庞庆源 <pangqingyuan1991 at gmail.com<mailto:pangqingyuan1991 at gmail.com>>
Date: Tuesday, September 17, 2013 7:26 PM
To: Kenneth Moreland <kmorel at sandia.gov<mailto:kmorel at sandia.gov>>
Subject: [EXTERNAL] Re: [Paraview] How does paraview pass multiple filenames to reader plugin?
If I have 10 files,all of which render a sphere with different radius.Now I want to render all of them into a object,so that I can apply a filter for all of them.
Suppose my files' name are f1.sd<http://f1.sd>,f2.sd<http://f2.sd>,...,f10.sd<http://f10.sd>,paraview will combine them as one f..sd.If I unfold f..sd and choose all of the files,paraview will render ten objects showed on the Pipeline Browser.I can only apply a filter for just one of the objects.If I don't unfold f..sd but choose it,paraview will only render the first file,f1.sd<http://f1.sd>.
This is my real problem.
2013/9/17 Moreland, Kenneth <kmorel at sandia.gov<mailto:kmorel at sandia.gov>>
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>
--
庞庆源<mailto:pangqingyuan1991 at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20130918/555c61a9/attachment-0001.htm>
More information about the ParaView
mailing list