X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_CreatePolyhedralVolumeDlg.cxx;h=f4050368807cdd51a4f4dd4afdcb6194672f3b6a;hp=73eae4dd247ec919a481138ca35ed4c8fc85b0f5;hb=6bac08c1a81f34d3f21c550bd92f83654b2546a5;hpb=f5016d85b7b4b88623723027a1585c6414c4dc66 diff --git a/src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.cxx b/src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.cxx index 73eae4dd2..f40503688 100644 --- a/src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2015 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 @@ -6,7 +6,7 @@ // 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. +// version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -49,6 +49,8 @@ #include #include +#include "utilities.h" + #include // OCCT includes @@ -106,7 +108,7 @@ namespace SMESH // Create and display actor myMapper = vtkDataSetMapper::New(); - myMapper->SetInput( myGrid ); + myMapper->SetInputData( myGrid ); myPreviewActor = SALOME_Actor::New(); myPreviewActor->PickableOff(); @@ -114,12 +116,12 @@ namespace SMESH 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); @@ -335,7 +337,7 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::Init() /* 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() ) ); @@ -351,7 +353,7 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::Init() 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(); @@ -589,15 +591,15 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::ClickOnOk() { 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; @@ -608,7 +610,7 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::ClickOnCancel() aViewWindow->SetSelectionMode( ActorSelection ); disconnect( mySelectionMgr, 0, this, 0 ); mySMESHGUI->ResetState(); - reject(); + QDialog::reject(); } //================================================================================= @@ -1037,30 +1039,6 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::enterEvent(QEvent* e) 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 :