X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_Hypotheses.cxx;h=b1f0e20faa9e2ea3b49b1ec29bca6b58c9ef6349;hp=06d9172e43f2560ee9c8085c573681e4811a30a2;hb=eef0bf5cc772a6bdacf6ae2a4d81fdcb9d3a7fdb;hpb=24fe0efaab9725fa5e51ec24bb653ec526df5445 diff --git a/src/SMESHGUI/SMESHGUI_Hypotheses.cxx b/src/SMESHGUI/SMESHGUI_Hypotheses.cxx index 06d9172e4..b1f0e20fa 100644 --- a/src/SMESHGUI/SMESHGUI_Hypotheses.cxx +++ b/src/SMESHGUI/SMESHGUI_Hypotheses.cxx @@ -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 @@ -29,6 +29,8 @@ #include "SMESHGUI_HypothesesUtils.h" #include "SMESHGUI_Utils.h" #include "SMESHGUI_SpinBox.h" +#include "SMESHGUI_VTKUtils.h" +#include "SMESH_Actor.h" // SALOME KERNEL includes #include @@ -41,6 +43,8 @@ #include #include #include +#include +#include // Qt includes #include @@ -84,7 +88,6 @@ void SMESHGUI_GenericHypothesisCreator::create( SMESH::SMESH_Hypothesis_ptr init const QString& theHypName, QWidget* parent, QObject* obj, const QString& slot ) { - MESSAGE( "Creation of hypothesis with initial params" ); setInitParamsHypothesis( initParamsHyp ); create( false, theHypName, parent, obj, slot ); } @@ -93,8 +96,6 @@ void SMESHGUI_GenericHypothesisCreator::create( bool isAlgo, const QString& theHypName, QWidget* theParent, QObject* obj, const QString& slot ) { - MESSAGE( "Creation of hypothesis" ); - myIsCreate = true; // Create hypothesis/algorithm @@ -239,7 +240,9 @@ QFrame* SMESHGUI_GenericHypothesisCreator::buildStdFrame() } } break; - } + + default:; + } // switch( (*anIt).myValue.type() ) if( w ) { @@ -271,13 +274,20 @@ void SMESHGUI_GenericHypothesisCreator::onDialogFinished( int result ) bool res = result==QDialog::Accepted; if( res ) { - SUIT_OverrideCursor wc; - /*QString paramValues = */storeParams(); + try + { + SUIT_OverrideCursor wc; + storeParams(); // No longer needed since NoteBook appears and "Value" OB field shows names of variable -// if ( !paramValues.isEmpty() ) { -// if ( _PTR(SObject) SHyp = SMESH::FindSObject( myHypo )) -// SMESH::SetValue( SHyp, paramValues ); -// } + // QString paramValues = storeParams(); + // if ( !paramValues.isEmpty() ) { + // if ( _PTR(SObject) SHyp = SMESH::FindSObject( myHypo )) + // SMESH::SetValue( SHyp, paramValues ); + // } + } + catch ( const SALOME::SALOME_Exception& S_ex ) { + SalomeApp_Tools::QtCatchCorbaException( S_ex ); + } } changeWidgets().clear(); @@ -297,7 +307,7 @@ void SMESHGUI_GenericHypothesisCreator::onDialogFinished( int result ) { SMESH::SObjectList listSOmesh = SMESH::GetMeshesUsingAlgoOrHypothesis( myHypo ); if( listSOmesh.size() > 0 ) - for( int i = 0; i < listSOmesh.size(); i++ ) + for( size_t i = 0; i < listSOmesh.size(); i++ ) { _PTR(SObject) submSO = listSOmesh[i]; SMESH::SMESH_Mesh_var aMesh = SMESH::SObjectToInterface( submSO ); @@ -306,6 +316,10 @@ void SMESHGUI_GenericHypothesisCreator::onDialogFinished( int result ) aMesh = aSubMesh->GetFather(); _PTR(SObject) meshSO = SMESH::FindSObject( aMesh ); SMESH::ModifiedMesh( meshSO, false, aMesh->NbNodes()==0); + SMESH_Actor* actor = SMESH::FindActorByEntry( meshSO->GetID().c_str() ); + if( actor ) { + actor->Update(); + } } } SMESHGUI::GetSMESHGUI()->updateObjBrowser( true, 0 ); @@ -317,6 +331,9 @@ void SMESHGUI_GenericHypothesisCreator::onDialogFinished( int result ) myDlg->close(); //delete myDlg; since WA_DeleteOnClose==true myDlg = 0; + if (SVTK_ViewWindow* vf = SMESH::GetCurrentVtkView()) { + vf->Repaint(); + } emit finished( result ); } @@ -391,8 +408,8 @@ QString SMESHGUI_GenericHypothesisCreator::stdParamValues( const ListOfStdParams { QString valueStr = ""; ListOfStdParams::const_iterator param = params.begin(), aLast = params.end(); - uint len0 = 0; - for( int i=0; param!=aLast; param++, i++ ) + int len0 = 0; + for ( ; param != aLast; param++ ) { if ( valueStr.length() > len0 ) { valueStr += "; "; @@ -732,6 +749,8 @@ HypothesisData::HypothesisData( const QString& theTypeName, const QString& theLabel, const QString& theIconId, const QString& theContext, + const int theGroupID, + const int thePriority, const QList& theDim, const bool theIsAuxOrNeedHyp, const QStringList& theBasicHypos, @@ -747,14 +766,16 @@ HypothesisData::HypothesisData( const QString& theTypeName, Label( theLabel ), IconId( theIconId ), Context( theContext ), + GroupID( theGroupID ), + Priority( thePriority ), Dim( theDim ), IsAuxOrNeedHyp( theIsAuxOrNeedHyp ), + IsNeedGeometry( theIsNeedGeometry ), + IsSupportSubmeshes( supportSub ), BasicHypos( theBasicHypos ), OptionalHypos( theOptionalHypos ), InputTypes( theInputTypes ), - OutputTypes( theOutputTypes ), - IsNeedGeometry( theIsNeedGeometry ), - IsSupportSubmeshes( supportSub ) + OutputTypes( theOutputTypes ) { }