<div dir="ltr">Hello rclaveria,<div>iterating through the file collection has to be done on the client side. It seems like you are only programming server side code. Paraview is very limited by design if you want to change the client from the server. Everything action has to be initiated from the client.</div><div>Have a look at the PVDReader section of ParaView/ParaViewCore/ServerManager/SMApplication/Resources/readers.xml and write a client side proxy that invokes the required operations.</div><div><br></div><div>The following can't be discussed as is. Obviously, those lines won't compile without more context. Either show the complete file, or at least the compiler output.</div><div>

<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">"The following piece of code doesn't even compile:</span><br style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">        vtkDataObject* outputreader = reader->SetUpOutput();</span><br style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">        output->DeepCopy(outputreader)</span><wbr style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">;"</span></div><div><br></div><div>Regards,</div><div>Jussuf<br style="color:rgb(34,34,34);font-family:arial,sans-serif;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">

<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, May 31, 2018 at 12:13 AM, rclaveria <span dir="ltr"><<a href="mailto:rclaveria@dim.uchile.cl" target="_blank">rclaveria@dim.uchile.cl</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
I'm writing a Paraview plugin in C++ (a source, to be precise) where I generate a mesh from external code and save it in PVD format. Then I have to read the newly created file and load it into the output, in order to display the mesh on the main Paraview screen.<br>
<br>
I've written other source algorithms which rely on reading files but I've always read .vtk format so far. That was not a problem since I can read them with vtkGenericDataObjectReader within the  RequestData function:<br>
<br>
        vtkSmartPointer<vtkGenericData<wbr>ObjectReader> reader =<br>
           vtkSmartPointer<vtkGenericDat<wbr>aObjectReader>::New();<br>
        std::string inputFilename = dir.toStdString() + "file.vtk";<br>
        reader->SetFileName(inputFilen<wbr>ame.c_str());<br>
        reader->Update();<br>
        vtkUnstructuredGrid* outputreader = reader->GetUnstructuredGridOut<wbr>put();<br>
        output->DeepCopy(outputreader)<wbr>;<br>
<br>
With pvd files, however, is not equally simple to load a file into the output. The following piece of code works well for the reading part:<br>
<br>
        vtkSmartPointer<vtkPVDReader> reader =<br>
           vtkSmartPointer<vtkPVDReader><wbr>::New();<br>
        std::string inputFilename = dir.toStdString() + "file.pvd";<br>
        reader->SetFileName(inputFilen<wbr>ame.c_str());<br>
        reader->Update();<br>
<br>
But I don't know how to show the first file of the collection on the screen (pvd is a list of objects rather than a single file) and activate the "animation" on the VCR menu (one can put plays and the whole sequence displays). In other words, my code intends to replicate what happens when the user opens a .pvd file from the "File -> Open" menu, but I don't manage to do it. The following piece of code doesn't even compile:<br>
<br>
        vtkDataObject* outputreader = reader->SetUpOutput();<br>
        output->DeepCopy(outputreader)<wbr>;<br>
<br>
I'd be grateful to get some help with this issue.<br>
<br>
Regards,<br>
R<br>
______________________________<wbr>_________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensou<wbr>rce/opensource.html</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=Paraview-developers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>Paraview-developers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://public.kitware.com/mailman/listinfo/paraview-developers" rel="noreferrer" target="_blank">https://public.kitware.com/mai<wbr>lman/listinfo/paraview-develop<wbr>ers</a><br>
</blockquote></div><br></div>