Salome HOME
Merge branch 'V8_4_BR'
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_GroupOpDlg.cxx
index 69077f967f5ef8ec291f55ad8706943d2ef6b401..83c67e4a473b25ee34161a5088e4246034cd33aa 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -31,6 +31,7 @@
 #include "SMESHGUI_Utils.h"
 #include "SMESHGUI_VTKUtils.h"
 #include "SMESH_TypeFilter.hxx"
+#include <SMESH_ActorUtils.h>
 
 #include <LightApp_Application.h>
 #include <LightApp_SelectionMgr.h>
@@ -232,6 +233,8 @@ void SMESHGUI_GroupOpDlg::Init()
   if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
     aViewWindow->SetSelectionMode(ActorSelection);
   mySelectionMgr->installFilter(new SMESH_TypeFilter (SMESH::GROUP));
+
+  setDefaultGroupColor();
 }
 
 /*!
@@ -255,7 +258,7 @@ bool SMESHGUI_GroupOpDlg::isValid( const QList<SMESH::SMESH_GroupBase_var>& theL
   {
     SMESH::SMESH_GroupBase_var aGrp = *anIter;
     if ( CORBA::is_nil( aGrp ) )
-      continue; // nonsence
+      continue; // nonsense
 
     SMESH::SMESH_Mesh_var aMesh = aGrp->GetMesh();
     if ( CORBA::is_nil( aMesh ) )
@@ -447,6 +450,14 @@ SALOMEDS::Color SMESHGUI_GroupOpDlg::getColor() const
   return aColor;
 }
 
+/*!
+  \brief Set default color for group
+*/
+void SMESHGUI_GroupOpDlg::setDefaultGroupColor()
+{
+  myColorBtn->setColor( SMESH::GetColor( "SMESH", "default_grp_color", QColor( 255, 170, 0 ) ) );
+}
+
 /*!
   \brief SLOT, called when selection is changed. Current implementation does 
    nothing. The method should be redefined in derived classes to update 
@@ -471,7 +482,7 @@ void SMESHGUI_GroupOpDlg::setVisible( bool visible )
 }
 
 /*!
-  \brief SLOT called when dialog must be deativated
+  \brief SLOT called when dialog must be deactivated
 */
 void SMESHGUI_GroupOpDlg::onDeactivate()
 {
@@ -505,6 +516,7 @@ void SMESHGUI_GroupOpDlg::reset()
 {
   myNameEdit->setText("");
   myNameEdit->setFocus();
+  setDefaultGroupColor();
 }
 
 /*!
@@ -584,7 +596,7 @@ SMESHGUI_UnionGroupsDlg::SMESHGUI_UnionGroupsDlg( SMESHGUI* theModule )
 : SMESHGUI_GroupOpDlg( theModule )
 {
   setWindowTitle(tr("UNION_OF_GROUPS"));
-  setHelpFileName( "using_operations_on_groups_page.html#union_anchor" );
+  setHelpFileName( "using_operations_on_groups.html#union-anchor" );
 
   QGroupBox* anArgGrp = getArgGrp();
   myListWg = new QListWidget( anArgGrp );
@@ -693,7 +705,7 @@ SMESHGUI_IntersectGroupsDlg::SMESHGUI_IntersectGroupsDlg( SMESHGUI* theModule )
 : SMESHGUI_GroupOpDlg( theModule )
 {
   setWindowTitle(tr("INTERSECTION_OF_GROUPS"));
-  setHelpFileName( "using_operations_on_groups_page.html#intersection_anchor" );
+  setHelpFileName( "using_operations_on_groups.html#intersection-anchor" );
 
   QGroupBox* anArgGrp = getArgGrp();
   myListWg = new QListWidget( anArgGrp );
@@ -802,7 +814,7 @@ SMESHGUI_CutGroupsDlg::SMESHGUI_CutGroupsDlg( SMESHGUI* theModule )
 : SMESHGUI_GroupOpDlg( theModule )
 {
   setWindowTitle(tr("CUT_OF_GROUPS"));
-  setHelpFileName( "using_operations_on_groups_page.html#cut_anchor" );
+  setHelpFileName( "using_operations_on_groups.html#cut-anchor" );
 
   QGroupBox* anArgGrp = getArgGrp();
 
@@ -984,7 +996,7 @@ SMESHGUI_DimGroupDlg::SMESHGUI_DimGroupDlg( SMESHGUI* theModule )
   : SMESHGUI_GroupOpDlg( theModule )
 {
   setWindowTitle( tr( "CREATE_GROUP_OF_UNDERLYING_ELEMS" ) );
-  setHelpFileName( "group_of_underlying_elements_page.html" );
+  setHelpFileName( "group_of_underlying_elements.html" );
 
   QGroupBox* anArgGrp = getArgGrp();