<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; ">
<div style="font-family: Calibri, sans-serif; ">
<div>
<div>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.</div>
</div>
</div>
<div style="font-family: Calibri, sans-serif; "><br>
</div>
<blockquote style="margin: 0px 0px 0px 40px; border: none; padding: 0px; ">
<div>
<div><font face="Courier"> // Description:</font></div>
<div><font face="Courier"> // Adds names of files to be read. The files are read in the order</font></div>
<div><font face="Courier"> // they are added.</font></div>
<div><font face="Courier"> virtual void AddFileName(const char* fname);</font></div>
<div><font face="Courier"><br>
</font></div>
<div><font face="Courier"> // Description:</font></div>
<div><font face="Courier"> // Remove all file names.</font></div>
<div><font face="Courier"> virtual void RemoveAllFileNames();</font></div>
</div>
</blockquote>
<div style="font-family: Calibri, sans-serif; "><br>
</div>
<div style="font-family: Calibri, sans-serif; ">Then in your reader xml file of the SourceProxy declare a StringVectorProperty with a FileListDomain. Here is an example of that.</div>
<div style="font-family: Calibri, sans-serif; "><br>
</div>
<blockquote style="margin:0 0 0 40px; border:none; padding:0px;">
<div>
<div><font face="Courier"> <StringVectorProperty animateable="0"</font></div>
<div><font face="Courier"> clean_command="RemoveAllFileNames"</font></div>
<div><font face="Courier"> command="AddFileName"</font></div>
<div><font face="Courier"> name="FileNames"</font></div>
<div><font face="Courier"> number_of_elements="0"</font></div>
<div><font face="Courier"> panel_visibility="never"</font></div>
<div><font face="Courier"> repeat_command="1"></font></div>
<div><font face="Courier"> <FileListDomain name="files" /></font></div>
<div><font face="Courier"> <Documentation>The list of files to be read by the</font></div>
<div><font face="Courier"> reader.</Documentation></font></div>
<div><font face="Courier"> </StringVectorProperty></font></div>
<div style="font-family: Calibri, sans-serif; "><br>
</div>
</div>
</blockquote>
<div style="font-family: Calibri, sans-serif; ">-Ken</div>
<div style="font-family: Calibri, sans-serif; "><br>
</div>
<span id="OLK_SRC_BODY_SECTION" style="font-family: Calibri, sans-serif; ">
<div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<span style="font-weight:bold">From: </span>庞庆源 <<a href="mailto:pangqingyuan1991@gmail.com">pangqingyuan1991@gmail.com</a>><br>
<span style="font-weight:bold">Date: </span>Tuesday, September 17, 2013 5:23 AM<br>
<span style="font-weight:bold">To: </span>paraview <<a href="mailto:paraview@paraview.org">paraview@paraview.org</a>><br>
<span style="font-weight:bold">Subject: </span>[EXTERNAL] [Paraview] How does paraview pass multiple filenames to reader plugin?<br>
</div>
<div><br>
</div>
<div>
<div>
<div dir="ltr">I have read some source of paraview plugin.All of them define a char pointer such as:
<div>char *FileName;</div>
<div>and have two macro:</div>
<div>
<div> vtkSetStringMacro(FileName);</div>
<div> vtkGetStringMacro(FileName);</div>
<div>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?</div>
-- <br>
<font face="arial,helvetica,sans-serif" size="6" color="#33ff33"><a href="mailto:pangqingyuan1991@gmail.com" target="_blank">庞庆源<span></span><span></span></a></font></div>
</div>
</div>
</div>
</span>
</body>
</html>