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

index 6a3d7a2528b5eb4da197461154a840ed9d01689e..6fcea65a5b970b965a332fdc436dfa6975c89e4d 100644 (file)
 #include CORBA_SERVER_HEADER(SMESH_Group)
 #include CORBA_SERVER_HEADER(SMESH_Mesh)
 
+std::string SMESHGUI_Displayer::getName( const QString& entry )
+{
+  Handle( SALOME_InteractiveObject ) theIO = new SALOME_InteractiveObject();
+  theIO->setEntry( entry.toUtf8().constData() );
+  if ( !theIO.IsNull() )
+  {
+    //  Find SOBject (because shape should be published previously)
+    if ( study() )
+    {
+      _PTR(SObject) aSObj ( study()->studyDS()->FindObjectID( theIO->getEntry() ) );
+      _PTR(GenericAttribute) anAttr;
+
+      if ( aSObj && aSObj->FindAttribute( anAttr, "AttributeName") )
+      {
+        _PTR(AttributeName) aNameAttr( anAttr );
+        return aNameAttr->Value();
+      }
+    }
+  }
+  return "";
+}
 
 SMESHGUI_Displayer::SMESHGUI_Displayer( SalomeApp_Application* app )
 : LightApp_Displayer(),
@@ -102,6 +123,7 @@ SALOME_Prs* SMESHGUI_Displayer::buildPresentation( const QString& entry, SALOME_
           SPV3D_Prs *pv3dPrs = dynamic_cast<SPV3D_Prs*>( prs );
           if( pv3dPrs )
           {
+            pv3dPrs->SetName( getName( entry ) );
             pv3dPrs->FillUsingActor( anActor );
           }
         }
index 1bde5b45d6ee33e5b63fdf3e875f6b1397f7f6cf..f78acc8dd178d4841c77075d9959c0593047770a 100644 (file)
@@ -48,6 +48,7 @@ public:
 
 protected:
   SalomeApp_Study*         study() const;
+  std::string              getName( const QString& entry );
 
 private:
   SalomeApp_Application*   myApp;