<div dir="ltr">I noticed a mistake in the code that I wrote. The creation of the<div>array should be done like this:</div><div><br></div><div><span style="font-family:arial,sans-serif;font-size:13.3333339691162px">vtkSmartPointer<</span><span style="font-family:arial,sans-serif;font-size:13.3333339691162px">vtkStringArray> strArr =</span></div><div><span style="font-family:arial,sans-serif;font-size:13.3333339691162px"> vtkSmartPointer<vtkStringArray>::New();</span><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 25, 2014 at 6:54 AM, David Gobbi <span dir="ltr"><<a href="mailto:david.gobbi@gmail.com" target="_blank">david.gobbi@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Orlando,<div><br></div><div>An array cannot, by itself, be an output.</div><div>Instead, the array must be attached to a vtkDataObject.<br></div><div><br></div><div><div>vtkDataObject *output = outInfo->Get(vtkDataObject::DATA_OBJECT());</div></div><div>vtkSmartPointer<vtkStringArray> strArr = vtkStringArray::New();<br></div><div>strArray->SetName("Strings"); // set name to whatever you want</div><div>output->GetFieldData()->AddArray(strArray);</div><div><br></div><div>The "FieldData" of a vtkDataObject is a collection of arrays, you</div><div>can add an unlimited number of arrays to it, and then retrieve them</div><div>later:</div><div><br></div><div>vtkStringArray *a = vtkStringArray::SafeDownCast(</div><div> output->GetFieldData()->GetAbstractArray("Strings"));</div><div><br></div><div>You don't need to add any new outputs to the algorithm. You can just</div><div>add the arrays to the FieldData of an output that already exists.</div><span class="HOEnZb"><font color="#888888"><div><br></div><div> - David</div></font></span><div><div class="h5"><div><br><div class="gmail_extra"><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 25, 2014 at 2:23 AM, RIVERA, Orlando <span dir="ltr"><<a href="mailto:Orlando.RIVERA@mtu.de" target="_blank">Orlando.RIVERA@mtu.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div lang="DE" link="blue" vlink="purple">
<div>
<div>
<div>
<div>
<p><span lang="EN-US">Dear Community<u></u><u></u></span></p>
<p><span lang="EN-US"><u></u> <u></u></span></p>
<p><span lang="EN-US">I have been trying for a while and I checked some examples as well
<u></u><u></u></span></p>
<p><span lang="EN-US"><u></u> <u></u></span></p>
<p><span lang="EN-US">I just want in a reader by RequestData to add two extra output ports one for vtkStringArray and one to vtkIntArray ,
<u></u><u></u></span></p>
<p><span lang="EN-US"><u></u> <u></u></span></p>
<p><span lang="EN-US">Something lilke: <u></u><u></u></span></p>
<p><span lang="EN-US"><u></u> <u></u></span></p>
<p><span lang="EN-US">void RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector* outputVector){<u></u><u></u></span></p>
<p><span lang="EN-US"> {<u></u><u></u></span></p>
<p><span lang="EN-US">...... <u></u><u></u></span></p>
<p><span lang="EN-US"> vtkSmartPointer<vtkInformation> outinfo1= outputVector->GetInformationObject(1);<u></u><u></u></span></p>
<p><span lang="EN-US"> vtkSmartPointer<vtkStringArray> strArr= vtkStringArray::SafeDownCast(outInfo1->Get(vtkDataObject::DATA_OBJECT()));<u></u><u></u></span></p>
<p><span lang="EN-US"> strArr->SetNumberOfValues() ;<u></u><u></u></span></p>
<p><span lang="EN-US">...<u></u><u></u></span></p>
<p><span lang="EN-US">} <u></u><u></u></span></p>
<p><span lang="EN-US"><u></u> <u></u></span></p>
<p><span lang="EN-US">I think I need to tell outputVector somewhere that its second element is a vtkStringArray? I saw all plugins send vtkPoint, Grids etc but nothing like string-int arrays .Sorry for my naivety !<u></u><u></u></span></p>
<p><span lang="EN-US"><u></u> <u></u></span></p>
<p>Cheers <u></u><u></u></p>
<p><u></u> <u></u></p>
<p>Orlando <u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p>
</div>
</div>
</div>
</div>
<span style="font-size:8pt;font-family:Arial;color:silver">--</span><br>
<span style="font-size:8pt;font-family:Arial;color:silver"><strong>MTU Aero Engines AG</strong></span><br>
<span style="font-size:8pt;font-family:Arial;color:silver">Vorstand/Board of Management: Reiner Winkler, Vorsitzender/CEO; Dr. Rainer Martens, Michael Schreyögg, Dr. Stefan Weingartner</span><br>
<span style="font-size:8pt;font-family:Arial;color:silver">Vorsitzender des Aufsichtsrats/Chairman of the Supervisory Board: Klaus Eberhardt</span><br>
<span style="font-size:8pt;font-family:Arial;color:silver">Sitz der Gesellschaft/Registered Office: Muenchen</span><br>
<span style="font-size:8pt;font-family:Arial;color:silver">Handelsregister/Commercial Register: Muenchen HRB 157206</span><br>
<br>
<span style="font-size:8pt;font-family:Arial;color:silver">Diese E-Mail sowie ihre Anhaenge enthalten MTU-eigene vertrauliche oder rechtlich geschuetzte Informationen.</span><br>
<span style="font-size:8pt;font-family:Arial;color:silver">Wenn Sie nicht der beabsichtigte Empfaenger sind, informieren Sie bitte den Absender und loeschen Sie diese</span><br>
<span style="font-size:8pt;font-family:Arial;color:silver">E-Mail sowie die Anhaenge. Das unbefugte Speichern, Kopieren oder Weiterleiten ist nicht gestattet.</span><br>
<br>
<span style="font-size:8pt;font-family:Arial;color:silver">This e-mail and any attached documents are proprietary to MTU, confidential or protected by law.</span><br>
<span style="font-size:8pt;font-family:Arial;color:silver">If you are not the intended recipient, please advise the sender and delete this message and its attachments.</span><br>
<span style="font-size:8pt;font-family:Arial;color:silver">Any unauthorised storing, copying or distribution is prohibited.</span></div></blockquote></div><br></div></div></div></div></div>
</blockquote></div><br></div>