<div dir="ltr">I don&#39;t think ReadFieldData returns anything.<br><br>Instead you should be using do_reader-&gt;GetOutput()-&gt;GetFieldData(); (after calling ReadFieldData())<br><br>I suggest you to instantiate the class like this<br>
<br>vtkSmartPointer&lt;vtkDataObjectReader&gt; do_reader =<br> vtkSmartPointer&lt;vtkDataObjectReader&gt;::New();<br><br>Jothy<br><br><br><br><div class="gmail_quote">On Thu, Feb 9, 2012 at 1:26 PM,  <span dir="ltr">&lt;<a href="mailto:ycollette.nospam@free.fr">ycollette.nospam@free.fr</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I found the way to initialize the class in C++:<br>
<div class="im"><br>
  vtkFieldData * dataSet = NULL;<br>
</div>  vtkDataObject * do_tmp = NULL;<br>
  vtkDataObjectReader * do_reader = vtkDataObjectReader::New(); // instead of new vtkDataObjectReader<br>
<br>
  do_reader-&gt;ReadAllFieldsOn();<br>
  do_reader-&gt;SetFileName(Filename);<br>
  do_tmp = do_reader-&gt;GetOutput();<br>
  dataSet = do_reader-&gt;ReadFieldData();<br>
<br>
Now, I&#39;ve got a problem: this simple program hangs when I call dataSet = do_reader-&gt;ReadFieldData();<br>
<br>
YC<br>
<br>
----- Mail original -----<br>
De: &quot;ycollette nospam&quot; &lt;<a href="mailto:ycollette.nospam@free.fr">ycollette.nospam@free.fr</a>&gt;<br>
Ā: <a href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a><br>
Envoyé: Jeudi 9 Février 2012 14:04:27<br>
Objet: [vtkusers] How to use vtkDataObjectReader in C++<br>
<div><div></div><div class="h5"><br>
Hello,<br>
<br>
I tried to compile the following code under C++, but the compiler complains about not being able to access protected members (the contructor and the destructor).<br>
Here is the peice of code:<br>
<br>
  vtkFieldData * dataSet = NULL;<br>
  vtkDataObjectReader * do_reader = new vtkDataObjectReader;<br>
<br>
  do_reader-&gt;ReadAllFieldsOn();<br>
  do_reader-&gt;SetFileName(Filename);<br>
  dataSet = do_reader-&gt;ReadFieldData();<br>
<br>
<br>
My question is: how to use vtkDataObjectReader in C++ ?<br>
<br>
Best regards,<br>
<br>
YC<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr">Jothy<br></div><br>
</div>