Re: [Paraview] ParaView session state
Hi Aron and all, Following this discussion For what I can see, all the session state is stored in a variable called "State" inside Internals of vtkSMSessionProxyManager (vtkSMSessionProxyManagerInternals). This State is of type vtkSMMessage, which is a typedef of paraview_protobuf::Message. In other words, the state of the whole session is stored as a generated protobuf class (or package), which is defined in vtkPVMessage.proto. I guess this make sense as -- I image -- this makes read/write from a flat XML much easier (as well as transferring from client-to-server and vice versa). It would be great if someone with more knowledge on these details can clarify that I am in fact correct... Cheers, Eduardo. September 26, 2017 10:33 AM, "Aron Helser" wrote: Hi Eduardo, I think you've basically got it, but the state is more complicated than you think. Basically everything has a vtkSMProxy, and those proxies contain the state of the pipeline, representation, and views. Anything that is modified from the defaults gets saved in the state file. The vtkSMSessionProxyManager is the root of a session, as you've found. The input data is saved in the state file as absolute paths, and you do need the input data. When you read state, it has that intelligent option to search for the data files in another directory... I've just been learning this stuff trying to add dynamic lights to ParaView, so hopefully I'm close :) HTH, Regards, Aron On Tue, Sep 26, 2017 at 12:33 PM, wrote: Hello list, Where is the data structure(s) in the code where all the objects for the state of a particular ParaView session are kept while it is running?. I have been reading the code, and I think it should be in the "internals" of vtkSMSessionProxyManager, but I am unsure. As far as I understand, the state (which can be saved to XML) is all it takes to recreate a session (Am I right here? Probably you need the input data as well, right?). Thanks for the help!, Eduardo. P.S.: Are my emails going to SPAM? Can someone respond ("hi") to this email to confirm otherwise? Thanks !. ___ Powered by www.kitware.com (http://www.kitware.com) Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html (http://www.kitware.com/opensource/opensource.html) Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView (http://paraview.org/Wiki/ParaView) Search the list archives at: http://markmail.org/search/?q=ParaView (http://markmail.org/search/?q=ParaView) Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/paraview (http://public.kitware.com/mailman/listinfo/paraview) ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Search the list archives at: http://markmail.org/search/?q=ParaView Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/paraview
Re: [Paraview] [vtkusers] Paraview Error while reading .vts file
Hi Siming, Please reply-all to keep the discussion on the list so others may participate and benefit. This line in your export code is a problem: sgrid->GetCellData()->AddArray(probe->GetOutput()->GetPointData()->GetArray(i)); Point and cell data arrays have different lengths for structured grids. The writer is apparently not catching this, but the reader is. Cory On Wed, Sep 27, 2017 at 9:42 AM, Siming Bayer wrote: > I used the vtkProbeFilter to interpolate the value on the edges of a > volumetric mesh onto a image volume with dimension of 256x256x256. And save > the output of vtkProbeFilter to a .vts file use the following code: > > vtkSmartPointer volume = vtkSmartPointer::New(); > > volume->DeepCopy(reader->GetOutput()); > > //find the cell centers, store as polydata > > vtkSmartPointer probePoints = vtkSmartPointer::New(); > > double center[3] = { 0,0,0 }; > > for (vtkIdType cellId = 0; cellId < volume->GetNumberOfCells(); ++cellId) > > { > > double pcoords[3] = { 0,0,0 }; > > double *weights = new double[volume->GetMaxCellSize()]; > > vtkCell* cell = volume->GetCell(cellId); > > int subId = cell->GetParametricCenter(pcoords); > > cell->EvaluateLocation(subId, pcoords, center, weights); > > probePoints->InsertNextPoint(center[0], center[1], center[2]); > > } > > vtkSmartPointer probePolyData = > vtkSmartPointer::New(); > > probePolyData->SetPoints(probePoints); > > //read the .vtu mesh file as untructured grid > > vtkSmartPointer meshReader = > vtkSmartPointer::New(); > > meshReader->SetFileName(argv[2]); > > meshReader->Update(); > > vtkUnstructuredGrid* ugrid = meshReader->GetOutput(); > > std::cout << "Interpolating" << std::endl; > > //Probe filter > > vtkSmartPointer probe = > vtkSmartPointer::New(); > > probe->SetValidPointMaskArrayName("mesh"); > > probe->SetSourceData(ugrid); > > probe->SetInputData(probePolyData); > > probe->Update(); > > //save the output of probefileter as .vtu file > > vtkSmartPointer sgrid = > vtkSmartPointer::New(); > > sgrid->SetDimensions(256, 256, 256); > > sgrid->SetPoints(probePoints); > > unsigned int numberOfArrays = > probe->GetOutput()->GetPointData()->GetNumberOfArrays(); > > std::cout << "Copying arrays:" << std::endl; > > for (unsigned int i = 0; i < numberOfArrays; i++) > > { > > std::cout << "\t" << > probe->GetOutput()->GetPointData()->GetArray(i)->GetName() << std::endl; > > sgrid->GetCellData()->AddArray(probe->GetOutput()->GetPointData()->GetArray(i)); > > } > > std::cout << "Writing .vts output" << std::endl; > > vtkSmartPointer sWriter = > vtkSmartPointer::New(); > > sWriter->SetFileName("test.vts"); > > sWriter->SetInputData(sgrid); > > sWriter->Write(); > > } > > > Maybe something wrong here? > > > best, > > Siming > > > 2017-09-27 15:29 GMT+02:00 Cory Quammen : >> >> [Moving this discussion over to the ParaView list serve as it has to >> do with ParaView.] >> >> Unfortunately, there's not enough information in the header file. What >> wrote this .vts file? >> >> Thanks, >> Cory >> >> On Wed, Sep 27, 2017 at 9:25 AM, Siming Bayer >> wrote: >> > Yes, >> > >> > the whole file is quite large. The header part is the following: >> > >> > >> > > > header_type="UInt32" compressor="vtkZLibDataCompressor"> >> > >> > > >> >> > >> > >> > >> > > > format="appended" RangeMin="0"RangeMax="0" >> > offset="0" /> >> > > > format="appended" RangeMin="0"RangeMax="0" >> > offset="906832" /> >> > > > NumberOfComponents="3" format="appended" RangeMin="0" >> > RangeMax="0"offset="1813664" /> >> > > > RangeMin="0" >> > RangeMax="0"offset="2720496" /> >> > >> > >> > > > format="appended" RangeMin="0.86602540378" >> > RangeMax="440.80693053" >> > offset="2758320" /> >> > >> > >> > >> > >> > >> > >> > _...(here >> > is the data) >> > >> > >> > >> > Thank you! >> > >> > best, >> > Siming >> > >> > 2017-09-27 15:21 GMT+02:00 Cory Quammen : >> >> >> >> On Wed, Sep 27, 2017 at 8:50 AM, Siming Bayer >> >> wrote: >> >> > Dear all, >> >> > >> >> > I got the following error while reading a .vts file with ParaView: >> >> > >> >> > >> >> > >> >> > ERROR: In >> >> > >> >> > >> >> > C:\bbd\7cc78367\build\superbuild\paraview\src\VTK\IO\XML\vtkXMLStructuredDataReader.cxx, >> >> > line 360 >> >> > >> >> > vtkXMLStructuredGridReader (0B791F40): Error reading extent 0 >> >> > 255 0 >> >> > 255 0 255 from piece 0 >> >> > >> >> > >> >> > What does it mean? What could be the reason? >> >> > >> >> >> >> Perhaps there is something wrong with the file. Can you share it, or >> >> ideally a smaller data set that exhibits the same problem? >> >> >> >> Thanks, >> >> Cory >> >> >> >> > >> >> > >> >> > >> >> > ___ >> >> > Powe
Re: [Paraview] [vtkusers] Paraview Error while reading .vts file
[Moving this discussion over to the ParaView list serve as it has to do with ParaView.] Unfortunately, there's not enough information in the header file. What wrote this .vts file? Thanks, Cory On Wed, Sep 27, 2017 at 9:25 AM, Siming Bayer wrote: > Yes, > > the whole file is quite large. The header part is the following: > > > header_type="UInt32" compressor="vtkZLibDataCompressor"> > > > > > > > format="appended" RangeMin="0"RangeMax="0" > offset="0" /> > format="appended" RangeMin="0"RangeMax="0" > offset="906832" /> > NumberOfComponents="3" format="appended" RangeMin="0" > RangeMax="0"offset="1813664" /> > RangeMax="0"offset="2720496" /> > > > format="appended" RangeMin="0.86602540378"RangeMax="440.80693053" > offset="2758320" /> > > > > > > _...(here > is the data) > > > > Thank you! > > best, > Siming > > 2017-09-27 15:21 GMT+02:00 Cory Quammen : >> >> On Wed, Sep 27, 2017 at 8:50 AM, Siming Bayer >> wrote: >> > Dear all, >> > >> > I got the following error while reading a .vts file with ParaView: >> > >> > >> > >> > ERROR: In >> > >> > C:\bbd\7cc78367\build\superbuild\paraview\src\VTK\IO\XML\vtkXMLStructuredDataReader.cxx, >> > line 360 >> > >> > vtkXMLStructuredGridReader (0B791F40): Error reading extent 0 >> > 255 0 >> > 255 0 255 from piece 0 >> > >> > >> > What does it mean? What could be the reason? >> > >> >> Perhaps there is something wrong with the file. Can you share it, or >> ideally a smaller data set that exhibits the same problem? >> >> Thanks, >> Cory >> >> > >> > >> > >> > ___ >> > Powered by www.kitware.com >> > >> > Visit other Kitware open-source projects at >> > http://www.kitware.com/opensource/opensource.html >> > >> > Please keep messages on-topic and check the VTK FAQ at: >> > http://www.vtk.org/Wiki/VTK_FAQ >> > >> > Search the list archives at: http://markmail.org/search/?q=vtkusers >> > >> > Follow this link to subscribe/unsubscribe: >> > http://public.kitware.com/mailman/listinfo/vtkusers >> > >> >> >> >> -- >> Cory Quammen >> Staff R&D Engineer >> Kitware, Inc. > > -- Cory Quammen Staff R&D Engineer Kitware, Inc. ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Search the list archives at: http://markmail.org/search/?q=ParaView Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/paraview