Matthias, Attached is the Python script that reloads a file-series. You can import this as a macro or just run it from the Python shell. In either case, ensure that the reader to reload is the active reader.
Utkarsh On Thu, Sep 18, 2014 at 9:34 AM, Zenker, Dr. Matthias <matthias.zen...@erbe-med.com> wrote: > OK - but don't forget that the weekend is also there to have some free > time... ;) > > Matthias > >> -----Ursprüngliche Nachricht----- >> Von: Utkarsh Ayachit [mailto:utkarsh.ayac...@kitware.com] >> Gesendet: Donnerstag, 18. September 2014 14:46 >> An: Zenker, Dr. Matthias >> Cc: Cory Quammen; paraview@paraview.org >> Betreff: Re: [Paraview] How to simply "Reload" a data file >> >> Sorry, didn't get around to it yet. Over this weekend is more likely, since >> I am >> tracking down some last minute issues with 4.2 right now. >> >> Utkarsh >> >> On Thu, Sep 18, 2014 at 3:33 AM, Zenker, Dr. Matthias >> <matthias.zen...@erbe-med.com> wrote: >> > Hi Utkarsh, >> > >> > any news regarding a reload data function (see below)? >> > >> > Matthias >> > >> >> -----Ursprüngliche Nachricht----- >> >> Von: Utkarsh Ayachit [mailto:utkarsh.ayac...@kitware.com] >> >> Gesendet: Montag, 15. September 2014 16:50 >> >> An: Zenker, Dr. Matthias >> >> Cc: Cory Quammen; paraview@paraview.org >> >> Betreff: Re: [Paraview] How to simply "Reload" a data file >> >> >> >> Ah. since it's a file series, it would not work the way Cory is >> >> suggesting. I'll see if I can cook up a Python script that can make >> >> this possible for now. We're putting this on the roadmap for the next >> >> release (I know I've said that a few times in the past :) ). >> >> >> >> Utkarsh >> >> >> >> On Mon, Sep 15, 2014 at 10:31 AM, Zenker, Dr. Matthias >> >> <matthias.zen...@erbe-med.com> wrote: >> >> > Normally I load a time series, either a series of vtu files or a >> >> > time collection >> >> (pvd file containing the vtu file names with asociated timestamps). >> >> During the simulation, new files are added to the series. So it would >> >> be nice to watch the simulation going on by reloading from time to time. >> >> > >> >> > Matthias >> >> > >> >> >> -----Ursprüngliche Nachricht----- >> >> >> Von: Utkarsh Ayachit [mailto:utkarsh.ayac...@kitware.com] >> >> >> Gesendet: Montag, 15. September 2014 16:28 >> >> >> An: Zenker, Dr. Matthias >> >> >> Cc: Cory Quammen; paraview@paraview.org >> >> >> Betreff: Re: [Paraview] How to simply "Reload" a data file >> >> >> >> >> >> I suspect will not work with vtu. To understand this better, what >> >> >> is that which is changing that you need to reload the file? Are >> >> >> you loading a file series or a single file? >> >> >> >> >> >> Utkarsh >> >> >> >> >> >> On Mon, Sep 15, 2014 at 9:54 AM, Zenker, Dr. Matthias >> >> >> <matthias.zen...@erbe-med.com> wrote: >> >> >> > Hi Cory, >> >> >> > >> >> >> > I use the reader for vtu format and pvd (vtu time collection). I >> >> >> > tried to >> >> >> modify the xml as follows: >> >> >> > >> >> >> > <ParaViewPlugin> >> >> >> > <ServerManagerConfiguration> >> >> >> > <ProxyGroup name="sources"> >> >> >> > <SourceProxy name="VTUrefresh" base_proxygroup="sources" >> >> >> base_proxyname="VTUReader" class="vtuReader"> >> >> >> > <Property name="Refresh" command="Modified" >> >> >> panel_widget="command_button"/> >> >> >> > <Hints> >> >> >> > <ReaderFactory extensions="vtu pvd" >> >> >> > file_description="vtu Reader >> >> >> (Refresh button)" /> >> >> >> > </Hints> >> >> >> > </SourceProxy> >> >> >> > </ProxyGroup> >> >> >> > </ServerManagerConfiguration> >> >> >> > <ParaViewReaders> >> >> >> > <Reader name="ReaderWithButton" /> >> >> >> > </ParaViewReaders> >> >> >> > </ParaViewPlugin> >> >> >> > >> >> >> > But I cannot even load it as plugin. Presumably there are >> >> >> > special keyword to >> >> >> use for the name of the original reader. Is there a documentation >> >> >> where I can find more information on that topic? >> >> >> > >> >> >> > Thanks, >> >> >> > >> >> >> > Matthias >> >> >> > >> >> >> >> -----Ursprüngliche Nachricht----- >> >> >> >> Von: Cory Quammen [mailto:cory.quam...@kitware.com] >> >> >> >> Gesendet: Montag, 15. September 2014 15:05 >> >> >> >> An: Zenker, Dr. Matthias >> >> >> >> Cc: paraview@paraview.org >> >> >> >> Betreff: Re: [Paraview] How to simply "Reload" a data file >> >> >> >> >> >> >> >> Matthias, >> >> >> >> >> >> >> >> The method I suggested requires modifying ParaView's source >> >> >> >> code, so it won't work for a binary distribution. >> >> >> >> >> >> >> >> As for the XML method, did you try to load an Xdmf file through >> >> >> >> what should be the new "Xdmf Reader (Refresh button)" reader? >> >> >> >> If you are loading a different type of file, this plugin will >> >> >> >> have no effect because it provides a Refresh button only for >> >> >> >> the Xdmf reader. You could modify the XML for other reader types, >> though. >> >> >> >> >> >> >> >> Thanks, >> >> >> >> Cory >> >> >> >> >> >> >> >> On Mon, Sep 15, 2014 at 4:16 AM, Zenker, Dr. Matthias >> >> >> >> <matthias.zen...@erbe-med.com> wrote: >> >> >> >> > Hi, >> >> >> >> > >> >> >> >> > I wanted to try the "Reload" button which presumably can be >> >> >> >> > created by >> >> >> >> one of the methods outlined below. But I am maybe too naive or >> >> >> >> am missing >> >> >> >> something: I have a Windoze binary distribution of ParaView 4.0.1. >> >> >> >> I did not find the file indicated by Cory, and copying the xml >> >> >> >> code given by Sébastien into a file and loading that as plugin >> >> >> >> had no effect >> >> >> visible to me. >> >> >> >> > >> >> >> >> > What am I missing here? >> >> >> >> > >> >> >> >> > Thank you, >> >> >> >> > >> >> >> >> > Matthias >> >> >> >> > >> >> >> >> >> -----Ursprüngliche Nachricht----- >> >> >> >> >> Von: paraview-boun...@paraview.org [mailto:paraview- >> >> >> >> >> boun...@paraview.org] Im Auftrag von paraview- >> >> >> requ...@paraview.org >> >> >> >> >> Gesendet: Samstag, 15. Juni 2013 18:00 >> >> >> >> >> An: paraview@paraview.org >> >> >> >> >> Betreff: Reload a file >> >> >> >> >> >> >> >> >> >> Send ParaView mailing list submissions to >> >> >> >> >> paraview@paraview.org >> >> >> >> >> >> >> >> >> >> To subscribe or unsubscribe via the World Wide Web, visit >> >> >> >> >> http://www.paraview.org/mailman/listinfo/paraview >> >> >> >> >> or, via email, send a message with subject or body 'help' to >> >> >> >> >> paraview-requ...@paraview.org >> >> >> >> >> >> >> >> >> >> You can reach the person managing the list at >> >> >> >> >> paraview-ow...@paraview.org >> >> >> >> >> >> >> >> >> >> When replying, please edit your Subject line so it is more >> >> >> >> >> specific than >> >> >> >> "Re: >> >> >> >> >> Contents of ParaView digest..." >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> Today's Topics: >> >> >> >> >> >> >> >> >> >> 1. Re: How to simply "Reload" a data file (Cory Quammen) >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> ------------------------------------------------------------ >> >> >> >> >> --- >> >> >> >> >> --- >> >> >> >> >> --- >> >> >> >> >> - >> >> >> >> >> >> >> >> >> >> Message: 1 >> >> >> >> >> Date: Fri, 14 Jun 2013 13:42:34 -0400 >> >> >> >> >> From: Cory Quammen <cquam...@cs.unc.edu> >> >> >> >> >> Subject: Re: [Paraview] How to simply "Reload" a data file >> >> >> >> >> To: Sebastien Jourdain <sebastien.jourd...@kitware.com> >> >> >> >> >> Cc: Michael Jackson <mike.jack...@bluequartz.net>, >> ParaView >> >> >> >> >> <paraview@paraview.org> >> >> >> >> >> Message-ID: >> >> >> >> >> <CANmPiKDegNcAjjRwcVimiGAq3s9j02q7xE- >> >> >> >> >> oervrsrnbzus...@mail.gmail.com> >> >> >> >> >> Content-Type: text/plain; charset=ISO-8859-1 >> >> >> >> >> >> >> >> >> >> For what it's worth, I just experimented with adding the >> >> >> >> >> line >> >> >> >> >> >> >> >> >> >> <Property name="Refresh" command="Modified" >> >> >> >> >> panel_widget="command_button"/> >> >> >> >> >> >> >> >> >> >> to the CSV reader and XDMF reader in >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> ParaView/ParaViewCore/ServerManager/SMApplication/Resources/readers >> >> >> >> >> .xml >> >> >> >> >> >> >> >> >> >> The Refresh button appears among the other property widgets >> >> >> >> >> and it indeed reloads the data set. >> >> >> >> >> >> >> >> >> >> I would happily add this to all the readers and submit a >> >> >> >> >> patch to gerrit if it would be received well by the core >> >> >> >> >> ParaView >> >> developers. >> >> >> >> >> >> >> >> >> >> Thanks, >> >> >> >> >> Cory >> >> >> >> >> >> >> >> >> >> On Fri, Jun 14, 2013 at 11:57 AM, Sebastien Jourdain >> >> >> >> >> <sebastien.jourd...@kitware.com> wrote: >> >> >> >> >> > BTW that's the correct XML for you, just need to create a >> >> >> >> >> > file with that in and load it as a plugin and you will >> >> >> >> >> > have your >> >> "Refresh" >> >> >> button. >> >> >> >> >> > >> >> >> >> >> > <ParaViewPlugin> >> >> >> >> >> > <ServerManagerConfiguration> >> >> >> >> >> > <ProxyGroup name="sources"> <SourceProxy >> >> >> >> >> > name="XDMFRrefresh" base_proxygroup="sources" >> >> >> >> >> > base_proxyname="XdmfReader" class="vtkXdmfReader"> >> >> >> >> >> > <Property name="Refresh" command="Modified" >> >> >> >> >> > panel_widget="command_button"/> >> >> >> >> >> > <Hints> >> >> >> >> >> > <ReaderFactory extensions="xmf xdmf" >> >> >> >> >> > file_description="Xdmf Reader (Refresh button)" /> >> >> >> >> >> > </Hints> >> >> >> >> >> > </SourceProxy> >> >> >> >> >> > </ProxyGroup> >> >> >> >> >> > </ServerManagerConfiguration> >> >> >> >> >> > <ParaViewReaders> >> >> >> >> >> > <Reader name="ReaderWithButton" /> >> >> >> >> >> > </ParaViewReaders> >> >> >> >> >> > </ParaViewPlugin> >> >> >> >> >> > >> >> >> >> >> > >> >> >> >> >> > >> >> >> >> >> > >> >> >> >> >> > >> >> >> >> >> > On Fri, Jun 14, 2013 at 10:27 AM, Sebastien Jourdain >> >> >> >> >> > <sebastien.jourd...@kitware.com> wrote: >> >> >> >> >> >> >> >> >> >> >> >> Another approach could be a python macro that invalidate >> >> >> >> >> >> the "active/selected' proxy in the pipeline, but that one >> >> >> >> >> >> will require the usage of ParaView in built-in mode. >> >> >> >> >> >> >> >> >> >> >> >> If interested I can try to write the corresponding python >> code... >> >> >> >> >> >> >> >> >> >> >> >> Seb >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> On Fri, Jun 14, 2013 at 10:24 AM, Sebastien Jourdain >> >> >> >> >> >> <sebastien.jourd...@kitware.com> wrote: >> >> >> >> >> >>> >> >> >> >> >> >>> I forgot to state the obvious, the plugin is a XML one... >> >> >> >> >> >>> No code involved... >> >> >> >> >> >>> >> >> >> >> >> >>> In fact, just having the XML that I wrote in a file >> >> >> >> >> >>> extend the UI with a button to refresh the reader should be >> enough. >> >> >> >> >> >>> Need to figure out why the reader factory did not catch >> >> >> >> >> >>> up the >> >> >> hint. >> >> >> >> >> >>> >> >> >> >> >> >>> That should be the only thing that you would need. >> >> >> >> >> >>> >> >> >> >> >> >>> Seb >> >> >> >> >> >>> >> >> >> >> >> >>> >> >> >> >> >> >>> >> >> >> >> >> >>> On Fri, Jun 14, 2013 at 10:08 AM, Michael Jackson >> >> >> >> >> >>> <mike.jack...@bluequartz.net> wrote: >> >> >> >> >> >>>> >> >> >> >> >> >>>> I was hoping that ParaView just had something built in. >> >> >> >> >> >>>> I would rather not have to create a plugin and >> >> >> >> >> >>>> distribute that along side my own software and to keep >> >> >> >> >> >>>> up on builds for all the various OS's and all of that. >> >> >> >> >> >>>> i tried that for a while and I just could not >> >> >> >> keep up. >> >> >> >> >> >>>> >> >> >> >> >> >>>> So either I am the only person who has asked for this >> >> >> >> >> >>>> or there is some over riding reason in the design of >> >> >> >> >> >>>> ParView why this type of functionality is not in ParaView. >> >> >> >> >> >>>> >> >> >> >> >> >>>> Thanks >> >> >> >> >> >>>> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> __________________________________________________________ >> >> >> >> >> _ >> >> >> >> >> >>>> Mike Jackson Principal Software Engineer >> >> >> >> >> >>>> BlueQuartz Software Dayton, Ohio >> >> >> >> >> >>>> mike.jack...@bluequartz.net www.bluequartz.net >> >> >> >> >> >>>> >> >> >> >> >> >>>> On Jun 14, 2013, at 3:40 PM, Felipe Bordeu >> >> >> >> >> >>>> <felipe.bor...@ec-nantes.fr> >> >> >> >> >> >>>> wrote: >> >> >> >> >> >>>> >> >> >> >> >> >>>> > hi you can try the approach of S?bastien >> >> >> >> >> >>>> > >> >> >> >> >> >>>> > http://perso.uclouvain.be/sebastien.blaise/tools.html >> >> >> >> >> >>>> > >> >> >> >> >> >>>> > I haven't tested yet. >> >> >> >> >> >>>> > >> >> >> >> >> >>>> > You can save the code as a macro, so you will have a >> button. >> >> >> >> >> >>>> > >> >> >> >> >> >>>> > Felipe >> >> >> >> >> >>>> > >> >> >> >> >> >>>> > Le 14/06/2013 09:42, Michael Jackson a ?crit : >> >> >> >> >> >>>> >> Is there button where I can simply reload a data >> >> >> >> >> >>>> >> file that was read in a pipeline? >> >> >> >> >> >>>> >> >> >> >> >> >> >>>> >> We have a workflow where we process data into a file >> >> >> >> >> >>>> >> and view it in ParaView. it is becoming tedious to >> >> >> >> >> >>>> >> blow away the entire pipeline just to reload the new >> data. >> >> >> >> >> >>>> >> >> >> >> >> >> >>>> >> I know about state files but this still requires >> >> >> >> >> >>>> >> the user to go to the File->Load State... " menu and >> >> >> >> >> >>>> >> then select a state >> >> >> file. >> >> >> >> >> >>>> >> I would like to just select the data file in the >> >> >> >> >> >>>> >> Pipeline browser (XDMF File reader for us), and just >> >> >> >> >> >>>> >> click some button that just reloads data from the file. >> >> >> >> >> >>>> >> >> >> >> >> >> >>>> >> Or am I just missing something? I am using ParaView >> >> >> >> >> >>>> >> 3.98.1. I have to admit I have not tried any of the >> >> >> >> >> >>>> >> 4.0.RC* >> >> >> downloads. >> >> >> >> >> >>>> >> >> >> >> >> >> >>>> >> Thanks >> >> >> >> >> >>>> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> _________________________________________________________ >> >> >> >> >> >>>> >> Mike Jackson mike.jack...@bluequartz.net >> >> >> >> >> >>>> >> BlueQuartz Software www.bluequartz.net >> >> >> >> >> >>>> >> Principal Software Engineer Dayton, Ohio >> >> >> >> >> >>>> >> >> >> _______________________________________________ >> >> >> >> >> >>>> >> 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 >> >> >> >> >> >>>> >> >> >> >> >> >> >>>> >> Follow this link to subscribe/unsubscribe: >> >> >> >> >> >>>> >> http://www.paraview.org/mailman/listinfo/paraview >> >> >> >> >> >>>> > >> >> >> >> >> >>>> > >> >> >> >> >> >>>> > -- >> >> >> >> >> >>>> > Felipe Bordeu Weldt >> >> >> >> >> >>>> > Ing?nieur de Recherche >> >> >> >> >> >>>> > ------------------------------------- >> >> >> >> >> >>>> > T?l. : 33 (0)2 40 37 16 57 Fax. : 33 (0)2 40 74 74 06 >> >> >> >> >> >>>> > felipe.bor...@ec-nantes.fr Institut GeM - UMR CNRS >> >> >> >> >> >>>> > 6183 ?cole Centrale Nantes >> >> >> >> >> >>>> > 1 Rue de La No?, 44321 Nantes, FRANCE >> >> >> >> >> >>>> > ------------------------------------- >> >> >> >> >> >>>> > >> >> >> >> >> >>>> > >> >> _______________________________________________ >> >> >> >> >> >>>> > 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 >> >> >> >> >> >>>> > >> >> >> >> >> >>>> > Follow this link to subscribe/unsubscribe: >> >> >> >> >> >>>> > http://www.paraview.org/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 >> >> >> >> >> >>>> >> >> >> >> >> >>>> Follow this link to subscribe/unsubscribe: >> >> >> >> >> >>>> http://www.paraview.org/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 >> >> >> >> >> > >> >> >> >> >> > Follow this link to subscribe/unsubscribe: >> >> >> >> >> > http://www.paraview.org/mailman/listinfo/paraview >> >> >> >> >> > >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> -- >> >> >> >> >> Cory Quammen >> >> >> >> >> Research Associate >> >> >> >> >> Department of Computer Science The University of North >> >> >> >> >> Carolina at Chapel Hill >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> ------------------------------ >> >> >> >> >> >> >> >> >> >> _______________________________________________ >> >> >> >> >> 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 >> >> >> >> >> >> >> >> >> >> Follow this link to subscribe/unsubscribe: >> >> >> >> >> http://www.paraview.org/mailman/listinfo/paraview >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> End of ParaView Digest, Vol 110, Issue 42 >> >> >> >> >> ***************************************** >> >> >> >> > >> >> >> >> > >> >> >> >> > >> >> >> >> >> >> >> >> >> >> __________________________________________________________ >> >> >> >> ___________ >> >> >> >> > ERBE Elektromedizin GmbH >> >> >> >> > Firmensitz: 72072 Tuebingen >> >> >> >> > Geschaeftsfuehrer: Christian O. Erbe, Reiner Thede >> >> >> >> > Registergericht: Stuttgart HRB 380137 >> >> >> >> > >> >> >> >> > _______________________________________________ >> >> >> >> > 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 >> >> >> >> > >> >> >> >> > Follow this link to subscribe/unsubscribe: >> >> >> >> > http://public.kitware.com/mailman/listinfo/paraview >> >> >> > >> >> >> > >> >> >> > >> >> >> >> >> >> __________________________________________________________ >> >> >> ___________ >> >> >> > ERBE Elektromedizin GmbH >> >> >> > Firmensitz: 72072 Tuebingen >> >> >> > Geschaeftsfuehrer: Christian O. Erbe, Reiner Thede >> >> >> > Registergericht: Stuttgart HRB 380137 >> >> >> > >> >> >> > _______________________________________________ >> >> >> > 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 >> >> >> > >> >> >> > Follow this link to subscribe/unsubscribe: >> >> >> > http://public.kitware.com/mailman/listinfo/paraview >> >> > >> >> > >> >> > >> >> >> __________________________________________________________ >> >> ___________ >> >> > ERBE Elektromedizin GmbH >> >> > Firmensitz: 72072 Tuebingen >> >> > Geschaeftsfuehrer: Christian O. Erbe, Reiner Thede >> >> > Registergericht: Stuttgart HRB 380137 >> >> > >> > >> > >> > >> __________________________________________________________ >> ___________ >> > ERBE Elektromedizin GmbH >> > Firmensitz: 72072 Tuebingen >> > Geschaeftsfuehrer: Christian O. Erbe, Reiner Thede >> > Registergericht: Stuttgart HRB 380137 >> > > > > _____________________________________________________________________ > ERBE Elektromedizin GmbH > Firmensitz: 72072 Tuebingen > Geschaeftsfuehrer: Christian O. Erbe, Reiner Thede > Registergericht: Stuttgart HRB 380137 >
#============================================================================== # # Copyright (c) Kitware, Inc. # All rights reserved. # See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details. # # This software is distributed WITHOUT ANY WARRANTY; without even # the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR # PURPOSE. See the above copyright notice for more information. # #============================================================================== from paraview.vtk import vtkPVServerManagerCore as smc from os import path from paraview.vtk.vtkPVClientServerCoreDefault import vtkPVFileInformation # Locate the reader and it's FileName property. utils = smc.vtkSMCoreUtilities reader = GetActiveSource() fnameProperty = utils.GetFileNameProperty(reader.SMProxy) if reader else None if not fnameProperty: raise RuntimeError, "Ensure that the reader is active." # Access the first file name specified for the reader. # That will give us the location of the file series. firstFile = reader.GetProperty(fnameProperty).GetElement(0) dirname = path.dirname(firstFile) # get the directory listing for the directory containing the # file series helperProxy = servermanager.ProxyManager().NewProxy("misc", "FileInformationHelper") helperProxy = servermanager._getPyProxy(helperProxy) helperProxy.WorkingDirectory = dirname helperProxy.DirectoryListing = 1 helperProxy.GetProperty("Path").SetElement(0, dirname) helperProxy.SpecialDirectories = 0 helperProxy.UpdateVTKObjects() info = vtkPVFileInformation() helperProxy.GatherInformation(info) fileGroupOfInterest = None # Since the directory can have other items, locate the item # that corresonds to the file-group of interest. contents = info.GetContents() for index in xrange(contents.GetNumberOfItems()): item = contents.GetItemAsObject(index) if item and \ item.GetType() == vtkPVFileInformation.FILE_GROUP and \ item.GetContents().GetNumberOfItems() > 0 and \ item.GetContents().GetItemAsObject(0).GetType() == vtkPVFileInformation.SINGLE_FILE and \ item.GetContents().GetItemAsObject(0).GetFullPath() == firstFile: # found the file group! fileGroupOfInterest = item break del contents del info del helperProxy if not fileGroupOfInterest: raise RuntimeError, "Failed to locate the file listing." # Now get all files in the file group of interest. files = [] contents = fileGroupOfInterest.GetContents() for index in xrange(contents.GetNumberOfItems()): item = contents.GetItemAsObject(index) if item and item.GetType() == vtkPVFileInformation.SINGLE_FILE: files.append(item.GetFullPath()) del contents del fileGroupOfInterest # print "Updated list of files", files # Set the files on the reader. setattr(reader, fnameProperty, files) # Closing -- do the "next" thing. I'm just rendering or updating. if GetActiveView(): Render() else: UpdatePipeline()
_______________________________________________ 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 Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/paraview