<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252"><meta name="qrichtext" content="1"><style type="text/css">
p, li { white-space: pre-wrap; }
</style></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; font-size: 14px; "><div style="font-family: Calibri, sans-serif; color: rgb(0, 0, 0); ">Hello,</div><div style="font-family: Calibri, sans-serif; color: rgb(0, 0, 0); "><br></div><div style="font-family: Calibri, sans-serif; color: rgb(0, 0, 0); ">I am attempting to write a reader that handles both structured grids and meta-data. It was recommended to me that I use multiple ports, and populate a vtkTable with the meta-data.</div><div style="font-family: Calibri, sans-serif; color: rgb(0, 0, 0); "><br></div><div style="font-family: Calibri, sans-serif; color: rgb(0, 0, 0); ">I think I am having some conceptual problems with how this is supposed to work.</div><div style="font-family: Calibri, sans-serif; color: rgb(0, 0, 0); "><br></div><div style="font-family: Calibri, sans-serif; color: rgb(0, 0, 0); ">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…</div><div style="font-family: Calibri, sans-serif; color: rgb(0, 0, 0); "><br></div><div style="font-family: Calibri, sans-serif; color: rgb(0, 0, 0); ">My understanding is that I need to </div><div style="font-family: Calibri, sans-serif; "><br></div><ol style="font-family: Calibri, sans-serif; "><li>specify the number of output ports with this->SetNumberOfOutputPorts(2)</li><li>Populate the output port information</li></ol><blockquote style="margin:0 0 0 40px; border:none; padding:0px;"><div style="font-family: Calibri, sans-serif; "><span class="Apple-style-span" style="font-family: monospace; white-space: pre; ">int vtkGenericReader::<span style=" font-style:italic;">FillOutputPortInformation</span>(int port, vtkInformation* info)</span></div></blockquote><blockquote style="margin:0 0 0 40px; border:none; padding:0px;"><div style="font-family: Calibri, sans-serif; "><pre style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; text-indent: 0px; ">{</pre><pre style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; text-indent: 0px; "> switch(port)</pre><pre style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; text-indent: 0px; "> {</pre><pre style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; text-indent: 0px; "> case 0:</pre><pre style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; text-indent: 0px; "> info->Set(vtkDataObject::DATA_TYPE_NAME(), "vtkStructuredGrid");</pre><pre style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; text-indent: 0px; "> break;</pre><pre style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; text-indent: 0px; "> case 1:</pre><pre style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; text-indent: 0px; "> info->Set(vtkDataObject::DATA_TYPE_NAME(), "vtkTable");</pre><pre style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; text-indent: 0px; "> break;</pre><pre style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; text-indent: 0px; "> }</pre><pre style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; text-indent: 0px; "> return 1;</pre><pre style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; text-indent: 0px; ">}</pre><pre style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; text-indent: 0px; "><br></pre><pre style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; text-indent: 0px; ">3. Get the informationObject from the outputVector</pre><pre style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; text-indent: 0px; "><span class="Apple-tab-span" style="white-space:pre">        </span>outputvector->GetInformationObject(1);</pre><pre style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; text-indent: 0px; "><br></pre><pre style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; text-indent: 0px; ">4. Get the table data</pre><pre style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; text-indent: 0px; "><span class="Apple-tab-span" style="white-space:pre">        </span> this->MetaData = dynamic_cast<vtkTable*></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> (this->MetaDataOutInfo->Get(vtkDataObject::DATA_OBJECT()));<!--EndFragment--></pre><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#aaaaaa;"><br></span></pre><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">5. Add string to the table</pre><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br></pre><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><!--StartFragment--><span style=" color:#c0c0c0;"> </span><span style=" color:#55ff55;">vtkStringArray</span><span style=" color:#c0c0c0;"> </span><span style=" color:#aaaaaa;">*</span>MetaString<span style=" color:#c0c0c0;"> </span><span style=" color:#aaaaaa;">=</span><span style=" color:#c0c0c0;"> </span><span style=" color:#55ff55;">vtkStringArray</span><span style=" color:#aaaaaa;">::</span>New<span style=" color:#aaaaaa;">();</span></pre><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;"> </span>MetaString<span style=" color:#aaaaaa;">-></span><span style=" font-style:italic;">SetName</span><span style=" color:#aaaaaa;">(</span><span style=" color:#ff55ff;">"Meta Data"</span><span style=" color:#aaaaaa;">);</span></pre><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;"> </span>MetaString<span style=" color:#aaaaaa;">-></span><span style=" font-style:italic;">SetNumberOfComponents</span><span style=" color:#aaaaaa;">(</span><span style=" color:#ff55ff;">1</span><span style=" color:#aaaaaa;">);</span></pre><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;"> </span>MetaString<span style=" color:#aaaaaa;">-></span>InsertNextValue<span style=" color:#aaaaaa;">(</span><span style=" color:#ff55ff;">"This is a Test"</span><span style=" color:#aaaaaa;">);</span></pre><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;"> </span>MetaString<span style=" color:#aaaaaa;">-></span>InsertNextValue<span style=" color:#aaaaaa;">(</span><span style=" color:#ff55ff;">"Test 2"</span><span style=" color:#aaaaaa;">);</span></pre><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;"> </span>MetaString<span style=" color:#aaaaaa;">-></span>InsertNextValue<span style=" color:#aaaaaa;">(</span><span style=" color:#ff55ff;">"Test 3"</span><span style=" color:#aaaaaa;">);</span></pre><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;"> </span><span style=" color:#ffff55;">this</span><span style=" color:#aaaaaa;">-></span>MetaData<span style=" color:#aaaaaa;">-></span>AddColumn<span style=" color:#aaaaaa;">(</span>MetaString<span style=" color:#aaaaaa;">);</span><!--EndFragment--></pre></pre><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span class="Apple-tab-span" style="white-space:pre">        </span></pre><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br></pre><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">It is my understanding that this information should then be available in the ParaView GUI.</pre><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br></pre><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br></pre><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">The problems I am having are this:</pre><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br></pre><div><div><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">1. When attempting to get both port information objects on the first call to RequestInformation(), port 1 returns a NULL object. On the SECOND call to GetInformation(), both ports are available.</pre><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br></pre></div><div><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">2. All calls to RequestData() only provide access to port 0 in the Output information Vector. I can access port 1 if I utilize this->getExecutive()->getOutputInformation(1)</pre><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br></pre><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">3. When using #2 to get the information, I populate, but I am unsure where/how things are supposed to be accessible in the GUI.</pre><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br></pre><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br></pre><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">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.</pre><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br></pre><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">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! Am I missing some steps? Do I need to have XML code to access the vtkTable?</pre><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br></pre><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br></pre><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Thanks,</pre><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br></pre><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Joshua Murphy</pre><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Laboratory for Atmospheric and Space Physics</pre><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">University of Colorado, Boulder</pre><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br></pre></div></div></div></blockquote></body></html>