From: Anthony Geay Date: Tue, 11 Apr 2023 11:38:48 +0000 (+0200) Subject: Entry in pipeline browser with same name than those into the object browser. X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=6f6eb102edab66678ac34ba1925c554713089bbd;p=modules%2Fgui.git Entry in pipeline browser with same name than those into the object browser. --- diff --git a/src/SPV3D/SPV3D_Prs.cxx b/src/SPV3D/SPV3D_Prs.cxx index ed912665a..d10efd876 100644 --- a/src/SPV3D/SPV3D_Prs.cxx +++ b/src/SPV3D/SPV3D_Prs.cxx @@ -67,6 +67,12 @@ SPV3D_Prs *SPV3D_Prs::deepCopy() const return ret; } +pqProxy *getPQProxy(vtkSMProxy *proxy) +{ + pqServerManagerModel* smmodel = pqApplicationCore::instance()->getServerManagerModel(); + return smmodel->findItem(proxy); +} + void SPV3D_Prs::FillUsingActor(vtkActor *actor) const { SPV3D_EXPORTSPV3DData *alreadyExistingSrc = nullptr; @@ -86,6 +92,9 @@ void SPV3D_Prs::FillUsingActor(vtkActor *actor) const vtkPVTrivialProducer *clientSideObjectCast = vtkPVTrivialProducer::SafeDownCast(clientSideObject); clientSideObjectCast->SetOutput(ds2); mySourceProducer->updatePipeline(); + pqProxy *producerBase2( getPQProxy(producerBase) ); + if(producerBase2 && !_name.empty()) + producerBase2->rename( _name.c_str() ); this->SetSourceProducer( mySourceProducer ); } else diff --git a/src/SPV3D/SPV3D_Prs.h b/src/SPV3D/SPV3D_Prs.h index 89a012a5e..e6a0db650 100644 --- a/src/SPV3D/SPV3D_Prs.h +++ b/src/SPV3D/SPV3D_Prs.h @@ -56,6 +56,8 @@ public: explicit SPV3D_Prs( const char* entry, SPV3D_ViewWindow *view); ~SPV3D_Prs(); + void SetName(const std::string& name) { _name = name; } + SPV3D_Prs *deepCopy() const; void FillUsingActor(vtkActor *actor) const; @@ -86,4 +88,6 @@ private: SPV3D_EXPORTSPV3DData *_pvRendInfo = nullptr; SPV3D_ViewWindow *_view = nullptr; + //! Name attached to the displayable object in the study + std::string _name; };