]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Entry in pipeline browser with same name than those into the object browser.
authorAnthony Geay <anthony.geay@edf.fr>
Tue, 11 Apr 2023 11:38:48 +0000 (13:38 +0200)
committerAnthony Geay <anthony.geay@edf.fr>
Tue, 11 Apr 2023 11:38:48 +0000 (13:38 +0200)
src/SPV3D/SPV3D_Prs.cxx
src/SPV3D/SPV3D_Prs.h

index ed912665afaa66b4e17f34cc4f1fe0b3a65e9d33..d10efd876921f5914ab280a88a9d6366017ccdda 100644 (file)
@@ -67,6 +67,12 @@ SPV3D_Prs *SPV3D_Prs::deepCopy() const
   return ret;
 }
 
+pqProxy *getPQProxy(vtkSMProxy *proxy)
+{
+  pqServerManagerModel* smmodel = pqApplicationCore::instance()->getServerManagerModel();
+  return smmodel->findItem<pqProxy*>(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
index 89a012a5ed495711f1809921a186c48e410b5931..e6a0db650de57c371195e5ac9b055f9ba6960ccd 100644 (file)
@@ -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;
 };