<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.apple-style-span
        {mso-style-name:apple-style-span;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;}
span.apple-tab-span
        {mso-style-name:apple-tab-span;}
span.EmailStyle21
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:684865825;
        mso-list-template-ids:-1276857730;}
@list l1
        {mso-list-id:1754938244;
        mso-list-template-ids:-1276857730;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;">&gt;<o:p>&nbsp;</o:p></span></p>
<ol start="1" type="1">
<li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l0 level1 lfo1">
<span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;">specify the number of output ports with this-&gt;SetNumberOfOutputPorts(2)<o:p></o:p></span></li></ol>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">&lt;<o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Are you doing that in the constructor or somewhere else? The fact that you get one port NULL on first iteration hints that you&#8217;re calling this function too
 late.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Just a thought<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">JB<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"> paraview-developers-bounces@paraview.org [mailto:paraview-developers-bounces@paraview.org]
<b>On Behalf Of </b>Joshua Murphy<br>
<b>Sent:</b> 03 July 2012 21:31<br>
<b>To:</b> paraview-developers@paraview.org<br>
<b>Subject:</b> [Paraview-developers] Question about using multiple ports in ParaView reader<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">Hello,<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black"><o:p>&nbsp;</o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">I am attempting to write a reader that handles both structured grids and meta-data. &nbsp;It was recommended to me that I use multiple ports, and populate a vtkTable
 with the meta-data.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black"><o:p>&nbsp;</o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">I think I am having some conceptual problems with how this is supposed to work.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black"><o:p>&nbsp;</o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">I have written a dummy reader in an attempt to get the meta-data working prior to porting it to my real reader, but I am having trouble&#8230;<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black"><o:p>&nbsp;</o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:black">My understanding is that I need to&nbsp;<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;"><o:p>&nbsp;</o:p></span></p>
</div>
<ol start="1" type="1">
<li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l1 level1 lfo2">
<span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;">specify the number of output ports with this-&gt;SetNumberOfOutputPorts(2)<o:p></o:p></span></li><li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l1 level1 lfo2">
<span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;">Populate the output port information<o:p></o:p></span></li></ol>
<blockquote style="margin-left:30.0pt;margin-right:0cm">
<div>
<p class="MsoNormal"><span class="apple-style-span"><span style="font-size:10.5pt;font-family:&quot;Courier New&quot;">int vtkGenericReader::<i>FillOutputPortInformation</i>(int port, vtkInformation* info)</span></span><span style="font-size:10.5pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;"><o:p></o:p></span></p>
</div>
</blockquote>
<blockquote style="margin-left:30.0pt;margin-right:0cm">
<div>
<pre>{<o:p></o:p></pre>
<pre>&nbsp; switch(port)<o:p></o:p></pre>
<pre>&nbsp;&nbsp;&nbsp; {<o:p></o:p></pre>
<pre>&nbsp;&nbsp;&nbsp; case 0:<o:p></o:p></pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; info-&gt;Set(vtkDataObject::DATA_TYPE_NAME(), &quot;vtkStructuredGrid&quot;);<o:p></o:p></pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<o:p></o:p></pre>
<pre>&nbsp;&nbsp;&nbsp; case 1:<o:p></o:p></pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; info-&gt;Set(vtkDataObject::DATA_TYPE_NAME(), &quot;vtkTable&quot;);<o:p></o:p></pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<o:p></o:p></pre>
<pre>&nbsp;&nbsp;&nbsp; }<o:p></o:p></pre>
<pre>&nbsp; return 1;<o:p></o:p></pre>
<pre>}<o:p></o:p></pre>
<pre><o:p>&nbsp;</o:p></pre>
<pre>3. Get the informationObject from the outputVector<o:p></o:p></pre>
<pre><span class="apple-tab-span">&nbsp;&nbsp; </span>outputvector-&gt;GetInformationObject(1);<o:p></o:p></pre>
<pre><o:p>&nbsp;</o:p></pre>
<pre>4. Get the table data<o:p></o:p></pre>
<pre><span class="apple-tab-span">&nbsp;&nbsp; </span>&nbsp; this-&gt;MetaData = dynamic_cast&lt;vtkTable*&gt;<o:p></o:p></pre>
<pre style="-qt-block-indent:0">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (this-&gt;MetaDataOutInfo-&gt;Get(vtkDataObject::DATA_OBJECT()));<o:p></o:p></pre>
<pre style="-qt-block-indent:0"><o:p>&nbsp;</o:p></pre>
<pre style="-qt-block-indent:0">5. Add string to the table<o:p></o:p></pre>
<pre style="-qt-block-indent:0"><o:p>&nbsp;</o:p></pre>
<pre style="-qt-block-indent:0"><span style="color:silver">&nbsp; </span><span style="color:#55FF55">vtkStringArray</span><span style="color:silver"> </span><span style="color:#AAAAAA">*</span>MetaString<span style="color:silver"> </span><span style="color:#AAAAAA">=</span><span style="color:silver"> </span><span style="color:#55FF55">vtkStringArray</span><span style="color:#AAAAAA">::</span>New<span style="color:#AAAAAA">();</span><o:p></o:p></pre>
<pre style="-qt-block-indent:0"><span style="color:silver">&nbsp; </span>MetaString<span style="color:#AAAAAA">-&gt;</span><i>SetName</i><span style="color:#AAAAAA">(</span><span style="color:#FF55FF">&quot;Meta Data&quot;</span><span style="color:#AAAAAA">);</span><o:p></o:p></pre>
<pre style="-qt-block-indent:0"><span style="color:silver">&nbsp; </span>MetaString<span style="color:#AAAAAA">-&gt;</span><i>SetNumberOfComponents</i><span style="color:#AAAAAA">(</span><span style="color:#FF55FF">1</span><span style="color:#AAAAAA">);</span><o:p></o:p></pre>
<pre style="-qt-block-indent:0"><span style="color:silver">&nbsp; </span>MetaString<span style="color:#AAAAAA">-&gt;</span>InsertNextValue<span style="color:#AAAAAA">(</span><span style="color:#FF55FF">&quot;This is a Test&quot;</span><span style="color:#AAAAAA">);</span><o:p></o:p></pre>
<pre style="-qt-block-indent:0"><span style="color:silver">&nbsp; </span>MetaString<span style="color:#AAAAAA">-&gt;</span>InsertNextValue<span style="color:#AAAAAA">(</span><span style="color:#FF55FF">&quot;Test 2&quot;</span><span style="color:#AAAAAA">);</span><o:p></o:p></pre>
<pre style="-qt-block-indent:0"><span style="color:silver">&nbsp; </span>MetaString<span style="color:#AAAAAA">-&gt;</span>InsertNextValue<span style="color:#AAAAAA">(</span><span style="color:#FF55FF">&quot;Test 3&quot;</span><span style="color:#AAAAAA">);</span><o:p></o:p></pre>
<pre style="-qt-block-indent:0"><span style="color:silver">&nbsp; </span><span style="color:#FFFF55">this</span><span style="color:#AAAAAA">-&gt;</span>MetaData<span style="color:#AAAAAA">-&gt;</span>AddColumn<span style="color:#AAAAAA">(</span>MetaString<span style="color:#AAAAAA">);</span><o:p></o:p></pre>
<pre style="-qt-block-indent:0"><span class="apple-tab-span">&nbsp;&nbsp; </span><o:p></o:p></pre>
<pre style="-qt-block-indent:0"><o:p>&nbsp;</o:p></pre>
<pre style="-qt-block-indent:0">It is my understanding that this information should then be available in the ParaView GUI.<o:p></o:p></pre>
<pre style="-qt-block-indent:0"><o:p>&nbsp;</o:p></pre>
<pre style="-qt-block-indent:0"><o:p>&nbsp;</o:p></pre>
<pre style="-qt-block-indent:0">The problems I am having are this:<o:p></o:p></pre>
<pre style="-qt-block-indent:0"><o:p>&nbsp;</o:p></pre>
<div>
<div>
<pre style="-qt-block-indent:0">1.&nbsp; When attempting to get both port information objects on the first call to RequestInformation(), port 1 returns a NULL object.&nbsp; On the SECOND call to GetInformation(), both ports are available.<o:p></o:p></pre>
<pre style="-qt-block-indent:0"><o:p>&nbsp;</o:p></pre>
</div>
<div>
<pre style="-qt-block-indent:0">2.&nbsp; All calls to RequestData() only provide access to port 0 in the Output information Vector.&nbsp; I can access port 1 if I utilize this-&gt;getExecutive()-&gt;getOutputInformation(1)<o:p></o:p></pre>
<pre style="-qt-block-indent:0"><o:p>&nbsp;</o:p></pre>
<pre style="-qt-block-indent:0">3.&nbsp; When using #2 to get the information, I populate, but I am unsure where/how things are supposed to be accessible in the GUI.<o:p></o:p></pre>
<pre style="-qt-block-indent:0"><o:p>&nbsp;</o:p></pre>
<pre style="-qt-block-indent:0"><o:p>&nbsp;</o:p></pre>
<pre style="-qt-block-indent:0">What I am trying to do is be able to access the meta-data values from within ParaView so that I can utilize data values, units, model run data, etc.<o:p></o:p></pre>
<pre style="-qt-block-indent:0"><o:p>&nbsp;</o:p></pre>
<pre style="-qt-block-indent:0">If anyone can help me understand what is supposed to be going on, or if I am completely doing something wrong, I would be grateful!&nbsp; Am I missing some steps? Do I need to have XML code to access the vtkTable?<o:p></o:p></pre>
<pre style="-qt-block-indent:0"><o:p>&nbsp;</o:p></pre>
<pre style="-qt-block-indent:0"><o:p>&nbsp;</o:p></pre>
<pre style="-qt-block-indent:0">Thanks,<o:p></o:p></pre>
<pre style="-qt-block-indent:0"><o:p>&nbsp;</o:p></pre>
<pre style="-qt-block-indent:0">Joshua Murphy<o:p></o:p></pre>
<pre style="-qt-block-indent:0">Laboratory for Atmospheric and Space Physics<o:p></o:p></pre>
<pre style="-qt-block-indent:0">University of Colorado, Boulder<o:p></o:p></pre>
<pre style="-qt-block-indent:0"><o:p>&nbsp;</o:p></pre>
</div>
</div>
</div>
</blockquote>
</div>
</body>
</html>