-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 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
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// SMESH SMESHGUI : GUI for SMESH component
// Create and display actor
myMapper = vtkDataSetMapper::New();
- myMapper->SetInput( myGrid );
+ myMapper->SetInputData( myGrid );
myPreviewActor = SALOME_Actor::New();
myPreviewActor->PickableOff();
myPreviewActor->SetMapper( myMapper );
myPreviewActor->SetRepresentation( 3 );
- vtkFloatingPointType anRGB[3];
+ double anRGB[3];
vtkProperty* aProp = vtkProperty::New();
GetColor( "SMESH", "selection_element_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 170, 255 ) );
aProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
myPreviewActor->SetProperty( aProp );
- vtkFloatingPointType aFactor,aUnits;
+ double aFactor,aUnits;
myPreviewActor->SetResolveCoincidentTopology(true);
myPreviewActor->GetPolygonOffsetParameters(aFactor,aUnits);
myPreviewActor->SetPolygonOffsetParameters(aFactor,0.2*aUnits);
TextLabel_GroupName = new QLabel( tr( "SMESH_GROUP" ), GroupGroups );
ComboBox_GroupName = new QComboBox( GroupGroups );
ComboBox_GroupName->setEditable( true );
+ ComboBox_GroupName->setInsertPolicy( QComboBox::NoInsert );
GroupGroupsLayout->addWidget( TextLabel_GroupName );
GroupGroupsLayout->addWidget( ComboBox_GroupName, 1 );
/* signals and slots connections */
connect(buttonOk, SIGNAL( clicked() ), SLOT( ClickOnOk() ) );
- connect(buttonCancel, SIGNAL( clicked() ), SLOT( ClickOnCancel() ) );
+ connect(buttonCancel, SIGNAL( clicked() ), SLOT( reject() ) );
connect(buttonApply, SIGNAL( clicked() ), SLOT( ClickOnApply() ) );
connect(buttonHelp, SIGNAL( clicked() ), SLOT( ClickOnHelp() ) );
connect( mySelectionMgr, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
connect( Preview, SIGNAL(toggled(bool)), this, SLOT(ClickOnPreview(bool)));
/* to close dialog if study change */
- connect( mySMESHGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) );
+ connect( mySMESHGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( reject() ) );
ConstructorsClicked(0);
SelectionIntoArgument();
int idx = 0;
if( addToGroup ) {
aGroupName = ComboBox_GroupName->currentText();
- for ( int i = 1; i < ComboBox_GroupName->count(); i++ ) {
+ for ( int i = 1; i <= ComboBox_GroupName->count(); i++ ) {
QString aName = ComboBox_GroupName->itemText( i );
if ( aGroupName == aName && ( i == ComboBox_GroupName->currentIndex() || idx == 0 ) )
idx = i;
}
- if ( idx > 0 ) {
+ if ( idx > 0 && idx <= myGroups.count() ) {
SMESH::SMESH_GroupOnGeom_var aGeomGroup = SMESH::SMESH_GroupOnGeom::_narrow( myGroups[idx-1] );
if ( !aGeomGroup->_is_nil() ) {
int res = SUIT_MessageBox::question( this, tr( "SMESH_WRN_WARNING" ),
{
if(checkEditLine(false) == -1) {return;}
ClickOnApply();
- ClickOnCancel();
+ reject();
}
//=================================================================================
-// function : ClickOnCancel()
+// function : reject()
// purpose :
//=================================================================================
-void SMESHGUI_CreatePolyhedralVolumeDlg::ClickOnCancel()
+void SMESHGUI_CreatePolyhedralVolumeDlg::reject()
{
mySelectionMgr->clearFilters();
//SALOME_ListIO aList;
aViewWindow->SetSelectionMode( ActorSelection );
disconnect( mySelectionMgr, 0, this, 0 );
mySMESHGUI->ResetState();
- reject();
+ QDialog::reject();
}
//=================================================================================
ActivateThisDialog();
}
-
-//=================================================================================
-// function : closeEvent()
-// purpose :
-//=================================================================================
-void SMESHGUI_CreatePolyhedralVolumeDlg::closeEvent( QCloseEvent* e )
-{
- /* same than click on cancel button */
- ClickOnCancel();
-}
-
-
-//=======================================================================
-//function : hideEvent
-//purpose : caused by ESC key
-//=======================================================================
-
-void SMESHGUI_CreatePolyhedralVolumeDlg::hideEvent ( QHideEvent * e )
-{
- if ( !isMinimized() )
- ClickOnCancel();
-}
-
-
//=================================================================================
// function : GetConstructorId()
// purpose :