Hi Fabian, From: Fabian Wein <fabian.w...@am.uni-erlangen.de> Subject: Re: [Paraview] Please help!! How to force Render() from a reader Date: Wed, 14 Oct 2009 10:26:09 +0200
> Hi Takuya, > >> I am not sure what you mean by a thread (a client side code?), >> but perhaps you can simply write >> >> pqApplicationCore::instance()->render(); > > This has no effect. Meanwhile I think this is because of the client/server > structure. > > Update within the reader forces RequestUpdateExtent and RequestData > for the new time value - but it is not dispayed in the time GUI next > to the > VCR area. > > A reader is a server part, isn't it? I guess I need also a gui part. Perhaps you are right in that you need a gui (client) part. (PV experts: correct me if I am wrong) > > Is there a complete code example anywhere? Here is what I have in the gui (client) part for the "pesudo" live updating of my time-aware reader (I am using a QTimer for periodically polling a running case in a simple way). It's sort of brutal implementation though. If you are intersted in the full version, have a look at http://openfoamwiki.net/index.php/Contrib_Parallelized_Native_OpenFOAM_Reader_for_ParaView // only update pipeline information (RequestInformation()) this->Sp->GetProperty("Refresh")->Modified(); this->Sp->UpdatePipelineInformation(); this->Sp->UpdatePropertyInformation(); // explicitly pull the property informa tion // get the last timestep vtkSMDoubleVectorProperty *tsv = vtkSMDoubleVectorProperty::SafeDownCast(this->Sp->GetProperty("TimestepV alues")); if(tsv->GetNumberOfElements() > 0) { const double lastStep = tsv->GetElement(tsv->GetNumberOfElements() - 1); pqApplicationCore *app = pqApplicationCore::instance(); // set animation time to the last timestep QList<pqAnimationScene*> scenes = app->getServerManagerModel()->findItems<pqAnimationScene *>(); foreach (pqAnimationScene *scene, scenes) { scene->setAnimationTime(lastStep); } if(this->Rescale->isChecked()) { // rescale QList<pqPipelineRepresentation*> pipes = app->getServerManagerModel()->findItems<pqPipelineRepresentation *>( ); foreach (pqPipelineRepresentation *pipe, pipes) { pipe->resetLookupTableScalarRange(); } app->render(); } } Regards, Takuya Takuya OSHIMA, Ph.D. Faculty of Engineering, Niigata University 8050 Ikarashi-Ninocho, Nishi-ku, Niigata, 950-2181, JAPAN _______________________________________________ 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