-// 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
#include "SMESHGUI_Utils.h"
#include "SMESHGUI_VTKUtils.h"
#include "SMESH_TypeFilter.hxx"
+#include <SMESH_ActorUtils.h>
#include <LightApp_Application.h>
#include <LightApp_SelectionMgr.h>
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone()));
connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate()));
connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject()));
+ connect(mySMESHGUI, SIGNAL(SignalActivatedViewManager()), SLOT(onOpenView()));
+ connect(mySMESHGUI, SIGNAL(SignalCloseView()), SLOT(onCloseView()));
// set selection mode
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
mySelectionMgr->installFilter(new SMESH_TypeFilter (SMESH::GROUP));
+
+ setDefaultGroupColor();
}
/*!
{
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 ) )
QDialog::reject();
}
+//=================================================================================
+// function : onOpenView()
+// purpose :
+//=================================================================================
+void SMESHGUI_GroupOpDlg::onOpenView()
+{
+ if ( mySelector ) {
+ SMESH::SetPointRepresentation(false);
+ }
+ else {
+ mySelector = SMESH::GetViewWindow( mySMESHGUI )->GetSelector();
+ mySMESHGUI->EmitSignalDeactivateDialog();
+ setEnabled(true);
+ }
+}
+
+//=================================================================================
+// function : onCloseView()
+// purpose :
+//=================================================================================
+void SMESHGUI_GroupOpDlg::onCloseView()
+{
+ onDeactivate();
+ mySelector = 0;
+}
+
/*!
\brief SLOT called when "Help" button pressed shows "Help" page
*/
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
{
mySMESHGUI->EmitSignalDeactivateDialog();
setEnabled(true);
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
+ if ( aViewWindow ) {
aViewWindow->SetSelectionMode(ActorSelection);
+ if (!mySelector)
+ mySelector = aViewWindow->GetSelector();
+ }
mySelectionMgr->installFilter(new SMESH_TypeFilter (SMESH::GROUP));
}
{
myNameEdit->setText("");
myNameEdit->setFocus();
+ setDefaultGroupColor();
}
/*!
}
/*!
- \brief Provides reaction on \93F1\94 button pressing
+ \brief Provides reaction on �F1� button pressing
\param e key press event
*/
void SMESHGUI_GroupOpDlg::keyPressEvent( QKeyEvent* e )