]> SALOME platform Git repositories - modules/smesh.git/blobdiff - src/OBJECT/SMESH_Actor.cxx
Salome HOME
Issue 0019818: EDF 703 SMESH VISU : Display Mesh Groups names in viewer (as a caption)
[modules/smesh.git] / src / OBJECT / SMESH_Actor.cxx
index 49d838bac3d47d7efb04ad0f9d7404b28692f3af..0bd5e0dac8283b447a1918b01d7aa8fc2d1a2d37 100644 (file)
 #include "SMESH_ActorDef.h"
 #include "SMESH_ActorUtils.h"
 #include "SMESH_DeviceActor.h"
+#include "SMESH_ObjectDef.h"
 #include "SMESH_ControlsDef.hxx"
 #include "VTKViewer_ExtractUnstructuredGrid.h"
+#include "VTKViewer_FramedTextActor.h"
 #include "SALOME_InteractiveObject.hxx"
 
 #include "SUIT_Session.h"
@@ -415,6 +417,10 @@ SMESH_ActorDef::SMESH_ActorDef()
   // Clipping planes
   myImplicitBoolean = vtkImplicitBoolean::New();
   myImplicitBoolean->SetOperationTypeToIntersection();
+
+  // Set color of the name actor
+  SMESH::GetColor( "SMESH", "fill_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 170, 255 ) );
+  myNameActor->SetBackgroundColor(anRGB[0], anRGB[1], anRGB[2]);
 }
 
 
@@ -875,6 +881,9 @@ bool SMESH_ActorDef::Init(TVisualObjPtr theVisualObj,
     SetShrink();
   }
 
+  if( dynamic_cast<SMESH_GroupObj*>( myVisualObj.get() ) )
+    SetIsDisplayNameActor( true );
+
   myTimeStamp->Modified();
   Modified();
   return true;
@@ -1416,6 +1425,7 @@ vtkFloatingPointType SMESH_ActorDef::GetOpacity(){
 
 void SMESH_ActorDef::SetSufaceColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b){
   mySurfaceProp->SetColor(r,g,b);
+  myNameActor->SetBackgroundColor(r,g,b);
   Modified();
 }