From: eap Date: Thu, 1 Oct 2009 06:28:20 +0000 (+0000) Subject: untabify X-Git-Tag: V5_1_3rc1~22 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7af78cc3d0b95ec53ab6ec83a92b1df4a9fb6b2a;p=modules%2Fsmesh.git untabify --- diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index 66aefe0e2..2f6898312 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -118,7 +118,7 @@ #include CORBA_CLIENT_HEADER(SMESH_MeshEditor) // Qt includes -// #define INCLUDE_MENUITEM_DEF // VSR commented ???????? +// #define INCLUDE_MENUITEM_DEF // VSR commented ???????? #include // BOOST includes @@ -145,7 +145,7 @@ // Declarations //============================================================= void ImportMeshesFromFile(SMESH::SMESH_Gen_ptr theComponentMesh, - int theCommandID); + int theCommandID); void ExportMeshToFile(int theCommandID); @@ -159,7 +159,7 @@ // Definitions //============================================================= void ImportMeshesFromFile( SMESH::SMESH_Gen_ptr theComponentMesh, - int theCommandID ) + int theCommandID ) { QStringList filter; std::string myExtension; @@ -180,9 +180,9 @@ anInitialPath = QDir::currentPath(); QStringList filenames = SUIT_FileDlg::getOpenFileNames( SMESHGUI::desktop(), - anInitialPath, - filter, - QObject::tr( "SMESH_IMPORT_MESH" ) ); + anInitialPath, + filter, + QObject::tr( "SMESH_IMPORT_MESH" ) ); if ( filenames.count() > 0 ) { SUIT_OverrideCursor wc; _PTR(Study) aStudy = SMESH::GetActiveStudyDocument(); @@ -190,58 +190,58 @@ QStringList errors; bool isEmpty = false; for ( QStringList::ConstIterator it = filenames.begin(); it != filenames.end(); ++it ) { - QString filename = *it; - SMESH::mesh_array_var aMeshes = new SMESH::mesh_array; - try { - switch ( theCommandID ) { - case 111: - { - // DAT format (currently unsupported) - errors.append( QString( "%1 :\n\t%2" ).arg( filename ). - arg( QObject::tr( "SMESH_ERR_NOT_SUPPORTED_FORMAT" ) ) ); - break; - } - case 112: - { - // UNV format - aMeshes->length( 1 ); - aMeshes[0] = theComponentMesh->CreateMeshesFromUNV( filename.toLatin1().constData() ); - if ( aMeshes[0]->_is_nil() ) - errors.append( QString( "%1 :\n\t%2" ).arg( filename ). - arg( QObject::tr( "SMESH_ERR_UNKNOWN_IMPORT_ERROR" ) ) ); - break; - } - case 113: - { - // MED format - SMESH::DriverMED_ReadStatus res; - aMeshes = theComponentMesh->CreateMeshesFromMED( filename.toLatin1().constData(), res ); - if ( res != SMESH::DRS_OK ) { - errors.append( QString( "%1 :\n\t%2" ).arg( filename ). - arg( QObject::tr( QString( "SMESH_DRS_%1" ).arg( res ).toLatin1().data() ) ) ); - } - break; - } - } - } - catch ( const SALOME::SALOME_Exception& S_ex ) { - errors.append( QString( "%1 :\n\t%2" ).arg( filename ). - arg( QObject::tr( "SMESH_ERR_UNKNOWN_IMPORT_ERROR" ) ) ); - } - - for ( int i = 0, iEnd = aMeshes->length(); i < iEnd; i++ ) { - _PTR(SObject) aMeshSO = SMESH::FindSObject( aMeshes[i] ); - if ( aMeshSO ) { - _PTR(StudyBuilder) aBuilder = aStudy->NewBuilder(); - _PTR(AttributePixMap) aPixmap = aBuilder->FindOrCreateAttribute( aMeshSO, "AttributePixMap" ); - aPixmap->SetPixMap( "ICON_SMESH_TREE_MESH_IMPORTED" ); - if ( theCommandID == 112 ) // mesh names aren't taken from the file for UNV import - SMESH::SetName( aMeshSO, QFileInfo(filename).fileName() ); - } - else { - isEmpty = true; - } - } + QString filename = *it; + SMESH::mesh_array_var aMeshes = new SMESH::mesh_array; + try { + switch ( theCommandID ) { + case 111: + { + // DAT format (currently unsupported) + errors.append( QString( "%1 :\n\t%2" ).arg( filename ). + arg( QObject::tr( "SMESH_ERR_NOT_SUPPORTED_FORMAT" ) ) ); + break; + } + case 112: + { + // UNV format + aMeshes->length( 1 ); + aMeshes[0] = theComponentMesh->CreateMeshesFromUNV( filename.toLatin1().constData() ); + if ( aMeshes[0]->_is_nil() ) + errors.append( QString( "%1 :\n\t%2" ).arg( filename ). + arg( QObject::tr( "SMESH_ERR_UNKNOWN_IMPORT_ERROR" ) ) ); + break; + } + case 113: + { + // MED format + SMESH::DriverMED_ReadStatus res; + aMeshes = theComponentMesh->CreateMeshesFromMED( filename.toLatin1().constData(), res ); + if ( res != SMESH::DRS_OK ) { + errors.append( QString( "%1 :\n\t%2" ).arg( filename ). + arg( QObject::tr( QString( "SMESH_DRS_%1" ).arg( res ).toLatin1().data() ) ) ); + } + break; + } + } + } + catch ( const SALOME::SALOME_Exception& S_ex ) { + errors.append( QString( "%1 :\n\t%2" ).arg( filename ). + arg( QObject::tr( "SMESH_ERR_UNKNOWN_IMPORT_ERROR" ) ) ); + } + + for ( int i = 0, iEnd = aMeshes->length(); i < iEnd; i++ ) { + _PTR(SObject) aMeshSO = SMESH::FindSObject( aMeshes[i] ); + if ( aMeshSO ) { + _PTR(StudyBuilder) aBuilder = aStudy->NewBuilder(); + _PTR(AttributePixMap) aPixmap = aBuilder->FindOrCreateAttribute( aMeshSO, "AttributePixMap" ); + aPixmap->SetPixMap( "ICON_SMESH_TREE_MESH_IMPORTED" ); + if ( theCommandID == 112 ) // mesh names aren't taken from the file for UNV import + SMESH::SetName( aMeshSO, QFileInfo(filename).fileName() ); + } + else { + isEmpty = true; + } + } } // update Object browser @@ -249,16 +249,16 @@ // show Error message box if there were errors if ( errors.count() > 0 ) { - SUIT_MessageBox::critical( SMESHGUI::desktop(), - QObject::tr( "SMESH_ERROR" ), - QObject::tr( "SMESH_IMPORT_ERRORS" ) + "\n" + errors.join( "\n" ) ); + SUIT_MessageBox::critical( SMESHGUI::desktop(), + QObject::tr( "SMESH_ERROR" ), + QObject::tr( "SMESH_IMPORT_ERRORS" ) + "\n" + errors.join( "\n" ) ); } // show warning message box, if some imported mesh is empty if ( isEmpty ) { - SUIT_MessageBox::warning( SMESHGUI::desktop(), - QObject::tr( "SMESH_WRN_WARNING" ), - QObject::tr( "SMESH_DRS_SOME_EMPTY" ) ); + SUIT_MessageBox::warning( SMESHGUI::desktop(), + QObject::tr( "SMESH_WRN_WARNING" ), + QObject::tr( "SMESH_DRS_SOME_EMPTY" ) ); } } } @@ -488,7 +488,7 @@ } inline void InverseEntityMode(unsigned int& theOutputMode, - unsigned int theMode) + unsigned int theMode) { bool anIsNotPresent = ~theOutputMode & theMode; if(anIsNotPresent) @@ -506,31 +506,31 @@ if(selected.Extent() >= 1){ SALOME_ListIteratorOfListIO It( selected ); for( ; It.More(); It.Next()){ - Handle(SALOME_InteractiveObject) IObject = It.Value(); - if(IObject->hasEntry()){ - if(SMESH_Actor *anActor = SMESH::FindActorByEntry(IObject->getEntry())){ - unsigned int aMode = anActor->GetEntityMode(); - switch(theCommandID){ + Handle(SALOME_InteractiveObject) IObject = It.Value(); + if(IObject->hasEntry()){ + if(SMESH_Actor *anActor = SMESH::FindActorByEntry(IObject->getEntry())){ + unsigned int aMode = anActor->GetEntityMode(); + switch(theCommandID){ case 216: InverseEntityMode(aMode,SMESH_Actor::e0DElements); break; - case 217: - InverseEntityMode(aMode,SMESH_Actor::eEdges); - break; - case 218: - InverseEntityMode(aMode,SMESH_Actor::eFaces); - break; - case 219: - InverseEntityMode(aMode,SMESH_Actor::eVolumes); - break; - case 220: - aMode = SMESH_Actor::eAllEntity; - break; - } - if(aMode) - anActor->SetEntityMode(aMode); - } - } + case 217: + InverseEntityMode(aMode,SMESH_Actor::eEdges); + break; + case 218: + InverseEntityMode(aMode,SMESH_Actor::eFaces); + break; + case 219: + InverseEntityMode(aMode,SMESH_Actor::eVolumes); + break; + case 220: + aMode = SMESH_Actor::eAllEntity; + break; + } + if(aMode) + anActor->SetEntityMode(aMode); + } + } } } } @@ -575,12 +575,12 @@ _PTR(SObject) aGroupSObject = SMESH::FindSObject(aGroupObject); if(SMESH_Actor *anActor = SMESH::FindActorByEntry(aGroupSObject->GetID().c_str())) { - if( aGroupObject->GetType() == SMESH::NODE ) - anActor->SetNodeColor( aColor.R, aColor.G, aColor.B ); - else if( aGroupObject->GetType() == SMESH::EDGE ) - anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B ); - else - anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B ); + if( aGroupObject->GetType() == SMESH::NODE ) + anActor->SetNodeColor( aColor.R, aColor.G, aColor.B ); + else if( aGroupObject->GetType() == SMESH::EDGE ) + anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B ); + else + anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B ); } } @@ -597,7 +597,7 @@ Handle(SALOME_InteractiveObject) anIObject = selected.First(); SMESH::SMESH_Mesh_var aMesh = SMESH::IObjectToInterface(anIObject); if ( !aMesh->_is_nil() ) { - aMesh->SetAutoColor( false ); + aMesh->SetAutoColor( false ); } } } @@ -620,36 +620,36 @@ if(selected.Extent() >= 1){ switch(theCommandID){ case 1134:{ - SMESHGUI::GetSMESHGUI()->EmitSignalDeactivateDialog(); - (new SMESHGUI_ClippingDlg( SMESHGUI::GetSMESHGUI() ))->show(); - return; + SMESHGUI::GetSMESHGUI()->EmitSignalDeactivateDialog(); + (new SMESHGUI_ClippingDlg( SMESHGUI::GetSMESHGUI() ))->show(); + return; } case 1133:{ - SMESHGUI::GetSMESHGUI()->EmitSignalDeactivateDialog(); - (new SMESHGUI_TransparencyDlg( SMESHGUI::GetSMESHGUI() ))->show(); - return; + SMESHGUI::GetSMESHGUI()->EmitSignalDeactivateDialog(); + (new SMESHGUI_TransparencyDlg( SMESHGUI::GetSMESHGUI() ))->show(); + return; }} SALOME_ListIteratorOfListIO It( selected ); for( ; It.More(); It.Next()){ - Handle(SALOME_InteractiveObject) IObject = It.Value(); - if(IObject->hasEntry()){ - if(SMESH_Actor *anActor = SMESH::FindActorByEntry(IObject->getEntry())){ - switch(theCommandID){ - case 211: - anActor->SetRepresentation(SMESH_Actor::eEdge); - break; - case 212: - anActor->SetRepresentation(SMESH_Actor::eSurface); - break; - case 213: - if(anActor->IsShrunk()) - anActor->UnShrink(); - else - anActor->SetShrink(); - break; - case 215: - anActor->SetRepresentation(SMESH_Actor::ePoint); - break; + Handle(SALOME_InteractiveObject) IObject = It.Value(); + if(IObject->hasEntry()){ + if(SMESH_Actor *anActor = SMESH::FindActorByEntry(IObject->getEntry())){ + switch(theCommandID){ + case 211: + anActor->SetRepresentation(SMESH_Actor::eEdge); + break; + case 212: + anActor->SetRepresentation(SMESH_Actor::eSurface); + break; + case 213: + if(anActor->IsShrunk()) + anActor->UnShrink(); + else + anActor->SetShrink(); + break; + case 215: + anActor->SetRepresentation(SMESH_Actor::ePoint); + break; case 231: if(anActor->GetQuadratic2DRepresentation() != SMESH_Actor::eLines) anActor->SetQuadratic2DRepresentation(SMESH_Actor::eLines); @@ -658,103 +658,103 @@ if(anActor->GetQuadratic2DRepresentation() != SMESH_Actor::eArcs) anActor->SetQuadratic2DRepresentation(SMESH_Actor::eArcs); break; - case 1132:{ - vtkFloatingPointType color[3]; - anActor->GetSufaceColor(color[0], color[1], color[2]); - int c0 = int (color[0] * 255); - int c1 = int (color[1] * 255); - int c2 = int (color[2] * 255); - QColor c(c0, c1, c2); - - vtkFloatingPointType edgecolor[3]; - anActor->GetEdgeColor(edgecolor[0], edgecolor[1], edgecolor[2]); - c0 = int (edgecolor[0] * 255); - c1 = int (edgecolor[1] * 255); - c2 = int (edgecolor[2] * 255); - QColor e(c0, c1, c2); - - vtkFloatingPointType backfacecolor[3]; - anActor->GetBackSufaceColor(backfacecolor[0], backfacecolor[1], backfacecolor[2]); - c0 = int (backfacecolor[0] * 255); - c1 = int (backfacecolor[1] * 255); - c2 = int (backfacecolor[2] * 255); - QColor b(c0, c1, c2); - - vtkFloatingPointType nodecolor[3]; - anActor->GetNodeColor(nodecolor[0], nodecolor[1], nodecolor[2]); - c0 = int (nodecolor[0] * 255); - c1 = int (nodecolor[1] * 255); - c2 = int (nodecolor[2] * 255); - QColor n(c0, c1, c2); - - int Edgewidth = (int)anActor->GetLineWidth(); - if(Edgewidth == 0) - Edgewidth = 1; - int intValue = int(anActor->GetNodeSize()); - vtkFloatingPointType Shrink = anActor->GetShrinkFactor(); - - SMESHGUI_Preferences_ColorDlg *aDlg = - new SMESHGUI_Preferences_ColorDlg( SMESHGUI::GetSMESHGUI() ); - aDlg->SetColor(1, c); - aDlg->SetColor(2, e); - aDlg->SetColor(3, n); - aDlg->SetColor(4, b); - aDlg->SetIntValue(1, Edgewidth); - aDlg->SetIntValue(2, intValue); - aDlg->SetIntValue(3, int(Shrink*100.)); - if(aDlg->exec()){ - QColor color = aDlg->GetColor(1); - QColor edgecolor = aDlg->GetColor(2); - QColor nodecolor = aDlg->GetColor(3); - QColor backfacecolor = aDlg->GetColor(4); - /* actor color and backface color */ - anActor->SetSufaceColor(vtkFloatingPointType (color.red()) / 255., - vtkFloatingPointType (color.green()) / 255., - vtkFloatingPointType (color.blue()) / 255.); - anActor->SetBackSufaceColor(vtkFloatingPointType (backfacecolor.red()) / 255., - vtkFloatingPointType (backfacecolor.green()) / 255., - vtkFloatingPointType (backfacecolor.blue()) / 255.); - - /* edge color */ - anActor->SetEdgeColor(vtkFloatingPointType (edgecolor.red()) / 255., - vtkFloatingPointType (edgecolor.green()) / 255., - vtkFloatingPointType (edgecolor.blue()) / 255.); - - /* Shrink factor and size edges */ - anActor->SetShrinkFactor(aDlg->GetIntValue(3) / 100.); - anActor->SetLineWidth(aDlg->GetIntValue(1)); - - /* Nodes color and size */ - anActor->SetNodeColor(vtkFloatingPointType (nodecolor.red()) / 255., - vtkFloatingPointType (nodecolor.green()) / 255., - vtkFloatingPointType (nodecolor.blue()) / 255.); - anActor->SetNodeSize(aDlg->GetIntValue(2)); - - SMESH::SMESH_GroupBase_var aGroupObject = SMESH::IObjectToInterface(IObject); - if( !aGroupObject->_is_nil() ) - { - SMESH::ElementType anElementType = aGroupObject->GetType(); - QColor aColor; - switch( anElementType ) - { - case SMESH::NODE: aColor = nodecolor; break; - case SMESH::EDGE: aColor = edgecolor; break; - default: aColor = color; break; - } - - SALOMEDS::Color aGroupColor; - aGroupColor.R = (float)aColor.red() / 255.0; - aGroupColor.G = (float)aColor.green() / 255.0; - aGroupColor.B = (float)aColor.blue() / 255.0; - aGroupObject->SetColor( aGroupColor ); - } - - delete aDlg; - } - break; - }} - } - } + case 1132:{ + vtkFloatingPointType color[3]; + anActor->GetSufaceColor(color[0], color[1], color[2]); + int c0 = int (color[0] * 255); + int c1 = int (color[1] * 255); + int c2 = int (color[2] * 255); + QColor c(c0, c1, c2); + + vtkFloatingPointType edgecolor[3]; + anActor->GetEdgeColor(edgecolor[0], edgecolor[1], edgecolor[2]); + c0 = int (edgecolor[0] * 255); + c1 = int (edgecolor[1] * 255); + c2 = int (edgecolor[2] * 255); + QColor e(c0, c1, c2); + + vtkFloatingPointType backfacecolor[3]; + anActor->GetBackSufaceColor(backfacecolor[0], backfacecolor[1], backfacecolor[2]); + c0 = int (backfacecolor[0] * 255); + c1 = int (backfacecolor[1] * 255); + c2 = int (backfacecolor[2] * 255); + QColor b(c0, c1, c2); + + vtkFloatingPointType nodecolor[3]; + anActor->GetNodeColor(nodecolor[0], nodecolor[1], nodecolor[2]); + c0 = int (nodecolor[0] * 255); + c1 = int (nodecolor[1] * 255); + c2 = int (nodecolor[2] * 255); + QColor n(c0, c1, c2); + + int Edgewidth = (int)anActor->GetLineWidth(); + if(Edgewidth == 0) + Edgewidth = 1; + int intValue = int(anActor->GetNodeSize()); + vtkFloatingPointType Shrink = anActor->GetShrinkFactor(); + + SMESHGUI_Preferences_ColorDlg *aDlg = + new SMESHGUI_Preferences_ColorDlg( SMESHGUI::GetSMESHGUI() ); + aDlg->SetColor(1, c); + aDlg->SetColor(2, e); + aDlg->SetColor(3, n); + aDlg->SetColor(4, b); + aDlg->SetIntValue(1, Edgewidth); + aDlg->SetIntValue(2, intValue); + aDlg->SetIntValue(3, int(Shrink*100.)); + if(aDlg->exec()){ + QColor color = aDlg->GetColor(1); + QColor edgecolor = aDlg->GetColor(2); + QColor nodecolor = aDlg->GetColor(3); + QColor backfacecolor = aDlg->GetColor(4); + /* actor color and backface color */ + anActor->SetSufaceColor(vtkFloatingPointType (color.red()) / 255., + vtkFloatingPointType (color.green()) / 255., + vtkFloatingPointType (color.blue()) / 255.); + anActor->SetBackSufaceColor(vtkFloatingPointType (backfacecolor.red()) / 255., + vtkFloatingPointType (backfacecolor.green()) / 255., + vtkFloatingPointType (backfacecolor.blue()) / 255.); + + /* edge color */ + anActor->SetEdgeColor(vtkFloatingPointType (edgecolor.red()) / 255., + vtkFloatingPointType (edgecolor.green()) / 255., + vtkFloatingPointType (edgecolor.blue()) / 255.); + + /* Shrink factor and size edges */ + anActor->SetShrinkFactor(aDlg->GetIntValue(3) / 100.); + anActor->SetLineWidth(aDlg->GetIntValue(1)); + + /* Nodes color and size */ + anActor->SetNodeColor(vtkFloatingPointType (nodecolor.red()) / 255., + vtkFloatingPointType (nodecolor.green()) / 255., + vtkFloatingPointType (nodecolor.blue()) / 255.); + anActor->SetNodeSize(aDlg->GetIntValue(2)); + + SMESH::SMESH_GroupBase_var aGroupObject = SMESH::IObjectToInterface(IObject); + if( !aGroupObject->_is_nil() ) + { + SMESH::ElementType anElementType = aGroupObject->GetType(); + QColor aColor; + switch( anElementType ) + { + case SMESH::NODE: aColor = nodecolor; break; + case SMESH::EDGE: aColor = edgecolor; break; + default: aColor = color; break; + } + + SALOMEDS::Color aGroupColor; + aGroupColor.R = (float)aColor.red() / 255.0; + aGroupColor.G = (float)aColor.green() / 255.0; + aGroupColor.B = (float)aColor.blue() / 255.0; + aGroupObject->SetColor( aGroupColor ); + } + + delete aDlg; + } + break; + }} + } + } } SMESH::RepaintCurrentView(); } @@ -770,88 +770,88 @@ if( !selected.IsEmpty() ){ Handle(SALOME_InteractiveObject) anIO = selected.First(); if(!anIO.IsNull()){ - QString aTitle; - SMESH_Actor::eControl aControl = SMESH_Actor::eNone; - if(SMESH_Actor *anActor = SMESH::FindActorByEntry(anIO->getEntry())){ - switch ( theCommandID ){ - case 6001: - aTitle = QObject::tr( "LENGTH_EDGES" ); - aControl = SMESH_Actor::eLength; - break; - case 6018: - aTitle = QObject::tr( "LENGTH2D_EDGES" ); - aControl = SMESH_Actor::eLength2D; - break; - case 6002: - aTitle = QObject::tr( "FREE_EDGES" ); - aControl = SMESH_Actor::eFreeEdges; - break; - case 6003: - aTitle = QObject::tr( "FREE_BORDERS" ); - aControl = SMESH_Actor::eFreeBorders; - break; - case 6004: - aTitle = QObject::tr( "MULTI_BORDERS" ); - aControl = SMESH_Actor::eMultiConnection; - break; - case 6005: - aTitle = QObject::tr( "FREE_NODES" ); - aControl = SMESH_Actor::eFreeNodes; - break; - case 6019: - aTitle = QObject::tr( "MULTI2D_BORDERS" ); - aControl = SMESH_Actor::eMultiConnection2D; - break; - case 6011: - aTitle = QObject::tr( "AREA_ELEMENTS" ); - aControl = SMESH_Actor::eArea; - break; - case 6012: - aTitle = QObject::tr( "TAPER_ELEMENTS" ); - aControl = SMESH_Actor::eTaper; - break; - case 6013: - aTitle = QObject::tr( "ASPECTRATIO_ELEMENTS" ); - aControl = SMESH_Actor::eAspectRatio; - break; - case 6017: - aTitle = QObject::tr( "ASPECTRATIO_3D_ELEMENTS" ); - aControl = SMESH_Actor::eAspectRatio3D; - break; - case 6014: - aTitle = QObject::tr( "MINIMUMANGLE_ELEMENTS" ); - aControl = SMESH_Actor::eMinimumAngle; - break; - case 6015: - aTitle = QObject::tr( "WARP_ELEMENTS" ); - aControl = SMESH_Actor::eWarping; - break; - case 6016: - aTitle = QObject::tr( "SKEW_ELEMENTS" ); - aControl = SMESH_Actor::eSkew; - break; - case 6009: - aTitle = QObject::tr( "SMESH_VOLUME" ); - aControl = SMESH_Actor::eVolume3D; - break; - case 6021: - aTitle = QObject::tr( "FREE_FACES" ); - aControl = SMESH_Actor::eFreeFaces; - break; - } - anActor->SetControlMode(aControl); - anActor->GetScalarBarActor()->SetTitle(aTitle.toLatin1().data()); - SMESH::RepaintCurrentView(); - } + QString aTitle; + SMESH_Actor::eControl aControl = SMESH_Actor::eNone; + if(SMESH_Actor *anActor = SMESH::FindActorByEntry(anIO->getEntry())){ + switch ( theCommandID ){ + case 6001: + aTitle = QObject::tr( "LENGTH_EDGES" ); + aControl = SMESH_Actor::eLength; + break; + case 6018: + aTitle = QObject::tr( "LENGTH2D_EDGES" ); + aControl = SMESH_Actor::eLength2D; + break; + case 6002: + aTitle = QObject::tr( "FREE_EDGES" ); + aControl = SMESH_Actor::eFreeEdges; + break; + case 6003: + aTitle = QObject::tr( "FREE_BORDERS" ); + aControl = SMESH_Actor::eFreeBorders; + break; + case 6004: + aTitle = QObject::tr( "MULTI_BORDERS" ); + aControl = SMESH_Actor::eMultiConnection; + break; + case 6005: + aTitle = QObject::tr( "FREE_NODES" ); + aControl = SMESH_Actor::eFreeNodes; + break; + case 6019: + aTitle = QObject::tr( "MULTI2D_BORDERS" ); + aControl = SMESH_Actor::eMultiConnection2D; + break; + case 6011: + aTitle = QObject::tr( "AREA_ELEMENTS" ); + aControl = SMESH_Actor::eArea; + break; + case 6012: + aTitle = QObject::tr( "TAPER_ELEMENTS" ); + aControl = SMESH_Actor::eTaper; + break; + case 6013: + aTitle = QObject::tr( "ASPECTRATIO_ELEMENTS" ); + aControl = SMESH_Actor::eAspectRatio; + break; + case 6017: + aTitle = QObject::tr( "ASPECTRATIO_3D_ELEMENTS" ); + aControl = SMESH_Actor::eAspectRatio3D; + break; + case 6014: + aTitle = QObject::tr( "MINIMUMANGLE_ELEMENTS" ); + aControl = SMESH_Actor::eMinimumAngle; + break; + case 6015: + aTitle = QObject::tr( "WARP_ELEMENTS" ); + aControl = SMESH_Actor::eWarping; + break; + case 6016: + aTitle = QObject::tr( "SKEW_ELEMENTS" ); + aControl = SMESH_Actor::eSkew; + break; + case 6009: + aTitle = QObject::tr( "SMESH_VOLUME" ); + aControl = SMESH_Actor::eVolume3D; + break; + case 6021: + aTitle = QObject::tr( "FREE_FACES" ); + aControl = SMESH_Actor::eFreeFaces; + break; + } + anActor->SetControlMode(aControl); + anActor->GetScalarBarActor()->SetTitle(aTitle.toLatin1().data()); + SMESH::RepaintCurrentView(); + } } } } bool CheckOIType(const Handle(SALOME_InteractiveObject) & theIO, - MeshObjectType theType, - const QString theInTypeName, - QString & theOutTypeName) + MeshObjectType theType, + const QString theInTypeName, + QString & theOutTypeName) { SMESH_TypeFilter aTypeFilter( theType ); QString entry; @@ -876,17 +876,17 @@ _PTR(SComponent) aSComp = aSObj->GetFatherComponent(); CORBA::String_var anID = aSComp->GetID().c_str(); if (!strcmp(anID.in(),theIO->getEntry())) - return "Component"; + return "Component"; } QString aTypeName; if ( - CheckOIType ( theIO, HYPOTHESIS, "Hypothesis", aTypeName ) || - CheckOIType ( theIO, ALGORITHM, "Algorithm", aTypeName ) || - CheckOIType ( theIO, MESH, "Mesh", aTypeName ) || - CheckOIType ( theIO, SUBMESH, "SubMesh", aTypeName ) || - CheckOIType ( theIO, GROUP, "Group", aTypeName ) - ) + CheckOIType ( theIO, HYPOTHESIS, "Hypothesis", aTypeName ) || + CheckOIType ( theIO, ALGORITHM, "Algorithm", aTypeName ) || + CheckOIType ( theIO, MESH, "Mesh", aTypeName ) || + CheckOIType ( theIO, SUBMESH, "SubMesh", aTypeName ) || + CheckOIType ( theIO, GROUP, "Group", aTypeName ) + ) return aTypeName; return "NoType"; @@ -905,10 +905,10 @@ SALOME_ListIteratorOfListIO It(selected); for ( ; It.More(); It.Next()) { - Handle(SALOME_InteractiveObject) IObject = It.Value(); - QString Type = CheckTypeObject(IObject); - if (Type.compare(RefType) != 0) - return "Heterogeneous Selection"; + Handle(SALOME_InteractiveObject) IObject = It.Value(); + QString Type = CheckTypeObject(IObject); + if (Type.compare(RefType) != 0) + return "Heterogeneous Selection"; } return RefType; @@ -936,17 +936,17 @@ QString cur = anIO->getComponentDataType(); _PTR(SObject) aSO = aStudy->FindObjectID(anIO->getEntry()); if (aSO) { - // check if object is reference - _PTR(SObject) aRefSObj; - aNameList.append("\n - "); - if ( aSO->ReferencedObject( aRefSObj ) ) { - QString aRefName = QString::fromStdString ( aRefSObj->GetName() ); - aNameList.append( aRefName ); - cur = QString::fromStdString ( aRefSObj->GetFatherComponent()->ComponentDataType() ); - } - else - aNameList.append(anIO->getName()); - objectCount++; + // check if object is reference + _PTR(SObject) aRefSObj; + aNameList.append("\n - "); + if ( aSO->ReferencedObject( aRefSObj ) ) { + QString aRefName = QString::fromStdString ( aRefSObj->GetName() ); + aNameList.append( aRefName ); + cur = QString::fromStdString ( aRefSObj->GetFatherComponent()->ComponentDataType() ); + } + else + aNameList.append(anIO->getName()); + objectCount++; } if( aParentComponent.isNull() ) @@ -960,17 +960,17 @@ if ( aParentComponent != SMESHGUI::GetSMESHGUI()->name() ) { SUIT_MessageBox::warning( SMESHGUI::desktop(), - QObject::tr("ERR_ERROR"), - QObject::tr("NON_SMESH_OBJECTS_SELECTED").arg( SMESHGUI::GetSMESHGUI()->moduleName() ) ); + QObject::tr("ERR_ERROR"), + QObject::tr("NON_SMESH_OBJECTS_SELECTED").arg( SMESHGUI::GetSMESHGUI()->moduleName() ) ); return; } // VSR 17/11/04: check if all objects selected belong to SMESH component <-- finish if (SUIT_MessageBox::warning - (SMESHGUI::desktop(), - QObject::tr("SMESH_WRN_WARNING"), - QObject::tr("SMESH_REALLY_DELETE").arg( objectCount ).arg( aNameList ), - SUIT_MessageBox::Yes | SUIT_MessageBox::No, - SUIT_MessageBox::Yes) != SUIT_MessageBox::Yes) + (SMESHGUI::desktop(), + QObject::tr("SMESH_WRN_WARNING"), + QObject::tr("SMESH_REALLY_DELETE").arg( objectCount ).arg( aNameList ), + SUIT_MessageBox::Yes | SUIT_MessageBox::No, + SUIT_MessageBox::Yes) != SUIT_MessageBox::Yes) return; SalomeApp_Application* anApp = dynamic_cast( SUIT_Session::session()->activeApplication() ); @@ -983,18 +983,18 @@ for( ; It.More(); It.Next()){ // loop on selected IO's Handle(SALOME_InteractiveObject) IObject = It.Value(); if(IObject->hasEntry()) { - _PTR(SObject) aSO = aStudy->FindObjectID(IObject->getEntry()); - - // disable removal of "SMESH" component object - if(aSO->FindAttribute(anAttr, "AttributeIOR")){ - anIOR = anAttr; - if ( engineIOR() == anIOR->Value().c_str() ) - continue; - } - //Check the referenced object - _PTR(SObject) aRefSObject; - if ( aSO && aSO->ReferencedObject( aRefSObject ) ) - aSO = aRefSObject; // Delete main Object instead of reference + _PTR(SObject) aSO = aStudy->FindObjectID(IObject->getEntry()); + + // disable removal of "SMESH" component object + if(aSO->FindAttribute(anAttr, "AttributeIOR")){ + anIOR = anAttr; + if ( engineIOR() == anIOR->Value().c_str() ) + continue; + } + //Check the referenced object + _PTR(SObject) aRefSObject; + if ( aSO && aSO->ReferencedObject( aRefSObject ) ) + aSO = aRefSObject; // Delete main Object instead of reference // put the whole hierarchy of sub-objects of the selected SO into a list and // then treat them all starting from the deepest objects (at list back) @@ -1017,15 +1017,15 @@ std::string anEntry = SO->GetID(); /** Erase graphical object **/ - if(SO->FindAttribute(anAttr, "AttributeIOR")){ - QVector aViews = vm->getViews(); - for(int i = 0; i < nbSf; i++){ - SUIT_ViewWindow *sf = aViews[i]; - if(SMESH_Actor* anActor = SMESH::FindActorByEntry(sf,anEntry.c_str())){ - SMESH::RemoveActor(sf,anActor); - } - } - } + if(SO->FindAttribute(anAttr, "AttributeIOR")){ + QVector aViews = vm->getViews(); + for(int i = 0; i < nbSf; i++){ + SUIT_ViewWindow *sf = aViews[i]; + if(SMESH_Actor* anActor = SMESH::FindActorByEntry(sf,anEntry.c_str())){ + SMESH::RemoveActor(sf,anActor); + } + } + } /** Remove an object from data structures **/ SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow( SMESH::SObjectToObject( SO )); @@ -1058,7 +1058,7 @@ //op->finish(); } } - } /* listSO back loop */ + } /* listSO back loop */ } /* IObject->hasEntry() */ } /* more/next */ aStudyBuilder->CommitCommand(); @@ -1180,7 +1180,7 @@ SMESHGUI* SMESHGUI::GetSMESHGUI() { _PTR(Study) aStudy = study->studyDS(); if ( aStudy ) - GetSMESHGen()->SetCurrentStudy( _CAST(Study,aStudy)->GetStudy() ); + GetSMESHGen()->SetCurrentStudy( _CAST(Study,aStudy)->GetStudy() ); } } @@ -1322,8 +1322,8 @@ static int isStudyLocked(_PTR(Study) theStudy){ static bool checkLock(_PTR(Study) theStudy) { if (isStudyLocked(theStudy)) { SUIT_MessageBox::warning( SMESHGUI::desktop(), - QObject::tr("WRN_WARNING"), - QObject::tr("WRN_STUDY_LOCKED") ); + QObject::tr("WRN_WARNING"), + QObject::tr("WRN_STUDY_LOCKED") ); return true; } return false; @@ -1365,13 +1365,13 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) //QAction* act = action( theCommandID ); - switch (theCommandID) { - case 33: // DELETE + switch (theCommandID) { + case 33: // DELETE if(checkLock(aStudy)) break; OnEditDelete(); break; - case 113: // IMPORT + case 113: // IMPORT case 112: case 111: { @@ -1399,7 +1399,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) break; } - case 122: // EXPORT MED + case 122: // EXPORT MED case 121: case 123: case 124: @@ -1412,7 +1412,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) break; } - case 200: // SCALAR BAR + case 200: // SCALAR BAR { LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr(); SALOME_ListIO selected; @@ -1420,12 +1420,12 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) aSel->selectedObjects( selected ); if( selected.Extent() ) { - Handle(SALOME_InteractiveObject) anIO = selected.First(); - if( anIO->hasEntry() ) { - if( SMESH_Actor* anActor = SMESH::FindActorByEntry( anIO->getEntry() ) ) { - anActor->SetControlMode( SMESH_Actor::eNone ); - } - } + Handle(SALOME_InteractiveObject) anIO = selected.First(); + if( anIO->hasEntry() ) { + if( SMESH_Actor* anActor = SMESH::FindActorByEntry( anIO->getEntry() ) ) { + anActor->SetControlMode( SMESH_Actor::eNone ); + } + } } break; } @@ -1479,16 +1479,16 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) SALOME_ListIteratorOfListIO it(selected); for( ; it.More(); it.Next()) { Handle(SALOME_InteractiveObject) anIObject = it.Value(); - if(anIObject->hasEntry()) { - if(SMESH_Actor *anActor = SMESH::FindActorByEntry(anIObject->getEntry())){ - anActor->SetFacesOriented( !anActor->GetFacesOriented() ); - } - } + if(anIObject->hasEntry()) { + if(SMESH_Actor *anActor = SMESH::FindActorByEntry(anIObject->getEntry())){ + anActor->SetFacesOriented( !anActor->GetFacesOriented() ); + } + } } break; } - case 214: // UPDATE + case 214: // UPDATE { if(checkLock(aStudy)) break; try { @@ -1511,15 +1511,15 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) break; } - case 300: // ERASE - case 301: // DISPLAY - case 302: // DISPLAY ONLY + case 300: // ERASE + case 301: // DISPLAY + case 302: // DISPLAY ONLY { SMESH::EDisplaing anAction; switch (theCommandID) { - case 300: anAction = SMESH::eErase; break; - case 301: anAction = SMESH::eDisplay; break; - case 302: anAction = SMESH::eDisplayOnly; break; + case 300: anAction = SMESH::eErase; break; + case 301: anAction = SMESH::eDisplay; break; + case 302: anAction = SMESH::eDisplayOnly; break; } LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr(); @@ -1528,7 +1528,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) aSel->selectedObjects( sel_objects ); if( theCommandID==302 ) - startOperation( myEraseAll ); + startOperation( myEraseAll ); extractContainers( sel_objects, to_process ); @@ -1559,28 +1559,28 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) } if (anAction == SMESH::eErase) { - SALOME_ListIO l1; - aSel->setSelectedObjects( l1 ); + SALOME_ListIO l1; + aSel->setSelectedObjects( l1 ); } else - aSel->setSelectedObjects( to_process ); + aSel->setSelectedObjects( to_process ); break; } - case 4000: // NODES + case 4000: // NODES { if(checkLock(aStudy)) break; if ( vtkwnd ) { - EmitSignalDeactivateDialog(); + EmitSignalDeactivateDialog(); - ( new SMESHGUI_NodesDlg( this ) )->show(); + ( new SMESHGUI_NodesDlg( this ) )->show(); } else { - SUIT_MessageBox::warning(desktop(), - tr("SMESH_WRN_WARNING"), - tr("SMESH_WRN_VIEWER_VTK")); + SUIT_MessageBox::warning(desktop(), + tr("SMESH_WRN_WARNING"), + tr("SMESH_WRN_VIEWER_VTK")); } break; } @@ -1595,12 +1595,12 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) break; } - case 406: // MOVE NODE + case 406: // MOVE NODE { if ( !vtkwnd ) { SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ), - tr( "NOT_A_VTK_VIEWER" ) ); + tr( "NOT_A_VTK_VIEWER" ) ); break; } @@ -1609,9 +1609,9 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) break; } - case 701: // COMPUTE MESH - case 711: // PRECOMPUTE MESH - case 712: // EVALUATE MESH + case 701: // COMPUTE MESH + case 711: // PRECOMPUTE MESH + case 712: // EVALUATE MESH { if (checkLock(aStudy)) break; startOperation( theCommandID ); @@ -1637,7 +1637,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) if ( !vtkwnd ) { SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ), - tr( "NOT_A_VTK_VIEWER" ) ); + tr( "NOT_A_VTK_VIEWER" ) ); break; } @@ -1667,7 +1667,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) if ( !vtkwnd ) { SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ), - tr( "NOT_A_VTK_VIEWER" ) ); + tr( "NOT_A_VTK_VIEWER" ) ); break; } @@ -1690,12 +1690,12 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) { if(checkLock(aStudy)) break; if( vtkwnd ) { - EmitSignalDeactivateDialog(); - ( new SMESHGUI_SmoothingDlg( this ) )->show(); + EmitSignalDeactivateDialog(); + ( new SMESHGUI_SmoothingDlg( this ) )->show(); } else { - SUIT_MessageBox::warning(desktop(), - tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK")); + SUIT_MessageBox::warning(desktop(), + tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK")); } break; } @@ -1703,11 +1703,11 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) { if (checkLock(aStudy)) break; if (vtkwnd) { - EmitSignalDeactivateDialog(); - ( new SMESHGUI_ExtrusionDlg ( this ) )->show(); + EmitSignalDeactivateDialog(); + ( new SMESHGUI_ExtrusionDlg ( this ) )->show(); } else { - SUIT_MessageBox::warning(desktop(), - tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK")); + SUIT_MessageBox::warning(desktop(), + tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK")); } break; } @@ -1715,12 +1715,12 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) { if(checkLock(aStudy)) break; if( vtkwnd ) { - EmitSignalDeactivateDialog(); - ( new SMESHGUI_RevolutionDlg( this ) )->show(); + EmitSignalDeactivateDialog(); + ( new SMESHGUI_RevolutionDlg( this ) )->show(); } else { - SUIT_MessageBox::warning(desktop(), - tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK")); + SUIT_MessageBox::warning(desktop(), + tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK")); } break; } @@ -1734,8 +1734,8 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) ( new SMESHGUI_MeshPatternDlg( this ) )->show(); } else { - SUIT_MessageBox::warning(desktop(), - tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK")); + SUIT_MessageBox::warning(desktop(), + tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK")); } break; } @@ -1743,11 +1743,11 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) { if (checkLock(aStudy)) break; if (vtkwnd) { - EmitSignalDeactivateDialog(); - ( new SMESHGUI_ExtrusionAlongPathDlg( this ) )->show(); + EmitSignalDeactivateDialog(); + ( new SMESHGUI_ExtrusionAlongPathDlg( this ) )->show(); } else { - SUIT_MessageBox::warning(desktop(), - tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK")); + SUIT_MessageBox::warning(desktop(), + tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK")); } break; } @@ -1756,12 +1756,12 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) startOperation( 417 ); /* if (checkLock(aStudy)) break; if (vtkwnd) { - EmitSignalDeactivateDialog(); - new SMESHGUI_ConvToQuadDlg(); + EmitSignalDeactivateDialog(); + new SMESHGUI_ConvToQuadDlg(); } else { - SUIT_MessageBox::warning(desktop(), + SUIT_MessageBox::warning(desktop(), tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK")); - }*/ + }*/ break; } case 418: // create 2D mesh from 3D @@ -1779,7 +1779,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) if ( !vtkwnd ) { SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ), - tr( "NOT_A_VTK_VIEWER" ) ); + tr( "NOT_A_VTK_VIEWER" ) ); break; } @@ -1794,7 +1794,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) int nbSel = selected.Extent(); if (nbSel == 1) { - // check if mesh is selected + // check if mesh is selected aMesh = SMESH::GetMeshByIO( selected.First() ); } SMESHGUI_GroupDlg *aDlg = new SMESHGUI_GroupDlg( this, aMesh); @@ -1807,7 +1807,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) if ( !vtkwnd ) { SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ), - tr( "NOT_A_VTK_VIEWER" ) ); + tr( "NOT_A_VTK_VIEWER" ) ); break; } @@ -1821,52 +1821,52 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) int nbSel = selected.Extent(); if (nbSel == 1) { - // check if submesh is selected - Handle(SALOME_InteractiveObject) IObject = selected.First(); - if (IObject->hasEntry()) { - _PTR(SObject) aSObj = aStudy->FindObjectID(IObject->getEntry()); - if( aSObj ) { - SMESH::SMESH_subMesh_var aSubMesh = SMESH::SMESH_subMesh::_narrow( SMESH::SObjectToObject( aSObj ) ); - if (!aSubMesh->_is_nil()) { - try { - SMESH::SMESH_Mesh_var aMesh = aSubMesh->GetFather(); - // get submesh elements list by types - SMESH::long_array_var aNodes = aSubMesh->GetElementsByType(SMESH::NODE); - SMESH::long_array_var aEdges = aSubMesh->GetElementsByType(SMESH::EDGE); - SMESH::long_array_var aFaces = aSubMesh->GetElementsByType(SMESH::FACE); - SMESH::long_array_var aVolumes = aSubMesh->GetElementsByType(SMESH::VOLUME); - // create group for each type o elements - QString aName = IObject->getName(); - if (aNodes->length() > 0) { - SMESH::SMESH_Group_var aGroup = SMESH::AddGroup(aMesh, SMESH::NODE, aName + "_Nodes"); - aGroup->Add(aNodes.inout()); - } - if (aEdges->length() > 0) { - SMESH::SMESH_Group_var aGroup = SMESH::AddGroup(aMesh, SMESH::EDGE, aName + "_Edges"); - aGroup->Add(aEdges.inout()); - } - if (aFaces->length() > 0) { - SMESH::SMESH_Group_var aGroup = SMESH::AddGroup(aMesh, SMESH::FACE, aName + "_Faces"); - aGroup->Add(aFaces.inout()); - } - if (aVolumes->length() > 0) { - SMESH::SMESH_Group_var aGroup = SMESH::AddGroup(aMesh, SMESH::VOLUME, aName + "_Volumes"); - aGroup->Add(aVolumes.inout()); - } - updateObjBrowser(); - - } + // check if submesh is selected + Handle(SALOME_InteractiveObject) IObject = selected.First(); + if (IObject->hasEntry()) { + _PTR(SObject) aSObj = aStudy->FindObjectID(IObject->getEntry()); + if( aSObj ) { + SMESH::SMESH_subMesh_var aSubMesh = SMESH::SMESH_subMesh::_narrow( SMESH::SObjectToObject( aSObj ) ); + if (!aSubMesh->_is_nil()) { + try { + SMESH::SMESH_Mesh_var aMesh = aSubMesh->GetFather(); + // get submesh elements list by types + SMESH::long_array_var aNodes = aSubMesh->GetElementsByType(SMESH::NODE); + SMESH::long_array_var aEdges = aSubMesh->GetElementsByType(SMESH::EDGE); + SMESH::long_array_var aFaces = aSubMesh->GetElementsByType(SMESH::FACE); + SMESH::long_array_var aVolumes = aSubMesh->GetElementsByType(SMESH::VOLUME); + // create group for each type o elements + QString aName = IObject->getName(); + if (aNodes->length() > 0) { + SMESH::SMESH_Group_var aGroup = SMESH::AddGroup(aMesh, SMESH::NODE, aName + "_Nodes"); + aGroup->Add(aNodes.inout()); + } + if (aEdges->length() > 0) { + SMESH::SMESH_Group_var aGroup = SMESH::AddGroup(aMesh, SMESH::EDGE, aName + "_Edges"); + aGroup->Add(aEdges.inout()); + } + if (aFaces->length() > 0) { + SMESH::SMESH_Group_var aGroup = SMESH::AddGroup(aMesh, SMESH::FACE, aName + "_Faces"); + aGroup->Add(aFaces.inout()); + } + if (aVolumes->length() > 0) { + SMESH::SMESH_Group_var aGroup = SMESH::AddGroup(aMesh, SMESH::VOLUME, aName + "_Volumes"); + aGroup->Add(aVolumes.inout()); + } + updateObjBrowser(); + + } catch(const SALOME::SALOME_Exception & S_ex){ - SalomeApp_Tools::QtCatchCorbaException(S_ex); - } - } - } - } + SalomeApp_Tools::QtCatchCorbaException(S_ex); + } + } + } + } } else if(nbSel==0) { SUIT_MessageBox::warning(desktop(), - tr("SMESH_WRN_WARNING"), - tr("SMESH_WRN_NO_AVAILABLE_DATA")); + tr("SMESH_WRN_WARNING"), + tr("SMESH_WRN_NO_AVAILABLE_DATA")); } break; } @@ -1876,7 +1876,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) if ( !vtkwnd ) { SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ), - tr( "NOT_A_VTK_VIEWER" ) ); + tr( "NOT_A_VTK_VIEWER" ) ); break; } @@ -1895,16 +1895,16 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) SMESH::SMESH_GroupBase_var aGroup = SMESH::IObjectToInterface(It.Value()); if (!aGroup->_is_nil()) { - nbSelectedGroups++; + nbSelectedGroups++; SMESHGUI_GroupDlg *aDlg = new SMESHGUI_GroupDlg( this, aGroup); aDlg->show(); - } + } } if (nbSelectedGroups == 0) - { - SMESHGUI_GroupDlg *aDlg = new SMESHGUI_GroupDlg( this, SMESH::SMESH_GroupBase::_nil()); - aDlg->show(); - } + { + SMESHGUI_GroupDlg *aDlg = new SMESHGUI_GroupDlg( this, SMESH::SMESH_GroupBase::_nil()); + aDlg->show(); + } break; } @@ -1912,8 +1912,8 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) { if(checkLock(aStudy)) break; if (myState == 800) { - SMESHGUI_GroupDlg *aDlg = (SMESHGUI_GroupDlg*) myActiveDialogBox; - if (aDlg) aDlg->onAdd(); + SMESHGUI_GroupDlg *aDlg = (SMESHGUI_GroupDlg*) myActiveDialogBox; + if (aDlg) aDlg->onAdd(); } break; } @@ -1922,8 +1922,8 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) { if(checkLock(aStudy)) break; if (myState == 800) { - SMESHGUI_GroupDlg *aDlg = (SMESHGUI_GroupDlg*) myActiveDialogBox; - if (aDlg) aDlg->onRemove(); + SMESHGUI_GroupDlg *aDlg = (SMESHGUI_GroupDlg*) myActiveDialogBox; + if (aDlg) aDlg->onRemove(); } break; } @@ -1933,7 +1933,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) if ( !vtkwnd ) { SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ), - tr( "NOT_A_VTK_VIEWER" ) ); + tr( "NOT_A_VTK_VIEWER" ) ); break; } @@ -1953,7 +1953,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) if (!aGroup->_is_nil()) { SMESHGUI_GroupDlg *aDlg = new SMESHGUI_GroupDlg( this, aGroup, true ); aDlg->show(); - } + } } break; } @@ -1965,7 +1965,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) if ( !vtkwnd ) { SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ), - tr( "NOT_A_VTK_VIEWER" ) ); + tr( "NOT_A_VTK_VIEWER" ) ); break; } @@ -2004,7 +2004,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) if ( !vtkwnd ) { SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ), - tr( "NOT_A_VTK_VIEWER" ) ); + tr( "NOT_A_VTK_VIEWER" ) ); break; } @@ -2017,7 +2017,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) break; } - case 900: // MESH INFOS + case 900: // MESH INFOS { EmitSignalDeactivateDialog(); LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr(); @@ -2029,8 +2029,8 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) SALOME_ListIO IOs; SALOME_ListIteratorOfListIO It (selected); for ( ; It.More(); It.Next() ) { - IOs.Clear(); IOs.Append( It.Value() ); - aSel->setSelectedObjects( IOs ); + IOs.Clear(); IOs.Append( It.Value() ); + aSel->setSelectedObjects( IOs ); ( new SMESHGUI_MeshInfosDlg( this ) )->show(); } // restore selection @@ -2041,7 +2041,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) break; } - case 902: // STANDARD MESH INFOS + case 902: // STANDARD MESH INFOS { EmitSignalDeactivateDialog(); LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr(); @@ -2053,27 +2053,27 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) SALOME_ListIO IOs; SALOME_ListIteratorOfListIO It (selected); for ( ; It.More(); It.Next() ) { - IOs.Clear(); - IOs.Append( It.Value() ); - aSel->setSelectedObjects( IOs ); + IOs.Clear(); + IOs.Append( It.Value() ); + aSel->setSelectedObjects( IOs ); ( new SMESHGUI_StandardMeshInfosDlg( this ) )->show(); } // restore selection - aSel->setSelectedObjects( selected ); + aSel->setSelectedObjects( selected ); } else ( new SMESHGUI_StandardMeshInfosDlg( this ) )->show(); break; } - case 903: // WHAT IS + case 903: // WHAT IS { EmitSignalDeactivateDialog(); ( new SMESHGUI_WhatIsDlg( this ) )->show(); break; } - case 1100: // EDIT HYPOTHESIS + case 1100: // EDIT HYPOTHESIS { if(checkLock(aStudy)) break; @@ -2086,7 +2086,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) if (nbSel == 1) { Handle(SALOME_InteractiveObject) anIObject = selected.First(); - SMESH::SMESH_Hypothesis_var aHypothesis = SMESH::IObjectToInterface(anIObject); + SMESH::SMESH_Hypothesis_var aHypothesis = SMESH::IObjectToInterface(anIObject); /* Look for all mesh objects that have this hypothesis affected in order to flag as ModifiedMesh */ /* At end below '...->updateObjBrowser(true)' will change icon of mesh objects */ @@ -2108,7 +2108,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) break; } - case 1101: // RENAME + case 1101: // RENAME { if ( checkLock( aStudy ) ) break; @@ -2148,14 +2148,14 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) { SMESHGUI::GetSMESHGen()->SetName(obj->GetIOR().c_str(), newName.toLatin1().data()); - // update name of group object and its actor - SMESH::SMESH_GroupBase_var aGroupObject = SMESH::IObjectToInterface(IObject); - if( !aGroupObject->_is_nil() ) - { - aGroupObject->SetName( newName.toLatin1().data() ); - if ( SMESH_Actor *anActor = SMESH::FindActorByEntry( IObject->getEntry() ) ) - anActor->setName( newName.toLatin1().data() ); - } + // update name of group object and its actor + SMESH::SMESH_GroupBase_var aGroupObject = SMESH::IObjectToInterface(IObject); + if( !aGroupObject->_is_nil() ) + { + aGroupObject->SetName( newName.toLatin1().data() ); + if ( SMESH_Actor *anActor = SMESH::FindActorByEntry( IObject->getEntry() ) ) + anActor->setName( newName.toLatin1().data() ); + } updateObjBrowser(); } @@ -2166,13 +2166,13 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) if (!isAny) { SUIT_MessageBox::warning(desktop(), - QObject::tr("SMESH_WRN_WARNING"), - QObject::tr("SMESH_WRN_NO_APPROPRIATE_SELECTION")); + QObject::tr("SMESH_WRN_WARNING"), + QObject::tr("SMESH_WRN_NO_APPROPRIATE_SELECTION")); } break; } - case 1102: // REMOVE HYPOTHESIS / ALGORITHMS + case 1102: // REMOVE HYPOTHESIS / ALGORITHMS { if(checkLock(aStudy)) break; SUIT_OverrideCursor wc; @@ -2184,8 +2184,8 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) SALOME_ListIteratorOfListIO It(selected); for (int i = 0; It.More(); It.Next(), i++) { - Handle(SALOME_InteractiveObject) IObject = It.Value(); - SMESH::RemoveHypothesisOrAlgorithmOnMesh(IObject); + Handle(SALOME_InteractiveObject) IObject = It.Value(); + SMESH::RemoveHypothesisOrAlgorithmOnMesh(IObject); } SALOME_ListIO l1; aSel->setSelectedObjects( l1 ); @@ -2193,17 +2193,17 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) break; } - case 4009: // ELEM0D - case 4010: // GEOM::EDGE - case 4021: // TRIANGLE - case 4022: // QUAD - case 4023: // POLYGON - case 4031: // TETRA - case 4032: // HEXA + case 4009: // ELEM0D + case 4010: // GEOM::EDGE + case 4021: // TRIANGLE + case 4022: // QUAD + case 4023: // POLYGON + case 4031: // TETRA + case 4032: // HEXA { if(checkLock(aStudy)) break; if ( vtkwnd ) { - EmitSignalDeactivateDialog(); + EmitSignalDeactivateDialog(); SMDSAbs_ElementType type = SMDSAbs_Edge; int nbNodes = 2; switch (theCommandID) { @@ -2215,32 +2215,32 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) type = SMDSAbs_Face; nbNodes = 4; break; case 4031: // TETRA type = SMDSAbs_Volume; nbNodes = 4; break; - case 4023: // POLYGON - type = SMDSAbs_Face; nbNodes = 5; break; // 5 - identificator for POLYGON + case 4023: // POLYGON + type = SMDSAbs_Face; nbNodes = 5; break; // 5 - identificator for POLYGON case 4032: // HEXA type = SMDSAbs_Volume; nbNodes = 8; break; - case 4033: // POLYHEDRE - type = SMDSAbs_Volume; nbNodes = 9; break; // 9 - identificator for POLYHEDRE + case 4033: // POLYHEDRE + type = SMDSAbs_Volume; nbNodes = 9; break; // 9 - identificator for POLYHEDRE default:; } - ( new SMESHGUI_AddMeshElementDlg( this, type, nbNodes ) )->show(); + ( new SMESHGUI_AddMeshElementDlg( this, type, nbNodes ) )->show(); } else { - SUIT_MessageBox::warning(desktop(), - tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK")); + SUIT_MessageBox::warning(desktop(), + tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK")); } break; } - case 4033: // POLYHEDRON + case 4033: // POLYHEDRON { if(checkLock(aStudy)) break; if ( vtkwnd ) { - EmitSignalDeactivateDialog(); - ( new SMESHGUI_CreatePolyhedralVolumeDlg( this ) )->show(); + EmitSignalDeactivateDialog(); + ( new SMESHGUI_CreatePolyhedralVolumeDlg( this ) )->show(); } else { - SUIT_MessageBox::warning(SMESHGUI::desktop(), - tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK")); + SUIT_MessageBox::warning(SMESHGUI::desktop(), + tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK")); } break; } @@ -2254,60 +2254,60 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) { if(checkLock(aStudy)) break; if ( vtkwnd ) { - EmitSignalDeactivateDialog(); - int type; - - switch (theCommandID) { - case 4034: - type = QUAD_EDGE; break; - case 4035: - type = QUAD_TRIANGLE; break; - case 4036: - type = QUAD_QUADRANGLE; break; - case 4037: - type = QUAD_TETRAHEDRON; break; - case 4038: - type = QUAD_PYRAMID; break; - case 4039: - type = QUAD_PENTAHEDRON; break; - case 4040: - type = QUAD_HEXAHEDRON; - break; - default:; - } - ( new SMESHGUI_AddQuadraticElementDlg( this, type ) )->show(); + EmitSignalDeactivateDialog(); + int type; + + switch (theCommandID) { + case 4034: + type = QUAD_EDGE; break; + case 4035: + type = QUAD_TRIANGLE; break; + case 4036: + type = QUAD_QUADRANGLE; break; + case 4037: + type = QUAD_TETRAHEDRON; break; + case 4038: + type = QUAD_PYRAMID; break; + case 4039: + type = QUAD_PENTAHEDRON; break; + case 4040: + type = QUAD_HEXAHEDRON; + break; + default:; + } + ( new SMESHGUI_AddQuadraticElementDlg( this, type ) )->show(); } else { - SUIT_MessageBox::warning(SMESHGUI::desktop(), - tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK")); + SUIT_MessageBox::warning(SMESHGUI::desktop(), + tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK")); } break; } - case 4041: // REMOVES NODES + case 4041: // REMOVES NODES { if(checkLock(aStudy)) break; if ( vtkwnd ) { - EmitSignalDeactivateDialog(); - ( new SMESHGUI_RemoveNodesDlg( this ) )->show(); + EmitSignalDeactivateDialog(); + ( new SMESHGUI_RemoveNodesDlg( this ) )->show(); } else { - SUIT_MessageBox::warning(SMESHGUI::desktop(), - tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK")); + SUIT_MessageBox::warning(SMESHGUI::desktop(), + tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK")); } break; } - case 4042: // REMOVES ELEMENTS + case 4042: // REMOVES ELEMENTS { if(checkLock(aStudy)) break; if( vtkwnd ) { - EmitSignalDeactivateDialog(); - ( new SMESHGUI_RemoveElementsDlg( this ) )->show(); + EmitSignalDeactivateDialog(); + ( new SMESHGUI_RemoveElementsDlg( this ) )->show(); } else - { - SUIT_MessageBox::warning(SMESHGUI::desktop(), - tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK")); - } + { + SUIT_MessageBox::warning(SMESHGUI::desktop(), + tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK")); + } break; } case 4043: { // CLEAR_MESH @@ -2341,53 +2341,53 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) } } catch (const SALOME::SALOME_Exception& S_ex){ - wc.suspend(); - SalomeApp_Tools::QtCatchCorbaException(S_ex); - wc.resume(); + wc.suspend(); + SalomeApp_Tools::QtCatchCorbaException(S_ex); + wc.resume(); } } SMESH::UpdateView(); updateObjBrowser(); break; } - case 4051: // RENUMBERING NODES + case 4051: // RENUMBERING NODES { if(checkLock(aStudy)) break; if( vtkwnd ) { - EmitSignalDeactivateDialog(); - ( new SMESHGUI_RenumberingDlg( this, 0 ) )->show(); + EmitSignalDeactivateDialog(); + ( new SMESHGUI_RenumberingDlg( this, 0 ) )->show(); } else - { - SUIT_MessageBox::warning(SMESHGUI::desktop(), - tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK")); - } + { + SUIT_MessageBox::warning(SMESHGUI::desktop(), + tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK")); + } break; } - case 4052: // RENUMBERING ELEMENTS + case 4052: // RENUMBERING ELEMENTS { if(checkLock(aStudy)) break; if ( vtkwnd ) { - EmitSignalDeactivateDialog(); - ( new SMESHGUI_RenumberingDlg( this, 1 ) )->show(); + EmitSignalDeactivateDialog(); + ( new SMESHGUI_RenumberingDlg( this, 1 ) )->show(); } else - { - SUIT_MessageBox::warning(SMESHGUI::desktop(), - tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK")); - } + { + SUIT_MessageBox::warning(SMESHGUI::desktop(), + tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK")); + } break; } case 4061: // TRANSLATION { if(checkLock(aStudy)) break; if ( vtkwnd ) { - EmitSignalDeactivateDialog(); - ( new SMESHGUI_TranslationDlg( this ) )->show(); + EmitSignalDeactivateDialog(); + ( new SMESHGUI_TranslationDlg( this ) )->show(); } else { - SUIT_MessageBox::warning(SMESHGUI::desktop(), - tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK")); + SUIT_MessageBox::warning(SMESHGUI::desktop(), + tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK")); } break; } @@ -2395,12 +2395,12 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) { if(checkLock(aStudy)) break; if( vtkwnd ) { - EmitSignalDeactivateDialog(); - ( new SMESHGUI_RotationDlg( this ) )->show(); + EmitSignalDeactivateDialog(); + ( new SMESHGUI_RotationDlg( this ) )->show(); } else { - SUIT_MessageBox::warning(SMESHGUI::desktop(), - tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK")); + SUIT_MessageBox::warning(SMESHGUI::desktop(), + tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK")); } break; } @@ -2408,12 +2408,12 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) { if(checkLock(aStudy)) break; if(vtkwnd) { - EmitSignalDeactivateDialog(); - ( new SMESHGUI_SymmetryDlg( this ) )->show(); + EmitSignalDeactivateDialog(); + ( new SMESHGUI_SymmetryDlg( this ) )->show(); } else { - SUIT_MessageBox::warning(SMESHGUI::desktop(), - tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK")); + SUIT_MessageBox::warning(SMESHGUI::desktop(), + tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK")); } break; } @@ -2421,12 +2421,12 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) { if(checkLock(aStudy)) break; if(vtkwnd) { - EmitSignalDeactivateDialog(); - ( new SMESHGUI_SewingDlg( this ) )->show(); + EmitSignalDeactivateDialog(); + ( new SMESHGUI_SewingDlg( this ) )->show(); } else { - SUIT_MessageBox::warning(SMESHGUI::desktop(), - tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK")); + SUIT_MessageBox::warning(SMESHGUI::desktop(), + tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK")); } break; } @@ -2434,12 +2434,12 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) { if(checkLock(aStudy)) break; if(vtkwnd) { - EmitSignalDeactivateDialog(); - ( new SMESHGUI_EditMeshDlg( this, 0 ) )->show(); + EmitSignalDeactivateDialog(); + ( new SMESHGUI_EditMeshDlg( this, 0 ) )->show(); } else { - SUIT_MessageBox::warning(SMESHGUI::desktop(), - tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK")); + SUIT_MessageBox::warning(SMESHGUI::desktop(), + tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK")); } break; } @@ -2447,11 +2447,11 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) { if (checkLock(aStudy)) break; if (vtkwnd) { - EmitSignalDeactivateDialog(); - ( new SMESHGUI_EditMeshDlg( this, 1 ) )->show(); + EmitSignalDeactivateDialog(); + ( new SMESHGUI_EditMeshDlg( this, 1 ) )->show(); } else { - SUIT_MessageBox::warning(SMESHGUI::desktop(), - tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK")); + SUIT_MessageBox::warning(SMESHGUI::desktop(), + tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK")); } break; } @@ -2478,7 +2478,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) } break; - case 6017: // CONTROLS + case 6017: // CONTROLS case 6016: case 6015: case 6014: @@ -2500,27 +2500,27 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) SALOME_ListIO selected; mgr->selectedObjects( selected ); if ( selected.Extent() == 1 && selected.First()->hasEntry() ) { - _PTR(SObject) SO = aStudy->FindObjectID( selected.First()->getEntry() ); - if ( SO ) { - CORBA::Object_var aObject = SMESH::SObjectToObject( SO ); - SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_narrow( aObject ); - SMESH::SMESH_subMesh_var aSubMesh = SMESH::SMESH_subMesh::_narrow( aObject ); - SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow( aObject ); - if ( !aMesh->_is_nil() || !aSubMesh->_is_nil() || !aGroup->_is_nil() ) { - ::Control( theCommandID ); - break; - } - } + _PTR(SObject) SO = aStudy->FindObjectID( selected.First()->getEntry() ); + if ( SO ) { + CORBA::Object_var aObject = SMESH::SObjectToObject( SO ); + SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_narrow( aObject ); + SMESH::SMESH_subMesh_var aSubMesh = SMESH::SMESH_subMesh::_narrow( aObject ); + SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow( aObject ); + if ( !aMesh->_is_nil() || !aSubMesh->_is_nil() || !aGroup->_is_nil() ) { + ::Control( theCommandID ); + break; + } + } } SUIT_MessageBox::warning(desktop(), - tr( "SMESH_WRN_WARNING" ), - tr( "SMESH_BAD_SELECTION" ) ); + tr( "SMESH_WRN_WARNING" ), + tr( "SMESH_BAD_SELECTION" ) ); break; } else { SUIT_MessageBox::warning(desktop(), - tr( "SMESH_WRN_WARNING" ), - tr( "NOT_A_VTK_VIEWER" ) ); + tr( "SMESH_WRN_WARNING" ), + tr( "NOT_A_VTK_VIEWER" ) ); } break; case 9010: @@ -2531,11 +2531,11 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) SALOME_ListIteratorOfListIO it(selected); for( ; it.More(); it.Next()) { Handle(SALOME_InteractiveObject) anIObject = it.Value(); - if(anIObject->hasEntry()) { - if(SMESH_Actor *anActor = SMESH::FindActorByEntry(anIObject->getEntry())){ - anActor->SetPointsLabeled( !anActor->GetPointsLabeled() ); - } - } + if(anIObject->hasEntry()) { + if(SMESH_Actor *anActor = SMESH::FindActorByEntry(anIObject->getEntry())){ + anActor->SetPointsLabeled( !anActor->GetPointsLabeled() ); + } + } } break; } @@ -2544,12 +2544,12 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) LightApp_SelectionMgr* mgr = selectionMgr(); SALOME_ListIO selected; mgr->selectedObjects( selected ); - if (selected.Extent() == 1) { - Handle(SALOME_InteractiveObject) anIObject = selected.First(); - if(anIObject->hasEntry()) - if(SMESH_Actor *anActor = SMESH::FindActorByEntry(anIObject->getEntry())){ - anActor->SetCellsLabeled( !anActor->GetCellsLabeled() ); - } + if (selected.Extent() == 1) { + Handle(SALOME_InteractiveObject) anIObject = selected.First(); + if(anIObject->hasEntry()) + if(SMESH_Actor *anActor = SMESH::FindActorByEntry(anIObject->getEntry())){ + anActor->SetCellsLabeled( !anActor->GetCellsLabeled() ); + } } break; } @@ -2636,7 +2636,7 @@ void SMESHGUI::createPopupItem( const int id, const QString& clients, const QString& types, const QString& theRule, - const int pId ) + const int pId ) { int parentId = pId; if( pId!=-1 ) @@ -3040,22 +3040,22 @@ void SMESHGUI::initialize( CAM_Application* app ) myRules.clear(); QString OB = "'ObjectBrowser'", - View = "'" + SVTK_Viewer::Type() + "'", - pat = "'%1'", - mesh = pat.arg( SMESHGUI_Selection::typeName( MESH ) ), - group = pat.arg( SMESHGUI_Selection::typeName( GROUP ) ), - hypo = pat.arg( SMESHGUI_Selection::typeName( HYPOTHESIS ) ), - algo = pat.arg( SMESHGUI_Selection::typeName( ALGORITHM ) ), - elems = QString( "'%1' '%2' '%3' '%4' '%5' '%6'" ). + View = "'" + SVTK_Viewer::Type() + "'", + pat = "'%1'", + mesh = pat.arg( SMESHGUI_Selection::typeName( MESH ) ), + group = pat.arg( SMESHGUI_Selection::typeName( GROUP ) ), + hypo = pat.arg( SMESHGUI_Selection::typeName( HYPOTHESIS ) ), + algo = pat.arg( SMESHGUI_Selection::typeName( ALGORITHM ) ), + elems = QString( "'%1' '%2' '%3' '%4' '%5' '%6'" ). arg( SMESHGUI_Selection::typeName( SUBMESH_VERTEX ) ). - arg( SMESHGUI_Selection::typeName( SUBMESH_EDGE ) ). - arg( SMESHGUI_Selection::typeName( SUBMESH_FACE ) ). - arg( SMESHGUI_Selection::typeName( SUBMESH_SOLID ) ). - arg( SMESHGUI_Selection::typeName( SUBMESH_COMPOUND ) ). - arg( SMESHGUI_Selection::typeName( SUBMESH ) ), + arg( SMESHGUI_Selection::typeName( SUBMESH_EDGE ) ). + arg( SMESHGUI_Selection::typeName( SUBMESH_FACE ) ). + arg( SMESHGUI_Selection::typeName( SUBMESH_SOLID ) ). + arg( SMESHGUI_Selection::typeName( SUBMESH_COMPOUND ) ). + arg( SMESHGUI_Selection::typeName( SUBMESH ) ), subMesh = elems, - mesh_group = mesh + " " + subMesh + " " + group, - hyp_alg = hypo + " " + algo; + mesh_group = mesh + " " + subMesh + " " + group, + hyp_alg = hypo + " " + algo; // popup for object browser QString @@ -3353,7 +3353,7 @@ void SMESHGUI::initialize( CAM_Application* app ) popupMgr()->insert( separator(), -1, -1 ); connect( application(), SIGNAL( viewManagerActivated( SUIT_ViewManager* ) ), - this, SLOT( onViewManagerActivated( SUIT_ViewManager* ) ) ); + this, SLOT( onViewManagerActivated( SUIT_ViewManager* ) ) ); } //================================================================================ @@ -3475,7 +3475,7 @@ void SMESHGUI::contextMenuPopup( const QString& client, QMenu* menu, QString& ti if ( obj ) { QString aName = QString( obj->GetName().c_str() ); while ( aName.at( aName.length() - 1 ) == ' ' ) // Remove extraspaces in Name of Popup - aName.remove( (aName.length() - 1), 1 ); + aName.remove( (aName.length() - 1), 1 ); title = aName; } } @@ -3752,48 +3752,48 @@ void SMESHGUI::preferencesChanged( const QString& sect, const QString& name ) if( name=="selection_object_color" || name=="selection_element_color" || name=="selection_width" || name=="highlight_color" || name=="highlight_width" || name=="selection_precision_node" || name=="selection_precision_element" || - name=="selection_precision_object") + name=="selection_precision_object") SMESH::UpdateSelectionProp( this ); else if (name == QString("scalar_bar_vertical_x") || name == QString("scalar_bar_vertical_width")){ sbX1 = aResourceMgr->doubleValue("SMESH", "scalar_bar_vertical_x", sbX1); sbW = aResourceMgr->doubleValue("SMESH", "scalar_bar_vertical_width", sbW); if(sbX1+sbW > aTol){ - aWarning = "Origin and Size Vertical: X+Width > 1\n"; - sbX1=0.01; - sbW=0.08; - aResourceMgr->setValue("SMESH", "scalar_bar_vertical_x", sbX1); - aResourceMgr->setValue("SMESH", "scalar_bar_vertical_width", sbW); + aWarning = "Origin and Size Vertical: X+Width > 1\n"; + sbX1=0.01; + sbW=0.08; + aResourceMgr->setValue("SMESH", "scalar_bar_vertical_x", sbX1); + aResourceMgr->setValue("SMESH", "scalar_bar_vertical_width", sbW); } } else if(name == QString("scalar_bar_vertical_y") || name == QString("scalar_bar_vertical_height")){ sbY1 = aResourceMgr->doubleValue("SMESH", "scalar_bar_vertical_y", sbY1); sbH = aResourceMgr->doubleValue("SMESH", "scalar_bar_vertical_height",sbH); if(sbY1+sbH > aTol){ - aWarning = "Origin and Size Vertical: Y+Height > 1\n"; - aResourceMgr->setValue("SMESH", "scalar_bar_vertical_y", sbY1); - aResourceMgr->setValue("SMESH", "scalar_bar_vertical_height",sbH); + aWarning = "Origin and Size Vertical: Y+Height > 1\n"; + aResourceMgr->setValue("SMESH", "scalar_bar_vertical_y", sbY1); + aResourceMgr->setValue("SMESH", "scalar_bar_vertical_height",sbH); } } else if(name == QString("scalar_bar_horizontal_x") || name == QString("scalar_bar_horizontal_width")){ sbX1 = aResourceMgr->doubleValue("SMESH", "scalar_bar_horizontal_x", sbX1); sbW = aResourceMgr->doubleValue("SMESH", "scalar_bar_horizontal_width", sbW); if(sbX1+sbW > aTol){ - aWarning = "Origin and Size Horizontal: X+Width > 1\n"; - sbX1=0.1; - sbW=0.08; - aResourceMgr->setValue("SMESH", "scalar_bar_horizontal_x", sbX1); - aResourceMgr->setValue("SMESH", "scalar_bar_horizontal_width", sbW); + aWarning = "Origin and Size Horizontal: X+Width > 1\n"; + sbX1=0.1; + sbW=0.08; + aResourceMgr->setValue("SMESH", "scalar_bar_horizontal_x", sbX1); + aResourceMgr->setValue("SMESH", "scalar_bar_horizontal_width", sbW); } } else if(name == QString("scalar_bar_horizontal_y") || name == QString("scalar_bar_horizontal_height")){ sbY1 = aResourceMgr->doubleValue("SMESH", "scalar_bar_horizontal_y", sbY1); sbH = aResourceMgr->doubleValue("SMESH", "scalar_bar_horizontal_height",sbH); if(sbY1+sbH > aTol){ - aWarning = "Origin and Size Horizontal: Y+Height > 1\n"; - sbY1=0.01; - sbH=0.08; - aResourceMgr->setValue("SMESH", "scalar_bar_horizontal_y", sbY1); - aResourceMgr->setValue("SMESH", "scalar_bar_horizontal_height",sbH); + aWarning = "Origin and Size Horizontal: Y+Height > 1\n"; + sbY1=0.01; + sbH=0.08; + aResourceMgr->setValue("SMESH", "scalar_bar_horizontal_y", sbY1); + aResourceMgr->setValue("SMESH", "scalar_bar_horizontal_height",sbH); } } else if ( name == "segmentation" ) { @@ -3808,8 +3808,8 @@ void SMESHGUI::preferencesChanged( const QString& sect, const QString& name ) if(aWarning.size() != 0){ aWarning += "The default values are applied instead."; SUIT_MessageBox::warning(SMESHGUI::desktop(), - QObject::tr("SMESH_ERR_SCALARBAR_PARAMS"), - QObject::tr(aWarning.c_str())); + QObject::tr("SMESH_ERR_SCALARBAR_PARAMS"), + QObject::tr(aWarning.c_str())); } } } @@ -3951,7 +3951,7 @@ SALOMEDS::Color SMESHGUI::getUniqueColor( const QList& theReser { aTolerance /= 2; if( aTolerance < 1 ) - break; + break; } //cout << "Iteration N" << anIterations << " (tolerance=" << aTolerance << ")"<< endl; @@ -3972,9 +3972,9 @@ SALOMEDS::Color SMESHGUI::getUniqueColor( const QList& theReser //cout << h << " "; if( abs( h - aHue ) < aTolerance ) { - ok = false; - //cout << "break (diff = " << abs( h - aHue ) << ")"; - break; + ok = false; + //cout << "break (diff = " << abs( h - aHue ) << ")"; + break; } } //cout << endl; @@ -4040,19 +4040,19 @@ void SMESHGUI::storeVisualParameters (int savePoint) QVector views = vman->getViews(); for (int i = 0, iEnd = vman->getViewsCount(); i < iEnd; i++) { - if (SVTK_ViewWindow* vtkView = dynamic_cast(views[i])) + if (SVTK_ViewWindow* vtkView = dynamic_cast(views[i])) { - VTK::ActorCollectionCopy aCopy(vtkView->getRenderer()->GetActors()); - vtkActorCollection* allActors = aCopy.GetActors(); - allActors->InitTraversal(); - while (vtkActor* actor = allActors->GetNextActor()) + VTK::ActorCollectionCopy aCopy(vtkView->getRenderer()->GetActors()); + vtkActorCollection* allActors = aCopy.GetActors(); + allActors->InitTraversal(); + while (vtkActor* actor = allActors->GetNextActor()) { - if (actor->GetVisibility()) // store only visible actors + if (actor->GetVisibility()) // store only visible actors { SMESH_Actor* aSmeshActor = 0; if (actor->IsA("SMESH_Actor")) aSmeshActor = SMESH_Actor::SafeDownCast(actor); - if (aSmeshActor && aSmeshActor->hasIO()) + if (aSmeshActor && aSmeshActor->hasIO()) { Handle(SALOME_InteractiveObject) io = aSmeshActor->getIO(); if (io->hasEntry()) @@ -4161,10 +4161,10 @@ void SMESHGUI::storeVisualParameters (int savePoint) ip->setParameter(entry, param + QString::number(ipl+1).toLatin1().data(), planeValue); } } // if (io->hasEntry()) - } // SMESH_Actor && hasIO - } // isVisible - } // while.. actors traversal - } // if (vtkView) + } // SMESH_Actor && hasIO + } // isVisible + } // while.. actors traversal + } // if (vtkView) } // for (views) vtkViewers++; } // if (SVTK view model) @@ -4232,7 +4232,7 @@ void SMESHGUI::restoreVisualParameters (int savePoint) bool ok; int viewIndex = viewIndexStr.toUInt(&ok); if (!ok) // bad conversion of view index to integer - continue; + continue; // viewers if (viewerTypStr == SVTK_Viewer::Type()) @@ -4259,7 +4259,7 @@ void SMESHGUI::restoreVisualParameters (int savePoint) // access later when restoring other parameters SVTK_ViewWindow* vtkView = (SVTK_ViewWindow*) vman->getActiveView(); vtkRenderer* Renderer = vtkView->getRenderer(); - VTK::ActorCollectionCopy aCopy(Renderer->GetActors()); + VTK::ActorCollectionCopy aCopy(Renderer->GetActors()); vtkActorCollection* theActors = aCopy.GetActors(); theActors->InitTraversal(); bool isFound = false; @@ -4280,10 +4280,10 @@ void SMESHGUI::restoreVisualParameters (int savePoint) } } } // if (paramNameStr == "Visibility") - else + else { // the rest properties "work" with SMESH_Actor - if (aSmeshActor) + if (aSmeshActor) { QString val ((*valuesIt).c_str()); @@ -4386,7 +4386,7 @@ void SMESHGUI::restoreVisualParameters (int savePoint) } } } // if (aSmeshActor) - } // other parameters than Visibility + } // other parameters than Visibility } } // for names/parameters iterator } // for entries iterator diff --git a/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx b/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx index fd617e809..33c410193 100644 --- a/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx @@ -186,11 +186,11 @@ namespace SMESH vtkIdList *anIds = vtkIdList::New(); if(aConn) - for (int i = 0, iEnd = theIds.size(); i < iEnd; i++) - anIds->InsertId(i,theIds[aConn[i]]); + for (int i = 0, iEnd = theIds.size(); i < iEnd; i++) + anIds->InsertId(i,theIds[aConn[i]]); else - for (int i = 0, iEnd = theIds.size(); i < iEnd; i++) - anIds->InsertId(i,theIds[i]); + for (int i = 0, iEnd = theIds.size(); i < iEnd; i++) + anIds->InsertId(i,theIds[i]); myGrid->InsertNextCell(theType,anIds); anIds->Delete(); @@ -212,8 +212,8 @@ namespace SMESH ~TElementSimulation() { if (FindVtkViewWindow(myApplication->activeViewManager(), myViewWindow)) { - myVTKViewWindow->RemoveActor(myPreviewActor); - myVTKViewWindow->RemoveActor(myFaceOrientation); + myVTKViewWindow->RemoveActor(myPreviewActor); + myVTKViewWindow->RemoveActor(myFaceOrientation); } myPreviewActor->Delete(); myFaceOrientation->Delete(); @@ -237,7 +237,7 @@ namespace SMESH //================================================================================= SMESHGUI_AddMeshElementDlg::SMESHGUI_AddMeshElementDlg( SMESHGUI* theModule, SMDSAbs_ElementType ElementType, - int nbNodes ) + int nbNodes ) : QDialog( SMESH::GetDesktop( theModule ) ), mySMESHGUI( theModule ), mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ) @@ -466,9 +466,9 @@ void SMESHGUI_AddMeshElementDlg::ClickOnApply() aMeshEditor->AddEdge(anArrayOfIndices.inout()); break; case SMDSAbs_Face: { if(myIsPoly) - aMeshEditor->AddPolygonalFace(anArrayOfIndices.inout()); + aMeshEditor->AddPolygonalFace(anArrayOfIndices.inout()); else - aMeshEditor->AddFace(anArrayOfIndices.inout()); + aMeshEditor->AddFace(anArrayOfIndices.inout()); break; } case SMDSAbs_Volume: @@ -536,10 +536,10 @@ void SMESHGUI_AddMeshElementDlg::ClickOnHelp() platform = "application"; #endif SUIT_MessageBox::warning(this, tr("WRN_WARNING"), - tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", - platform)). - arg(myHelpFileName)); + tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", + platform)). + arg(myHelpFileName)); } } @@ -571,12 +571,12 @@ void SMESHGUI_AddMeshElementDlg::onTextChange (const QString& theNewText) bool allOk = true; for (int i = 0; i < aListId.count(); i++) { if( const SMDS_MeshNode * n = aMesh->FindNode( aListId[ i ].toInt() ) ) - { - newIndices.Add( n->GetID() ); - myNbOkNodes++; - } + { + newIndices.Add( n->GetID() ); + myNbOkNodes++; + } else - allOk = false; + allOk = false; } mySelector->AddOrRemoveIndex( myActor->getIO(), newIndices, false ); @@ -587,10 +587,10 @@ void SMESHGUI_AddMeshElementDlg::onTextChange (const QString& theNewText) if (myIsPoly) { - if ( !allOk || myElementType != SMDSAbs_Face || aListId.count() < 3 ) - myNbOkNodes = 0; - else - myNbOkNodes = aListId.count(); + if ( !allOk || myElementType != SMDSAbs_Face || aListId.count() < 3 ) + myNbOkNodes = 0; + else + myNbOkNodes = aListId.count(); } } diff --git a/src/SMESHGUI/SMESHGUI_AddQuadraticElementDlg.cxx b/src/SMESHGUI/SMESHGUI_AddQuadraticElementDlg.cxx index 1c3106e73..4a9fa18ac 100644 --- a/src/SMESHGUI/SMESHGUI_AddQuadraticElementDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_AddQuadraticElementDlg.cxx @@ -221,7 +221,7 @@ namespace SMESH void SetPosition (SMESH_Actor* theActor, const int theType, TVTKIds& theIds, - const int theMode, + const int theMode, const bool theReverse) { vtkUnstructuredGrid *aGrid = theActor->GetUnstructuredGrid(); @@ -311,8 +311,8 @@ namespace SMESH ~TElementSimulation() { if (FindVtkViewWindow(myApplication->activeViewManager(), myViewWindow)) { - myVTKViewWindow->RemoveActor(myPreviewActor); - myVTKViewWindow->RemoveActor(myFaceOrientation); + myVTKViewWindow->RemoveActor(myPreviewActor); + myVTKViewWindow->RemoveActor(myFaceOrientation); } myPreviewActor->Delete(); myFaceOrientation->Delete(); @@ -411,7 +411,7 @@ QWidget* IdEditItem::createEditor() const // purpose : constructor //================================================================================= SMESHGUI_AddQuadraticElementDlg::SMESHGUI_AddQuadraticElementDlg( SMESHGUI* theModule, - const int theType ) + const int theType ) : QDialog( SMESH::GetDesktop( theModule ) ), mySMESHGUI( theModule ), mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ), @@ -766,10 +766,10 @@ void SMESHGUI_AddQuadraticElementDlg::ClickOnHelp() platform = "application"; #endif SUIT_MessageBox::warning(this, tr("WRN_WARNING"), - tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", - platform)). - arg(myHelpFileName)); + tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", + platform)). + arg(myHelpFileName)); } } @@ -797,12 +797,12 @@ void SMESHGUI_AddQuadraticElementDlg::onTextChange (const QString& theNewText) for (int i = 0; i < aListId.count(); i++) { if ( const SMDS_MeshNode * n = aMesh->FindNode( aListId[ i ].toInt() ) ) { - newIndices.Add( n->GetID() ); + newIndices.Add( n->GetID() ); } else { - allOk = false; - break; + allOk = false; + break; } } @@ -914,16 +914,16 @@ void SMESHGUI_AddQuadraticElementDlg::displaySimulation() else { for ( int row = 0; row < myNbCorners; row++ ) - anIds.push_back( myActor->GetObject()->GetNodeVTKId( myTable->item(row, 0)->text().toInt() ) ); + anIds.push_back( myActor->GetObject()->GetNodeVTKId( myTable->item(row, 0)->text().toInt() ) ); for ( int row = 0; row < myTable->rowCount(); row++ ) { - anID = myTable->item(row, 1)->text().toInt(&ok); - if (!ok) { - anID = myTable->item(row, 0)->text().toInt(); - aDisplayMode = VTK_WIREFRAME; - } - anIds.push_back( myActor->GetObject()->GetNodeVTKId(anID) ); + anID = myTable->item(row, 1)->text().toInt(&ok); + if (!ok) { + anID = myTable->item(row, 0)->text().toInt(); + aDisplayMode = VTK_WIREFRAME; + } + anIds.push_back( myActor->GetObject()->GetNodeVTKId(anID) ); } } @@ -1117,7 +1117,7 @@ void SMESHGUI_AddQuadraticElementDlg::UpdateTable( bool theConersValidity ) // clear table for ( int row = 0; row < myTable->rowCount(); row++ ) for ( int col = 0; col < myTable->columnCount(); col++ ) - if ( QTableWidgetItem* aTWI = myTable->item(row, col) ) aTWI->setText(""); + if ( QTableWidgetItem* aTWI = myTable->item(row, col) ) aTWI->setText(""); myTable->setEnabled( false ); } diff --git a/src/SMESHGUI/SMESHGUI_BuildCompoundDlg.cxx b/src/SMESHGUI/SMESHGUI_BuildCompoundDlg.cxx index 3ec453d0b..c26ecf3c5 100644 --- a/src/SMESHGUI/SMESHGUI_BuildCompoundDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_BuildCompoundDlg.cxx @@ -292,22 +292,22 @@ bool SMESHGUI_BuildCompoundDlg::ClickOnApply() if (!myMesh->_is_nil()) { QStringList aParameters; aParameters << (CheckBoxMerge->isChecked() ? SpinBoxTol->text() : QString(" ")); - try { + try { SUIT_OverrideCursor aWaitCursor; SMESH::SMESH_Gen_var aSMESHGen = SMESHGUI::GetSMESHGen(); // concatenate meshes SMESH::SMESH_Mesh_var aCompoundMesh; if(CheckBoxCommon->isChecked()) - aCompoundMesh = aSMESHGen->ConcatenateWithGroups(myMeshArray, - !(ComboBoxUnion->currentIndex()), - CheckBoxMerge->isChecked(), - SpinBoxTol->GetValue()); + aCompoundMesh = aSMESHGen->ConcatenateWithGroups(myMeshArray, + !(ComboBoxUnion->currentIndex()), + CheckBoxMerge->isChecked(), + SpinBoxTol->GetValue()); else - aCompoundMesh = aSMESHGen->Concatenate(myMeshArray, - !(ComboBoxUnion->currentIndex()), - CheckBoxMerge->isChecked(), - SpinBoxTol->GetValue()); + aCompoundMesh = aSMESHGen->Concatenate(myMeshArray, + !(ComboBoxUnion->currentIndex()), + CheckBoxMerge->isChecked(), + SpinBoxTol->GetValue()); aCompoundMesh->SetParameters( aParameters.join(":").toLatin1().constData() ); @@ -360,10 +360,10 @@ void SMESHGUI_BuildCompoundDlg::ClickOnHelp() app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); else { SUIT_MessageBox::warning(this, tr("WRN_WARNING"), - tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", - "application")). - arg(myHelpFileName)); + tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", + "application")). + arg(myHelpFileName)); } } diff --git a/src/SMESHGUI/SMESHGUI_ClippingDlg.cxx b/src/SMESHGUI/SMESHGUI_ClippingDlg.cxx index 6f2d9293e..1364b265d 100644 --- a/src/SMESHGUI/SMESHGUI_ClippingDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ClippingDlg.cxx @@ -264,31 +264,31 @@ void SMESHGUI_ClippingDlg::AddPlane (SMESH_Actor* theActor, vtkFloatingPointType aDel = aDataSet->GetLength()/2.0; vtkFloatingPointType aDelta[2][3] = {{aDir[0][0]*aDel, aDir[0][1]*aDel, aDir[0][2]*aDel}, - {aDir[1][0]*aDel, aDir[1][1]*aDel, aDir[1][2]*aDel}}; + {aDir[1][0]*aDel, aDir[1][1]*aDel, aDir[1][2]*aDel}}; vtkFloatingPointType aParam, aPnt0[3], aPnt1[3], aPnt2[3]; vtkFloatingPointType aPnt01[3] = {aPnt[0] - aDelta[0][0] - aDelta[1][0], - aPnt[1] - aDelta[0][1] - aDelta[1][1], - aPnt[2] - aDelta[0][2] - aDelta[1][2]}; + aPnt[1] - aDelta[0][1] - aDelta[1][1], + aPnt[2] - aDelta[0][2] - aDelta[1][2]}; vtkFloatingPointType aPnt02[3] = {aPnt01[0] + aNormal[0], - aPnt01[1] + aNormal[1], - aPnt01[2] + aNormal[2]}; + aPnt01[1] + aNormal[1], + aPnt01[2] + aNormal[2]}; vtkPlane::IntersectWithLine(aPnt01,aPnt02,aNormal,anOrigin,aParam,aPnt0); vtkFloatingPointType aPnt11[3] = {aPnt[0] - aDelta[0][0] + aDelta[1][0], - aPnt[1] - aDelta[0][1] + aDelta[1][1], - aPnt[2] - aDelta[0][2] + aDelta[1][2]}; + aPnt[1] - aDelta[0][1] + aDelta[1][1], + aPnt[2] - aDelta[0][2] + aDelta[1][2]}; vtkFloatingPointType aPnt12[3] = {aPnt11[0] + aNormal[0], - aPnt11[1] + aNormal[1], - aPnt11[2] + aNormal[2]}; + aPnt11[1] + aNormal[1], + aPnt11[2] + aNormal[2]}; vtkPlane::IntersectWithLine(aPnt11,aPnt12,aNormal,anOrigin,aParam,aPnt1); vtkFloatingPointType aPnt21[3] = {aPnt[0] + aDelta[0][0] - aDelta[1][0], - aPnt[1] + aDelta[0][1] - aDelta[1][1], - aPnt[2] + aDelta[0][2] - aDelta[1][2]}; + aPnt[1] + aDelta[0][1] - aDelta[1][1], + aPnt[2] + aDelta[0][2] - aDelta[1][2]}; vtkFloatingPointType aPnt22[3] = {aPnt21[0] + aNormal[0], - aPnt21[1] + aNormal[1], - aPnt21[2] + aNormal[2]}; + aPnt21[1] + aNormal[1], + aPnt21[2] + aNormal[2]}; vtkPlane::IntersectWithLine(aPnt21,aPnt22,aNormal,anOrigin,aParam,aPnt2); vtkPlaneSource* aPlaneSource = aPlane->myPlaneSource; @@ -555,17 +555,17 @@ void SMESHGUI_ClippingDlg::ClickOnHelp() if (app) app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); else { - QString platform; + QString platform; #ifdef WIN32 - platform = "winapplication"; + platform = "winapplication"; #else - platform = "application"; + platform = "application"; #endif SUIT_MessageBox::warning(this, tr("WRN_WARNING"), - tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", - platform)). - arg(myHelpFileName)); + tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", + platform)). + arg(myHelpFileName)); } } @@ -581,24 +581,24 @@ void SMESHGUI_ClippingDlg::onSelectionChanged() Handle(SALOME_InteractiveObject) IOS = aList.First(); myActor = SMESH::FindActorByEntry(IOS->getEntry()); if (myActor) { - std::for_each(myPlanes.begin(),myPlanes.end(),TSetVisiblity(false)); - myPlanes.clear(); - - vtkIdType anId = 0, anEnd = myActor->GetNumberOfClippingPlanes(); - for ( ; anId < anEnd; anId++) { - if (vtkImplicitFunction* aFunction = myActor->GetClippingPlane(anId)) { - if(OrientedPlane* aPlane = OrientedPlane::SafeDownCast(aFunction)){ - OrientedPlane* anOrientedPlane = OrientedPlane::New(aViewWindow); - SMESH::TVTKPlane aTVTKPlane(anOrientedPlane); - anOrientedPlane->Delete(); - aTVTKPlane->ShallowCopy(aPlane); - myPlanes.push_back(aTVTKPlane); - } - } - } - - std::for_each(myPlanes.begin(),myPlanes.end(), - TSetVisiblity(PreviewCheckBox->isChecked())); + std::for_each(myPlanes.begin(),myPlanes.end(),TSetVisiblity(false)); + myPlanes.clear(); + + vtkIdType anId = 0, anEnd = myActor->GetNumberOfClippingPlanes(); + for ( ; anId < anEnd; anId++) { + if (vtkImplicitFunction* aFunction = myActor->GetClippingPlane(anId)) { + if(OrientedPlane* aPlane = OrientedPlane::SafeDownCast(aFunction)){ + OrientedPlane* anOrientedPlane = OrientedPlane::New(aViewWindow); + SMESH::TVTKPlane aTVTKPlane(anOrientedPlane); + anOrientedPlane->Delete(); + aTVTKPlane->ShallowCopy(aPlane); + myPlanes.push_back(aTVTKPlane); + } + } + } + + std::for_each(myPlanes.begin(),myPlanes.end(), + TSetVisiblity(PreviewCheckBox->isChecked())); } } SMESH::RenderViewWindow(aViewWindow); @@ -840,31 +840,31 @@ void SMESHGUI_ClippingDlg::SetCurrentPlaneParam() vtkFloatingPointType aDel = aDataSet->GetLength()/2.0; vtkFloatingPointType aDelta[2][3] = {{aDir[0][0]*aDel, aDir[0][1]*aDel, aDir[0][2]*aDel}, - {aDir[1][0]*aDel, aDir[1][1]*aDel, aDir[1][2]*aDel}}; + {aDir[1][0]*aDel, aDir[1][1]*aDel, aDir[1][2]*aDel}}; vtkFloatingPointType aParam, aPnt0[3], aPnt1[3], aPnt2[3]; vtkFloatingPointType aPnt01[3] = {aPnt[0] - aDelta[0][0] - aDelta[1][0], - aPnt[1] - aDelta[0][1] - aDelta[1][1], - aPnt[2] - aDelta[0][2] - aDelta[1][2]}; + aPnt[1] - aDelta[0][1] - aDelta[1][1], + aPnt[2] - aDelta[0][2] - aDelta[1][2]}; vtkFloatingPointType aPnt02[3] = {aPnt01[0] + aNormal[0], - aPnt01[1] + aNormal[1], - aPnt01[2] + aNormal[2]}; + aPnt01[1] + aNormal[1], + aPnt01[2] + aNormal[2]}; vtkPlane::IntersectWithLine(aPnt01,aPnt02,aNormal,anOrigin,aParam,aPnt0); vtkFloatingPointType aPnt11[3] = {aPnt[0] - aDelta[0][0] + aDelta[1][0], - aPnt[1] - aDelta[0][1] + aDelta[1][1], - aPnt[2] - aDelta[0][2] + aDelta[1][2]}; + aPnt[1] - aDelta[0][1] + aDelta[1][1], + aPnt[2] - aDelta[0][2] + aDelta[1][2]}; vtkFloatingPointType aPnt12[3] = {aPnt11[0] + aNormal[0], - aPnt11[1] + aNormal[1], - aPnt11[2] + aNormal[2]}; + aPnt11[1] + aNormal[1], + aPnt11[2] + aNormal[2]}; vtkPlane::IntersectWithLine(aPnt11,aPnt12,aNormal,anOrigin,aParam,aPnt1); vtkFloatingPointType aPnt21[3] = {aPnt[0] + aDelta[0][0] - aDelta[1][0], - aPnt[1] + aDelta[0][1] - aDelta[1][1], - aPnt[2] + aDelta[0][2] - aDelta[1][2]}; + aPnt[1] + aDelta[0][1] - aDelta[1][1], + aPnt[2] + aDelta[0][2] - aDelta[1][2]}; vtkFloatingPointType aPnt22[3] = {aPnt21[0] + aNormal[0], - aPnt21[1] + aNormal[1], - aPnt21[2] + aNormal[2]}; + aPnt21[1] + aNormal[1], + aPnt21[2] + aNormal[2]}; vtkPlane::IntersectWithLine(aPnt21,aPnt22,aNormal,anOrigin,aParam,aPnt2); vtkPlaneSource* aPlaneSource = aPlane->myPlaneSource; diff --git a/src/SMESHGUI/SMESHGUI_ClippingDlg.h b/src/SMESHGUI/SMESHGUI_ClippingDlg.h index af9829762..ed92330f2 100644 --- a/src/SMESHGUI/SMESHGUI_ClippingDlg.h +++ b/src/SMESHGUI/SMESHGUI_ClippingDlg.h @@ -82,16 +82,16 @@ public: // used in SMESHGUI::restoreVisualParameters() to avoid // declaration of OrientedPlane outside of SMESHGUI_ClippingDlg.cxx static void AddPlane (SMESH_Actor* theActor, - SVTK_ViewWindow* theViewWindow, - SMESH::Orientation theOrientation, - double theDistance, - vtkFloatingPointType theAngle[2]); + SVTK_ViewWindow* theViewWindow, + SMESH::Orientation theOrientation, + double theDistance, + vtkFloatingPointType theAngle[2]); static void GetPlaneParam (SMESH_Actor* theActor, - int thePlaneIndex, - SMESH::Orientation& theOrientation, - double& theDistance, - vtkFloatingPointType* theAngle); + int thePlaneIndex, + SMESH::Orientation& theOrientation, + double& theDistance, + vtkFloatingPointType* theAngle); protected: void keyPressEvent( QKeyEvent* ); diff --git a/src/SMESHGUI/SMESHGUI_ConvToQuadOp.cxx b/src/SMESHGUI/SMESHGUI_ConvToQuadOp.cxx index 962b11abd..656b47463 100644 --- a/src/SMESHGUI/SMESHGUI_ConvToQuadOp.cxx +++ b/src/SMESHGUI/SMESHGUI_ConvToQuadOp.cxx @@ -185,7 +185,7 @@ bool SMESHGUI_ConvToQuadOp::onApply() { dlg()->show(); SUIT_MessageBox::warning( myDlg, - tr( "SMESH_WRN_WARNING" ), tr("MESH_IS_NOT_SELECTED") ); + tr( "SMESH_WRN_WARNING" ), tr("MESH_IS_NOT_SELECTED") ); return false; } @@ -196,7 +196,7 @@ bool SMESHGUI_ConvToQuadOp::onApply() if( CORBA::is_nil(mesh) ) { SUIT_MessageBox::warning( myDlg, - tr( "SMESH_WRN_WARNING" ), tr("REF_IS_NULL") ); + tr( "SMESH_WRN_WARNING" ), tr("REF_IS_NULL") ); return false; } @@ -210,7 +210,7 @@ bool SMESHGUI_ConvToQuadOp::onApply() { bool aParam = true; if( myDlg->IsEnabledCheck() ) - aParam = myDlg->IsMediumNdsOnGeom(); + aParam = myDlg->IsMediumNdsOnGeom(); aEditor->ConvertToQuadratic( aParam ); aResult = true; diff --git a/src/SMESHGUI/SMESHGUI_CreatePatternDlg.cxx b/src/SMESHGUI/SMESHGUI_CreatePatternDlg.cxx index e50b7048c..5ee6ade48 100755 --- a/src/SMESHGUI/SMESHGUI_CreatePatternDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_CreatePatternDlg.cxx @@ -193,11 +193,11 @@ QWidget* SMESHGUI_CreatePatternDlg::createMainFrame( QWidget* theParent ) // Connect signals and slots connect( myTypeGrp, SIGNAL( buttonClicked( int ) ), - this, SLOT( onTypeChanged( int ) ) ); + this, SLOT( onTypeChanged( int ) ) ); connect( myProjectChk, SIGNAL( toggled( bool ) ), - this, SLOT( onProject( bool ) ) ); + this, SLOT( onProject( bool ) ) ); connect( aSelBtn, SIGNAL( clicked() ), - this, SLOT( onSelBtnClicked() ) ); + this, SLOT( onSelBtnClicked() ) ); return aMainGrp; } @@ -274,11 +274,11 @@ void SMESHGUI_CreatePatternDlg::Init( const int theType ) // selection and SMESHGUI connect( mySelectionMgr, SIGNAL( currentSelectionChanged() ), - this, SLOT( onSelectionDone() ) ); + this, SLOT( onSelectionDone() ) ); connect( mySMESHGUI, SIGNAL( SignalDeactivateActiveDialog() ), - this, SLOT( onDeactivate() ) ); + this, SLOT( onDeactivate() ) ); connect( mySMESHGUI, SIGNAL( SignalCloseAllDialogs() ), - this, SLOT( onClose() ) ); + this, SLOT( onClose() ) ); mySwitch2d->setEnabled( theType == Type_2d ); mySwitch3d->setEnabled( theType == Type_3d ); @@ -342,8 +342,8 @@ bool SMESHGUI_CreatePatternDlg::isValid() { if ( myGeomObj->_is_nil() ) { SUIT_MessageBox::information( this, - tr( "SMESH_INSUFFICIENT_DATA" ), - tr( "SMESHGUI_INVALID_PARAMETERS" ) ); + tr( "SMESH_INSUFFICIENT_DATA" ), + tr( "SMESHGUI_INVALID_PARAMETERS" ) ); return false; } return true; @@ -406,13 +406,13 @@ void SMESHGUI_CreatePatternDlg::onSave() if ( aWritten != aLen ) { SUIT_MessageBox::information( this, - tr( "SMESH_ERROR" ), - tr( "ERROR_OF_SAVING" ) ); + tr( "SMESH_ERROR" ), + tr( "ERROR_OF_SAVING" ) ); } else { //SUIT_Application::getDesktop()->setSelectionModes(ActorSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ) ) - aViewWindow->SetSelectionMode( ActorSelection ); + aViewWindow->SetSelectionMode( ActorSelection ); disconnect( mySelectionMgr, 0, this, 0 ); disconnect( mySMESHGUI, 0, this, 0 ); mySMESHGUI->ResetState(); @@ -465,7 +465,7 @@ void SMESHGUI_CreatePatternDlg::onOk() else { //SUIT_Application::getDesktop()->setSelectionModes(ActorSelection); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ) ) - aViewWindow->SetSelectionMode( ActorSelection ); + aViewWindow->SetSelectionMode( ActorSelection ); disconnect( mySelectionMgr, 0, this, 0 ); disconnect( mySMESHGUI, 0, this, 0 ); mySMESHGUI->ResetState(); @@ -512,11 +512,11 @@ void SMESHGUI_CreatePatternDlg::onHelp() platform = "application"; #endif SUIT_MessageBox::warning( this, - tr( "WRN_WARNING" ), - tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ). - arg( app->resourceMgr()->stringValue( "ExternalBrowser", - platform ) ). - arg( myHelpFileName ) ); + tr( "WRN_WARNING" ), + tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ). + arg( app->resourceMgr()->stringValue( "ExternalBrowser", + platform ) ). + arg( myHelpFileName ) ); } } @@ -754,20 +754,20 @@ void SMESHGUI_CreatePatternDlg::activateSelection() if ( myType == Type_2d ) { mySelectionMgr->installFilter( new SMESH_NumberFilter( "SMESH", - TopAbs_SHAPE, - -1, - TopAbs_FACE ) ); + TopAbs_SHAPE, + -1, + TopAbs_FACE ) ); } else { TColStd_MapOfInteger aTypes; aTypes.Add( TopAbs_SHELL ); aTypes.Add( TopAbs_SOLID ); mySelectionMgr->installFilter( new SMESH_NumberFilter( "SMESH", - TopAbs_FACE, - 6, - aTypes, - GEOM::GEOM_Object::_nil(), - true ) ); + TopAbs_FACE, + 6, + aTypes, + GEOM::GEOM_Object::_nil(), + true ) ); } } diff --git a/src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.cxx b/src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.cxx index a9736fd61..c62b83711 100644 --- a/src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.cxx @@ -129,9 +129,9 @@ namespace SMESH typedef std::vector TVTKIds; void SetPosition(SMESH_Actor* theActor, - vtkIdType theType, - const TVTKIds& theIds, - bool theReset=true) + vtkIdType theType, + const TVTKIds& theIds, + bool theReset=true) { vtkUnstructuredGrid *aGrid = theActor->GetUnstructuredGrid(); myGrid->SetPoints(aGrid->GetPoints()); @@ -141,14 +141,14 @@ namespace SMESH vtkIdList *anIds = vtkIdList::New(); for (int i = 0, iEnd = theIds.size(); i < iEnd; i++) - anIds->InsertId(i,theIds[i]); + anIds->InsertId(i,theIds[i]); myGrid->InsertNextCell(theType,anIds); if(theIds.size()!=0){ - myGrid->InsertNextCell(theType,anIds); - myGrid->Modified(); + myGrid->InsertNextCell(theType,anIds); + myGrid->Modified(); } - + anIds->Delete(); SetVisibility(true); @@ -167,7 +167,7 @@ namespace SMESH ~TPolySimulation(){ if( myViewWindow ) - myViewWindow->RemoveActor(myPreviewActor); + myViewWindow->RemoveActor(myPreviewActor); myPreviewActor->Delete(); @@ -358,42 +358,42 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::ConstructorsClicked(int constructorId) { case 0 : { - if ( myActor ){ + if ( myActor ){ myActor->SetPointRepresentation(true); - } + } else SMESH::SetPointRepresentation(true); - if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(NodeSelection); - - AddButton->setEnabled(false); - RemoveButton->setEnabled(false); - TextLabelIds->setText( tr( "SMESH_ID_NODES" ) ); - myFacesByNodesLabel->show(); - myFacesByNodes->clear(); - myFacesByNodes->show(); - AddButton->show(); - RemoveButton->show(); - Preview->show(); - break; + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(NodeSelection); + + AddButton->setEnabled(false); + RemoveButton->setEnabled(false); + TextLabelIds->setText( tr( "SMESH_ID_NODES" ) ); + myFacesByNodesLabel->show(); + myFacesByNodes->clear(); + myFacesByNodes->show(); + AddButton->show(); + RemoveButton->show(); + Preview->show(); + break; } case 1 : { - if( myActor ){ - myActor->SetPointRepresentation(false); - } else { - SMESH::SetPointRepresentation(false); - } - if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(FaceSelection); - - TextLabelIds->setText( tr( "SMESH_ID_FACES" ) ); - myFacesByNodesLabel->hide(); - myFacesByNodes->hide(); - AddButton->hide(); - RemoveButton->hide(); - Preview->show(); - break; + if( myActor ){ + myActor->SetPointRepresentation(false); + } else { + SMESH::SetPointRepresentation(false); + } + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(FaceSelection); + + TextLabelIds->setText( tr( "SMESH_ID_FACES" ) ); + myFacesByNodesLabel->hide(); + myFacesByNodes->hide(); + AddButton->hide(); + RemoveButton->hide(); + Preview->show(); + break; } } @@ -425,71 +425,71 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::ClickOnApply() if(checkEditLine(false) == -1) {return;} busy = true; if (GetConstructorId() == 0) - { - SMESH::long_array_var anIdsOfNodes = new SMESH::long_array; - SMESH::long_array_var aQuantities = new SMESH::long_array; - - aQuantities->length( myFacesByNodes->count() ); - - TColStd_ListOfInteger aNodesIds; - - int aNbQuantities = 0; - for (int i = 0; i < myFacesByNodes->count(); i++ ) { - QStringList anIds = myFacesByNodes->item(i)->text().split( " ", QString::SkipEmptyParts ); - for (QStringList::iterator it = anIds.begin(); it != anIds.end(); ++it) - aNodesIds.Append( (*it).toInt() ); - - aQuantities[aNbQuantities++] = anIds.count(); - } - - anIdsOfNodes->length(aNodesIds.Extent()); - - int aNbIdsOfNodes = 0; - TColStd_ListIteratorOfListOfInteger It; - It.Initialize(aNodesIds); - for( ;It.More();It.Next()) - anIdsOfNodes[aNbIdsOfNodes++] = It.Value(); - - try{ - SUIT_OverrideCursor aWaitCursor; - SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor(); - aMeshEditor->AddPolyhedralVolume(anIdsOfNodes, aQuantities); - }catch(SALOME::SALOME_Exception& exc){ - INFOS("Follow exception was cought:\n\t"<length( myFacesByNodes->count() ); + + TColStd_ListOfInteger aNodesIds; + + int aNbQuantities = 0; + for (int i = 0; i < myFacesByNodes->count(); i++ ) { + QStringList anIds = myFacesByNodes->item(i)->text().split( " ", QString::SkipEmptyParts ); + for (QStringList::iterator it = anIds.begin(); it != anIds.end(); ++it) + aNodesIds.Append( (*it).toInt() ); + + aQuantities[aNbQuantities++] = anIds.count(); + } + + anIdsOfNodes->length(aNodesIds.Extent()); + + int aNbIdsOfNodes = 0; + TColStd_ListIteratorOfListOfInteger It; + It.Initialize(aNodesIds); + for( ;It.More();It.Next()) + anIdsOfNodes[aNbIdsOfNodes++] = It.Value(); + + try{ + SUIT_OverrideCursor aWaitCursor; + SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor(); + aMeshEditor->AddPolyhedralVolume(anIdsOfNodes, aQuantities); + }catch(SALOME::SALOME_Exception& exc){ + INFOS("Follow exception was cought:\n\t"<text().split( " ", QString::SkipEmptyParts ); - anIdsOfFaces->length(aListId.count()); - for ( int i = 0; i < aListId.count(); i++ ) - anIdsOfFaces[i] = aListId[i].toInt(); - - try{ - SUIT_OverrideCursor aWaitCursor; - SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor(); - aMeshEditor->AddPolyhedralVolumeByFaces(anIdsOfFaces); - }catch(SALOME::SALOME_Exception& exc){ - INFOS("Follow exception was cought:\n\t"<text().split( " ", QString::SkipEmptyParts ); + anIdsOfFaces->length(aListId.count()); + for ( int i = 0; i < aListId.count(); i++ ) + anIdsOfFaces[i] = aListId[i].toInt(); + + try{ + SUIT_OverrideCursor aWaitCursor; + SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor(); + aMeshEditor->AddPolyhedralVolumeByFaces(anIdsOfFaces); + }catch(SALOME::SALOME_Exception& exc){ + INFOS("Follow exception was cought:\n\t"<setSelectedObjects( aList ); SMESH::UpdateView(); if( myActor ){ - unsigned int anEntityMode = myActor->GetEntityMode(); - myActor->SetEntityMode(SMESH_Actor::eVolumes | anEntityMode); + unsigned int anEntityMode = myActor->GetEntityMode(); + myActor->SetEntityMode(SMESH_Actor::eVolumes | anEntityMode); } //ConstructorsClicked( GetConstructorId() ); busy = false; @@ -507,7 +507,7 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::ClickOnOk() ClickOnCancel(); } - + //================================================================================= // function : ClickOnCancel() // purpose : @@ -543,10 +543,10 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::ClickOnHelp() platform = "application"; #endif SUIT_MessageBox::warning(this, tr("WRN_WARNING"), - tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", - platform)). - arg(myHelpFileName)); + tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", + platform)). + arg(myHelpFileName)); } } @@ -570,67 +570,67 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::onTextChange(const QString& theNewText) if (GetConstructorId() == 0) { if ( aMesh ) { - TColStd_MapOfInteger newIndices; + TColStd_MapOfInteger newIndices; - QStringList aListId = theNewText.split( " ", QString::SkipEmptyParts ); - for ( int i = 0; i < aListId.count(); i++ ) { - const SMDS_MeshNode * n = aMesh->FindNode( aListId[ i ].toInt() ); - if ( n ) { - newIndices.Add(n->GetID()); - myNbOkElements++; - } - } + QStringList aListId = theNewText.split( " ", QString::SkipEmptyParts ); + for ( int i = 0; i < aListId.count(); i++ ) { + const SMDS_MeshNode * n = aMesh->FindNode( aListId[ i ].toInt() ); + if ( n ) { + newIndices.Add(n->GetID()); + myNbOkElements++; + } + } - mySelector->AddOrRemoveIndex( myActor->getIO(), newIndices, false ); + mySelector->AddOrRemoveIndex( myActor->getIO(), newIndices, false ); - if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->highlight( myActor->getIO(), true, true ); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->highlight( myActor->getIO(), true, true ); - if ( myNbOkElements>0 && aListId.count()>=3) - AddButton->setEnabled(true); - else - AddButton->setEnabled(false); + if ( myNbOkElements>0 && aListId.count()>=3) + AddButton->setEnabled(true); + else + AddButton->setEnabled(false); - displaySimulation(); + displaySimulation(); } } else if (GetConstructorId() == 1) { - myNbOkElements = 0; - buttonOk->setEnabled( false ); - buttonApply->setEnabled( false ); + myNbOkElements = 0; + buttonOk->setEnabled( false ); + buttonApply->setEnabled( false ); - // check entered ids of faces and hilight them - QStringList aListId; - if ( aMesh ) { - TColStd_MapOfInteger newIndices; + // check entered ids of faces and hilight them + QStringList aListId; + if ( aMesh ) { + TColStd_MapOfInteger newIndices; - aListId = theNewText.split( " ", QString::SkipEmptyParts ); - - for ( int i = 0; i < aListId.count(); i++ ) { - const SMDS_MeshElement * e = aMesh->FindElement( aListId[ i ].toInt() ); - if ( e ) { - newIndices.Add(e->GetID()); - myNbOkElements++; - } - } - - mySelector->AddOrRemoveIndex( myActor->getIO(), newIndices, false ); - if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->highlight( myActor->getIO(), true, true ); + aListId = theNewText.split( " ", QString::SkipEmptyParts ); + + for ( int i = 0; i < aListId.count(); i++ ) { + const SMDS_MeshElement * e = aMesh->FindElement( aListId[ i ].toInt() ); + if ( e ) { + newIndices.Add(e->GetID()); + myNbOkElements++; + } + } + + mySelector->AddOrRemoveIndex( myActor->getIO(), newIndices, false ); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->highlight( myActor->getIO(), true, true ); - if ( myNbOkElements ) { - if (aListId.count()>1){ - buttonOk->setEnabled( true ); - buttonApply->setEnabled( true ); - } - else{ - buttonOk->setEnabled( false ); - buttonApply->setEnabled( false ); - } - if(aListId.count()>1) - displaySimulation(); - } - } + if ( myNbOkElements ) { + if (aListId.count()>1){ + buttonOk->setEnabled( true ); + buttonApply->setEnabled( true ); + } + else{ + buttonOk->setEnabled( false ); + buttonApply->setEnabled( false ); + } + if(aListId.count()>1) + displaySimulation(); + } + } } busy = false; } @@ -749,13 +749,13 @@ int SMESHGUI_CreatePolyhedralVolumeDlg::checkEditLine(bool checkLast) case 0:{ // nodes const SMDS_MeshNode * aNode = aMesh->FindNode( aListId[ i ].toInt() ); if( !aNode ){ - SUIT_MessageBox::warning(this, - tr("SMESH_POLYEDRE_CREATE_ERROR"), - tr("The incorrect indices of nodes!")); - - myEditCurrentArgument->clear(); - myEditCurrentArgument->setText( aString ); - return -1; + SUIT_MessageBox::warning(this, + tr("SMESH_POLYEDRE_CREATE_ERROR"), + tr("The incorrect indices of nodes!")); + + myEditCurrentArgument->clear(); + myEditCurrentArgument->setText( aString ); + return -1; } break; @@ -764,24 +764,24 @@ int SMESHGUI_CreatePolyhedralVolumeDlg::checkEditLine(bool checkLast) bool aElemIsOK = true; const SMDS_MeshElement * aElem = aMesh->FindElement( aListId[ i ].toInt() ); if (!aElem) - { - aElemIsOK = false; - } + { + aElemIsOK = false; + } else - { - SMDSAbs_ElementType aType = aMesh->GetElementType( aElem->GetID(),true ); - if (aType != SMDSAbs_Face){ - aElemIsOK = false; - } - } + { + SMDSAbs_ElementType aType = aMesh->GetElementType( aElem->GetID(),true ); + if (aType != SMDSAbs_Face){ + aElemIsOK = false; + } + } if (!aElemIsOK){ - SUIT_MessageBox::warning(this, - tr("SMESH_POLYEDRE_CREATE_ERROR"), - tr("The incorrect indices of faces!")); - - myEditCurrentArgument->clear(); - myEditCurrentArgument->setText( aString ); - return -1; + SUIT_MessageBox::warning(this, + tr("SMESH_POLYEDRE_CREATE_ERROR"), + tr("The incorrect indices of faces!")); + + myEditCurrentArgument->clear(); + myEditCurrentArgument->setText( aString ); + return -1; } break; } @@ -804,66 +804,66 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::displaySimulation() vtkIdType aType = VTK_CONVEX_POINT_SET; SMDS_Mesh* aMesh = 0; if ( myActor ){ - aMesh = myActor->GetObject()->GetMesh(); + aMesh = myActor->GetObject()->GetMesh(); } if (GetConstructorId() == 0 && aMesh){ - if (!AddButton->isEnabled()){ - mySimulation->ResetGrid(true); - for (int i = 0; i < myFacesByNodes->count(); i++) { - QStringList anIds = myFacesByNodes->item(i)->text().split( " ", QString::SkipEmptyParts ); - SMESH::TPolySimulation::TVTKIds aVTKIds_faces; - for (QStringList::iterator it = anIds.begin(); it != anIds.end(); ++it){ - const SMDS_MeshNode* aNode = aMesh->FindNode( (*it).toInt() ); - if (!aNode) continue; - vtkIdType aId = myActor->GetObject()->GetNodeVTKId( (*it).toInt() ); - aVTKIds.push_back(aId); - aVTKIds_faces.push_back(aId); - } - if(!Preview->isChecked()){ - aType = VTK_POLYGON; - mySimulation->SetPosition(myActor, aType, aVTKIds_faces,false); - } - } - if(myFacesByNodes->count() == 0){ - mySimulation->SetVisibility(false); - } else { - mySimulation->SetVisibility(true); - } - if(Preview->isChecked()){ - mySimulation->SetPosition(myActor, aType, aVTKIds); - } - } else { - // add ids from edit line - QStringList anEditIds = myEditCurrentArgument->text().split( " ", QString::SkipEmptyParts ); - for ( int i = 0; i < anEditIds.count(); i++ ) - aVTKIds.push_back( myActor->GetObject()->GetNodeVTKId( anEditIds[ i ].toInt() )); - aType = VTK_POLYGON; - mySimulation->SetPosition(myActor, aType, aVTKIds); - } + if (!AddButton->isEnabled()){ + mySimulation->ResetGrid(true); + for (int i = 0; i < myFacesByNodes->count(); i++) { + QStringList anIds = myFacesByNodes->item(i)->text().split( " ", QString::SkipEmptyParts ); + SMESH::TPolySimulation::TVTKIds aVTKIds_faces; + for (QStringList::iterator it = anIds.begin(); it != anIds.end(); ++it){ + const SMDS_MeshNode* aNode = aMesh->FindNode( (*it).toInt() ); + if (!aNode) continue; + vtkIdType aId = myActor->GetObject()->GetNodeVTKId( (*it).toInt() ); + aVTKIds.push_back(aId); + aVTKIds_faces.push_back(aId); + } + if(!Preview->isChecked()){ + aType = VTK_POLYGON; + mySimulation->SetPosition(myActor, aType, aVTKIds_faces,false); + } + } + if(myFacesByNodes->count() == 0){ + mySimulation->SetVisibility(false); + } else { + mySimulation->SetVisibility(true); + } + if(Preview->isChecked()){ + mySimulation->SetPosition(myActor, aType, aVTKIds); + } + } else { + // add ids from edit line + QStringList anEditIds = myEditCurrentArgument->text().split( " ", QString::SkipEmptyParts ); + for ( int i = 0; i < anEditIds.count(); i++ ) + aVTKIds.push_back( myActor->GetObject()->GetNodeVTKId( anEditIds[ i ].toInt() )); + aType = VTK_POLYGON; + mySimulation->SetPosition(myActor, aType, aVTKIds); + } }else if(GetConstructorId() == 1 && aMesh){ - QStringList aListId = myEditCurrentArgument->text().split( " ", QString::SkipEmptyParts ); - for ( int i = 0; i < aListId.count(); i++ ) - { - const SMDS_MeshElement * anElem = aMesh->FindElement( aListId[ i ].toInt() ); - if ( !anElem ) continue; - SMDSAbs_ElementType aFaceType = aMesh->GetElementType( anElem->GetID(),true ); - if (aFaceType != SMDSAbs_Face) continue; - - SMDS_ElemIteratorPtr anIter = anElem->nodesIterator(); - SMESH::TPolySimulation::TVTKIds aVTKIds_faces; - while( anIter->more() ) - if ( const SMDS_MeshNode* aNode = (SMDS_MeshNode*)anIter->next() ){ - vtkIdType aId = myActor->GetObject()->GetNodeVTKId( aNode->GetID() ); - aVTKIds.push_back(aId); - aVTKIds_faces.push_back(aId); - } - if(!Preview->isChecked()){ - aType = VTK_POLYGON; - mySimulation->SetPosition(myActor, aType, aVTKIds_faces); - } - } - if(Preview->isChecked()) - mySimulation->SetPosition(myActor, aType, aVTKIds); + QStringList aListId = myEditCurrentArgument->text().split( " ", QString::SkipEmptyParts ); + for ( int i = 0; i < aListId.count(); i++ ) + { + const SMDS_MeshElement * anElem = aMesh->FindElement( aListId[ i ].toInt() ); + if ( !anElem ) continue; + SMDSAbs_ElementType aFaceType = aMesh->GetElementType( anElem->GetID(),true ); + if (aFaceType != SMDSAbs_Face) continue; + + SMDS_ElemIteratorPtr anIter = anElem->nodesIterator(); + SMESH::TPolySimulation::TVTKIds aVTKIds_faces; + while( anIter->more() ) + if ( const SMDS_MeshNode* aNode = (SMDS_MeshNode*)anIter->next() ){ + vtkIdType aId = myActor->GetObject()->GetNodeVTKId( aNode->GetID() ); + aVTKIds.push_back(aId); + aVTKIds_faces.push_back(aId); + } + if(!Preview->isChecked()){ + aType = VTK_POLYGON; + mySimulation->SetPosition(myActor, aType, aVTKIds_faces); + } + } + if(Preview->isChecked()) + mySimulation->SetPosition(myActor, aType, aVTKIds); } SMESH::UpdateView(); } diff --git a/src/SMESHGUI/SMESHGUI_DeleteGroupDlg.cxx b/src/SMESHGUI/SMESHGUI_DeleteGroupDlg.cxx index 6e2a106a2..1922e70de 100644 --- a/src/SMESHGUI/SMESHGUI_DeleteGroupDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_DeleteGroupDlg.cxx @@ -189,7 +189,7 @@ bool SMESHGUI_DeleteGroupDlg::isValid() { if (myListBox->count() == 0) { SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"), - tr("NO_SELECTED_GROUPS")); + tr("NO_SELECTED_GROUPS")); return false; } @@ -266,10 +266,10 @@ void SMESHGUI_DeleteGroupDlg::onHelp() platform = "application"; #endif SUIT_MessageBox::warning(this, tr("WRN_WARNING"), - tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", - platform)). - arg(myHelpFileName)); + tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", + platform)). + arg(myHelpFileName)); } } diff --git a/src/SMESHGUI/SMESHGUI_Displayer.cxx b/src/SMESHGUI/SMESHGUI_Displayer.cxx index 613fbb9e4..0b41a00d0 100644 --- a/src/SMESHGUI/SMESHGUI_Displayer.cxx +++ b/src/SMESHGUI/SMESHGUI_Displayer.cxx @@ -59,16 +59,16 @@ SALOME_Prs* SMESHGUI_Displayer::buildPresentation( const QString& entry, SALOME_ SUIT_ViewWindow* wnd = vtk_viewer->getViewManager()->getActiveView(); SMESH_Actor* anActor = SMESH::FindActorByEntry( wnd, entry.toLatin1().data() ); if( !anActor ) - anActor = SMESH::CreateActor( study()->studyDS(), entry.toLatin1().data(), true ); + anActor = SMESH::CreateActor( study()->studyDS(), entry.toLatin1().data(), true ); if( anActor ) { - SMESH::DisplayActor( wnd, anActor ); + SMESH::DisplayActor( wnd, anActor ); prs = LightApp_Displayer::buildPresentation( entry.toLatin1().data(), aViewFrame ); } if( prs ) - UpdatePrs( prs ); + UpdatePrs( prs ); else if( anActor ) - SMESH::RemoveActor( vtk_viewer->getViewManager()->getActiveView(), anActor ); + SMESH::RemoveActor( vtk_viewer->getViewManager()->getActiveView(), anActor ); } } diff --git a/src/SMESHGUI/SMESHGUI_EditMeshDlg.cxx b/src/SMESHGUI/SMESHGUI_EditMeshDlg.cxx index c8aa3710d..5c84c204b 100644 --- a/src/SMESHGUI/SMESHGUI_EditMeshDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_EditMeshDlg.cxx @@ -169,7 +169,7 @@ namespace SMESH } void SetPointsData ( SMDS_Mesh* theMesh, - TColStd_MapOfInteger & theNodesIdMap ) + TColStd_MapOfInteger & theNodesIdMap ) { vtkPoints* aPoints = vtkPoints::New(); aPoints->SetNumberOfPoints(theNodesIdMap.Extent()); @@ -177,9 +177,9 @@ namespace SMESH TColStd_MapIteratorOfMapOfInteger idIter( theNodesIdMap ); for( int i = 0; idIter.More(); idIter.Next(), i++ ) { - const SMDS_MeshNode* aNode = theMesh->FindNode(idIter.Key()); - aPoints->SetPoint( i, aNode->X(), aNode->Y(), aNode->Z() ); - myIDs.push_back(idIter.Key()); + const SMDS_MeshNode* aNode = theMesh->FindNode(idIter.Key()); + aPoints->SetPoint( i, aNode->X(), aNode->Y(), aNode->Z() ); + myIDs.push_back(idIter.Key()); } myIdGrid->SetPoints(aPoints); @@ -190,7 +190,7 @@ namespace SMESH } void SetElemsData( TColStd_MapOfInteger & theElemsIdMap, - std::list & aGrCentersXYZ ) + std::list & aGrCentersXYZ ) { vtkPoints* aPoints = vtkPoints::New(); aPoints->SetNumberOfPoints(theElemsIdMap.Extent()); @@ -198,14 +198,14 @@ namespace SMESH TColStd_MapIteratorOfMapOfInteger idIter( theElemsIdMap ); for( ; idIter.More(); idIter.Next() ) { - myIDs.push_back(idIter.Key()); + myIDs.push_back(idIter.Key()); } gp_XYZ aXYZ; std::list::iterator coordIt = aGrCentersXYZ.begin(); for( int i = 0; coordIt != aGrCentersXYZ.end(); coordIt++, i++ ) { - aXYZ = *coordIt; - aPoints->SetPoint( i, aXYZ.X(), aXYZ.Y(), aXYZ.Z() ); + aXYZ = *coordIt; + aPoints->SetPoint( i, aXYZ.X(), aXYZ.Y(), aXYZ.Z() ); } myIdGrid->SetPoints(aPoints); aPoints->Delete(); @@ -234,20 +234,20 @@ namespace SMESH myIsPointsLabeled = theIsPointsLabeled && myIdGrid->GetNumberOfPoints(); if ( myIsPointsLabeled ) { - myPointsNumDataSet->ShallowCopy(myIdGrid); - vtkDataSet *aDataSet = myPointsNumDataSet; - int aNbElem = myIDs.size(); - vtkIntArray *anArray = vtkIntArray::New(); - anArray->SetNumberOfValues( aNbElem ); - for ( int i = 0; i < aNbElem; i++ ) - anArray->SetValue( i, myIDs[i] ); - aDataSet->GetPointData()->SetScalars( anArray ); - anArray->Delete(); - myPtsMaskPoints->SetInput( aDataSet ); - myPointLabels->SetVisibility( theIsActorVisible ); + myPointsNumDataSet->ShallowCopy(myIdGrid); + vtkDataSet *aDataSet = myPointsNumDataSet; + int aNbElem = myIDs.size(); + vtkIntArray *anArray = vtkIntArray::New(); + anArray->SetNumberOfValues( aNbElem ); + for ( int i = 0; i < aNbElem; i++ ) + anArray->SetValue( i, myIDs[i] ); + aDataSet->GetPointData()->SetScalars( anArray ); + anArray->Delete(); + myPtsMaskPoints->SetInput( aDataSet ); + myPointLabels->SetVisibility( theIsActorVisible ); } else { - myPointLabels->SetVisibility( false ); + myPointLabels->SetVisibility( false ); } } @@ -270,7 +270,7 @@ namespace SMESH //myPtsSelectVisiblePoints->UnRegisterAllOutputs(); //vtk 5.0 porting myPtsSelectVisiblePoints->Delete(); - //myPtsMaskPoints->UnRegisterAllOutputs(); //vtk 5.0 porting + //myPtsMaskPoints->UnRegisterAllOutputs(); //vtk 5.0 porting myPtsMaskPoints->Delete(); myPointLabels->Delete(); @@ -282,8 +282,8 @@ namespace SMESH static const char * IconFirst[] = { "18 10 2 1", -" g None", -". g #000000", +" g None", +". g #000000", " . . ", " .. .. .. ", " .. ... ... ", @@ -300,7 +300,7 @@ static const char * IconFirst[] = { // purpose : //================================================================================= SMESHGUI_EditMeshDlg::SMESHGUI_EditMeshDlg (SMESHGUI* theModule, - int theAction) + int theAction) : QDialog(SMESH::GetDesktop(theModule)), mySMESHGUI(theModule), mySelectionMgr(SMESH::GetSelectionMgr(theModule)), @@ -327,9 +327,9 @@ SMESHGUI_EditMeshDlg::SMESHGUI_EditMeshDlg (SMESHGUI* theModule, /***************************************************************/ GroupConstructors = new QGroupBox(myAction == 1 ? - tr("SMESH_MERGE_ELEMENTS") : - tr("SMESH_MERGE_NODES"), - this); + tr("SMESH_MERGE_ELEMENTS") : + tr("SMESH_MERGE_NODES"), + this); QButtonGroup* ButtonGroup = new QButtonGroup(this); QHBoxLayout* GroupConstructorsLayout = new QHBoxLayout(GroupConstructors); @@ -362,9 +362,9 @@ SMESHGUI_EditMeshDlg::SMESHGUI_EditMeshDlg (SMESHGUI* theModule, /***************************************************************/ // Controls for coincident elements detecting GroupCoincident = new QGroupBox(myAction == 1 ? - tr("COINCIDENT_ELEMENTS") : - tr("COINCIDENT_NODES"), - this); + tr("COINCIDENT_ELEMENTS") : + tr("COINCIDENT_NODES"), + this); QGridLayout* GroupCoincidentLayout = new QGridLayout(GroupCoincident); GroupCoincidentLayout->setSpacing(SPACING); @@ -542,7 +542,7 @@ void SMESHGUI_EditMeshDlg::Init() // purpose : //================================================================================= void SMESHGUI_EditMeshDlg::FindGravityCenter(TColStd_MapOfInteger & theElemsIdMap, - std::list< gp_XYZ > & theGrCentersXYZ) + std::list< gp_XYZ > & theGrCentersXYZ) { if (!myActor) return; @@ -659,10 +659,10 @@ void SMESHGUI_EditMeshDlg::ClickOnHelp() platform = "application"; #endif SUIT_MessageBox::warning(this, tr("WRN_WARNING"), - tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", - platform)). - arg(myHelpFileName)); + tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", + platform)). + arg(myHelpFileName)); } } @@ -722,15 +722,15 @@ void SMESHGUI_EditMeshDlg::onDetect() switch (myAction) { case 0 : if(!mySubMeshOrGroup->_is_nil()) - aMeshEditor->FindCoincidentNodesOnPart(mySubMeshOrGroup, SpinBoxTolerance->GetValue(), aGroupsArray); + aMeshEditor->FindCoincidentNodesOnPart(mySubMeshOrGroup, SpinBoxTolerance->GetValue(), aGroupsArray); else - aMeshEditor->FindCoincidentNodes(SpinBoxTolerance->GetValue(), aGroupsArray); + aMeshEditor->FindCoincidentNodes(SpinBoxTolerance->GetValue(), aGroupsArray); break; case 1 : if(!mySubMeshOrGroup->_is_nil()) - aMeshEditor->FindEqualElements(mySubMeshOrGroup, aGroupsArray); + aMeshEditor->FindEqualElements(mySubMeshOrGroup, aGroupsArray); else - aMeshEditor->FindEqualElements(myMesh, aGroupsArray); + aMeshEditor->FindEqualElements(myMesh, aGroupsArray); break; } @@ -739,7 +739,7 @@ void SMESHGUI_EditMeshDlg::onDetect() QStringList anIDs; for (int j = 0; j < aGroup.length(); j++) - anIDs.append(QString::number(aGroup[j])); + anIDs.append(QString::number(aGroup[j])); ListCoincident->addItem(anIDs.join(" ")); } @@ -1044,11 +1044,11 @@ void SMESHGUI_EditMeshDlg::SelectionIntoArgument() if (myAction == 0) { SMESH::SetPointRepresentation(true); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(NodeSelection); + aViewWindow->SetSelectionMode(NodeSelection); } else if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(CellSelection); + aViewWindow->SetSelectionMode(CellSelection); } } diff --git a/src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.cxx b/src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.cxx index c68301016..2131b25e6 100644 --- a/src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.cxx @@ -354,9 +354,9 @@ SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* theMod connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(reject())); connect(ElementsLineEdit, SIGNAL(textChanged(const QString&)), - SLOT(onTextChange(const QString&))); + SLOT(onTextChange(const QString&))); connect(StartPointLineEdit, SIGNAL(textChanged(const QString&)), - SLOT(onTextChange(const QString&))); + SLOT(onTextChange(const QString&))); connect(MeshCheck, SIGNAL(toggled(bool)), SLOT(onSelectMesh())); @@ -440,19 +440,19 @@ void SMESHGUI_ExtrusionAlongPathDlg::ConstructorsClicked (int type) SMESH::SetPointRepresentation(false); if (MeshCheck->isChecked()) { if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(ActorSelection); + aViewWindow->SetSelectionMode(ActorSelection); mySelectionMgr->installFilter(myElementsFilter); } else { if (type == 0) - { - if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(EdgeSelection); - } + { + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(EdgeSelection); + } if (type == 1) - { - if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(FaceSelection); - } + { + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(FaceSelection); + } } } connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); @@ -492,16 +492,16 @@ bool SMESHGUI_ExtrusionAlongPathDlg::ClickOnApply() bool bOk; int j = 0; for (int i = 0; i < aListElementsId.count(); i++) { - long ind = aListElementsId[ i ].toLong(&bOk); - if (bOk) { - const SMDS_MeshElement* e = aMesh->FindElement(ind); - if (e) { - bool typeMatch = Elements1dRB->isChecked() && e->GetType() == SMDSAbs_Edge || - Elements2dRB->isChecked() && e->GetType() == SMDSAbs_Face; - if (typeMatch) - anElementsId[ j++ ] = ind; - } - } + long ind = aListElementsId[ i ].toLong(&bOk); + if (bOk) { + const SMDS_MeshElement* e = aMesh->FindElement(ind); + if (e) { + bool typeMatch = Elements1dRB->isChecked() && e->GetType() == SMDSAbs_Edge || + Elements2dRB->isChecked() && e->GetType() == SMDSAbs_Face; + if (typeMatch) + anElementsId[ j++ ] = ind; + } + } } anElementsId->length(j); } @@ -559,44 +559,44 @@ bool SMESHGUI_ExtrusionAlongPathDlg::ClickOnApply() /* if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() ) { if( MeshCheck->isChecked() ) { - if( GetConstructorId() == 0 ) - SMESH::ListOfGroups_var groups = - aMeshEditor->ExtrusionAlongPathObject1DMakeGroups(myIDSource, myPathMesh, - myPathShape, aNodeStart, - AnglesGrp->isChecked(), anAngles, - BasePointGrp->isChecked(), aBasePoint, retVal); - else - SMESH::ListOfGroups_var groups = - aMeshEditor->ExtrusionAlongPathObject2DMakeGroups(myIDSource, myPathMesh, - myPathShape, aNodeStart, - AnglesGrp->isChecked(), anAngles, - BasePointGrp->isChecked(), aBasePoint, retVal); + if( GetConstructorId() == 0 ) + SMESH::ListOfGroups_var groups = + aMeshEditor->ExtrusionAlongPathObject1DMakeGroups(myIDSource, myPathMesh, + myPathShape, aNodeStart, + AnglesGrp->isChecked(), anAngles, + BasePointGrp->isChecked(), aBasePoint, retVal); + else + SMESH::ListOfGroups_var groups = + aMeshEditor->ExtrusionAlongPathObject2DMakeGroups(myIDSource, myPathMesh, + myPathShape, aNodeStart, + AnglesGrp->isChecked(), anAngles, + BasePointGrp->isChecked(), aBasePoint, retVal); } else - SMESH::ListOfGroups_var groups = - aMeshEditor->ExtrusionAlongPathMakeGroups(anElementsId, myPathMesh, - myPathShape, aNodeStart, - AnglesGrp->isChecked(), anAngles, - BasePointGrp->isChecked(), aBasePoint, retVal); + SMESH::ListOfGroups_var groups = + aMeshEditor->ExtrusionAlongPathMakeGroups(anElementsId, myPathMesh, + myPathShape, aNodeStart, + AnglesGrp->isChecked(), anAngles, + BasePointGrp->isChecked(), aBasePoint, retVal); } else { if( MeshCheck->isChecked() ) { - if( GetConstructorId() == 0 ) - retVal = aMeshEditor->ExtrusionAlongPathObject1D(myIDSource, myPathMesh, - myPathShape, aNodeStart, - AnglesGrp->isChecked(), anAngles, - BasePointGrp->isChecked(), aBasePoint); - else - retVal = aMeshEditor->ExtrusionAlongPathObject2D(myIDSource, myPathMesh, - myPathShape, aNodeStart, - AnglesGrp->isChecked(), anAngles, - BasePointGrp->isChecked(), aBasePoint); + if( GetConstructorId() == 0 ) + retVal = aMeshEditor->ExtrusionAlongPathObject1D(myIDSource, myPathMesh, + myPathShape, aNodeStart, + AnglesGrp->isChecked(), anAngles, + BasePointGrp->isChecked(), aBasePoint); + else + retVal = aMeshEditor->ExtrusionAlongPathObject2D(myIDSource, myPathMesh, + myPathShape, aNodeStart, + AnglesGrp->isChecked(), anAngles, + BasePointGrp->isChecked(), aBasePoint); } else - retVal = aMeshEditor->ExtrusionAlongPath(anElementsId, myPathMesh, - myPathShape, aNodeStart, - AnglesGrp->isChecked(), anAngles, - BasePointGrp->isChecked(), aBasePoint); + retVal = aMeshEditor->ExtrusionAlongPath(anElementsId, myPathMesh, + myPathShape, aNodeStart, + AnglesGrp->isChecked(), anAngles, + BasePointGrp->isChecked(), aBasePoint); } */ @@ -606,17 +606,17 @@ bool SMESHGUI_ExtrusionAlongPathDlg::ClickOnApply() ElemType = SMESH::EDGE; if( !MeshCheck->isChecked() ) { SMESH::ListOfGroups_var groups = - aMeshEditor->ExtrusionAlongPathX(anElementsId, myPath, aNodeStart, AnglesGrp->isChecked(), - anAngles, LinearAnglesCheck->isChecked(), - BasePointGrp->isChecked(), aBasePoint, - NeedGroups, ElemType, retVal); + aMeshEditor->ExtrusionAlongPathX(anElementsId, myPath, aNodeStart, AnglesGrp->isChecked(), + anAngles, LinearAnglesCheck->isChecked(), + BasePointGrp->isChecked(), aBasePoint, + NeedGroups, ElemType, retVal); } else { SMESH::ListOfGroups_var groups = - aMeshEditor->ExtrusionAlongPathObjX(myIDSource, myPath, aNodeStart, AnglesGrp->isChecked(), - anAngles, LinearAnglesCheck->isChecked(), - BasePointGrp->isChecked(), aBasePoint, - NeedGroups, ElemType, retVal); + aMeshEditor->ExtrusionAlongPathObjX(myIDSource, myPath, aNodeStart, AnglesGrp->isChecked(), + anAngles, LinearAnglesCheck->isChecked(), + BasePointGrp->isChecked(), aBasePoint, + NeedGroups, ElemType, retVal); } @@ -628,33 +628,33 @@ bool SMESHGUI_ExtrusionAlongPathDlg::ClickOnApply() switch (retVal) { case SMESH::SMESH_MeshEditor::EXTR_NO_ELEMENTS: SUIT_MessageBox::warning(this, - tr("SMESH_ERROR"), - tr("NO_ELEMENTS_SELECTED")); + tr("SMESH_ERROR"), + tr("NO_ELEMENTS_SELECTED")); return false; break; case SMESH::SMESH_MeshEditor::EXTR_PATH_NOT_EDGE: SUIT_MessageBox::warning(this, - tr("SMESH_ERROR"), - tr("SELECTED_PATH_IS_NOT_EDGE")); + tr("SMESH_ERROR"), + tr("SELECTED_PATH_IS_NOT_EDGE")); return false; break; case SMESH::SMESH_MeshEditor::EXTR_BAD_PATH_SHAPE: SUIT_MessageBox::warning(this, - tr("SMESH_ERROR"), - tr("BAD_SHAPE_TYPE")); + tr("SMESH_ERROR"), + tr("BAD_SHAPE_TYPE")); return false; break; case SMESH::SMESH_MeshEditor::EXTR_BAD_STARTING_NODE: SUIT_MessageBox::warning(this, - tr("SMESH_ERROR"), - tr("EXTR_BAD_STARTING_NODE")); + tr("SMESH_ERROR"), + tr("EXTR_BAD_STARTING_NODE")); return false; break; case SMESH::SMESH_MeshEditor::EXTR_BAD_ANGLES_NUMBER: SUIT_MessageBox::warning(this, - tr("SMESH_ERROR"), - tr("WRONG_ANGLES_NUMBER")); + tr("SMESH_ERROR"), + tr("WRONG_ANGLES_NUMBER")); return false; break; case SMESH::SMESH_MeshEditor::EXTR_CANT_GET_TANGENT: SUIT_MessageBox::warning(this, - tr("SMESH_ERROR"), - tr("CANT_GET_TANGENT")); + tr("SMESH_ERROR"), + tr("CANT_GET_TANGENT")); return false; break; case SMESH::SMESH_MeshEditor::EXTR_OK: break; @@ -700,10 +700,10 @@ void SMESHGUI_ExtrusionAlongPathDlg::ClickOnHelp() platform = "application"; #endif SUIT_MessageBox::warning(this, tr("WRN_WARNING"), - tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", - platform)). - arg(myHelpFileName)); + tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", + platform)). + arg(myHelpFileName)); } } @@ -762,21 +762,21 @@ void SMESHGUI_ExtrusionAlongPathDlg::onTextChange (const QString& theNewText) const Handle(SALOME_InteractiveObject)& anIO = myMeshActor->getIO(); TColStd_MapOfInteger newIndices; for (int i = 0; i < aListId.count(); i++) { - long ind = aListId[ i ].toLong(&bOk); - if (bOk) { - const SMDS_MeshElement* e = aMesh->FindElement(ind); - if (e) { - // check also type of element - bool typeMatch = Elements1dRB->isChecked() && e->GetType() == SMDSAbs_Edge || - Elements2dRB->isChecked() && e->GetType() == SMDSAbs_Face; - if (typeMatch) - newIndices.Add(e->GetID()); - } - } + long ind = aListId[ i ].toLong(&bOk); + if (bOk) { + const SMDS_MeshElement* e = aMesh->FindElement(ind); + if (e) { + // check also type of element + bool typeMatch = Elements1dRB->isChecked() && e->GetType() == SMDSAbs_Edge || + Elements2dRB->isChecked() && e->GetType() == SMDSAbs_Face; + if (typeMatch) + newIndices.Add(e->GetID()); + } + } } mySelector->AddOrRemoveIndex(anIO, newIndices, false); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->highlight( anIO, true, true ); + aViewWindow->highlight( anIO, true, true ); } } else if (send == StartPointLineEdit && @@ -785,27 +785,27 @@ void SMESHGUI_ExtrusionAlongPathDlg::onTextChange (const QString& theNewText) SMESH_Actor* aPathActor = SMESH::FindActorByObject(myPath); SMDS_Mesh* aMesh = 0; if (aPathActor) - aMesh = aPathActor->GetObject()->GetMesh(); + aMesh = aPathActor->GetObject()->GetMesh(); if (aMesh) { - //mySelectionMgr->clearSelected(); - //mySelectionMgr->AddIObject(aPathActor->getIO()); + //mySelectionMgr->clearSelected(); + //mySelectionMgr->AddIObject(aPathActor->getIO()); SALOME_ListIO aList; aList.Append(aPathActor->getIO()); mySelectionMgr->setSelectedObjects(aList, false); - bool bOk; - long ind = theNewText.toLong(&bOk); - if (bOk) { - const SMDS_MeshNode* n = aMesh->FindNode(ind); - if (n) { - //if (!mySelectionMgr->IsIndexSelected(aPathActor->getIO(), n->GetID())) { + bool bOk; + long ind = theNewText.toLong(&bOk); + if (bOk) { + const SMDS_MeshNode* n = aMesh->FindNode(ind); + if (n) { + //if (!mySelectionMgr->IsIndexSelected(aPathActor->getIO(), n->GetID())) { TColStd_MapOfInteger newIndices; - newIndices.Add(n->GetID()); - mySelector->AddOrRemoveIndex( aPathActor->getIO(), newIndices, false ); - if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->highlight( aPathActor->getIO(), true, true ); - } - } + newIndices.Add(n->GetID()); + mySelector->AddOrRemoveIndex( aPathActor->getIO(), newIndices, false ); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->highlight( aPathActor->getIO(), true, true ); + } + } } } } @@ -929,10 +929,10 @@ void SMESHGUI_ExtrusionAlongPathDlg::SelectionIntoArgument() TopoDS_Vertex aVertex; if (!aGeomObj->_is_nil()) { if (aGeomObj->IsShape() && GEOMBase::GetShape(aGeomObj, aVertex) && !aVertex.IsNull()) { - gp_Pnt aPnt = BRep_Tool::Pnt(aVertex); - XSpin->SetValue(aPnt.X()); - YSpin->SetValue(aPnt.Y()); - ZSpin->SetValue(aPnt.Z()); + gp_Pnt aPnt = BRep_Tool::Pnt(aVertex); + XSpin->SetValue(aPnt.X()); + YSpin->SetValue(aPnt.Y()); + ZSpin->SetValue(aPnt.Z()); } return; } @@ -997,19 +997,19 @@ void SMESHGUI_ExtrusionAlongPathDlg::SetEditCurrentArgument (QToolButton* button SMESH::SetPointRepresentation(false); if (MeshCheck->isChecked()) { if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(ActorSelection); + aViewWindow->SetSelectionMode(ActorSelection); mySelectionMgr->installFilter(myElementsFilter); } else { if (Elements1dRB->isChecked()) - { - if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(EdgeSelection); - } + { + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(EdgeSelection); + } else if (Elements2dRB->isChecked()) - { - if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(FaceSelection); - } + { + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(FaceSelection); + } } } else if (button == SelectPathMeshButton) { myEditCurrentArgument = PathMeshLineEdit; @@ -1024,10 +1024,10 @@ void SMESHGUI_ExtrusionAlongPathDlg::SetEditCurrentArgument (QToolButton* button if (!myPath->_is_nil()) { SMESH_Actor* aPathActor = SMESH::FindActorByObject(myPath); if (aPathActor) { - SMESH::SetPointRepresentation(true); - if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(NodeSelection); - SMESH::SetPickable(aPathActor); + SMESH::SetPointRepresentation(true); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(NodeSelection); + SMESH::SetPickable(aPathActor); } } } @@ -1172,21 +1172,21 @@ bool SMESHGUI_ExtrusionAlongPathDlg::eventFilter (QObject* object, QEvent* event QKeyEvent* ke = (QKeyEvent*)event; if (object == AnglesList) { if (ke->key() == Qt::Key_Delete) - OnAngleRemoved(); + OnAngleRemoved(); } } else if (event->type() == QEvent::FocusIn) { if (object == ElementsLineEdit) { if (myEditCurrentArgument != ElementsLineEdit) - SetEditCurrentArgument(SelectElementsButton); + SetEditCurrentArgument(SelectElementsButton); } else if (object == StartPointLineEdit) { if (myEditCurrentArgument != StartPointLineEdit) - SetEditCurrentArgument(SelectStartPointButton); + SetEditCurrentArgument(SelectStartPointButton); } else if (object == XSpin->editor() || object == YSpin->editor() || object == ZSpin->editor()) { if (myEditCurrentArgument != XSpin) - SetEditCurrentArgument(SelectBasePointButton); + SetEditCurrentArgument(SelectBasePointButton); } } return QDialog::eventFilter(object, event); @@ -1216,8 +1216,8 @@ void SMESHGUI_ExtrusionAlongPathDlg::setFilters() { if(myMesh->_is_nil()) { SUIT_MessageBox::critical(this, - tr("SMESH_ERROR"), - tr("NO_MESH_SELECTED")); + tr("SMESH_ERROR"), + tr("NO_MESH_SELECTED")); return; } if ( !myFilterDlg ) @@ -1270,7 +1270,7 @@ void SMESHGUI_ExtrusionAlongPathDlg::updateLinearAngles() enableLinear = false; anItem->text().toDouble(&enableLinear); if( !enableLinear ) - break; + break; } } if( !enableLinear ) diff --git a/src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx b/src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx index beb2e3f24..7c32fc1e2 100644 --- a/src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx @@ -400,24 +400,24 @@ void SMESHGUI_ExtrusionDlg::ConstructorsClicked (int constructorId) { GroupArguments->setTitle(tr("EXTRUSION_1D")); if (!CheckBoxMesh->isChecked()) - { - LineEditElements->clear(); - myIDs.clear(); - if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(EdgeSelection); - } + { + LineEditElements->clear(); + myIDs.clear(); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(EdgeSelection); + } break; } case 1: { GroupArguments->setTitle(tr("EXTRUSION_2D")); if (!CheckBoxMesh->isChecked()) - { - LineEditElements->clear(); - myIDs.clear(); - if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(FaceSelection); - } + { + LineEditElements->clear(); + myIDs.clear(); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(FaceSelection); + } break; } } @@ -509,8 +509,8 @@ bool SMESHGUI_ExtrusionDlg::ClickOnApply() aParameters << SpinBox_Dz->text(); } else if ( RadioButton4->isChecked() ) { gp_XYZ aNormale(SpinBox_Vx->GetValue(), - SpinBox_Vy->GetValue(), - SpinBox_Vz->GetValue()); + SpinBox_Vy->GetValue(), + SpinBox_Vz->GetValue()); aNormale /= aNormale.Modulus(); @@ -536,26 +536,26 @@ bool SMESHGUI_ExtrusionDlg::ClickOnApply() if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() ) { if( CheckBoxMesh->isChecked() ) { - if( GetConstructorId() == 0 ) - SMESH::ListOfGroups_var groups = - aMeshEditor->ExtrusionSweepObject1DMakeGroups(mySelectedObject, aVector, aNbSteps); - else - SMESH::ListOfGroups_var groups = - aMeshEditor->ExtrusionSweepObject2DMakeGroups(mySelectedObject, aVector, aNbSteps); - } - else - SMESH::ListOfGroups_var groups = - aMeshEditor->ExtrusionSweepMakeGroups(myElementsId.inout(), aVector, aNbSteps); + if( GetConstructorId() == 0 ) + SMESH::ListOfGroups_var groups = + aMeshEditor->ExtrusionSweepObject1DMakeGroups(mySelectedObject, aVector, aNbSteps); + else + SMESH::ListOfGroups_var groups = + aMeshEditor->ExtrusionSweepObject2DMakeGroups(mySelectedObject, aVector, aNbSteps); + } + else + SMESH::ListOfGroups_var groups = + aMeshEditor->ExtrusionSweepMakeGroups(myElementsId.inout(), aVector, aNbSteps); } else { - if( CheckBoxMesh->isChecked() ) { - if( GetConstructorId() == 0 ) - aMeshEditor->ExtrusionSweepObject1D(mySelectedObject, aVector, aNbSteps); - else - aMeshEditor->ExtrusionSweepObject2D(mySelectedObject, aVector, aNbSteps); - } - else - aMeshEditor->ExtrusionSweep(myElementsId.inout(), aVector, aNbSteps); + if( CheckBoxMesh->isChecked() ) { + if( GetConstructorId() == 0 ) + aMeshEditor->ExtrusionSweepObject1D(mySelectedObject, aVector, aNbSteps); + else + aMeshEditor->ExtrusionSweepObject2D(mySelectedObject, aVector, aNbSteps); + } + else + aMeshEditor->ExtrusionSweep(myElementsId.inout(), aVector, aNbSteps); } myMesh->SetParameters( aParameters.join(":").toLatin1().constData() ); @@ -611,10 +611,10 @@ void SMESHGUI_ExtrusionDlg::ClickOnHelp() platform = "application"; #endif SUIT_MessageBox::warning(this, tr("WRN_WARNING"), - tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", - platform)). - arg(myHelpFileName)); + tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", + platform)). + arg(myHelpFileName)); } } @@ -666,7 +666,7 @@ void SMESHGUI_ExtrusionDlg::onTextChange (const QString& theNewText) myElementsId->length( myNbOkElements = newIndices.Extent() ); mySelector->AddOrRemoveIndex(myIO, newIndices, false); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->highlight( myIO, true, true ); + aViewWindow->highlight( myIO, true, true ); } } @@ -744,7 +744,7 @@ void SMESHGUI_ExtrusionDlg::SelectionIntoArgument() aNbElements = aMapIndex.Extent(); if (aNbElements < 1) - return; + return; myElementsId = new SMESH::long_array; myElementsId->length( aNbElements ); @@ -802,20 +802,20 @@ void SMESHGUI_ExtrusionDlg::SetEditCurrentArgument() myEditCurrentArgument = (QWidget*)LineEditElements; if (CheckBoxMesh->isChecked()) { if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(ActorSelection); + aViewWindow->SetSelectionMode(ActorSelection); mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter); } else { int aConstructorId = GetConstructorId(); if (aConstructorId == 0) - { - if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(EdgeSelection); - } + { + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(EdgeSelection); + } else if (aConstructorId == 1) - { - if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(FaceSelection); - } + { + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(FaceSelection); + } } } else if (send == SelectVectorButton){ @@ -930,13 +930,13 @@ void SMESHGUI_ExtrusionDlg::onSelectMesh (bool toSelectMesh) int aConstructorId = GetConstructorId(); if (aConstructorId == 0) { - if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(EdgeSelection); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(EdgeSelection); } else if (aConstructorId == 1) { - if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(FaceSelection); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(FaceSelection); } LineEditElements->setReadOnly(false); @@ -983,8 +983,8 @@ void SMESHGUI_ExtrusionDlg::setFilters() { if(myMesh->_is_nil()) { SUIT_MessageBox::critical(this, - tr("SMESH_ERROR"), - tr("NO_MESH_SELECTED")); + tr("SMESH_ERROR"), + tr("NO_MESH_SELECTED")); return; } if ( !myFilterDlg ) diff --git a/src/SMESHGUI/SMESHGUI_FilterDlg.cxx b/src/SMESHGUI/SMESHGUI_FilterDlg.cxx index c6b4b699f..b567f89a5 100755 --- a/src/SMESHGUI/SMESHGUI_FilterDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_FilterDlg.cxx @@ -210,7 +210,7 @@ bool SMESHGUI_FilterTable::AdditionalWidget::IsValid (const bool theMsg) const if (aWg->isEnabled() && aWg->validator()->validate(aText, p) != QValidator::Acceptable) { if (theMsg) SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"), - tr("SMESHGUI_INVALID_PARAMETERS")); + tr("SMESHGUI_INVALID_PARAMETERS")); return false; } } @@ -423,13 +423,13 @@ public: ~ComboDelegate(); QWidget* createEditor( QWidget*, const QStyleOptionViewItem&, - const QModelIndex& ) const; + const QModelIndex& ) const; void setEditorData( QWidget*, const QModelIndex& ) const; void setModelData( QWidget*, QAbstractItemModel*, const QModelIndex& ) const; void updateEditorGeometry( QWidget*, const QStyleOptionViewItem&, - const QModelIndex& ) const; + const QModelIndex& ) const; private: QTableWidget* myTable; }; @@ -445,8 +445,8 @@ SMESHGUI_FilterTable::ComboDelegate::~ComboDelegate() } QWidget* SMESHGUI_FilterTable::ComboDelegate::createEditor( QWidget* parent, - const QStyleOptionViewItem& option, - const QModelIndex& index ) const + const QStyleOptionViewItem& option, + const QModelIndex& index ) const { QStringList l = index.data( Qt::UserRole ).toStringList(); if ( !l.isEmpty() ) { @@ -459,7 +459,7 @@ QWidget* SMESHGUI_FilterTable::ComboDelegate::createEditor( QWidget* parent, } void SMESHGUI_FilterTable::ComboDelegate::setEditorData( QWidget* editor, - const QModelIndex& index ) const + const QModelIndex& index ) const { QString value = index.model()->data( index, Qt::DisplayRole ).toString(); QComboBox* cb = dynamic_cast( editor ); @@ -475,8 +475,8 @@ void SMESHGUI_FilterTable::ComboDelegate::setEditorData( QWidget* editor, } void SMESHGUI_FilterTable::ComboDelegate::setModelData( QWidget* editor, - QAbstractItemModel* model, - const QModelIndex& index) const + QAbstractItemModel* model, + const QModelIndex& index) const { QComboBox* cb = dynamic_cast( editor ); if ( cb ) model->setData( index, cb->currentText(), Qt::DisplayRole ); @@ -484,8 +484,8 @@ void SMESHGUI_FilterTable::ComboDelegate::setModelData( QWidget* editor, } void SMESHGUI_FilterTable::ComboDelegate::updateEditorGeometry( QWidget* editor, - const QStyleOptionViewItem& option, - const QModelIndex& index ) const + const QStyleOptionViewItem& option, + const QModelIndex& index ) const { editor->setGeometry( option.rect ); } @@ -597,8 +597,8 @@ bool SMESHGUI_FilterTable::Table::isEditable (int row, int col) const void SMESHGUI_FilterTable::Table::setReadOnly( bool on ) { setEditTriggers( on ? - QAbstractItemView::NoEditTriggers : - QAbstractItemView::AllEditTriggers ); + QAbstractItemView::NoEditTriggers : + QAbstractItemView::AllEditTriggers ); } bool SMESHGUI_FilterTable::Table::isReadOnly() const @@ -1031,10 +1031,10 @@ void SMESHGUI_FilterTable::GetCriterion (const int theRow, theCriterion.Threshold = (double)((ComboItem*)aTable->item(theRow, 2))->value(); else if ( aCriterionType != SMESH::FT_RangeOfIds && aCriterionType != SMESH::FT_BelongToGeom && - aCriterionType != SMESH::FT_BelongToPlane && - aCriterionType != SMESH::FT_BelongToCylinder && - aCriterionType != SMESH::FT_BelongToGenSurface && - aCriterionType != SMESH::FT_LyingOnGeom) + aCriterionType != SMESH::FT_BelongToPlane && + aCriterionType != SMESH::FT_BelongToCylinder && + aCriterionType != SMESH::FT_BelongToGenSurface && + aCriterionType != SMESH::FT_LyingOnGeom) { theCriterion.Compare = ((ComboItem*)aTable->item(theRow, 1))->value(); theCriterion.Threshold = aTable->item(theRow, 2)->text().toDouble(); @@ -1462,9 +1462,9 @@ void SMESHGUI_FilterTable::onCriterionChanged (const int row, const int col, con aText.toDouble(&isOk); aTable->item( row, 2 )->setText(isOk ? aText : QString("")); if (!aTable->isEditable(row, 1)) - aTable->setEditable(true, row, 1); + aTable->setEditable(true, row, 1); if (!aTable->isEditable(row, 2)) - aTable->setEditable(true, row, 2); + aTable->setEditable(true, row, 2); } } @@ -1781,7 +1781,7 @@ SMESHGUI_FilterTable::Table* SMESHGUI_FilterTable::createTable (QWidget* thePar } static int aLenCr = qAbs( aMaxLenCr - - aMetrics.width(tr("CRITERION"))) / aMetrics.width(' ') + 5; + aMetrics.width(tr("CRITERION"))) / aMetrics.width(' ') + 5; QString aCrStr; aCrStr.fill(' ', aLenCr); @@ -1811,10 +1811,10 @@ SMESHGUI_FilterTable::Table* SMESHGUI_FilterTable::createTable (QWidget* thePar aTable->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding)); connect(aTable, SIGNAL(cellChanged(int, int)), - this, SLOT(onCriterionChanged(int, int))); + this, SLOT(onCriterionChanged(int, int))); connect(aTable, SIGNAL(currentCellChanged(int, int, int, int)), - this, SLOT(onCurrentChanged(int, int))); + this, SLOT(onCurrentChanged(int, int))); return aTable; } @@ -1844,15 +1844,15 @@ void SMESHGUI_FilterTable::SetEditable (const bool isEditable) Table* aTable = anIter.value(); for (int i = 0, n = aTable->rowCount(); i < n; i++) for (int j = 0, m = aTable->columnCount(); j < m; j++) - { - QTableWidgetItem* anItem = aTable->item(i, j); - if ( dynamic_cast( anItem ) ) { - Qt::ItemFlags f = anItem->flags(); - if (!isEditable) f = f & ~Qt::ItemIsUserCheckable; - else f = f | Qt::ItemIsUserCheckable; - anItem->setFlags( f ); - } - } + { + QTableWidgetItem* anItem = aTable->item(i, j); + if ( dynamic_cast( anItem ) ) { + Qt::ItemFlags f = anItem->flags(); + if (!isEditable) f = f & ~Qt::ItemIsUserCheckable; + else f = f | Qt::ItemIsUserCheckable; + anItem->setFlags( f ); + } + } //end of IPAL19974 if (isEditable) @@ -2037,8 +2037,8 @@ void SMESHGUI_FilterTable::SetID( const int theRow, // Purpose : Get text and internal value from cell of ID value //======================================================================= bool SMESHGUI_FilterTable::GetID( const int theRow, - QString& theText, - const int theEntityType ) + QString& theText, + const int theEntityType ) { Table* aTable = myTables[ theEntityType == -1 ? GetType() : theEntityType ]; QTableWidgetItem* anItem = aTable->item( theRow, 5 ); @@ -2335,8 +2335,8 @@ void SMESHGUI_FilterDlg::Init (const QList& theTypes) mySetInViewer->setChecked(true); mySourceGrp->button(myApplyToState.contains(theTypes.first()) ? - myApplyToState[ theTypes.first() ] : - Selection)->setChecked(true); + myApplyToState[ theTypes.first() ] : + Selection)->setChecked(true); } //======================================================================= @@ -2410,10 +2410,10 @@ void SMESHGUI_FilterDlg::onHelp() platform = "application"; #endif SUIT_MessageBox::warning(this, tr("WRN_WARNING"), - tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", - platform)). - arg(myHelpFileName)); + tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", + platform)). + arg(myHelpFileName)); } } @@ -2568,7 +2568,7 @@ bool SMESHGUI_FilterDlg::isValid() const SMESH::GetActiveStudyDocument()->FindObjectByName(aName.toLatin1().constData(), "GEOM"); if (aList.size() == 0) { SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"), - tr("BAD_SHAPE_NAME").arg(aName)); + tr("BAD_SHAPE_NAME").arg(aName)); return false; } @@ -2584,26 +2584,26 @@ bool SMESHGUI_FilterDlg::isValid() const aFace.IsNull() || aFace.ShapeType() != TopAbs_FACE) { SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"), - tr("SHAPE_IS_NOT_A_FACE").arg(aName)); + tr("SHAPE_IS_NOT_A_FACE").arg(aName)); return false; } Handle(Geom_Surface) aSurf = BRep_Tool::Surface(TopoDS::Face(aFace)); if (aSurf.IsNull()) { SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"), - tr("SHAPE_IS_NOT_A_FACE").arg(aName)); + tr("SHAPE_IS_NOT_A_FACE").arg(aName)); return false; } if (aType == SMESH::FT_BelongToPlane && !aSurf->IsKind(STANDARD_TYPE(Geom_Plane))) { SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"), - tr("SHAPE_IS_NOT_A_PLANE").arg(aName)); + tr("SHAPE_IS_NOT_A_PLANE").arg(aName)); return false; } if (aType == SMESH::FT_BelongToCylinder && !aSurf->IsKind(STANDARD_TYPE(Geom_CylindricalSurface))) { SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"), - tr("SHAPE_IS_NOT_A_CYLINDER").arg(aName)); + tr("SHAPE_IS_NOT_A_CYLINDER").arg(aName)); return false; } } diff --git a/src/SMESHGUI/SMESHGUI_FilterDlg.h b/src/SMESHGUI/SMESHGUI_FilterDlg.h index 4380d54d8..e38b5b6cd 100755 --- a/src/SMESHGUI/SMESHGUI_FilterDlg.h +++ b/src/SMESHGUI/SMESHGUI_FilterDlg.h @@ -123,12 +123,12 @@ public: const int = -1 ); void SetID( const int, - const QString&, - const int = -1 ); + const QString&, + const int = -1 ); bool GetID( const int, - QString&, - const int = -1 ); + QString&, + const int = -1 ); void Update(); diff --git a/src/SMESHGUI/SMESHGUI_FilterLibraryDlg.cxx b/src/SMESHGUI/SMESHGUI_FilterLibraryDlg.cxx index 47c9e912c..9eb27ab6b 100644 --- a/src/SMESHGUI/SMESHGUI_FilterLibraryDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_FilterLibraryDlg.cxx @@ -226,7 +226,7 @@ QWidget* SMESHGUI_FilterLibraryDlg::createMainFrame (QWidget* theParent) connect(myOpenBtn, SIGNAL(clicked()), this, SLOT(onBrowse())); connect(myListBox, SIGNAL(itemSelectionChanged()), - this, SLOT(onFilterChanged())); + this, SLOT(onFilterChanged())); connect(myAddBtn, SIGNAL(clicked()), this, SLOT(onAddBtnPressed())); connect(myDeleteBtn, SIGNAL(clicked()), this, SLOT(onDeleteBtnPressed())); @@ -423,7 +423,7 @@ bool SMESHGUI_FilterLibraryDlg::onApply() if (myLibrary->_is_nil()) { SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_WRN_WARNING"), - tr("LIBRARY_IS_NOT_LOADED")); + tr("LIBRARY_IS_NOT_LOADED")); return false; } @@ -437,11 +437,11 @@ bool SMESHGUI_FilterLibraryDlg::onApply() } else if (myMode == EDIT || myMode == ADD_TO) { SMESH::Filter_var aFilter = createFilter(); if (!myListBox->selectedItems().empty() && - !myLibrary->Replace(myCurrFilterName.toLatin1().constData(), - myName->text().toLatin1().constData(), - aFilter.in())) { + !myLibrary->Replace(myCurrFilterName.toLatin1().constData(), + myName->text().toLatin1().constData(), + aFilter.in())) { SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"), - tr("ERROR_OF_EDITING")); + tr("ERROR_OF_EDITING")); aResult = false; } else @@ -457,7 +457,7 @@ bool SMESHGUI_FilterLibraryDlg::onApply() delete aFileName; } else if (myMode != COPY_FROM) { SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"), - tr("ERROR_OF_SAVING")); + tr("ERROR_OF_SAVING")); } else { } @@ -507,10 +507,10 @@ void SMESHGUI_FilterLibraryDlg::onHelp() platform = "application"; #endif SUIT_MessageBox::warning(this, tr("WRN_WARNING"), - tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", - platform)). - arg(myHelpFileName)); + tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", + platform)). + arg(myHelpFileName)); } } @@ -674,7 +674,7 @@ void SMESHGUI_FilterLibraryDlg::processNewLibrary() if (myLibrary->_is_nil()) { if (myMode == COPY_FROM) { SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"), - tr("ERROR_LOAD")); + tr("ERROR_LOAD")); return; } else { myLibrary = aFilterMgr->CreateLibrary(); @@ -730,7 +730,7 @@ bool SMESHGUI_FilterLibraryDlg::isNameValid(const bool theMess) const if (aCurrName.isEmpty()) { if (theMess) SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"), - tr("EMPTY_FILTER_NAME")); + tr("EMPTY_FILTER_NAME")); return false; } @@ -739,7 +739,7 @@ bool SMESHGUI_FilterLibraryDlg::isNameValid(const bool theMess) const if (aNames[ f ] == aCurrName && aNames[ f ] != myCurrFilterName) { if (theMess) SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"), - tr("ERROR_FILTER_NAME")); + tr("ERROR_FILTER_NAME")); return false; } } @@ -787,7 +787,7 @@ bool SMESHGUI_FilterLibraryDlg::isPermissionValid(const bool theIsExistingOnly) if (!isWritable) { SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_WRN_WARNING"), - tr("NO_PERMISSION")); + tr("NO_PERMISSION")); return false; } @@ -831,8 +831,8 @@ void SMESHGUI_FilterLibraryDlg::onFilterChanged() SMESH::Filter_var aFilter = createFilter(); myLibrary->Replace(myCurrFilterName.toLatin1().constData(), - myName->text().toLatin1().constData(), - aFilter); + myName->text().toLatin1().constData(), + aFilter); } // Fill table with filter parameters @@ -938,8 +938,8 @@ void SMESHGUI_FilterLibraryDlg::onAddBtnPressed() SMESH::Filter_var aFilter = createFilter(); myLibrary->Replace(myCurrFilterName.toLatin1().constData(), - myName->text().toLatin1().constData(), - aFilter); + myName->text().toLatin1().constData(), + aFilter); } myTable->Clear(myTable->GetType()); @@ -955,7 +955,7 @@ void SMESHGUI_FilterLibraryDlg::addFilterToLib (const QString& theName) { if (myLibrary->_is_nil()) { SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_WRN_WARNING"), - tr("LIBRARY_IS_NOT_LOADED")); + tr("LIBRARY_IS_NOT_LOADED")); return; } @@ -979,7 +979,7 @@ void SMESHGUI_FilterLibraryDlg::addFilterToLib (const QString& theName) if (!aResult) { SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"), - tr("ERROR_OF_ADDING")); + tr("ERROR_OF_ADDING")); } updateList(); @@ -989,7 +989,7 @@ void SMESHGUI_FilterLibraryDlg::addFilterToLib (const QString& theName) if (theName != aName) SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_WARNING"), - tr("ASSIGN_NEW_NAME").arg(theName).arg(aName)); + tr("ASSIGN_NEW_NAME").arg(theName).arg(aName)); } //======================================================================= @@ -1089,7 +1089,7 @@ void SMESHGUI_FilterLibraryDlg::onDeleteBtnPressed() { if (myLibrary->_is_nil()) { SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_WRN_WARNING"), - tr("LIBRARY_IS_NOT_LOADED")); + tr("LIBRARY_IS_NOT_LOADED")); return; } @@ -1097,7 +1097,7 @@ void SMESHGUI_FilterLibraryDlg::onDeleteBtnPressed() if (anIndex == -1 || !myLibrary->Delete(myCurrFilterName.toLatin1().constData())) { SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"), - tr("ERROR_OF_DELETING")); + tr("ERROR_OF_DELETING")); } else { myCurrFilterName = ""; myCurrFilter = -1; @@ -1188,8 +1188,8 @@ void SMESHGUI_FilterLibraryDlg::onNeedValidation() { SMESH::Filter_var aFilter = createFilter(myTable->GetType()); myLibrary->Replace(myCurrFilterName.toLatin1().constData(), - myName->text().toLatin1().constData(), - aFilter); + myName->text().toLatin1().constData(), + aFilter); } } } diff --git a/src/SMESHGUI/SMESHGUI_GEOMGenUtils.cxx b/src/SMESHGUI/SMESHGUI_GEOMGenUtils.cxx index 33907aec0..d3544b4d2 100644 --- a/src/SMESHGUI/SMESHGUI_GEOMGenUtils.cxx +++ b/src/SMESHGUI/SMESHGUI_GEOMGenUtils.cxx @@ -64,7 +64,7 @@ namespace SMESH SMESH::SMESH_subMesh_var aSubmesh = SObjectToInterface( theMeshOrSubmesh ); if ( !aSubmesh->_is_nil() ) - return aSubmesh->GetSubShape(); + return aSubmesh->GetSubShape(); } } return GEOM::GEOM_Object::_nil(); @@ -89,7 +89,7 @@ namespace SMESH SALOMEDS_SObject* aRefSO = _CAST(SObject,aRefSOClient); aMeshShape = GEOM::GEOM_Object::_narrow(aRefSO->GetObject()); } else { - SALOMEDS_SObject* aSO = _CAST(SObject,aSObject); + SALOMEDS_SObject* aSO = _CAST(SObject,aSObject); aMeshShape = GEOM::GEOM_Object::_narrow(aSO->GetObject()); } diff --git a/src/SMESHGUI/SMESHGUI_GroupDlg.cxx b/src/SMESHGUI/SMESHGUI_GroupDlg.cxx index 80e98c0cf..ddbfbc4ff 100644 --- a/src/SMESHGUI/SMESHGUI_GroupDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_GroupDlg.cxx @@ -103,7 +103,7 @@ // purpose : //================================================================================= SMESHGUI_GroupDlg::SMESHGUI_GroupDlg( SMESHGUI* theModule, - SMESH::SMESH_Mesh_ptr theMesh ) + SMESH::SMESH_Mesh_ptr theMesh ) : QDialog( SMESH::GetDesktop( theModule ) ), mySMESHGUI( theModule ), mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ), @@ -129,7 +129,7 @@ SMESHGUI_GroupDlg::SMESHGUI_GroupDlg( SMESHGUI* theModule, // purpose : //================================================================================= SMESHGUI_GroupDlg::SMESHGUI_GroupDlg( SMESHGUI* theModule, - SMESH::SMESH_GroupBase_ptr theGroup, + SMESH::SMESH_GroupBase_ptr theGroup, const bool theIsConvert ) : QDialog( SMESH::GetDesktop( theModule ) ), mySMESHGUI( theModule ), @@ -330,7 +330,7 @@ void SMESHGUI_GroupDlg::initDialog( bool create) QLabel* aColorLab = new QLabel(tr( "SMESH_CHECK_COLOR" ), aColorBox ); myColorBtn = new QtxColorButton(aColorBox); myColorBtn->setSizePolicy( QSizePolicy::MinimumExpanding, - myColorBtn->sizePolicy().verticalPolicy() ); + myColorBtn->sizePolicy().verticalPolicy() ); aColorBoxLayout->addWidget(aColorLab); aColorBoxLayout->addWidget(myColorBtn); @@ -693,36 +693,36 @@ void SMESHGUI_GroupDlg::setSelectionMode (int theMode) switch (theMode) { case 0: if (myActor) - myActor->SetPointRepresentation(true); - else - SMESH::SetPointRepresentation(true); - if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(NodeSelection); - break; + myActor->SetPointRepresentation(true); + else + SMESH::SetPointRepresentation(true); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(NodeSelection); + break; case 1: - if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(EdgeSelection); - break; + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(EdgeSelection); + break; case 2: - if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(FaceSelection); - break; + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(FaceSelection); + break; default: - if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(VolumeSelection); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(VolumeSelection); } } else { if (theMode == 4) - mySelectionMgr->installFilter(mySubMeshFilter); + mySelectionMgr->installFilter(mySubMeshFilter); else if (theMode == 5) - mySelectionMgr->installFilter(myGroupFilter); + mySelectionMgr->installFilter(myGroupFilter); else if (theMode == 6) - mySelectionMgr->installFilter(myMeshFilter); + mySelectionMgr->installFilter(myMeshFilter); else if (theMode == 7) - mySelectionMgr->installFilter(myGeomFilter); + mySelectionMgr->installFilter(myGeomFilter); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(ActorSelection); + aViewWindow->SetSelectionMode(ActorSelection); } mySelectionMode = theMode; } @@ -752,7 +752,7 @@ bool SMESHGUI_GroupDlg::onApply() if (myMesh->_is_nil()) return false; myGroup = myMesh->ConvertToStandalone( myGroupOnGeom ); - // nullify pointer, because object become dead + // nullify pointer, because object become dead myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil(); } } @@ -773,7 +773,7 @@ bool SMESHGUI_GroupDlg::onApply() int i, k = myElements->count(); anIdList->length(k); for (i = 0; i < k; i++) { - anIdList[i] = myElements->item(i)->text().toInt(); + anIdList[i] = myElements->item(i)->text().toInt(); } myGroup = SMESH::AddGroup(myMesh, aType, myName->text()); @@ -800,46 +800,46 @@ bool SMESHGUI_GroupDlg::onApply() _PTR(SObject) aMeshGroupSO = SMESH::FindSObject(myGroup); if(SMESH_Actor *anActor = SMESH::FindActorByEntry(aMeshGroupSO->GetID().c_str())) { - anActor->setName(myName->text().toLatin1().data()); - switch ( myTypeId ) { - case 0: anActor->SetNodeColor( aColor.R, aColor.G, aColor.B ); break; - case 1: anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B ); break; - case 2: - case 3: anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B ); break; - } + anActor->setName(myName->text().toLatin1().data()); + switch ( myTypeId ) { + case 0: anActor->SetNodeColor( aColor.R, aColor.G, aColor.B ); break; + case 1: anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B ); break; + case 2: + case 3: anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B ); break; + } } QList aAddList; int i, total = myElements->count(); for (i = 0; i < total; i++) { - int anId = myElements->item(i)->text().toInt(); - int idx = myIdList.indexOf(anId); - if ( idx == -1 ) - aAddList.append(anId); - else - myIdList.removeAt(idx); + int anId = myElements->item(i)->text().toInt(); + int idx = myIdList.indexOf(anId); + if ( idx == -1 ) + aAddList.append(anId); + else + myIdList.removeAt(idx); } if (!aAddList.empty()) { - SMESH::long_array_var anIdList = new SMESH::long_array; - int added = aAddList.count(); - anIdList->length(added); - for (i = 0; i < added; i++) - anIdList[i] = aAddList[i]; - myGroup->Add(anIdList.inout()); + SMESH::long_array_var anIdList = new SMESH::long_array; + int added = aAddList.count(); + anIdList->length(added); + for (i = 0; i < added; i++) + anIdList[i] = aAddList[i]; + myGroup->Add(anIdList.inout()); } if (!myIdList.empty()) { - SMESH::long_array_var anIdList = new SMESH::long_array; - int removed = myIdList.count(); - anIdList->length(removed); - for (i = 0; i < removed; i++) - anIdList[i] = myIdList[i]; - myGroup->Remove(anIdList.inout()); + SMESH::long_array_var anIdList = new SMESH::long_array; + int removed = myIdList.count(); + anIdList->length(removed); + for (i = 0; i < removed; i++) + anIdList[i] = myIdList[i]; + myGroup->Remove(anIdList.inout()); } /* init for next operation */ myIdList.clear(); for (i = 0; i < total; i++) { - myIdList.append(myElements->item(i)->text().toInt()); + myIdList.append(myElements->item(i)->text().toInt()); } } @@ -863,12 +863,12 @@ bool SMESHGUI_GroupDlg::onApply() _PTR(Study) aStudy = SMESH::GetActiveStudyDocument(); GEOM::GEOM_IGroupOperations_var aGroupOp = - SMESH::GetGEOMGen()->GetIGroupOperations(aStudy->StudyId()); + SMESH::GetGEOMGen()->GetIGroupOperations(aStudy->StudyId()); if (myGeomObjects->length() == 1) { - myGroupOnGeom = myMesh->CreateGroupFromGEOM(aType, - myName->text().toLatin1().data(), - myGeomObjects[0]); + myGroupOnGeom = myMesh->CreateGroupFromGEOM(aType, + myName->text().toLatin1().data(), + myGeomObjects[0]); } else { SMESH::SMESH_Gen_var aSMESHGen = SMESHGUI::GetSMESHGen(); @@ -910,12 +910,12 @@ bool SMESHGUI_GroupDlg::onApply() aNewGeomGroupName += myName->text(); SALOMEDS::SObject_var aNewGroupSO = geomGen->AddInStudy(aSMESHGen->GetCurrentStudy(), aGroupVar, - aNewGeomGroupName.toLatin1().data(), aMeshShape); + aNewGeomGroupName.toLatin1().data(), aMeshShape); } myGroupOnGeom = myMesh->CreateGroupFromGEOM(aType, - myName->text().toLatin1().data(), - aGroupVar); + myName->text().toLatin1().data(), + aGroupVar); } SALOMEDS::Color aColor = getGroupColor(); @@ -938,13 +938,13 @@ bool SMESHGUI_GroupDlg::onApply() _PTR(SObject) aMeshGroupSO = SMESH::FindSObject(myGroupOnGeom); if(SMESH_Actor *anActor = SMESH::FindActorByEntry(aMeshGroupSO->GetID().c_str())) { - anActor->setName(myName->text().toLatin1().data()); - switch ( myTypeId ) { - case 0: anActor->SetNodeColor( aColor.R, aColor.G, aColor.B ); break; - case 1: anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B ); break; - case 2: - case 3: anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B ); break; - } + anActor->setName(myName->text().toLatin1().data()); + switch ( myTypeId ) { + case 0: anActor->SetNodeColor( aColor.R, aColor.G, aColor.B ); break; + case 1: anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B ); break; + case 2: + case 3: anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B ); break; + } } } @@ -1026,7 +1026,7 @@ void SMESHGUI_GroupDlg::onObjectSelectionChanged() myGeomObjects->length(0); if (myGeomGroupBtn->isChecked()) - myGeomGroupBtn->setChecked(false); + myGeomGroupBtn->setChecked(false); if (!myCreate) myName->setText( "" ); @@ -1045,16 +1045,16 @@ void SMESHGUI_GroupDlg::onObjectSelectionChanged() Handle(SALOME_InteractiveObject) IO = aList.First(); if (myCreate) { - restoreShowEntityMode(); - myMesh = SMESH::IObjectToInterface(IO); + restoreShowEntityMode(); + myMesh = SMESH::IObjectToInterface(IO); setShowEntityMode(); updateGeomPopup(); if (myMesh->_is_nil()) - { + { updateButtons(); - myIsBusy = false; - return; - } + myIsBusy = false; + return; + } myGroup = SMESH::SMESH_Group::_nil(); // NPAL19389: create a group with a selection in another group @@ -1075,15 +1075,15 @@ void SMESHGUI_GroupDlg::onObjectSelectionChanged() else { SMESH::SMESH_GroupBase_var aGroup = SMESH::IObjectToInterface(IO); if (aGroup->_is_nil()) - { - myIsBusy = false; + { + myIsBusy = false; return; - } + } myIsBusy = false; myCurrentLineEdit = 0; - myGroup = SMESH::SMESH_Group::_nil(); - myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil(); + myGroup = SMESH::SMESH_Group::_nil(); + myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil(); init(aGroup); myIsBusy = true; @@ -1097,13 +1097,13 @@ void SMESHGUI_GroupDlg::onObjectSelectionChanged() if (myGrpTypeId == 0) { - if (myTypeId == -1) - onTypeChanged(0); - else - { - myElements->clear(); - setSelectionMode(myTypeId); - } + if (myTypeId == -1) + onTypeChanged(0); + else + { + myElements->clear(); + setSelectionMode(myTypeId); + } } myIsBusy = false; @@ -1119,10 +1119,10 @@ void SMESHGUI_GroupDlg::onObjectSelectionChanged() if (aNbSel == 0 || !aMeshSO) { - myGeomObjects->length(0); - updateButtons(); - myIsBusy = false; - return; + myGeomObjects->length(0); + updateButtons(); + myIsBusy = false; + return; } myGeomObjects->length(aNbSel); @@ -1181,10 +1181,10 @@ void SMESHGUI_GroupDlg::onObjectSelectionChanged() myGeomObjects->length(i); if ( i == 0 ) - { - myIsBusy = false; - return; - } + { + myIsBusy = false; + return; + } aNbSel = i; } @@ -1258,26 +1258,26 @@ void SMESHGUI_GroupDlg::onObjectSelectionChanged() QString aListStr = ""; int aNbItems = 0; if (myTypeId == 0) { - aNbItems = SMESH::GetNameOfSelectedNodes(mySelector, myActor->getIO(), aListStr); + aNbItems = SMESH::GetNameOfSelectedNodes(mySelector, myActor->getIO(), aListStr); } else { - aNbItems = SMESH::GetNameOfSelectedElements(mySelector, myActor->getIO(), aListStr); + aNbItems = SMESH::GetNameOfSelectedElements(mySelector, myActor->getIO(), aListStr); } if (aNbItems > 0) { - QListWidgetItem* anItem; - QList listItemsToSel; - QStringList anElements = aListStr.split( " ", QString::SkipEmptyParts); - for (QStringList::iterator it = anElements.begin(); it != anElements.end(); ++it) { - QList found = myElements->findItems(*it, Qt::MatchExactly); - foreach(anItem, found) - if (!anItem->isSelected()) - listItemsToSel.push_back(anItem); - } - bool blocked = myElements->signalsBlocked(); - myElements->blockSignals(true); - foreach(anItem, listItemsToSel) anItem->setSelected(true); - myElements->blockSignals(blocked); - onListSelectionChanged(); - listItemsToSel.clear(); + QListWidgetItem* anItem; + QList listItemsToSel; + QStringList anElements = aListStr.split( " ", QString::SkipEmptyParts); + for (QStringList::iterator it = anElements.begin(); it != anElements.end(); ++it) { + QList found = myElements->findItems(*it, Qt::MatchExactly); + foreach(anItem, found) + if (!anItem->isSelected()) + listItemsToSel.push_back(anItem); + } + bool blocked = myElements->signalsBlocked(); + myElements->blockSignals(true); + foreach(anItem, listItemsToSel) anItem->setSelected(true); + myElements->blockSignals(blocked); + onListSelectionChanged(); + listItemsToSel.clear(); } } } @@ -1413,8 +1413,8 @@ void SMESHGUI_GroupDlg::setFilters() { if(myMesh->_is_nil()) { SUIT_MessageBox::critical(this, - tr("SMESH_ERROR"), - tr("NO_MESH_SELECTED")); + tr("SMESH_ERROR"), + tr("NO_MESH_SELECTED")); return; } @@ -1511,18 +1511,18 @@ void SMESHGUI_GroupDlg::onAdd() if (aNbItems > 0) { QStringList anElements = aListStr.split( " ", QString::SkipEmptyParts); for (QStringList::iterator it = anElements.begin(); it != anElements.end(); ++it) { - QList found = myElements->findItems(*it, Qt::MatchExactly); - if (found.count() == 0) { - anItem = new QListWidgetItem(*it); - myElements->addItem(anItem); - if (!anItem->isSelected()) - listItemsToSel.push_back(anItem); - } - else { - foreach(anItem, found) - if (!anItem->isSelected()) - listItemsToSel.push_back(anItem); - } + QList found = myElements->findItems(*it, Qt::MatchExactly); + if (found.count() == 0) { + anItem = new QListWidgetItem(*it); + myElements->addItem(anItem); + if (!anItem->isSelected()) + listItemsToSel.push_back(anItem); + } + else { + foreach(anItem, found) + if (!anItem->isSelected()) + listItemsToSel.push_back(anItem); + } } bool blocked = myElements->signalsBlocked(); myElements->blockSignals(true); @@ -1542,8 +1542,8 @@ void SMESHGUI_GroupDlg::onAdd() SMESH::SMESH_subMesh_var aSubMesh = SMESH::IObjectToInterface(anIt.Value()); if (!aSubMesh->_is_nil()) { - // check if mesh is the same - if (aSubMesh->GetFather()->GetId() == myMesh->GetId()) { + // check if mesh is the same + if (aSubMesh->GetFather()->GetId() == myMesh->GetId()) { try { SMESH::long_array_var anElements = aSubMesh->GetElementsByType(aType); int k = anElements->length(); @@ -1553,21 +1553,21 @@ void SMESHGUI_GroupDlg::onAdd() if (found.count() == 0) { anItem = new QListWidgetItem(aText); myElements->addItem(anItem); - if (!anItem->isSelected()) - listItemsToSel.push_back(anItem); + if (!anItem->isSelected()) + listItemsToSel.push_back(anItem); + } + else { + foreach(anItem, found) + if (!anItem->isSelected()) + listItemsToSel.push_back(anItem); } - else { - foreach(anItem, found) - if (!anItem->isSelected()) - listItemsToSel.push_back(anItem); - } } - bool blocked = myElements->signalsBlocked(); - myElements->blockSignals(true); - foreach(anItem, listItemsToSel) anItem->setSelected(true); - myElements->blockSignals(blocked); - onListSelectionChanged(); - listItemsToSel.clear(); + bool blocked = myElements->signalsBlocked(); + myElements->blockSignals(true); + foreach(anItem, listItemsToSel) anItem->setSelected(true); + myElements->blockSignals(blocked); + onListSelectionChanged(); + listItemsToSel.clear(); } catch (const SALOME::SALOME_Exception& ex) { SalomeApp_Tools::QtCatchCorbaException(ex); @@ -1589,32 +1589,32 @@ void SMESHGUI_GroupDlg::onAdd() SMESH::SMESH_GroupBase_var aGroup = SMESH::IObjectToInterface(anIt.Value()); if (!aGroup->_is_nil()) { - // check if mesh is the same - if (aGroup->GetType() == aType && aGroup->GetMesh()->GetId() == myMesh->GetId()) { - SMESH::long_array_var anElements = aGroup->GetListOfID(); - int k = anElements->length(); - for (int i = 0; i < k; i++) { - QString aText = QString::number(anElements[i]); - QList found = myElements->findItems(aText, Qt::MatchExactly); - if (found.count() == 0) { - anItem = new QListWidgetItem(aText); - myElements->addItem(anItem); - if (!anItem->isSelected()) - listItemsToSel.push_back(anItem); - } - else { - foreach(anItem, found) - if (!anItem->isSelected()) - listItemsToSel.push_back(anItem); - } - } - bool blocked = myElements->signalsBlocked(); - myElements->blockSignals(true); - foreach(anItem, listItemsToSel) anItem->setSelected(true); - myElements->blockSignals(blocked); - onListSelectionChanged(); - listItemsToSel.clear(); - } + // check if mesh is the same + if (aGroup->GetType() == aType && aGroup->GetMesh()->GetId() == myMesh->GetId()) { + SMESH::long_array_var anElements = aGroup->GetListOfID(); + int k = anElements->length(); + for (int i = 0; i < k; i++) { + QString aText = QString::number(anElements[i]); + QList found = myElements->findItems(aText, Qt::MatchExactly); + if (found.count() == 0) { + anItem = new QListWidgetItem(aText); + myElements->addItem(anItem); + if (!anItem->isSelected()) + listItemsToSel.push_back(anItem); + } + else { + foreach(anItem, found) + if (!anItem->isSelected()) + listItemsToSel.push_back(anItem); + } + } + bool blocked = myElements->signalsBlocked(); + myElements->blockSignals(true); + foreach(anItem, listItemsToSel) anItem->setSelected(true); + myElements->blockSignals(blocked); + onListSelectionChanged(); + listItemsToSel.clear(); + } } } mySelectGroup->setChecked(false); @@ -1652,19 +1652,19 @@ void SMESHGUI_GroupDlg::onAdd() int k = anElements->length(); for (int i = 0; i < k; i++) { - QString aText = QString::number(anElements[i]); - QList found = myElements->findItems(aText, Qt::MatchExactly); - if (found.count() == 0) { - anItem = new QListWidgetItem(aText); - myElements->addItem(anItem); - if (!anItem->isSelected()) - listItemsToSel.push_back(anItem); - } - else { - foreach(anItem, found) - if (!anItem->isSelected()) - listItemsToSel.push_back(anItem); - } + QString aText = QString::number(anElements[i]); + QList found = myElements->findItems(aText, Qt::MatchExactly); + if (found.count() == 0) { + anItem = new QListWidgetItem(aText); + myElements->addItem(anItem); + if (!anItem->isSelected()) + listItemsToSel.push_back(anItem); + } + else { + foreach(anItem, found) + if (!anItem->isSelected()) + listItemsToSel.push_back(anItem); + } } bool blocked = myElements->signalsBlocked(); myElements->blockSignals(true); @@ -1717,42 +1717,42 @@ void SMESHGUI_GroupDlg::onRemove() SALOME_ListIteratorOfListIO anIt (aList); for ( ; anIt.More(); anIt.Next()) { - SMESH::SMESH_subMesh_var aSubMesh = SMESH::IObjectToInterface(anIt.Value()); - if (!aSubMesh->_is_nil()) { - // check if mesh is the same - if (aSubMesh->GetFather()->GetId() == myMesh->GetId()) { - if (aType == SMESH::NODE) { - try { - SMESH::long_array_var anElements = aSubMesh->GetNodesId(); - int k = anElements->length(); - for (int i = 0; i < k; i++) { - QList found = - myElements->findItems(QString::number(anElements[i]), Qt::MatchExactly); - QListWidgetItem* anItem; - foreach(anItem, found) delete anItem; - } - } - catch (const SALOME::SALOME_Exception& ex) { - SalomeApp_Tools::QtCatchCorbaException(ex); - } - } - else { - try { - SMESH::long_array_var anElements = aSubMesh->GetElementsId(); - int k = anElements->length(); - for (int i = 0; i < k; i++) { - QList found = - myElements->findItems(QString::number(anElements[i]), Qt::MatchExactly); - QListWidgetItem* anItem; - foreach(anItem, found) delete anItem; - } - } - catch (const SALOME::SALOME_Exception& ex) { - SalomeApp_Tools::QtCatchCorbaException(ex); - } - } - } - } + SMESH::SMESH_subMesh_var aSubMesh = SMESH::IObjectToInterface(anIt.Value()); + if (!aSubMesh->_is_nil()) { + // check if mesh is the same + if (aSubMesh->GetFather()->GetId() == myMesh->GetId()) { + if (aType == SMESH::NODE) { + try { + SMESH::long_array_var anElements = aSubMesh->GetNodesId(); + int k = anElements->length(); + for (int i = 0; i < k; i++) { + QList found = + myElements->findItems(QString::number(anElements[i]), Qt::MatchExactly); + QListWidgetItem* anItem; + foreach(anItem, found) delete anItem; + } + } + catch (const SALOME::SALOME_Exception& ex) { + SalomeApp_Tools::QtCatchCorbaException(ex); + } + } + else { + try { + SMESH::long_array_var anElements = aSubMesh->GetElementsId(); + int k = anElements->length(); + for (int i = 0; i < k; i++) { + QList found = + myElements->findItems(QString::number(anElements[i]), Qt::MatchExactly); + QListWidgetItem* anItem; + foreach(anItem, found) delete anItem; + } + } + catch (const SALOME::SALOME_Exception& ex) { + SalomeApp_Tools::QtCatchCorbaException(ex); + } + } + } + } } } else if (myCurrentLineEdit == myGroupLine) { @@ -1763,20 +1763,20 @@ void SMESHGUI_GroupDlg::onRemove() SALOME_ListIteratorOfListIO anIt (aList); for ( ; anIt.More(); anIt.Next()) { - SMESH::SMESH_Group_var aGroup = SMESH::IObjectToInterface(anIt.Value()); - if (aRes && !aGroup->_is_nil()) { - // check if mesh is the same - if (aGroup->GetType() == aType && aGroup->GetMesh()->GetId() == myMesh->GetId()) { - SMESH::long_array_var anElements = aGroup->GetListOfID(); - int k = anElements->length(); - for (int i = 0; i < k; i++) { - QList found = - myElements->findItems(QString::number(anElements[i]), Qt::MatchExactly); - QListWidgetItem* anItem; - foreach(anItem, found) delete anItem; - } - } - } + SMESH::SMESH_Group_var aGroup = SMESH::IObjectToInterface(anIt.Value()); + if (aRes && !aGroup->_is_nil()) { + // check if mesh is the same + if (aGroup->GetType() == aType && aGroup->GetMesh()->GetId() == myMesh->GetId()) { + SMESH::long_array_var anElements = aGroup->GetListOfID(); + int k = anElements->length(); + for (int i = 0; i < k; i++) { + QList found = + myElements->findItems(QString::number(anElements[i]), Qt::MatchExactly); + QListWidgetItem* anItem; + foreach(anItem, found) delete anItem; + } + } + } } } } @@ -1804,7 +1804,7 @@ void SMESHGUI_GroupDlg::onSort() int id = myElements->item(i)->text().toInt(); anArray[i] = id; if (myElements->item(i)->isSelected()) - aSelected.append(id); + aSelected.append(id); } // sort & update list std::sort(anArray.begin(), anArray.end()); @@ -1816,7 +1816,7 @@ void SMESHGUI_GroupDlg::onSort() anItem = new QListWidgetItem(QString::number(anArray[i])); myElements->addItem(anItem); if (aSelected.contains(anArray[i])) - listItemsToSel.push_back(anItem); + listItemsToSel.push_back(anItem); } bool blocked = myElements->signalsBlocked(); myElements->blockSignals(true); @@ -1875,10 +1875,10 @@ void SMESHGUI_GroupDlg::onHelp() platform = "application"; #endif SUIT_MessageBox::warning(this, tr( "WRN_WARNING" ), - tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ). - arg(app->resourceMgr()->stringValue( "ExternalBrowser", - platform)). - arg(myHelpFileName)); + tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ). + arg(app->resourceMgr()->stringValue( "ExternalBrowser", + platform)). + arg(myHelpFileName)); } } @@ -1979,7 +1979,7 @@ void SMESHGUI_GroupDlg::onGeomSelectionButton(bool isBtnOn) myCurrentLineEdit = myGeomGroupLine; QAction* a = myGeomPopup->exec( QCursor::pos() ); if (!a || myActions[a] == DIRECT_GEOM_INDEX) - setSelectionMode(7); + setSelectionMode(7); } else if (!isBtnOn) { @@ -1999,17 +1999,17 @@ void SMESHGUI_GroupDlg::onGeomPopup( QAction* a ) { mySelectionMode = -1; if ( !myShapeByMeshOp ) { - myShapeByMeshOp = new SMESHGUI_ShapeByMeshOp(true); - connect(myShapeByMeshOp, SIGNAL(committed(SUIT_Operation*)), - SLOT(onPublishShapeByMeshDlg(SUIT_Operation*))); - connect(myShapeByMeshOp, SIGNAL(aborted(SUIT_Operation*)), - SLOT(onCloseShapeByMeshDlg(SUIT_Operation*))); + myShapeByMeshOp = new SMESHGUI_ShapeByMeshOp(true); + connect(myShapeByMeshOp, SIGNAL(committed(SUIT_Operation*)), + SLOT(onPublishShapeByMeshDlg(SUIT_Operation*))); + connect(myShapeByMeshOp, SIGNAL(aborted(SUIT_Operation*)), + SLOT(onCloseShapeByMeshDlg(SUIT_Operation*))); } // set mesh object to SMESHGUI_ShapeByMeshOp and start it if ( !myMesh->_is_nil() ) { - myIsBusy = true; + myIsBusy = true; hide(); // stop processing selection - myIsBusy = false; + myIsBusy = false; myShapeByMeshOp->setModule( mySMESHGUI ); myShapeByMeshOp->setStudy( 0 ); // it's really necessary myShapeByMeshOp->SetMesh( myMesh ); @@ -2036,12 +2036,12 @@ void SMESHGUI_GroupDlg::onPublishShapeByMeshDlg(SUIT_Operation* op) QString ID = aGeomVar->GetStudyEntry(); _PTR(Study) aStudy = SMESH::GetActiveStudyDocument(); if ( _PTR(SObject) aGeomSO = aStudy->FindObjectID( ID.toLatin1().data() )) { - SALOME_ListIO anIOList; - Handle(SALOME_InteractiveObject) anIO = new SALOME_InteractiveObject - ( aGeomSO->GetID().c_str(), "SMESH", aGeomSO->GetName().c_str() ); - anIOList.Append( anIO ); - mySelectionMgr->setSelectedObjects( anIOList, false ); - onObjectSelectionChanged(); + SALOME_ListIO anIOList; + Handle(SALOME_InteractiveObject) anIO = new SALOME_InteractiveObject + ( aGeomSO->GetID().c_str(), "SMESH", aGeomSO->GetName().c_str() ); + anIOList.Append( anIO ); + mySelectionMgr->setSelectedObjects( anIOList, false ); + onObjectSelectionChanged(); } } } @@ -2069,8 +2069,8 @@ void SMESHGUI_GroupDlg::onCloseShapeByMeshDlg(SUIT_Operation* op) void SMESHGUI_GroupDlg::setGroupColor( const SALOMEDS::Color& theColor ) { QColor aQColor( (int)( theColor.R * 255.0 ), - (int)( theColor.G * 255.0 ), - (int)( theColor.B * 255.0 ) ); + (int)( theColor.G * 255.0 ), + (int)( theColor.B * 255.0 ) ); setGroupQColor( aQColor ); } @@ -2141,8 +2141,8 @@ void SMESHGUI_GroupDlg::setDefaultGroupColor() SALOMEDS::Color aColor = SMESHGUI::getUniqueColor( aReservedColors ); aQColor.setRgb( (int)( aColor.R * 255.0 ), - (int)( aColor.G * 255.0 ), - (int)( aColor.B * 255.0 ) ); + (int)( aColor.G * 255.0 ), + (int)( aColor.B * 255.0 ) ); } diff --git a/src/SMESHGUI/SMESHGUI_GroupOpDlg.cxx b/src/SMESHGUI/SMESHGUI_GroupOpDlg.cxx index 44cdfdf94..13f5f4a93 100644 --- a/src/SMESHGUI/SMESHGUI_GroupOpDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_GroupOpDlg.cxx @@ -131,7 +131,7 @@ QWidget* SMESHGUI_GroupOpDlg::createMainFrame( QWidget* theParent ) QLabel* aColorLab = new QLabel(tr( "SMESH_CHECK_COLOR" ), aColorBox ); myColorBtn = new QtxColorButton(aColorBox); myColorBtn->setSizePolicy( QSizePolicy::MinimumExpanding, - myColorBtn->sizePolicy().verticalPolicy() ); + myColorBtn->sizePolicy().verticalPolicy() ); aColorBoxLayout->addWidget(aColorLab); aColorBoxLayout->addWidget(myColorBtn); @@ -242,7 +242,7 @@ bool SMESHGUI_GroupOpDlg::isValid( const QList& theL if ( theListGrp.isEmpty() ) { SUIT_MessageBox::information( this, tr("SMESH_INSUFFICIENT_DATA"), - tr("INCORRECT_ARGUMENTS") ); + tr("INCORRECT_ARGUMENTS") ); return false; } @@ -289,14 +289,14 @@ bool SMESHGUI_GroupOpDlg::isValid( const QList& theL if ( aMeshId == -1 ) { SUIT_MessageBox::information(this, tr("SMESH_INSUFFICIENT_DATA"), - tr("DIFF_MESHES")); + tr("DIFF_MESHES")); return false; } if ( aGrpType == -1 ) { SUIT_MessageBox::information(this, tr("SMESH_INSUFFICIENT_DATA"), - tr("DIFF_TYPES")); + tr("DIFF_TYPES")); return false; } @@ -343,10 +343,10 @@ void SMESHGUI_GroupOpDlg::onHelp() platform = "application"; #endif SUIT_MessageBox::warning(this, tr("WRN_WARNING"), - tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", - platform)). - arg(myHelpFileName)); + tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", + platform)). + arg(myHelpFileName)); } } @@ -610,7 +610,7 @@ bool SMESHGUI_UnionGroupsDlg::onApply() else { SUIT_MessageBox::critical(this, tr("SMESH_ERROR"), - tr("SMESH_OPERATION_FAILED")); + tr("SMESH_OPERATION_FAILED")); return false; } } @@ -712,7 +712,7 @@ bool SMESHGUI_IntersectGroupsDlg::onApply() else { SUIT_MessageBox::critical(this, tr("SMESH_ERROR"), - tr("SMESH_OPERATION_FAILED")); + tr("SMESH_OPERATION_FAILED")); return false; } } @@ -878,7 +878,7 @@ bool SMESHGUI_CutGroupsDlg::onApply() else { SUIT_MessageBox::critical(this, tr("SMESH_ERROR"), - tr("SMESH_OPERATION_FAILED")); + tr("SMESH_OPERATION_FAILED")); return false; } } @@ -1029,7 +1029,7 @@ bool SMESHGUI_DimGroupDlg::onApply() else { SUIT_MessageBox::critical(this, tr("SMESH_ERROR"), - tr("SMESH_OPERATION_FAILED")); + tr("SMESH_OPERATION_FAILED")); return false; } } diff --git a/src/SMESHGUI/SMESHGUI_GroupUtils.cxx b/src/SMESHGUI/SMESHGUI_GroupUtils.cxx index e645257e2..6b4079b19 100644 --- a/src/SMESHGUI/SMESHGUI_GroupUtils.cxx +++ b/src/SMESHGUI/SMESHGUI_GroupUtils.cxx @@ -35,13 +35,13 @@ namespace SMESH { SMESH::SMESH_Group_var AddGroup( SMESH::SMESH_Mesh_ptr theMesh, - SMESH::ElementType theType, - const QString& theGroupName ) + SMESH::ElementType theType, + const QString& theGroupName ) { SMESH::SMESH_Group_var aGroup; try { if ( !theMesh->_is_nil() ) - aGroup = theMesh->CreateGroup( theType, theGroupName.toLatin1().data() ); + aGroup = theMesh->CreateGroup( theType, theGroupName.toLatin1().data() ); } catch( const SALOME::SALOME_Exception& S_ex ) { SalomeApp_Tools::QtCatchCorbaException( S_ex ); diff --git a/src/SMESHGUI/SMESHGUI_GroupUtils.h b/src/SMESHGUI/SMESHGUI_GroupUtils.h index e0673a783..0482e78c9 100644 --- a/src/SMESHGUI/SMESHGUI_GroupUtils.h +++ b/src/SMESHGUI/SMESHGUI_GroupUtils.h @@ -40,8 +40,8 @@ namespace SMESH { SMESHGUI_EXPORT SMESH::SMESH_Group_var AddGroup( SMESH::SMESH_Mesh_ptr, - SMESH::ElementType, - const QString& ); + SMESH::ElementType, + const QString& ); } #endif // SMESHGUI_GROUPUTILS_H diff --git a/src/SMESHGUI/SMESHGUI_Hypotheses.cxx b/src/SMESHGUI/SMESHGUI_Hypotheses.cxx index cd98e6b4e..8e9ff3973 100644 --- a/src/SMESHGUI/SMESHGUI_Hypotheses.cxx +++ b/src/SMESHGUI/SMESHGUI_Hypotheses.cxx @@ -68,7 +68,7 @@ void SMESHGUI_GenericHypothesisCreator::setInitParamsHypothesis(SMESH::SMESH_Hyp } void SMESHGUI_GenericHypothesisCreator::create( SMESH::SMESH_Hypothesis_ptr initParamsHyp, - const QString& theHypName, + const QString& theHypName, QWidget* parent, QObject* obj, const QString& slot ) { MESSAGE( "Creation of hypothesis with initial params" ); @@ -77,8 +77,8 @@ void SMESHGUI_GenericHypothesisCreator::create( SMESH::SMESH_Hypothesis_ptr init } void SMESHGUI_GenericHypothesisCreator::create( bool isAlgo, - const QString& theHypName, - QWidget* theParent, QObject* obj, const QString& slot ) + const QString& theHypName, + QWidget* theParent, QObject* obj, const QString& slot ) { MESSAGE( "Creation of hypothesis" ); @@ -97,8 +97,8 @@ void SMESHGUI_GenericHypothesisCreator::create( bool isAlgo, } void SMESHGUI_GenericHypothesisCreator::edit( SMESH::SMESH_Hypothesis_ptr theHypothesis, - const QString& theHypName, - QWidget* theParent, QObject* obj, const QString& slot ) + const QString& theHypName, + QWidget* theParent, QObject* obj, const QString& slot ) { if( CORBA::is_nil( theHypothesis ) ) return; @@ -111,8 +111,8 @@ void SMESHGUI_GenericHypothesisCreator::edit( SMESH::SMESH_Hypothesis_ptr theHyp } void SMESHGUI_GenericHypothesisCreator::editHypothesis( SMESH::SMESH_Hypothesis_ptr h, - const QString& theHypName, - QWidget* theParent, + const QString& theHypName, + QWidget* theParent, QObject* obj, const QString& slot ) { myHypName = theHypName; @@ -173,7 +173,7 @@ QFrame* SMESHGUI_GenericHypothesisCreator::buildStdFrame() case QVariant::Int: { SalomeApp_IntSpinBox* sb = new SalomeApp_IntSpinBox( GroupC1 ); - sb->setObjectName( (*anIt).myName ); + sb->setObjectName( (*anIt).myName ); attuneStdWidget( sb, i ); sb->setValue( (*anIt).myValue.toInt() ); connect( sb, SIGNAL( valueChanged( int ) ), this, SLOT( onValueChanged() ) ); @@ -183,7 +183,7 @@ QFrame* SMESHGUI_GenericHypothesisCreator::buildStdFrame() case QVariant::Double: { SalomeApp_DoubleSpinBox* sb = new SMESHGUI_SpinBox( GroupC1 ); - sb->setObjectName( (*anIt).myName ); + sb->setObjectName( (*anIt).myName ); attuneStdWidget( sb, i ); sb->setValue( (*anIt).myValue.toDouble() ); connect( sb, SIGNAL( valueChanged( double ) ), this, SLOT( onValueChanged() ) ); @@ -275,13 +275,13 @@ void SMESHGUI_GenericHypothesisCreator::onDialogFinished( int result ) if( listSOmesh.size() > 0 ) for( int i = 0; i < listSOmesh.size(); i++ ) { - _PTR(SObject) submSO = listSOmesh[i]; - SMESH::SMESH_Mesh_var aMesh = SMESH::SObjectToInterface( submSO ); - SMESH::SMESH_subMesh_var aSubMesh = SMESH::SObjectToInterface( submSO ); - if( !aSubMesh->_is_nil() ) - aMesh = aSubMesh->GetFather(); - _PTR(SObject) meshSO = SMESH::FindSObject( aMesh ); - SMESH::ModifiedMesh( meshSO, false, aMesh->NbNodes()==0); + _PTR(SObject) submSO = listSOmesh[i]; + SMESH::SMESH_Mesh_var aMesh = SMESH::SObjectToInterface( submSO ); + SMESH::SMESH_subMesh_var aSubMesh = SMESH::SObjectToInterface( submSO ); + if( !aSubMesh->_is_nil() ) + aMesh = aSubMesh->GetFather(); + _PTR(SObject) meshSO = SMESH::FindSObject( aMesh ); + SMESH::ModifiedMesh( meshSO, false, aMesh->NbNodes()==0); } } SMESHGUI::GetSMESHGUI()->updateObjBrowser( true, 0 ); @@ -630,10 +630,10 @@ void SMESHGUI_HypothesisDlg::onHelp() platform = "application"; #endif SUIT_MessageBox::warning(this, tr("WRN_WARNING"), - tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", - platform)). - arg(myHelpFileName)); + tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", + platform)). + arg(myHelpFileName)); } } @@ -648,18 +648,18 @@ void SMESHGUI_HypothesisDlg::setType( const QString& t ) } HypothesisData::HypothesisData( const QString& theTypeName, - const QString& thePluginName, - const QString& theServerLibName, - const QString& theClientLibName, - const QString& theLabel, - const QString& theIconId, - const QList& theDim, - const bool theIsAux, - const QStringList& theNeededHypos, - const QStringList& theOptionalHypos, - const QStringList& theInputTypes, - const QStringList& theOutputTypes, - const bool theIsNeedGeometry, + const QString& thePluginName, + const QString& theServerLibName, + const QString& theClientLibName, + const QString& theLabel, + const QString& theIconId, + const QList& theDim, + const bool theIsAux, + const QStringList& theNeededHypos, + const QStringList& theOptionalHypos, + const QStringList& theInputTypes, + const QStringList& theOutputTypes, + const bool theIsNeedGeometry, const bool supportSub) : TypeName( theTypeName ), PluginName( thePluginName ), @@ -685,8 +685,8 @@ HypothesesSet::HypothesesSet( const QString& theSetName ) } HypothesesSet::HypothesesSet( const QString& theSetName, - const QStringList& theHypoList, - const QStringList& theAlgoList ) + const QStringList& theHypoList, + const QStringList& theAlgoList ) : myHypoSetName( theSetName ), myHypoList( theHypoList ), myAlgoList( theAlgoList ), diff --git a/src/SMESHGUI/SMESHGUI_Hypotheses.h b/src/SMESHGUI/SMESHGUI_Hypotheses.h index 0372b092f..0891def1b 100644 --- a/src/SMESHGUI/SMESHGUI_Hypotheses.h +++ b/src/SMESHGUI/SMESHGUI_Hypotheses.h @@ -52,7 +52,7 @@ public: virtual ~SMESHGUI_GenericHypothesisCreator(); void create( SMESH::SMESH_Hypothesis_ptr, - const QString&, QWidget*, QObject*, const QString& ); + const QString&, QWidget*, QObject*, const QString& ); void create( bool, const QString&, QWidget*, QObject*, const QString& ); void edit( SMESH::SMESH_Hypothesis_ptr, const QString&, QWidget*, QObject*, const QString& ); void setInitParamsHypothesis(SMESH::SMESH_Hypothesis_ptr); @@ -105,7 +105,7 @@ protected: static QString stdParamValues( const ListOfStdParams& ); virtual void attuneStdWidget( QWidget*, const int ) const; virtual QWidget* getCustomWidget( const StdParam&, - QWidget*, const int ) const; + QWidget*, const int ) const; virtual bool getParamFromCustomWidget( StdParam&, QWidget* ) const; virtual void valueChanged( QWidget* ); virtual QString caption() const; @@ -166,7 +166,7 @@ public: const QList&, const bool, const QStringList&, const QStringList&, const QStringList&, const QStringList&, - const bool=true, const bool supportSub=false ); + const bool=true, const bool supportSub=false ); QString TypeName; //!< hypothesis type name QString PluginName; //!< plugin name diff --git a/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx b/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx index 6bfb02b6f..65a599579 100644 --- a/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx +++ b/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx @@ -89,39 +89,39 @@ namespace SMESH QList myListOfHypothesesSets; void processHypothesisStatus(const int theHypStatus, - SMESH::SMESH_Hypothesis_ptr theHyp, - const bool theIsAddition) + SMESH::SMESH_Hypothesis_ptr theHyp, + const bool theIsAddition) { if (theHypStatus > SMESH::HYP_OK) { // get Hyp name QString aHypName ("NULL Hypothesis"); if (!CORBA::is_nil(theHyp)) { - _PTR(SObject) Shyp = SMESH::FindSObject(theHyp); - if (Shyp) - // name in study - aHypName = Shyp->GetName().c_str(); - else - // label in xml file - aHypName = GetHypothesisData(theHyp->GetName())->Label; + _PTR(SObject) Shyp = SMESH::FindSObject(theHyp); + if (Shyp) + // name in study + aHypName = Shyp->GetName().c_str(); + else + // label in xml file + aHypName = GetHypothesisData(theHyp->GetName())->Label; } // message bool isFatal = (theHypStatus >= SMESH::HYP_UNKNOWN_FATAL); QString aMsg; if (theIsAddition) - aMsg = (isFatal ? "SMESH_CANT_ADD_HYP" : "SMESH_ADD_HYP_WRN"); + aMsg = (isFatal ? "SMESH_CANT_ADD_HYP" : "SMESH_ADD_HYP_WRN"); else - aMsg = (isFatal ? "SMESH_CANT_RM_HYP" : "SMESH_RM_HYP_WRN"); + aMsg = (isFatal ? "SMESH_CANT_RM_HYP" : "SMESH_RM_HYP_WRN"); aMsg = QObject::tr(aMsg.toLatin1().data()).arg(aHypName) + - QObject::tr(QString("SMESH_HYP_%1").arg(theHypStatus).toLatin1().data()); + QObject::tr(QString("SMESH_HYP_%1").arg(theHypStatus).toLatin1().data()); if ( theHypStatus == SMESH::HYP_HIDDEN_ALGO ) // PAL18501 aMsg = aMsg.arg( GetHypothesisData(theHyp->GetName())->Dim[0] ); SUIT_MessageBox::warning(SMESHGUI::desktop(), - QObject::tr("SMESH_WRN_WARNING"), - aMsg); + QObject::tr("SMESH_WRN_WARNING"), + aMsg); } } @@ -138,73 +138,73 @@ namespace SMESH QString HypsXml; char* cenv = getenv("SMESH_MeshersList"); if (cenv) - HypsXml.sprintf("%s", cenv); + HypsXml.sprintf("%s", cenv); QStringList HypsXmlList = HypsXml.split(":", QString::SkipEmptyParts); if (HypsXmlList.count() == 0) { - SUIT_MessageBox::critical(SMESHGUI::desktop(), - QObject::tr("SMESH_WRN_WARNING"), - QObject::tr("MESHERS_FILE_NO_VARIABLE")); - return; + SUIT_MessageBox::critical(SMESHGUI::desktop(), + QObject::tr("SMESH_WRN_WARNING"), + QObject::tr("MESHERS_FILE_NO_VARIABLE")); + return; } // loop on files in HypsXml QString aNoAccessFiles; for (int i = 0; i < HypsXmlList.count(); i++) { - QString HypsXml = HypsXmlList[ i ]; + QString HypsXml = HypsXmlList[ i ]; - // Find full path to the resource XML file - QString xmlFile = resMgr->path("resources", "SMESH", HypsXml + ".xml"); + // Find full path to the resource XML file + QString xmlFile = resMgr->path("resources", "SMESH", HypsXml + ".xml"); if ( xmlFile.isEmpty() ) // try PLUGIN resources xmlFile = resMgr->path("resources", HypsXml, HypsXml + ".xml"); - QFile file (xmlFile); - if (file.exists() && file.open(QIODevice::ReadOnly)) { - file.close(); - - SMESHGUI_XmlHandler* aXmlHandler = new SMESHGUI_XmlHandler(); - ASSERT(aXmlHandler); - - QXmlInputSource source (&file); - QXmlSimpleReader reader; - reader.setContentHandler(aXmlHandler); - reader.setErrorHandler(aXmlHandler); - bool ok = reader.parse(source); - file.close(); - if (ok) { - myHypothesesMap.unite( aXmlHandler->myHypothesesMap ); + QFile file (xmlFile); + if (file.exists() && file.open(QIODevice::ReadOnly)) { + file.close(); + + SMESHGUI_XmlHandler* aXmlHandler = new SMESHGUI_XmlHandler(); + ASSERT(aXmlHandler); + + QXmlInputSource source (&file); + QXmlSimpleReader reader; + reader.setContentHandler(aXmlHandler); + reader.setErrorHandler(aXmlHandler); + bool ok = reader.parse(source); + file.close(); + if (ok) { + myHypothesesMap.unite( aXmlHandler->myHypothesesMap ); myAlgorithmsMap.unite( aXmlHandler->myAlgorithmsMap ); - QList::iterator it, pos = myListOfHypothesesSets.begin(); - for ( it = aXmlHandler->myListOfHypothesesSets.begin(); - it != aXmlHandler->myListOfHypothesesSets.end(); - ++it ) { - myListOfHypothesesSets.insert( pos, *it ); - } - } - else { - SUIT_MessageBox::critical(SMESHGUI::desktop(), - QObject::tr("INF_PARSE_ERROR"), - QObject::tr(aXmlHandler->errorProtocol().toLatin1().data())); - } + QList::iterator it, pos = myListOfHypothesesSets.begin(); + for ( it = aXmlHandler->myListOfHypothesesSets.begin(); + it != aXmlHandler->myListOfHypothesesSets.end(); + ++it ) { + myListOfHypothesesSets.insert( pos, *it ); + } + } + else { + SUIT_MessageBox::critical(SMESHGUI::desktop(), + QObject::tr("INF_PARSE_ERROR"), + QObject::tr(aXmlHandler->errorProtocol().toLatin1().data())); + } delete aXmlHandler; - } - else { - if (aNoAccessFiles.isEmpty()) - aNoAccessFiles = xmlFile; - else - aNoAccessFiles += ", " + xmlFile; - } + } + else { + if (aNoAccessFiles.isEmpty()) + aNoAccessFiles = xmlFile; + else + aNoAccessFiles += ", " + xmlFile; + } } // end loop if (!aNoAccessFiles.isEmpty()) { - QString aMess = QObject::tr("MESHERS_FILE_CANT_OPEN") + " " + aNoAccessFiles + "\n"; - aMess += QObject::tr("MESHERS_FILE_CHECK_VARIABLE"); - wc.suspend(); - SUIT_MessageBox::warning(SMESHGUI::desktop(), - QObject::tr("SMESH_WRN_WARNING"), - aMess); - wc.resume(); + QString aMess = QObject::tr("MESHERS_FILE_CANT_OPEN") + " " + aNoAccessFiles + "\n"; + aMess += QObject::tr("MESHERS_FILE_CHECK_VARIABLE"); + wc.suspend(); + SUIT_MessageBox::warning(SMESHGUI::desktop(), + QObject::tr("SMESH_WRN_WARNING"), + aMess); + wc.resume(); } } } @@ -226,13 +226,13 @@ namespace SMESH for ( anIter = pMap.begin(); anIter != pMap.end(); anIter++ ) { HypothesisData* aData = anIter.value(); if ( ( theDim < 0 || aData->Dim.contains( theDim ) ) && aData->IsAux == isAux) { - if (checkGeometry) { - if (aData->IsNeedGeometry == isNeedGeometry) - aHypList.append(anIter.key()); - } - else { - aHypList.append(anIter.key()); - } + if (checkGeometry) { + if (aData->IsNeedGeometry == isNeedGeometry) + aHypList.append(anIter.key()); + } + else { + aHypList.append(anIter.key()); + } } } return aHypList; @@ -248,11 +248,11 @@ namespace SMESH QList::iterator hypoSet; for ( hypoSet = myListOfHypothesesSets.begin(); - hypoSet != myListOfHypothesesSets.end(); - ++hypoSet ) { + hypoSet != myListOfHypothesesSets.end(); + ++hypoSet ) { HypothesesSet* aSet = *hypoSet; if ( aSet && aSet->count( true ) ) { - aSetNameList.append( aSet->name() ); + aSetNameList.append( aSet->name() ); } } @@ -263,11 +263,11 @@ namespace SMESH { QList::iterator hypoSet; for ( hypoSet = myListOfHypothesesSets.begin(); - hypoSet != myListOfHypothesesSets.end(); - ++hypoSet ) { + hypoSet != myListOfHypothesesSets.end(); + ++hypoSet ) { HypothesesSet* aSet = *hypoSet; if ( aSet && aSet->name() == theSetName ) - return aSet; + return aSet; } return 0; } @@ -347,48 +347,48 @@ namespace SMESH // 3. Load Client Plugin Library try { - // load plugin library - if(MYDEBUG) MESSAGE("Loading client meshers plugin library ..."); - LibHandle libHandle = LoadLib( aClientLibName.toLatin1().data() ); - if (!libHandle) { - // report any error, if occured - if ( MYDEBUG ) { + // load plugin library + if(MYDEBUG) MESSAGE("Loading client meshers plugin library ..."); + LibHandle libHandle = LoadLib( aClientLibName.toLatin1().data() ); + if (!libHandle) { + // report any error, if occured + if ( MYDEBUG ) { #ifdef WIN32 - const char* anError = "Can't load client meshers plugin library"; + const char* anError = "Can't load client meshers plugin library"; #else - const char* anError = dlerror(); + const char* anError = dlerror(); #endif - MESSAGE(anError); - } - } - else { - // get method, returning hypothesis creator - if(MYDEBUG) MESSAGE("Find GetHypothesisCreator() method ..."); - typedef SMESHGUI_GenericHypothesisCreator* (*GetHypothesisCreator) \ - ( const QString& ); - GetHypothesisCreator procHandle = - (GetHypothesisCreator)GetProc(libHandle, "GetHypothesisCreator"); - if (!procHandle) { - if(MYDEBUG) MESSAGE("bad hypothesis client plugin library"); - UnLoadLib(libHandle); - } - else { - // get hypothesis creator - if(MYDEBUG) MESSAGE("Get Hypothesis Creator for " << aHypType.toLatin1().data()); - aCreator = procHandle( aHypType ); - if (!aCreator) { - if(MYDEBUG) MESSAGE("no such a hypothesis in this plugin"); - } - else { - // map hypothesis creator to a hypothesis name + MESSAGE(anError); + } + } + else { + // get method, returning hypothesis creator + if(MYDEBUG) MESSAGE("Find GetHypothesisCreator() method ..."); + typedef SMESHGUI_GenericHypothesisCreator* (*GetHypothesisCreator) \ + ( const QString& ); + GetHypothesisCreator procHandle = + (GetHypothesisCreator)GetProc(libHandle, "GetHypothesisCreator"); + if (!procHandle) { + if(MYDEBUG) MESSAGE("bad hypothesis client plugin library"); + UnLoadLib(libHandle); + } + else { + // get hypothesis creator + if(MYDEBUG) MESSAGE("Get Hypothesis Creator for " << aHypType.toLatin1().data()); + aCreator = procHandle( aHypType ); + if (!aCreator) { + if(MYDEBUG) MESSAGE("no such a hypothesis in this plugin"); + } + else { + // map hypothesis creator to a hypothesis name // BUG 0020378 - //myHypCreatorMap[aHypType] = aCreator; - } - } - } + //myHypCreatorMap[aHypType] = aCreator; + } + } + } } catch (const SALOME::SALOME_Exception& S_ex) { - SalomeApp_Tools::QtCatchCorbaException(S_ex); + SalomeApp_Tools::QtCatchCorbaException(S_ex); } } @@ -397,25 +397,25 @@ namespace SMESH SMESH::SMESH_Hypothesis_ptr CreateHypothesis(const QString& aHypType, - const QString& aHypName, - const bool isAlgo) + const QString& aHypName, + const bool isAlgo) { if(MYDEBUG) MESSAGE("Create " << aHypType.toLatin1().data() << - " with name " << aHypName.toLatin1().data()); + " with name " << aHypName.toLatin1().data()); HypothesisData* aHypData = GetHypothesisData(aHypType); QString aServLib = aHypData->ServerLibName; try { SMESH::SMESH_Hypothesis_var aHypothesis; aHypothesis = SMESHGUI::GetSMESHGen()->CreateHypothesis(aHypType.toLatin1().data(), - aServLib.toLatin1().data()); + aServLib.toLatin1().data()); if (!aHypothesis->_is_nil()) { - _PTR(SObject) aHypSObject = SMESH::FindSObject(aHypothesis.in()); - if (aHypSObject) { - if (!aHypName.isEmpty()) - SMESH::SetName(aHypSObject, aHypName); - SMESHGUI::GetSMESHGUI()->updateObjBrowser(); - return aHypothesis._retn(); - } + _PTR(SObject) aHypSObject = SMESH::FindSObject(aHypothesis.in()); + if (aHypSObject) { + if (!aHypName.isEmpty()) + SMESH::SetName(aHypSObject, aHypName); + SMESHGUI::GetSMESHGUI()->updateObjBrowser(); + return aHypothesis._retn(); + } } } catch (const SALOME::SALOME_Exception & S_ex) { SalomeApp_Tools::QtCatchCorbaException(S_ex); @@ -435,23 +435,23 @@ namespace SMESH _PTR(SObject) SM = SMESH::FindSObject(aMesh); GEOM::GEOM_Object_var aShapeObject = SMESH::GetShapeOnMeshOrSubMesh(SM); try { - res = aMesh->AddHypothesis(aShapeObject, aHyp); - if (res < SMESH::HYP_UNKNOWN_FATAL) { - _PTR(SObject) aSH = SMESH::FindSObject(aHyp); - if (SM && aSH) { - SMESH::ModifiedMesh(SM, false, aMesh->NbNodes()==0); - } - } - if (res > SMESH::HYP_OK) { - wc.suspend(); - processHypothesisStatus(res, aHyp, true); - wc.resume(); - } + res = aMesh->AddHypothesis(aShapeObject, aHyp); + if (res < SMESH::HYP_UNKNOWN_FATAL) { + _PTR(SObject) aSH = SMESH::FindSObject(aHyp); + if (SM && aSH) { + SMESH::ModifiedMesh(SM, false, aMesh->NbNodes()==0); + } + } + if (res > SMESH::HYP_OK) { + wc.suspend(); + processHypothesisStatus(res, aHyp, true); + wc.resume(); + } } catch(const SALOME::SALOME_Exception& S_ex) { - wc.suspend(); - SalomeApp_Tools::QtCatchCorbaException(S_ex); - res = SMESH::HYP_UNKNOWN_FATAL; + wc.suspend(); + SalomeApp_Tools::QtCatchCorbaException(S_ex); + res = SMESH::HYP_UNKNOWN_FATAL; } } return res < SMESH::HYP_UNKNOWN_FATAL; @@ -466,33 +466,33 @@ namespace SMESH if (!aSubMesh->_is_nil() && ! aHyp->_is_nil()) { try { - SMESH::SMESH_Mesh_var aMesh = aSubMesh->GetFather(); - _PTR(SObject) SsubM = SMESH::FindSObject(aSubMesh); - GEOM::GEOM_Object_var aShapeObject = SMESH::GetShapeOnMeshOrSubMesh(SsubM); - if (!aMesh->_is_nil() && SsubM && !aShapeObject->_is_nil()) { - res = aMesh->AddHypothesis(aShapeObject, aHyp); - if (res < SMESH::HYP_UNKNOWN_FATAL) { + SMESH::SMESH_Mesh_var aMesh = aSubMesh->GetFather(); + _PTR(SObject) SsubM = SMESH::FindSObject(aSubMesh); + GEOM::GEOM_Object_var aShapeObject = SMESH::GetShapeOnMeshOrSubMesh(SsubM); + if (!aMesh->_is_nil() && SsubM && !aShapeObject->_is_nil()) { + res = aMesh->AddHypothesis(aShapeObject, aHyp); + if (res < SMESH::HYP_UNKNOWN_FATAL) { _PTR(SObject) meshSO = SMESH::FindSObject(aMesh); if (meshSO) SMESH::ModifiedMesh(meshSO, false, aMesh->NbNodes()==0); - } - if (res > SMESH::HYP_OK) { - wc.suspend(); - processHypothesisStatus(res, aHyp, true); - wc.resume(); - } - } - else { - SCRUTE(aHyp->_is_nil()); - SCRUTE(aMesh->_is_nil()); - SCRUTE(!SsubM); - SCRUTE(aShapeObject->_is_nil()); - } + } + if (res > SMESH::HYP_OK) { + wc.suspend(); + processHypothesisStatus(res, aHyp, true); + wc.resume(); + } + } + else { + SCRUTE(aHyp->_is_nil()); + SCRUTE(aMesh->_is_nil()); + SCRUTE(!SsubM); + SCRUTE(aShapeObject->_is_nil()); + } } catch(const SALOME::SALOME_Exception& S_ex) { - wc.suspend(); - SalomeApp_Tools::QtCatchCorbaException(S_ex); - res = SMESH::HYP_UNKNOWN_FATAL; + wc.suspend(); + SalomeApp_Tools::QtCatchCorbaException(S_ex); + res = SMESH::HYP_UNKNOWN_FATAL; } } else { @@ -511,28 +511,28 @@ namespace SMESH _PTR(Study) aStudy = GetActiveStudyDocument(); _PTR(SObject) aHypObj = aStudy->FindObjectID( IObject->getEntry() ); if( aHypObj ) - { - _PTR(SObject) MorSM = SMESH::GetMeshOrSubmesh( aHypObj ); - _PTR(SObject) aRealHypo; - if( aHypObj->ReferencedObject( aRealHypo ) ) - { - SMESH_Hypothesis_var hypo = SMESH_Hypothesis::_narrow( SObjectToObject( aRealHypo ) ); - RemoveHypothesisOrAlgorithmOnMesh( MorSM, hypo ); - } - else - { - SMESH_Hypothesis_var hypo = SMESH_Hypothesis::_narrow( SObjectToObject( aHypObj ) ); - SObjectList meshList = GetMeshesUsingAlgoOrHypothesis( hypo ); - for( int i = 0; i < meshList.size(); i++ ) - RemoveHypothesisOrAlgorithmOnMesh( meshList[ i ], hypo ); - } - } + { + _PTR(SObject) MorSM = SMESH::GetMeshOrSubmesh( aHypObj ); + _PTR(SObject) aRealHypo; + if( aHypObj->ReferencedObject( aRealHypo ) ) + { + SMESH_Hypothesis_var hypo = SMESH_Hypothesis::_narrow( SObjectToObject( aRealHypo ) ); + RemoveHypothesisOrAlgorithmOnMesh( MorSM, hypo ); + } + else + { + SMESH_Hypothesis_var hypo = SMESH_Hypothesis::_narrow( SObjectToObject( aHypObj ) ); + SObjectList meshList = GetMeshesUsingAlgoOrHypothesis( hypo ); + for( int i = 0; i < meshList.size(); i++ ) + RemoveHypothesisOrAlgorithmOnMesh( meshList[ i ], hypo ); + } + } } catch(const SALOME::SALOME_Exception& S_ex) { - wc.suspend(); - SalomeApp_Tools::QtCatchCorbaException(S_ex); - res = SMESH::HYP_UNKNOWN_FATAL; + wc.suspend(); + SalomeApp_Tools::QtCatchCorbaException(S_ex); + res = SMESH::HYP_UNKNOWN_FATAL; } return res < SMESH::HYP_UNKNOWN_FATAL; } @@ -566,7 +566,7 @@ namespace SMESH } else if(!aMesh->HasShapeToMesh()){ res = aMesh->RemoveHypothesis(aShapeObject, anHyp); - if (res < SMESH::HYP_UNKNOWN_FATAL) { + if (res < SMESH::HYP_UNKNOWN_FATAL) { _PTR(SObject) meshSO = SMESH::FindSObject(aMesh); if (meshSO) SMESH::ModifiedMesh(meshSO, false, aMesh->NbNodes()==0); @@ -579,9 +579,9 @@ namespace SMESH } } } catch(const SALOME::SALOME_Exception& S_ex) { - wc.suspend(); - SalomeApp_Tools::QtCatchCorbaException(S_ex); - res = SMESH::HYP_UNKNOWN_FATAL; + wc.suspend(); + SalomeApp_Tools::QtCatchCorbaException(S_ex); + res = SMESH::HYP_UNKNOWN_FATAL; } } return res < SMESH::HYP_UNKNOWN_FATAL; @@ -596,25 +596,25 @@ namespace SMESH if (!AlgoOrHyp->_is_nil()) { _PTR(SObject) SO_Hypothesis = SMESH::FindSObject(AlgoOrHyp); if (SO_Hypothesis) { - SObjectList listSO = - SMESHGUI::activeStudy()->studyDS()->FindDependances(SO_Hypothesis); - - if(MYDEBUG) MESSAGE("SMESHGUI::GetMeshesUsingAlgoOrHypothesis(): dependency number ="<GetFather(); - if (aFather) { - _PTR(SObject) SOfatherFather = aFather->GetFather(); - if (SOfatherFather) { - if(MYDEBUG) MESSAGE("SMESHGUI::GetMeshesUsingAlgoOrHypothesis(): dependency added to list"); - index++; - listSOmesh.resize(index); - listSOmesh[index - 1] = SOfatherFather; - } - } - } - } + SObjectList listSO = + SMESHGUI::activeStudy()->studyDS()->FindDependances(SO_Hypothesis); + + if(MYDEBUG) MESSAGE("SMESHGUI::GetMeshesUsingAlgoOrHypothesis(): dependency number ="<GetFather(); + if (aFather) { + _PTR(SObject) SOfatherFather = aFather->GetFather(); + if (SOfatherFather) { + if(MYDEBUG) MESSAGE("SMESHGUI::GetMeshesUsingAlgoOrHypothesis(): dependency added to list"); + index++; + listSOmesh.resize(index); + listSOmesh[index - 1] = SOfatherFather; + } + } + } + } } } if (MYDEBUG) MESSAGE("SMESHGUI::GetMeshesUsingAlgoOrHypothesis(): completed"); diff --git a/src/SMESHGUI/SMESHGUI_HypothesesUtils.h b/src/SMESHGUI/SMESHGUI_HypothesesUtils.h index 8ed6cd16f..56a80e434 100644 --- a/src/SMESHGUI/SMESHGUI_HypothesesUtils.h +++ b/src/SMESHGUI/SMESHGUI_HypothesesUtils.h @@ -65,7 +65,7 @@ namespace SMESH QStringList GetAvailableHypotheses( const bool, const int = -1, const bool = false, - const bool = true); + const bool = true); SMESHGUI_EXPORT QStringList GetHypothesesSets(); @@ -77,12 +77,12 @@ namespace SMESH SMESHGUI_EXPORT bool IsAvailableHypothesis( const HypothesisData*, - const QString&, - bool& ); + const QString&, + bool& ); SMESHGUI_EXPORT bool IsCompatibleAlgorithm( const HypothesisData*, - const HypothesisData* ); + const HypothesisData* ); SMESHGUI_EXPORT SMESHGUI_GenericHypothesisCreator* GetHypothesisCreator( const QString& ); @@ -103,7 +103,7 @@ namespace SMESH SMESHGUI_EXPORT bool RemoveHypothesisOrAlgorithmOnMesh( _PTR(SObject), - SMESH::SMESH_Hypothesis_ptr ); + SMESH::SMESH_Hypothesis_ptr ); typedef std::vector<_PTR(SObject)> SObjectList; SObjectList GetMeshesUsingAlgoOrHypothesis( SMESH::SMESH_Hypothesis_ptr ); diff --git a/src/SMESHGUI/SMESHGUI_IdValidator.h b/src/SMESHGUI/SMESHGUI_IdValidator.h index 66dcd6322..0f1cb30ef 100644 --- a/src/SMESHGUI/SMESHGUI_IdValidator.h +++ b/src/SMESHGUI/SMESHGUI_IdValidator.h @@ -47,15 +47,15 @@ public: // truncate extra ids int ind = 0, nbId = 0; while ( ind < input.length() ) { - if ( input.at( ind ) != ' ' ) { - if ( ++nbId > myMaxNbId ) { - input.truncate( ind ); - break; - } - ind = input.indexOf( ' ', ind ); - if ( ind < 0 ) break; - } - ind++; + if ( input.at( ind ) != ' ' ) { + if ( ++nbId > myMaxNbId ) { + input.truncate( ind ); + break; + } + ind = input.indexOf( ' ', ind ); + if ( ind < 0 ) break; + } + ind++; } } if ( pos > input.length() ) diff --git a/src/SMESHGUI/SMESHGUI_Make2DFrom3DOp.cxx b/src/SMESHGUI/SMESHGUI_Make2DFrom3DOp.cxx index ca1ad43c5..5c6f73c33 100644 --- a/src/SMESHGUI/SMESHGUI_Make2DFrom3DOp.cxx +++ b/src/SMESHGUI/SMESHGUI_Make2DFrom3DOp.cxx @@ -189,8 +189,8 @@ void SMESHGUI_Make2DFrom3DOp::startOperation() int nbSel = selected.Extent(); if (nbSel != 1) { SUIT_MessageBox::warning(desktop(), - tr("SMESH_WRN_WARNING"), - tr("SMESH_WRN_NO_AVAILABLE_DATA")); + tr("SMESH_WRN_WARNING"), + tr("SMESH_WRN_NO_AVAILABLE_DATA")); onCancel(); return; } @@ -199,8 +199,8 @@ void SMESHGUI_Make2DFrom3DOp::startOperation() myMesh = SMESH::GetMeshByIO(anIO); if (myMesh->_is_nil()) { SUIT_MessageBox::warning(desktop(), - tr("SMESH_WRN_WARNING"), - tr("SMESH_WRN_NO_AVAILABLE_DATA")); + tr("SMESH_WRN_WARNING"), + tr("SMESH_WRN_NO_AVAILABLE_DATA")); onCancel(); return; } @@ -214,8 +214,8 @@ void SMESHGUI_Make2DFrom3DOp::startOperation() if (!compute2DMesh()) { SUIT_MessageBox::warning(desktop(), - tr("SMESH_WRN_WARNING"), - tr("SMESH_WRN_COMPUTE_FAILED")); + tr("SMESH_WRN_WARNING"), + tr("SMESH_WRN_COMPUTE_FAILED")); onCancel(); return; } diff --git a/src/SMESHGUI/SMESHGUI_MeshDlg.cxx b/src/SMESHGUI/SMESHGUI_MeshDlg.cxx index 3a9f90256..a3446f299 100644 --- a/src/SMESHGUI/SMESHGUI_MeshDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshDlg.cxx @@ -381,7 +381,7 @@ SMESHGUI_MeshDlg::SMESHGUI_MeshDlg( const bool theToCreate, const bool theIsMesh myHypoSetButton->setText( tr( "HYPOTHESES_SETS" ) ); myHypoSetButton->setEnabled( false ); myHypoSetButton->setSizePolicy( QSizePolicy::MinimumExpanding, - myHypoSetButton->sizePolicy().verticalPolicy() ); + myHypoSetButton->sizePolicy().verticalPolicy() ); // Fill layout QGridLayout* aLay = new QGridLayout( mainFrame() ); @@ -542,14 +542,14 @@ void SMESHGUI_MeshDlg::setGeomPopupEnabled( const bool enable ) myGeomPopup->addAction( tr("DIRECT_GEOM_SELECTION") )->setData( DIRECT_GEOM_INDEX ); myGeomPopup->addAction( tr("GEOM_BY_MESH_ELEM_SELECTION") )->setData( GEOM_BY_MESH_INDEX ); connect( myGeomPopup, SIGNAL( triggered( QAction* ) ), SLOT( onGeomPopup( QAction* ) ) ); - connect( selBtn, SIGNAL( toggled(bool) ), this, SLOT( onGeomSelectionButton(bool) )); + connect( selBtn, SIGNAL( toggled(bool) ), this, SLOT( onGeomSelectionButton(bool) )); } } else { disconnect( selBtn, SIGNAL( toggled(bool) ), this, SLOT( onGeomSelectionButton(bool) )); if ( myGeomPopup ) { - delete myGeomPopup; - myGeomPopup = 0; + delete myGeomPopup; + myGeomPopup = 0; } } } diff --git a/src/SMESHGUI/SMESHGUI_MeshInfosBox.cxx b/src/SMESHGUI/SMESHGUI_MeshInfosBox.cxx index 211603528..7554a7959 100644 --- a/src/SMESHGUI/SMESHGUI_MeshInfosBox.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshInfosBox.cxx @@ -358,52 +358,52 @@ void SMESHGUI_MeshInfosBox::SetMeshInfo(const SMESH::long_array& theInfo) // edges myNbEdge ->setText( QString("%1").arg( theInfo[SMDSEntity_Edge] + - theInfo[SMDSEntity_Quad_Edge] )); + theInfo[SMDSEntity_Quad_Edge] )); myNbLinEdge ->setText( QString("%1").arg( theInfo[SMDSEntity_Edge] )); myNbQuadEdge ->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Edge] )); // faces myNbFace ->setText( QString("%1").arg( theInfo[SMDSEntity_Triangle] + - theInfo[SMDSEntity_Quad_Triangle] + - theInfo[SMDSEntity_Quadrangle] + - theInfo[SMDSEntity_Quad_Quadrangle] + - theInfo[SMDSEntity_Polygon] )); + theInfo[SMDSEntity_Quad_Triangle] + + theInfo[SMDSEntity_Quadrangle] + + theInfo[SMDSEntity_Quad_Quadrangle] + + theInfo[SMDSEntity_Polygon] )); myNbLinFace ->setText( QString("%1").arg( theInfo[SMDSEntity_Triangle] + - theInfo[SMDSEntity_Quadrangle] + - theInfo[SMDSEntity_Polygon] )); + theInfo[SMDSEntity_Quadrangle] + + theInfo[SMDSEntity_Polygon] )); myNbQuadFace ->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Triangle] + - theInfo[SMDSEntity_Quad_Quadrangle] )); + theInfo[SMDSEntity_Quad_Quadrangle] )); // volumes myNbVolum ->setText( QString("%1").arg( theInfo[SMDSEntity_Tetra] + - theInfo[SMDSEntity_Quad_Tetra] + - theInfo[SMDSEntity_Pyramid] + - theInfo[SMDSEntity_Quad_Pyramid] + - theInfo[SMDSEntity_Hexa] + - theInfo[SMDSEntity_Quad_Hexa] + - theInfo[SMDSEntity_Penta] + - theInfo[SMDSEntity_Quad_Penta] + - theInfo[SMDSEntity_Polyhedra] )); + theInfo[SMDSEntity_Quad_Tetra] + + theInfo[SMDSEntity_Pyramid] + + theInfo[SMDSEntity_Quad_Pyramid] + + theInfo[SMDSEntity_Hexa] + + theInfo[SMDSEntity_Quad_Hexa] + + theInfo[SMDSEntity_Penta] + + theInfo[SMDSEntity_Quad_Penta] + + theInfo[SMDSEntity_Polyhedra] )); myNbLinVolum ->setText( QString("%1").arg( theInfo[SMDSEntity_Tetra] + - theInfo[SMDSEntity_Pyramid] + - theInfo[SMDSEntity_Hexa] + - theInfo[SMDSEntity_Penta] + - theInfo[SMDSEntity_Polyhedra] )); + theInfo[SMDSEntity_Pyramid] + + theInfo[SMDSEntity_Hexa] + + theInfo[SMDSEntity_Penta] + + theInfo[SMDSEntity_Polyhedra] )); myNbQuadVolum->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Tetra] + - theInfo[SMDSEntity_Quad_Pyramid] + - theInfo[SMDSEntity_Quad_Hexa] + - theInfo[SMDSEntity_Quad_Penta] )); + theInfo[SMDSEntity_Quad_Pyramid] + + theInfo[SMDSEntity_Quad_Hexa] + + theInfo[SMDSEntity_Quad_Penta] )); if ( myFull ) { // triangles myNbTrai ->setText( QString("%1").arg( theInfo[SMDSEntity_Triangle] + - theInfo[SMDSEntity_Quad_Triangle] )); + theInfo[SMDSEntity_Quad_Triangle] )); myNbLinTrai ->setText( QString("%1").arg( theInfo[SMDSEntity_Triangle] )); myNbQuadTrai ->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Triangle] )); // quadrangles myNbQuad ->setText( QString("%1").arg( theInfo[SMDSEntity_Quadrangle] + - theInfo[SMDSEntity_Quad_Quadrangle] )); + theInfo[SMDSEntity_Quad_Quadrangle] )); myNbLinQuad ->setText( QString("%1").arg( theInfo[SMDSEntity_Quadrangle] )); myNbQuadQuad ->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Quadrangle] )); // poligones @@ -411,22 +411,22 @@ void SMESHGUI_MeshInfosBox::SetMeshInfo(const SMESH::long_array& theInfo) // tetras myNbTetra ->setText( QString("%1").arg( theInfo[SMDSEntity_Tetra] + - theInfo[SMDSEntity_Quad_Tetra] )); + theInfo[SMDSEntity_Quad_Tetra] )); myNbLinTetra ->setText( QString("%1").arg( theInfo[SMDSEntity_Tetra] )); myNbQuadTetra->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Tetra] )); // hexas myNbHexa ->setText( QString("%1").arg( theInfo[SMDSEntity_Hexa] + - theInfo[SMDSEntity_Quad_Hexa] )); + theInfo[SMDSEntity_Quad_Hexa] )); myNbLinHexa ->setText( QString("%1").arg( theInfo[SMDSEntity_Hexa] )); myNbQuadHexa ->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Hexa] )); // pyras myNbPyra ->setText( QString("%1").arg( theInfo[SMDSEntity_Pyramid] + - theInfo[SMDSEntity_Quad_Pyramid] )); + theInfo[SMDSEntity_Quad_Pyramid] )); myNbLinPyra ->setText( QString("%1").arg( theInfo[SMDSEntity_Pyramid] )); myNbQuadPyra ->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Pyramid] )); // prisms myNbPrism ->setText( QString("%1").arg( theInfo[SMDSEntity_Penta] + - theInfo[SMDSEntity_Quad_Penta] )); + theInfo[SMDSEntity_Quad_Penta] )); myNbLinPrism ->setText( QString("%1").arg( theInfo[SMDSEntity_Penta] )); myNbQuadPrism->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Penta] )); // polyedres diff --git a/src/SMESHGUI/SMESHGUI_MeshInfosDlg.cxx b/src/SMESHGUI/SMESHGUI_MeshInfosDlg.cxx index 0bc4b633a..fd6d42e52 100644 --- a/src/SMESHGUI/SMESHGUI_MeshInfosDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshInfosDlg.cxx @@ -198,17 +198,17 @@ void SMESHGUI_MeshInfosDlg::DumpMeshInfos() //CORBA::Object_var anObject = aSO->GetObject(); CORBA::Object_var anObject = SMESH::SObjectToObject(aSO); if (!CORBA::is_nil(anObject)) { - SMESH::SMESH_IDSource_var anIDSource = SMESH::SMESH_IDSource::_narrow(anObject); - if (!anIDSource->_is_nil()) { - myWGStack->setCurrentWidget(myMeshWidget); - setWindowTitle(tr("SMESH_MESHINFO_TITLE") + " [" + tr("SMESH_OBJECT_MESH") + "]"); - myMeshName->setText(aSO->GetName().c_str()); + SMESH::SMESH_IDSource_var anIDSource = SMESH::SMESH_IDSource::_narrow(anObject); + if (!anIDSource->_is_nil()) { + myWGStack->setCurrentWidget(myMeshWidget); + setWindowTitle(tr("SMESH_MESHINFO_TITLE") + " [" + tr("SMESH_OBJECT_MESH") + "]"); + myMeshName->setText(aSO->GetName().c_str()); - SMESH::long_array_var aMeshInfo = anIDSource->GetMeshInfo(); - myMeshInfoBox->SetMeshInfo( aMeshInfo ); + SMESH::long_array_var aMeshInfo = anIDSource->GetMeshInfo(); + myMeshInfoBox->SetMeshInfo( aMeshInfo ); - return; - } + return; + } } } } @@ -297,10 +297,10 @@ void SMESHGUI_MeshInfosDlg::onHelp() platform = "application"; #endif SUIT_MessageBox::warning(this, tr("WRN_WARNING"), - tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", - platform)). - arg(myHelpFileName)); + tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", + platform)). + arg(myHelpFileName)); } } diff --git a/src/SMESHGUI/SMESHGUI_MeshOp.cxx b/src/SMESHGUI/SMESHGUI_MeshOp.cxx index ef2f01528..eaa3098aa 100644 --- a/src/SMESHGUI/SMESHGUI_MeshOp.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshOp.cxx @@ -576,11 +576,11 @@ void SMESHGUI_MeshOp::selectionDone() SMESH::SObjectToInterface( pSubmesh ); bool editSubmesh = ( !sm->_is_nil() && SUIT_MessageBox::question( myDlg, tr( "SMESH_WARNING" ), - tr( "EDIT_SUBMESH_QUESTION"), - SUIT_MessageBox::Yes | - SUIT_MessageBox::No, - SUIT_MessageBox::No ) - == SUIT_MessageBox::Yes ); + tr( "EDIT_SUBMESH_QUESTION"), + SUIT_MessageBox::Yes | + SUIT_MessageBox::No, + SUIT_MessageBox::No ) + == SUIT_MessageBox::Yes ); if ( editSubmesh ) { selectionMgr()->clearFilters(); @@ -1666,7 +1666,7 @@ bool SMESHGUI_MeshOp::createSubMesh( QString& theMess ) aNewGeomGroupName += aName; SALOMEDS::SObject_var aNewGroupSO = geomGen->AddInStudy(aSMESHGen->GetCurrentStudy(), aGeomVar, - aNewGeomGroupName.toLatin1().data(), mainGeom); + aNewGeomGroupName.toLatin1().data(), mainGeom); } } } diff --git a/src/SMESHGUI/SMESHGUI_MeshOp.h b/src/SMESHGUI/SMESHGUI_MeshOp.h index e3e4358ed..93804eb09 100644 --- a/src/SMESHGUI/SMESHGUI_MeshOp.h +++ b/src/SMESHGUI/SMESHGUI_MeshOp.h @@ -102,7 +102,7 @@ private: const int ); // access to myAvailableHypData void createHypothesis( const int, const int, - const QString& ); + const QString& ); bool createMesh( QString& ); bool createSubMesh( QString& ); diff --git a/src/SMESHGUI/SMESHGUI_MeshPatternDlg.cxx b/src/SMESHGUI/SMESHGUI_MeshPatternDlg.cxx index 36a739f75..d80523066 100755 --- a/src/SMESHGUI/SMESHGUI_MeshPatternDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshPatternDlg.cxx @@ -420,10 +420,10 @@ bool SMESHGUI_MeshPatternDlg::isValid (const bool theMess) ok = myNode2->isValid( msg, theMess ) && ok; if( !ok ) { if( theMess ) { - QString str( tr( "SMESH_INCORRECT_INPUT" ) ); - if ( !msg.isEmpty() ) - str += "\n" + msg; - SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str ); + QString str( tr( "SMESH_INCORRECT_INPUT" ) ); + if ( !msg.isEmpty() ) + str += "\n" + msg; + SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str ); } return false; } @@ -440,14 +440,14 @@ bool SMESHGUI_MeshPatternDlg::isValid (const bool theMess) { if (theMess) SUIT_MessageBox::information(this, tr("SMESH_INSUFFICIENT_DATA"), - tr("SMESHGUI_INVALID_PARAMETERS")); + tr("SMESHGUI_INVALID_PARAMETERS")); return false; } if ( myName->text().isEmpty() ) { if (theMess) SUIT_MessageBox::information(this, tr("SMESH_INSUFFICIENT_DATA"), - tr("SMESHGUI_INVALID_PARAMETERS")); + tr("SMESHGUI_INVALID_PARAMETERS")); return false; } @@ -473,15 +473,15 @@ bool SMESHGUI_MeshPatternDlg::onApply() varIds->length(ids.count()); int i = 0; for (QList::iterator it = ids.begin(); it != ids.end(); ++it) - varIds[i++] = *it; + varIds[i++] = *it; myType == Type_2d - ? myPattern->ApplyToMeshFaces (myMesh, varIds, getNode(false), myReverseChk->isChecked()) - : myPattern->ApplyToHexahedrons(myMesh, varIds, getNode(false), getNode(true)); + ? myPattern->ApplyToMeshFaces (myMesh, varIds, getNode(false), myReverseChk->isChecked()) + : myPattern->ApplyToHexahedrons(myMesh, varIds, getNode(false), getNode(true)); QStringList aParameters; aParameters << myNode1->text(); if(myType == Type_3d ) - aParameters << myNode2->text(); + aParameters << myNode2->text(); myMesh->SetParameters( aParameters.join(":").toLatin1().constData() ); } else { // Applying a pattern to geometrical object @@ -497,15 +497,15 @@ bool SMESHGUI_MeshPatternDlg::onApply() //mySelectionMgr->clearSelected(); bool autoUpdate = SMESHGUI::automaticUpdate(); if (!isRefine() && autoUpdate) { - _PTR(SObject) aSO = SMESH::FindSObject(myMesh.in()); - SMESH_Actor* anActor = SMESH::FindActorByEntry(aSO->GetID().c_str()); - if (!anActor) { - anActor = SMESH::CreateActor(aSO->GetStudy(), aSO->GetID().c_str()); - if (anActor) { - SMESH::DisplayActor(SMESH::GetActiveWindow(), anActor); - SMESH::FitAll(); - } - } + _PTR(SObject) aSO = SMESH::FindSObject(myMesh.in()); + SMESH_Actor* anActor = SMESH::FindActorByEntry(aSO->GetID().c_str()); + if (!anActor) { + anActor = SMESH::CreateActor(aSO->GetStudy(), aSO->GetID().c_str()); + if (anActor) { + SMESH::DisplayActor(SMESH::GetActiveWindow(), anActor); + SMESH::FitAll(); + } + } } mySelectionMgr->clearSelected(); SMESH::UpdateView(); @@ -517,7 +517,7 @@ bool SMESHGUI_MeshPatternDlg::onApply() return true; } else { SUIT_MessageBox::information(this, tr("SMESH_ERROR"), - tr("SMESH_OPERATION_FAILED")); + tr("SMESH_OPERATION_FAILED")); return false; } } catch (const SALOME::SALOME_Exception& S_ex) { @@ -565,17 +565,17 @@ void SMESHGUI_MeshPatternDlg::onHelp() if (app) app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); else { - QString platform; + QString platform; #ifdef WIN32 - platform = "winapplication"; + platform = "winapplication"; #else - platform = "application"; + platform = "application"; #endif SUIT_MessageBox::warning(this, tr("WRN_WARNING"), - tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", - platform)). - arg(myHelpFileName)); + tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", + platform)). + arg(myHelpFileName)); } } @@ -593,7 +593,7 @@ void SMESHGUI_MeshPatternDlg::onSelectionDone() SALOME_ListIO aList; mySelectionMgr->selectedObjects(aList,SVTK_Viewer::Type()); if (aList.Extent() != 1) - return; + return; // Retrieve mesh from selection Handle(SALOME_InteractiveObject) anIO = aList.First(); @@ -624,11 +624,11 @@ void SMESHGUI_MeshPatternDlg::onSelectionDone() SALOME_ListIO aList; mySelectionMgr->selectedObjects(aList,SVTK_Viewer::Type()); if (aList.Extent() != 1) - return; + return; QString anIds; if (!SMESH::GetNameOfSelectedElements(mySelector, aList.First(), anIds)) - anIds = ""; + anIds = ""; myBusy = true; mySelEdit[ Ids ]->setText(anIds); @@ -638,7 +638,7 @@ void SMESHGUI_MeshPatternDlg::onSelectionDone() SALOME_ListIO aList; mySelectionMgr->selectedObjects(aList, SVTK_Viewer::Type()); if (aList.Extent() != 1) - return; + return; // Get geom object from selection Handle(SALOME_InteractiveObject) anIO = aList.First(); @@ -809,14 +809,14 @@ void SMESHGUI_MeshPatternDlg::onOpen() QFile aFile(fName); if (!aFile.open(QIODevice::ReadOnly)) { SUIT_MessageBox::information(this, tr("SMESH_ERROR"), - tr("ERROR_OF_OPENING")); + tr("ERROR_OF_OPENING")); return; } QByteArray aDataArray = aFile.readAll(); if (aDataArray.isEmpty()) { SUIT_MessageBox::information(this, tr("SMESH_ERROR"), - tr("ERROR_OF_READING")); + tr("ERROR_OF_READING")); return; } @@ -1046,11 +1046,11 @@ void SMESHGUI_MeshPatternDlg::updateWgState() if (!CORBA::is_nil(myPattern)/* && getIds(ids)*/) { SMESH::long_array_var keyPoints = myPattern->GetKeyPoints(); if (keyPoints->length()) { - myNode1->setEnabled(true); - myNode2->setEnabled(true); - myNode1->setRange(1, keyPoints->length()); - myNode2->setRange(1, keyPoints->length()); - return; + myNode1->setEnabled(true); + myNode2->setEnabled(true); + myNode1->setRange(1, keyPoints->length()); + myNode2->setRange(1, keyPoints->length()); + return; } } @@ -1075,13 +1075,13 @@ void SMESHGUI_MeshPatternDlg::activateSelection() if (myType == Type_2d) { - if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(FaceSelection); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(FaceSelection); } else { - if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(CellSelection); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(CellSelection); } } else { @@ -1146,7 +1146,7 @@ bool SMESHGUI_MeshPatternDlg::loadFromFile (const QString& theName) } catch (const SALOME::SALOME_Exception& S_ex) { SalomeApp_Tools::QtCatchCorbaException(S_ex); SUIT_MessageBox::information(this, tr("SMESH_ERROR"), - tr("ERROR_OF_LOADING") ); + tr("ERROR_OF_LOADING") ); return false; } } @@ -1229,13 +1229,13 @@ vtkUnstructuredGrid* SMESHGUI_MeshPatternDlg::getGrid() varIds->length(ids.count()); int i = 0; for (QList::iterator it = ids.begin(); it != ids.end(); ++it) - varIds[i++] = *it; + varIds[i++] = *it; pnts = myType == Type_2d - ? myPattern->ApplyToMeshFaces (myMesh, varIds, getNode(false), myReverseChk->isChecked()) - : myPattern->ApplyToHexahedrons(myMesh, varIds, getNode(false), getNode(true)); + ? myPattern->ApplyToMeshFaces (myMesh, varIds, getNode(false), myReverseChk->isChecked()) + : myPattern->ApplyToHexahedrons(myMesh, varIds, getNode(false), getNode(true)); } else { pnts = myType == Type_2d - ? myPattern->ApplyToFace (myGeomObj[ Object ], myGeomObj[ Vertex1 ], myReverseChk->isChecked()) + ? myPattern->ApplyToFace (myGeomObj[ Object ], myGeomObj[ Vertex1 ], myReverseChk->isChecked()) : myPattern->ApplyTo3DBlock(myGeomObj[ Object ], myGeomObj[ Vertex1 ], myGeomObj[ Vertex2 ]); } @@ -1380,7 +1380,7 @@ void SMESHGUI_MeshPatternDlg::onTextChanged (const QString& theNewText) for (int i = 0; i < aListId.count(); i++) { const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt()); if (e && e->GetType() == (myType == Type_2d ? SMDSAbs_Face : SMDSAbs_Volume)) - newIndices.Add(e->GetID()); + newIndices.Add(e->GetID()); } mySelector->AddOrRemoveIndex( anActor->getIO(), newIndices, false); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) diff --git a/src/SMESHGUI/SMESHGUI_MeshUtils.cxx b/src/SMESHGUI/SMESHGUI_MeshUtils.cxx index b524c2f83..df71815c2 100644 --- a/src/SMESHGUI/SMESHGUI_MeshUtils.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshUtils.cxx @@ -46,13 +46,13 @@ namespace SMESH if(!CORBA::is_nil(anObj)){ SMESH_Mesh_var aMesh = SMESH_Mesh::_narrow(anObj); if(!CORBA::is_nil(aMesh)) - return aMesh; + return aMesh; SMESH_GroupBase_var aGroup = SMESH_GroupBase::_narrow(anObj); if(!CORBA::is_nil(aGroup)) - return aGroup->GetMesh(); + return aGroup->GetMesh(); SMESH_subMesh_var aSubMesh = SMESH_subMesh::_narrow(anObj); if(!CORBA::is_nil(aSubMesh)) - return aSubMesh->GetFather(); + return aSubMesh->GetFather(); } return SMESH_Mesh::_nil(); } @@ -65,17 +65,17 @@ namespace SMESH QString name = baseName; while ( !aStudy->FindObjectByName( name.toLatin1().data(), "SMESH" ).empty() ) { int nb = 0; - QStringList names = name.split("_", QString::KeepEmptyParts); - if ( names.count() > 0 ) { - bool ok; - int index = names.last().toInt( &ok ); - if ( ok ) { - nb = index; - names.removeLast(); - } - } - names.append( QString::number( nb+1 ) ); - name = names.join( "_" ); + QStringList names = name.split("_", QString::KeepEmptyParts); + if ( names.count() > 0 ) { + bool ok; + int index = names.last().toInt( &ok ); + if ( ok ) { + nb = index; + names.removeLast(); + } + } + names.append( QString::number( nb+1 ) ); + name = names.join( "_" ); } return name; } diff --git a/src/SMESHGUI/SMESHGUI_MoveNodesDlg.cxx b/src/SMESHGUI/SMESHGUI_MoveNodesDlg.cxx index ecd46ea88..6243255af 100644 --- a/src/SMESHGUI/SMESHGUI_MoveNodesDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MoveNodesDlg.cxx @@ -278,7 +278,7 @@ bool SMESHGUI_MoveNodesDlg::isValid (const bool theMess) if (myId->text().isEmpty()) { if (theMess) SUIT_MessageBox::information(this, tr("SMESH_WARNING"), - tr("NODE_ID_IS_NOT_DEFINED")); + tr("NODE_ID_IS_NOT_DEFINED")); return false; } @@ -291,7 +291,7 @@ bool SMESHGUI_MoveNodesDlg::isValid (const bool theMess) if( theMess ) { QString str( tr( "SMESH_INCORRECT_INPUT" ) ); if ( !msg.isEmpty() ) - str += "\n" + msg; + str += "\n" + msg; SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str ); } return false; @@ -329,7 +329,7 @@ bool SMESHGUI_MoveNodesDlg::onApply() SMESH::SMESH_Mesh_var aMesh = SMESH::GetMeshByIO(myMeshActor->getIO()); if (aMesh->_is_nil()) { SUIT_MessageBox::information(this, tr("SMESH_ERROR"), - tr("SMESHG_NO_MESH")); + tr("SMESHG_NO_MESH")); return false; } @@ -398,17 +398,17 @@ void SMESHGUI_MoveNodesDlg::onHelp() if (app) app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); else { - QString platform; + QString platform; #ifdef WIN32 - platform = "winapplication"; + platform = "winapplication"; #else - platform = "application"; + platform = "application"; #endif SUIT_MessageBox::warning(this, tr("WRN_WARNING"), - tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", - platform)). - arg(myHelpFileName)); + tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", + platform)). + arg(myHelpFileName)); } } @@ -435,13 +435,13 @@ void SMESHGUI_MoveNodesDlg::onTextChange (const QString& theNewText) myBusy = false; if(const SMDS_MeshElement *anElem = aMesh->FindElement(theNewText.toInt())) { - TColStd_MapOfInteger aListInd; - aListInd.Add(anElem->GetID()); - mySelector->AddOrRemoveIndex(anIO,aListInd, false); - if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->highlight(anIO,true,true); - - onSelectionDone(); + TColStd_MapOfInteger aListInd; + aListInd.Add(anElem->GetID()); + mySelector->AddOrRemoveIndex(anIO,aListInd, false); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->highlight(anIO,true,true); + + onSelectionDone(); } } } diff --git a/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx b/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx index f26b81c5b..907f8a65b 100755 --- a/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx @@ -100,8 +100,8 @@ //======================================================================= SMESHGUI_MultiEditDlg ::SMESHGUI_MultiEditDlg(SMESHGUI* theModule, - const int theMode, - const bool the3d2d): + const int theMode, + const bool the3d2d): QDialog(SMESH::GetDesktop(theModule)), mySelector(SMESH::GetViewWindow(theModule)->GetSelector()), mySelectionMgr(SMESH::GetSelectionMgr(theModule)), @@ -192,7 +192,7 @@ QWidget* SMESHGUI_MultiEditDlg::createMainFrame (QWidget* theParent, const bool myToAllChk = new QCheckBox(tr("TO_ALL"), mySelGrp); mySelGrpLayout->addWidget(myToAllChk, mySelGrpLayout->rowCount(), 0, - 1, mySelGrpLayout->columnCount()); + 1, mySelGrpLayout->columnCount()); // Split/Join criterion group myCriterionGrp = new QGroupBox(tr("SPLIT_JOIN_CRITERION"), aMainGrp); @@ -440,30 +440,30 @@ SMESH::long_array_var SMESHGUI_MultiEditDlg::getIds() // skl 07.02.2006 SMDS_Mesh* aMesh = myActor->GetObject()->GetMesh(); if( myFilterType == SMESH::TriaFilter || - myFilterType == SMESH::QuadFilter || - myFilterType == SMESH::FaceFilter ) { - SMDS_FaceIteratorPtr it = aMesh->facesIterator(); - while(it->more()) { - const SMDS_MeshFace* f = it->next(); - if(myFilterType == SMESH::FaceFilter) { - myIds.Add(f->GetID()); - } - else if( myFilterType==SMESH::TriaFilter && - ( f->NbNodes()==3 || f->NbNodes()==6 ) ) { - myIds.Add(f->GetID()); - } - else if( myFilterType==SMESH::QuadFilter && - ( f->NbNodes()==4 || f->NbNodes()==8 ) ) { - myIds.Add(f->GetID()); - } - } + myFilterType == SMESH::QuadFilter || + myFilterType == SMESH::FaceFilter ) { + SMDS_FaceIteratorPtr it = aMesh->facesIterator(); + while(it->more()) { + const SMDS_MeshFace* f = it->next(); + if(myFilterType == SMESH::FaceFilter) { + myIds.Add(f->GetID()); + } + else if( myFilterType==SMESH::TriaFilter && + ( f->NbNodes()==3 || f->NbNodes()==6 ) ) { + myIds.Add(f->GetID()); + } + else if( myFilterType==SMESH::QuadFilter && + ( f->NbNodes()==4 || f->NbNodes()==8 ) ) { + myIds.Add(f->GetID()); + } + } } else if(myFilterType == SMESH::VolumeFilter) { - SMDS_VolumeIteratorPtr it = aMesh->volumesIterator(); - while(it->more()) { - const SMDS_MeshVolume* f = it->next(); - myIds.Add(f->GetID()); - } + SMDS_VolumeIteratorPtr it = aMesh->volumesIterator(); + while(it->more()) { + const SMDS_MeshVolume* f = it->next(); + myIds.Add(f->GetID()); + } } /* commented by skl 07.02.2006 TVisualObjPtr aVisualObj = anActor->GetObject(); @@ -472,14 +472,14 @@ SMESH::long_array_var SMESHGUI_MultiEditDlg::getIds() for (int i = 0, n = aGrid->GetNumberOfCells(); i < n; i++) { vtkCell* aCell = aGrid->GetCell(i); if (aCell != 0) { - vtkTriangle* aTri = vtkTriangle::SafeDownCast(aCell); - vtkQuad* aQua = vtkQuad::SafeDownCast(aCell); - vtkPolygon* aPG = vtkPolygon::SafeDownCast(aCell); + vtkTriangle* aTri = vtkTriangle::SafeDownCast(aCell); + vtkQuad* aQua = vtkQuad::SafeDownCast(aCell); + vtkPolygon* aPG = vtkPolygon::SafeDownCast(aCell); - vtkCell3D* a3d = vtkCell3D::SafeDownCast(aCell); - vtkConvexPointSet* aPH = vtkConvexPointSet::SafeDownCast(aCell); + vtkCell3D* a3d = vtkCell3D::SafeDownCast(aCell); + vtkConvexPointSet* aPH = vtkConvexPointSet::SafeDownCast(aCell); - if (aTri && myFilterType == SMESHGUI_TriaFilter || + if (aTri && myFilterType == SMESHGUI_TriaFilter || aQua && myFilterType == SMESHGUI_QuadFilter || (aTri || aQua || aPG) && myFilterType == SMESHGUI_FaceFilter || (a3d || aPH) && myFilterType == SMESHGUI_VolumeFilter) { @@ -540,10 +540,10 @@ void SMESHGUI_MultiEditDlg::onHelp() platform = "application"; #endif SUIT_MessageBox::warning(this, tr("WRN_WARNING"), - tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", - platform)). - arg(myHelpFileName)); + tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", + platform)). + arg(myHelpFileName)); } } @@ -594,10 +594,10 @@ void SMESHGUI_MultiEditDlg::onSelectionDone() if (aNbItems > 0) { QStringList anElements = aListStr.split(" ", QString::SkipEmptyParts); for (QStringList::iterator it = anElements.begin(); it != anElements.end(); ++it) { - QList items = myListBox->findItems(*it, Qt::MatchExactly); - QListWidgetItem* anItem; - foreach(anItem, items) - anItem->setSelected(true); + QList items = myListBox->findItems(*it, Qt::MatchExactly); + QListWidgetItem* anItem; + foreach(anItem, items) + anItem->setSelected(true); } } myMesh = SMESH::GetMeshByIO(anIO); @@ -1180,7 +1180,7 @@ bool SMESHGUI_UnionOfTrianglesDlg::isValid (const bool theMess) if( theMess ) { QString str( tr( "SMESH_INCORRECT_INPUT" ) ); if ( !msg.isEmpty() ) - str += "\n" + msg; + str += "\n" + msg; SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str ); } return false; diff --git a/src/SMESHGUI/SMESHGUI_MultiEditDlg.h b/src/SMESHGUI/SMESHGUI_MultiEditDlg.h index 0ada531f9..f14996814 100755 --- a/src/SMESHGUI/SMESHGUI_MultiEditDlg.h +++ b/src/SMESHGUI/SMESHGUI_MultiEditDlg.h @@ -113,7 +113,7 @@ protected: void setSelectionMode(); virtual bool isIdValid( const int ) const; virtual bool process( SMESH::SMESH_MeshEditor_ptr, - const SMESH::long_array& ) = 0; + const SMESH::long_array& ) = 0; int entityType(); protected: diff --git a/src/SMESHGUI/SMESHGUI_Operation.cxx b/src/SMESHGUI/SMESHGUI_Operation.cxx index 40bb88e65..863d4333a 100755 --- a/src/SMESHGUI/SMESHGUI_Operation.cxx +++ b/src/SMESHGUI/SMESHGUI_Operation.cxx @@ -120,7 +120,7 @@ bool SMESHGUI_Operation::isReadyToStart() const else if ( getSMESHGUI() == 0 ) { SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ), - tr( "NO_MODULE" ) ); + tr( "NO_MODULE" ) ); return false; } else if ( isStudyLocked() ) @@ -200,10 +200,10 @@ void SMESHGUI_Operation::onHelp() platform = "application"; #endif SUIT_MessageBox::warning( desktop(), tr("WRN_WARNING"), - tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", - platform)). - arg(myHelpFileName) ); + tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", + platform)). + arg(myHelpFileName) ); } } @@ -231,7 +231,7 @@ bool SMESHGUI_Operation::isStudyLocked( const bool theMess ) const { if ( theMess ) SUIT_MessageBox::warning( SMESHGUI::desktop(), tr( "WRN_WARNING" ), - tr( "WRN_STUDY_LOCKED" ) ); + tr( "WRN_STUDY_LOCKED" ) ); return true; } } @@ -260,7 +260,7 @@ bool SMESHGUI_Operation::isValid( SUIT_Operation* theOtherOp ) const return theOtherOp && theOtherOp->inherits( "SMESHGUI_Operation" ) && ( !anOps.contains( theOtherOp->metaObject()->className() ) || - anOps.contains( metaObject()->className() ) ); + anOps.contains( metaObject()->className() ) ); return true; } diff --git a/src/SMESHGUI/SMESHGUI_PatternWidget.cxx b/src/SMESHGUI/SMESHGUI_PatternWidget.cxx index c8ab77ac8..608a6e3a0 100644 --- a/src/SMESHGUI/SMESHGUI_PatternWidget.cxx +++ b/src/SMESHGUI/SMESHGUI_PatternWidget.cxx @@ -95,9 +95,9 @@ void SMESHGUI_PatternWidget::paintEvent( QPaintEvent* ) QPoint aQPnt = mapCoords( aPoint.x, aPoint.y ); painter.drawPie( aQPnt.x() - Radius, aQPnt.y() - Radius, - Radius * 2, Radius * 2, 0, 360 * 16 ); + Radius * 2, Radius * 2, 0, 360 * 16 ); painter.drawText( aQPnt.x() + Shift, aQPnt.y() - Shift, - QString::number( i+1 ) ); + QString::number( i+1 ) ); } // Draw lines diff --git a/src/SMESHGUI/SMESHGUI_PatternWidget.h b/src/SMESHGUI/SMESHGUI_PatternWidget.h index e4a6e41d3..fb2547811 100644 --- a/src/SMESHGUI/SMESHGUI_PatternWidget.h +++ b/src/SMESHGUI/SMESHGUI_PatternWidget.h @@ -53,8 +53,8 @@ public: ~SMESHGUI_PatternWidget(); void SetPoints( const PointVector&, - const QVector&, - const ConnectivityVector& ); + const QVector&, + const ConnectivityVector& ); private: PointVector myPoints; diff --git a/src/SMESHGUI/SMESHGUI_Preferences_ColorDlg.cxx b/src/SMESHGUI/SMESHGUI_Preferences_ColorDlg.cxx index 3b16aaf0b..f8ed909ae 100644 --- a/src/SMESHGUI/SMESHGUI_Preferences_ColorDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_Preferences_ColorDlg.cxx @@ -158,10 +158,10 @@ SMESHGUI_Preferences_ColorDlg::SMESHGUI_Preferences_ColorDlg( SMESHGUI* theModul connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) ); connect( mySMESHGUI, SIGNAL ( SignalDeactivateActiveDialog() ), - this, SLOT( DeactivateActiveDialog() ) ); + this, SLOT( DeactivateActiveDialog() ) ); /* to close dialog if study change */ connect( mySMESHGUI, SIGNAL ( SignalCloseAllDialogs() ), - this, SLOT( ClickOnCancel() ) ); + this, SLOT( ClickOnCancel() ) ); } //================================================================================= diff --git a/src/SMESHGUI/SMESHGUI_Preferences_ScalarBarDlg.cxx b/src/SMESHGUI/SMESHGUI_Preferences_ScalarBarDlg.cxx index a6d44e57a..175677f53 100644 --- a/src/SMESHGUI/SMESHGUI_Preferences_ScalarBarDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_Preferences_ScalarBarDlg.cxx @@ -300,7 +300,7 @@ SMESHGUI_Preferences_ScalarBarDlg::SMESHGUI_Preferences_ScalarBarDlg( SMESHGUI* SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI ); QColor titleColor = mgr->colorValue("SMESH", "scalar_bar_title_color", - QColor(255, 255, 255)); + QColor(255, 255, 255)); myTitleColorBtn->setColor(titleColor); myTitleFontCombo->setCurrentIndex(0); if (mgr->hasValue("SMESH", "scalar_bar_title_font")) { @@ -316,9 +316,9 @@ SMESHGUI_Preferences_ScalarBarDlg::SMESHGUI_Preferences_ScalarBarDlg( SMESHGUI* myTitleItalicCheck->setChecked( f.italic() ); myTitleShadowCheck->setChecked( f.overline() ); } - + QColor labelColor = mgr->colorValue("SMESH", "scalar_bar_label_color", - QColor(255, 255, 255)); + QColor(255, 255, 255)); myLabelsColorBtn->setColor(labelColor); myLabelsFontCombo->setCurrentIndex(0); if (mgr->hasValue("SMESH", "scalar_bar_label_font")) { @@ -352,16 +352,16 @@ SMESHGUI_Preferences_ScalarBarDlg::SMESHGUI_Preferences_ScalarBarDlg( SMESHGUI* QString name = isHoriz ? "scalar_bar_horizontal_%1" : "scalar_bar_vertical_%1"; myIniX = mgr->doubleValue("SMESH", name.arg( "x" ), - myHorizRadioBtn->isChecked() ? DEF_HOR_X : DEF_VER_X); + myHorizRadioBtn->isChecked() ? DEF_HOR_X : DEF_VER_X); myIniY = mgr->doubleValue("SMESH", name.arg( "y" ), - myHorizRadioBtn->isChecked() ? DEF_HOR_Y : DEF_VER_Y); + myHorizRadioBtn->isChecked() ? DEF_HOR_Y : DEF_VER_Y); myIniW = mgr->doubleValue("SMESH", name.arg( "width" ), - myHorizRadioBtn->isChecked() ? DEF_HOR_W : DEF_VER_W); + myHorizRadioBtn->isChecked() ? DEF_HOR_W : DEF_VER_W); myIniH = mgr->doubleValue("SMESH", name.arg( "height" ), - myHorizRadioBtn->isChecked() ? DEF_HOR_H : DEF_VER_H); + myHorizRadioBtn->isChecked() ? DEF_HOR_H : DEF_VER_H); setOriginAndSize(myIniX, myIniY, myIniW, myIniH); @@ -504,10 +504,10 @@ void SMESHGUI_Preferences_ScalarBarDlg::onHelp() platform = "application"; #endif SUIT_MessageBox::warning(this, tr("WRN_WARNING"), - tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", - platform)). - arg(myHelpFileName)); + tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", + platform)). + arg(myHelpFileName)); } } @@ -528,56 +528,56 @@ void SMESHGUI_Preferences_ScalarBarDlg::onSelectionChanged() if( anIO->hasEntry() ) { SMESH_Actor* anActor = SMESH::FindActorByEntry(anIO->getEntry()); if ( anActor && anActor->GetScalarBarActor() && anActor->GetControlMode() != SMESH_Actor::eNone ) { - myActor = anActor; - vtkScalarBarActor* myScalarBarActor = myActor->GetScalarBarActor(); - - if ( myScalarBarActor->GetLookupTable() ) { - vtkFloatingPointType *range = myScalarBarActor->GetLookupTable()->GetRange(); - myMinEdit->setText( QString::number( range[0],'g',12 ) ); - myMaxEdit->setText( QString::number( range[1],'g',12 ) ); - } - - vtkTextProperty* aTitleTextPrp = myScalarBarActor->GetTitleTextProperty(); - vtkFloatingPointType aTColor[3]; - aTitleTextPrp->GetColor( aTColor ); - myTitleColorBtn->setColor( QColor( (int)( aTColor[0]*255 ), (int)( aTColor[1]*255 ), (int)( aTColor[2]*255 ) ) ); - myTitleFontCombo->setCurrentIndex( aTitleTextPrp->GetFontFamily() ); - myTitleBoldCheck->setChecked( aTitleTextPrp->GetBold() ); - myTitleItalicCheck->setChecked( aTitleTextPrp->GetItalic() ); - myTitleShadowCheck->setChecked( aTitleTextPrp->GetShadow() ); - - vtkTextProperty* aLabelsTextPrp = myScalarBarActor->GetLabelTextProperty(); - vtkFloatingPointType aLColor[3]; - aLabelsTextPrp->GetColor( aLColor ); - myLabelsColorBtn->setColor( QColor( (int)( aLColor[0]*255 ), (int)( aLColor[1]*255 ), (int)( aLColor[2]*255 ) ) ); - myLabelsFontCombo->setCurrentIndex( aLabelsTextPrp->GetFontFamily() ); - myLabelsBoldCheck->setChecked( aLabelsTextPrp->GetBold() ); - myLabelsItalicCheck->setChecked( aLabelsTextPrp->GetItalic() ); - myLabelsShadowCheck->setChecked( aLabelsTextPrp->GetShadow() ); - - myLabelsSpin->setValue( myScalarBarActor->GetNumberOfLabels() ); - myColorsSpin->setValue( myScalarBarActor->GetMaximumNumberOfColors() ); - - if ( myScalarBarActor->GetOrientation() == VTK_ORIENT_VERTICAL ) - myVertRadioBtn->setChecked( true ); - else - myHorizRadioBtn->setChecked( true ); - myIniOrientation = myVertRadioBtn->isChecked(); - - myIniX = myScalarBarActor->GetPosition()[0]; - myIniY = myScalarBarActor->GetPosition()[1]; - myIniW = myScalarBarActor->GetWidth(); - myIniH = myScalarBarActor->GetHeight(); - setOriginAndSize( myIniX, myIniY, myIniW, myIniH ); - - myRangeGrp->setEnabled( true ); - myFontGrp->setEnabled( true ); - myLabColorGrp->setEnabled( true ); - myOrientationGrp->setEnabled( true ); - myOriginDimGrp->setEnabled( true ); - myOkBtn->setEnabled( true ); - myApplyBtn->setEnabled( true ); - return; + myActor = anActor; + vtkScalarBarActor* myScalarBarActor = myActor->GetScalarBarActor(); + + if ( myScalarBarActor->GetLookupTable() ) { + vtkFloatingPointType *range = myScalarBarActor->GetLookupTable()->GetRange(); + myMinEdit->setText( QString::number( range[0],'g',12 ) ); + myMaxEdit->setText( QString::number( range[1],'g',12 ) ); + } + + vtkTextProperty* aTitleTextPrp = myScalarBarActor->GetTitleTextProperty(); + vtkFloatingPointType aTColor[3]; + aTitleTextPrp->GetColor( aTColor ); + myTitleColorBtn->setColor( QColor( (int)( aTColor[0]*255 ), (int)( aTColor[1]*255 ), (int)( aTColor[2]*255 ) ) ); + myTitleFontCombo->setCurrentIndex( aTitleTextPrp->GetFontFamily() ); + myTitleBoldCheck->setChecked( aTitleTextPrp->GetBold() ); + myTitleItalicCheck->setChecked( aTitleTextPrp->GetItalic() ); + myTitleShadowCheck->setChecked( aTitleTextPrp->GetShadow() ); + + vtkTextProperty* aLabelsTextPrp = myScalarBarActor->GetLabelTextProperty(); + vtkFloatingPointType aLColor[3]; + aLabelsTextPrp->GetColor( aLColor ); + myLabelsColorBtn->setColor( QColor( (int)( aLColor[0]*255 ), (int)( aLColor[1]*255 ), (int)( aLColor[2]*255 ) ) ); + myLabelsFontCombo->setCurrentIndex( aLabelsTextPrp->GetFontFamily() ); + myLabelsBoldCheck->setChecked( aLabelsTextPrp->GetBold() ); + myLabelsItalicCheck->setChecked( aLabelsTextPrp->GetItalic() ); + myLabelsShadowCheck->setChecked( aLabelsTextPrp->GetShadow() ); + + myLabelsSpin->setValue( myScalarBarActor->GetNumberOfLabels() ); + myColorsSpin->setValue( myScalarBarActor->GetMaximumNumberOfColors() ); + + if ( myScalarBarActor->GetOrientation() == VTK_ORIENT_VERTICAL ) + myVertRadioBtn->setChecked( true ); + else + myHorizRadioBtn->setChecked( true ); + myIniOrientation = myVertRadioBtn->isChecked(); + + myIniX = myScalarBarActor->GetPosition()[0]; + myIniY = myScalarBarActor->GetPosition()[1]; + myIniW = myScalarBarActor->GetWidth(); + myIniH = myScalarBarActor->GetHeight(); + setOriginAndSize( myIniX, myIniY, myIniW, myIniH ); + + myRangeGrp->setEnabled( true ); + myFontGrp->setEnabled( true ); + myLabColorGrp->setEnabled( true ); + myOrientationGrp->setEnabled( true ); + myOriginDimGrp->setEnabled( true ); + myOkBtn->setEnabled( true ); + myApplyBtn->setEnabled( true ); + return; } } } @@ -625,9 +625,9 @@ void SMESHGUI_Preferences_ScalarBarDlg::onXYChanged() */ //================================================================================================= void SMESHGUI_Preferences_ScalarBarDlg::setOriginAndSize( const double x, - const double y, - const double w, - const double h ) + const double y, + const double w, + const double h ) { blockSignals( true ); myXSpin->setValue( x ); @@ -656,9 +656,9 @@ void SMESHGUI_Preferences_ScalarBarDlg::onOrientationChanged() setOriginAndSize( myIniX, myIniY, myIniW, myIniH ); else setOriginAndSize( aOrientation ? DEF_VER_X : DEF_HOR_X, - aOrientation ? DEF_VER_Y : DEF_HOR_Y, - aOrientation ? DEF_VER_W : DEF_HOR_W, - aOrientation ? DEF_VER_H : DEF_HOR_H ); + aOrientation ? DEF_VER_Y : DEF_HOR_Y, + aOrientation ? DEF_VER_W : DEF_HOR_W, + aOrientation ? DEF_VER_H : DEF_HOR_H ); } //================================================================================================= diff --git a/src/SMESHGUI/SMESHGUI_Preferences_ScalarBarDlg.h b/src/SMESHGUI/SMESHGUI_Preferences_ScalarBarDlg.h index 609631267..cc4126202 100644 --- a/src/SMESHGUI/SMESHGUI_Preferences_ScalarBarDlg.h +++ b/src/SMESHGUI/SMESHGUI_Preferences_ScalarBarDlg.h @@ -63,9 +63,9 @@ public: void closeEvent( QCloseEvent* ); void setOriginAndSize( const double, - const double, - const double, - const double ); + const double, + const double, + const double ); void initScalarBarFromResources(); protected slots: diff --git a/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx b/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx index 7986c2d63..9af8862ef 100644 --- a/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx @@ -204,7 +204,7 @@ void SMESHGUI_RemoveElementsDlg::Init() /* to close dialog if study change */ connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel())); connect(myEditCurrentArgument, SIGNAL(textChanged(const QString&)), - SLOT(onTextChange(const QString&))); + SLOT(onTextChange(const QString&))); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) aViewWindow->SetSelectionMode(CellSelection); @@ -291,10 +291,10 @@ void SMESHGUI_RemoveElementsDlg::ClickOnHelp() platform = "application"; #endif SUIT_MessageBox::warning(this, tr("WRN_WARNING"), - tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", - platform)). - arg(myHelpFileName)); + tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", + platform)). + arg(myHelpFileName)); } } @@ -321,15 +321,15 @@ void SMESHGUI_RemoveElementsDlg::onTextChange(const QString& theNewText) QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts); for (int i = 0; i < aListId.count(); i++) { - if(const SMDS_MeshElement *anElem = aMesh->FindElement(aListId[i].toInt())) { - newIndices.Add(anElem->GetID()); - myNbOkElements++; - } + if(const SMDS_MeshElement *anElem = aMesh->FindElement(aListId[i].toInt())) { + newIndices.Add(anElem->GetID()); + myNbOkElements++; + } } mySelector->AddOrRemoveIndex(anIO,newIndices,false); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->highlight(anIO,true,true); + aViewWindow->highlight(anIO,true,true); } } @@ -410,8 +410,8 @@ void SMESHGUI_RemoveElementsDlg::SetEditCurrentArgument() case 0: /* default constructor */ { if(send == SelectButtonC1A1) { - LineEditC1A1->setFocus(); - myEditCurrentArgument = LineEditC1A1; + LineEditC1A1->setFocus(); + myEditCurrentArgument = LineEditC1A1; } SelectionIntoArgument(); break; @@ -509,8 +509,8 @@ void SMESHGUI_RemoveElementsDlg::setFilters() { if(myMesh->_is_nil()) { SUIT_MessageBox::critical(this, - tr("SMESH_ERROR"), - tr("NO_MESH_SELECTED")); + tr("SMESH_ERROR"), + tr("NO_MESH_SELECTED")); return; } if ( !myFilterDlg ) diff --git a/src/SMESHGUI/SMESHGUI_RemoveNodesDlg.cxx b/src/SMESHGUI/SMESHGUI_RemoveNodesDlg.cxx index c511dbae4..e6687ff29 100644 --- a/src/SMESHGUI/SMESHGUI_RemoveNodesDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RemoveNodesDlg.cxx @@ -204,7 +204,7 @@ void SMESHGUI_RemoveNodesDlg::Init() /* to close dialog if study change */ connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel())); connect(myEditCurrentArgument, SIGNAL(textChanged(const QString&)), - SLOT(onTextChange(const QString&))); + SLOT(onTextChange(const QString&))); SMESH::SetPointRepresentation(true); @@ -297,10 +297,10 @@ void SMESHGUI_RemoveNodesDlg::ClickOnHelp() platform = "application"; #endif SUIT_MessageBox::warning(this, tr("WRN_WARNING"), - tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", - platform)). - arg(myHelpFileName)); + tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", + platform)). + arg(myHelpFileName)); } } @@ -327,15 +327,15 @@ void SMESHGUI_RemoveNodesDlg::onTextChange(const QString& theNewText) QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts); for (int i = 0; i < aListId.count(); i++) { - if (const SMDS_MeshNode *aNode = aMesh->FindNode(aListId[i].toInt())) { - newIndices.Add(aNode->GetID()); - myNbOkNodes++; - } + if (const SMDS_MeshNode *aNode = aMesh->FindNode(aListId[i].toInt())) { + newIndices.Add(aNode->GetID()); + myNbOkNodes++; + } } mySelector->AddOrRemoveIndex(anIO,newIndices,false); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->highlight(anIO,true,true); + aViewWindow->highlight(anIO,true,true); } } @@ -416,8 +416,8 @@ void SMESHGUI_RemoveNodesDlg::SetEditCurrentArgument() case 0: /* default constructor */ { if(send == SelectButtonC1A1) { - LineEditC1A1->setFocus(); - myEditCurrentArgument = LineEditC1A1; + LineEditC1A1->setFocus(); + myEditCurrentArgument = LineEditC1A1; } SelectionIntoArgument(); break; @@ -516,8 +516,8 @@ void SMESHGUI_RemoveNodesDlg::setFilters() { if(myMesh->_is_nil()) { SUIT_MessageBox::critical(this, - tr("SMESH_ERROR"), - tr("NO_MESH_SELECTED")); + tr("SMESH_ERROR"), + tr("NO_MESH_SELECTED")); return; } if ( !myFilterDlg ) diff --git a/src/SMESHGUI/SMESHGUI_RenumberingDlg.cxx b/src/SMESHGUI/SMESHGUI_RenumberingDlg.cxx index 26a2614ac..5e575a670 100644 --- a/src/SMESHGUI/SMESHGUI_RenumberingDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RenumberingDlg.cxx @@ -78,14 +78,14 @@ SMESHGUI_RenumberingDlg::SMESHGUI_RenumberingDlg( SMESHGUI* theModule, const int setModal(false); setAttribute(Qt::WA_DeleteOnClose, true); setWindowTitle(unit == 0 ? - tr("SMESH_RENUMBERING_NODES_TITLE") : - tr("SMESH_RENUMBERING_ELEMENTS_TITLE")); + tr("SMESH_RENUMBERING_NODES_TITLE") : + tr("SMESH_RENUMBERING_ELEMENTS_TITLE")); setSizeGripEnabled(true); SUIT_ResourceMgr* resMgr = SMESH::GetResourceMgr( mySMESHGUI ); QPixmap image0(resMgr->loadPixmap("SMESH", unit == 0 ? - tr("ICON_DLG_RENUMBERING_NODES") : - tr("ICON_DLG_RENUMBERING_ELEMENTS"))); + tr("ICON_DLG_RENUMBERING_NODES") : + tr("ICON_DLG_RENUMBERING_ELEMENTS"))); QPixmap image1(resMgr->loadPixmap("SMESH",tr("ICON_SELECT"))); QVBoxLayout* SMESHGUI_RenumberingDlgLayout = new QVBoxLayout(this); @@ -94,9 +94,9 @@ SMESHGUI_RenumberingDlg::SMESHGUI_RenumberingDlg( SMESHGUI* theModule, const int /***************************************************************/ GroupConstructors = new QGroupBox(unit == 0 ? - tr("SMESH_NODES") : - tr("SMESH_ELEMENTS"), - this); + tr("SMESH_NODES") : + tr("SMESH_ELEMENTS"), + this); myHelpFileName = unit == 0 ? "renumbering_nodes_and_elements_page.html#renumbering_nodes_anchor" : "renumbering_nodes_and_elements_page.html#renumbering_elements_anchor"; @@ -219,22 +219,22 @@ void SMESHGUI_RenumberingDlg::ClickOnApply() bool isUnitsLabeled = false; if (myUnit == 0 && anActor) { - isUnitsLabeled = anActor->GetPointsLabeled(); - if (isUnitsLabeled) anActor->SetPointsLabeled(false); + isUnitsLabeled = anActor->GetPointsLabeled(); + if (isUnitsLabeled) anActor->SetPointsLabeled(false); } else if (myUnit == 1 && anActor) { - isUnitsLabeled = anActor->GetCellsLabeled(); - if (isUnitsLabeled) anActor->SetCellsLabeled(false); + isUnitsLabeled = anActor->GetCellsLabeled(); + if (isUnitsLabeled) anActor->SetCellsLabeled(false); } SUIT_OverrideCursor aWaitCursor; if (myUnit == 0) { - aMeshEditor->RenumberNodes(); - if (isUnitsLabeled && anActor) anActor->SetPointsLabeled(true); + aMeshEditor->RenumberNodes(); + if (isUnitsLabeled && anActor) anActor->SetPointsLabeled(true); } else if (myUnit == 1) { - aMeshEditor->RenumberElements(); - if (isUnitsLabeled && anActor) anActor->SetCellsLabeled(true); + aMeshEditor->RenumberElements(); + if (isUnitsLabeled && anActor) anActor->SetCellsLabeled(true); } } catch(...) { @@ -285,10 +285,10 @@ void SMESHGUI_RenumberingDlg::ClickOnHelp() platform = "application"; #endif SUIT_MessageBox::warning(this, tr("WRN_WARNING"), - tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", - platform)). - arg(myHelpFileName)); + tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", + platform)). + arg(myHelpFileName)); } } @@ -316,7 +316,7 @@ void SMESHGUI_RenumberingDlg::SelectionIntoArgument() Handle(SALOME_InteractiveObject) IO = aList.First(); myMesh = SMESH::IObjectToInterface(IO); if (myMesh->_is_nil()) - aString = ""; + aString = ""; } } @@ -338,12 +338,12 @@ void SMESHGUI_RenumberingDlg::SetEditCurrentArgument() { case 0: /* default constructor */ { - if(send == SelectButton) { - LineEditMesh->setFocus(); - myEditCurrentArgument = LineEditMesh; - } - SelectionIntoArgument(); - break; + if(send == SelectButton) { + LineEditMesh->setFocus(); + myEditCurrentArgument = LineEditMesh; + } + SelectionIntoArgument(); + break; } } } diff --git a/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx b/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx index 270961236..484989dfd 100644 --- a/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx @@ -452,7 +452,7 @@ void SMESHGUI_RevolutionDlg::ConstructorsClicked (int constructorId) myIDs.clear(); myNbOkElements = 0; if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(aSelMode); + aViewWindow->SetSelectionMode(aSelMode); } myEditCurrentArgument = (QWidget*)LineEditElements; @@ -519,29 +519,29 @@ bool SMESHGUI_RevolutionDlg::ClickOnApply() if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() ) { if( CheckBoxMesh->isChecked() ) { - if( GetConstructorId() == 0 ) - SMESH::ListOfGroups_var groups = - aMeshEditor->RotationSweepObject1DMakeGroups(mySelectedObject, anAxis, - anAngle, aNbSteps, aTolerance); - else - SMESH::ListOfGroups_var groups = - aMeshEditor->RotationSweepObject2DMakeGroups(mySelectedObject, anAxis, - anAngle, aNbSteps, aTolerance); - } - else - SMESH::ListOfGroups_var groups = - aMeshEditor->RotationSweepMakeGroups(anElementsId.inout(), anAxis, - anAngle, aNbSteps, aTolerance); + if( GetConstructorId() == 0 ) + SMESH::ListOfGroups_var groups = + aMeshEditor->RotationSweepObject1DMakeGroups(mySelectedObject, anAxis, + anAngle, aNbSteps, aTolerance); + else + SMESH::ListOfGroups_var groups = + aMeshEditor->RotationSweepObject2DMakeGroups(mySelectedObject, anAxis, + anAngle, aNbSteps, aTolerance); + } + else + SMESH::ListOfGroups_var groups = + aMeshEditor->RotationSweepMakeGroups(anElementsId.inout(), anAxis, + anAngle, aNbSteps, aTolerance); } else { if( CheckBoxMesh->isChecked() ) { - if( GetConstructorId() == 0 ) - aMeshEditor->RotationSweepObject1D(mySelectedObject, anAxis, anAngle, aNbSteps, aTolerance); - else - aMeshEditor->RotationSweepObject2D(mySelectedObject, anAxis, anAngle, aNbSteps, aTolerance); - } - else - aMeshEditor->RotationSweep(anElementsId.inout(), anAxis, anAngle, aNbSteps, aTolerance); + if( GetConstructorId() == 0 ) + aMeshEditor->RotationSweepObject1D(mySelectedObject, anAxis, anAngle, aNbSteps, aTolerance); + else + aMeshEditor->RotationSweepObject2D(mySelectedObject, anAxis, anAngle, aNbSteps, aTolerance); + } + else + aMeshEditor->RotationSweep(anElementsId.inout(), anAxis, anAngle, aNbSteps, aTolerance); } myMesh->SetParameters( aParameters.join(":").toLatin1().constData() ); @@ -602,10 +602,10 @@ void SMESHGUI_RevolutionDlg::ClickOnHelp() platform = "application"; #endif SUIT_MessageBox::warning(this, tr("WRN_WARNING"), - tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", - platform)). - arg(myHelpFileName)); + tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", + platform)). + arg(myHelpFileName)); } } @@ -653,15 +653,15 @@ void SMESHGUI_RevolutionDlg::onTextChange (const QString& theNewText) QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts); for (int i = 0; i < aListId.count(); i++) { - const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt()); - if (e) - newIndices.Add(e->GetID()); - myNbOkElements++; + const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt()); + if (e) + newIndices.Add(e->GetID()); + myNbOkElements++; } mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->highlight( myActor->getIO(), true, true ); + aViewWindow->highlight( myActor->getIO(), true, true ); myElementsId = theNewText; } @@ -744,7 +744,7 @@ void SMESHGUI_RevolutionDlg::SelectionIntoArgument() aNbUnits = SMESH::GetNameOfSelectedElements(mySelector, IO, aString); myElementsId = aString; if (aNbUnits < 1) - return; + return; } myNbOkElements = true; } else { @@ -834,20 +834,20 @@ void SMESHGUI_RevolutionDlg::SetEditCurrentArgument() SMESH::SetPointRepresentation(false); if (CheckBoxMesh->isChecked()) { if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(ActorSelection); + aViewWindow->SetSelectionMode(ActorSelection); mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter); } else { int aConstructorId = GetConstructorId(); if (aConstructorId == 0) - { - if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(EdgeSelection); - } + { + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(EdgeSelection); + } else if (aConstructorId == 1) - { - if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(FaceSelection); - } + { + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(FaceSelection); + } } } else if (send == SelectPointButton) { myEditCurrentArgument = (QWidget*)SpinBox_X; @@ -956,13 +956,13 @@ void SMESHGUI_RevolutionDlg::onSelectMesh (bool toSelectMesh) int aConstructorId = GetConstructorId(); if (aConstructorId == 0) { - if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(EdgeSelection); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(EdgeSelection); } else if (aConstructorId == 1) { - if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(FaceSelection); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(FaceSelection); } LineEditElements->setReadOnly(false); @@ -993,8 +993,8 @@ int SMESHGUI_RevolutionDlg::GetConstructorId() bool SMESHGUI_RevolutionDlg::IsAxisOk() { return (SpinBox_DX->GetValue() != 0 || - SpinBox_DY->GetValue() != 0 || - SpinBox_DZ->GetValue() != 0); + SpinBox_DY->GetValue() != 0 || + SpinBox_DZ->GetValue() != 0); } //================================================================================= @@ -1055,7 +1055,7 @@ void SMESHGUI_RevolutionDlg::onDisplaySimulation(bool toDisplayPreview) anElementsId->length(aListElementsId.count()); for (int i = 0; i < aListElementsId.count(); i++) - anElementsId[i] = aListElementsId[i].toInt(); + anElementsId[i] = aListElementsId[i].toInt(); SMESH::AxisStruct anAxis; @@ -1071,27 +1071,27 @@ void SMESHGUI_RevolutionDlg::onDisplaySimulation(bool toDisplayPreview) double aTolerance = SpinBox_Tolerance->GetValue(); if (GroupAngle->checkedId() == 1) - anAngle = anAngle/aNbSteps; + anAngle = anAngle/aNbSteps; try { - SUIT_OverrideCursor aWaitCursor; - SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditPreviewer(); + SUIT_OverrideCursor aWaitCursor; + SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditPreviewer(); if( CheckBoxMesh->isChecked() ) { - if( GetConstructorId() == 0 ) - aMeshEditor->RotationSweepObject1D(mySelectedObject, anAxis, - anAngle, aNbSteps, aTolerance); - else - aMeshEditor->RotationSweepObject2D(mySelectedObject, anAxis, - anAngle, aNbSteps, aTolerance); - } - else - aMeshEditor->RotationSweep(anElementsId.inout(), - anAxis, - anAngle, - aNbSteps, - aTolerance); - SMESH::MeshPreviewStruct_var aMeshPreviewStruct = aMeshEditor->GetPreviewData(); - mySimulation->SetData(aMeshPreviewStruct._retn()); + if( GetConstructorId() == 0 ) + aMeshEditor->RotationSweepObject1D(mySelectedObject, anAxis, + anAngle, aNbSteps, aTolerance); + else + aMeshEditor->RotationSweepObject2D(mySelectedObject, anAxis, + anAngle, aNbSteps, aTolerance); + } + else + aMeshEditor->RotationSweep(anElementsId.inout(), + anAxis, + anAngle, + aNbSteps, + aTolerance); + SMESH::MeshPreviewStruct_var aMeshPreviewStruct = aMeshEditor->GetPreviewData(); + mySimulation->SetData(aMeshPreviewStruct._retn()); } catch (...) {} } else @@ -1155,8 +1155,8 @@ void SMESHGUI_RevolutionDlg::setFilters() { if(myMesh->_is_nil()) { SUIT_MessageBox::critical(this, - tr("SMESH_ERROR"), - tr("NO_MESH_SELECTED")); + tr("SMESH_ERROR"), + tr("NO_MESH_SELECTED")); return; } if ( !myFilterDlg ) diff --git a/src/SMESHGUI/SMESHGUI_RotationDlg.cxx b/src/SMESHGUI/SMESHGUI_RotationDlg.cxx index a148af80e..d9352dbc8 100644 --- a/src/SMESHGUI/SMESHGUI_RotationDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RotationDlg.cxx @@ -414,8 +414,8 @@ bool SMESHGUI_RotationDlg::ClickOnApply() aMeshEditor->RotateObject(mySelectedObject, anAxis, anAngle, false); else aMeshEditor->Rotate(anElementsId, anAxis, anAngle, false); - if( !myMesh->_is_nil()) - myMesh->SetParameters( aParameters.join(":").toLatin1().constData() ); + if( !myMesh->_is_nil()) + myMesh->SetParameters( aParameters.join(":").toLatin1().constData() ); break; case COPY_ELEMS_BUTTON: if ( makeGroups ) { @@ -431,8 +431,8 @@ bool SMESHGUI_RotationDlg::ClickOnApply() else aMeshEditor->Rotate(anElementsId, anAxis, anAngle, true); } - if( !myMesh->_is_nil()) - myMesh->SetParameters( aParameters.join(":").toLatin1().constData() ); + if( !myMesh->_is_nil()) + myMesh->SetParameters( aParameters.join(":").toLatin1().constData() ); break; case MAKE_MESH_BUTTON: SMESH::SMESH_Mesh_var mesh; @@ -442,8 +442,8 @@ bool SMESHGUI_RotationDlg::ClickOnApply() else mesh = aMeshEditor->RotateMakeMesh(anElementsId, anAxis, anAngle, makeGroups, LineEditNewMesh->text().toLatin1().data()); - if( !mesh->_is_nil()) - mesh->SetParameters( aParameters.join(":").toLatin1().constData() ); + if( !mesh->_is_nil()) + mesh->SetParameters( aParameters.join(":").toLatin1().constData() ); } } catch (...) { } @@ -506,10 +506,10 @@ void SMESHGUI_RotationDlg::ClickOnHelp() platform = "application"; #endif SUIT_MessageBox::warning(this, tr("WRN_WARNING"), - tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", - platform)). - arg(myHelpFileName)); + tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", + platform)). + arg(myHelpFileName)); } } @@ -543,15 +543,15 @@ void SMESHGUI_RotationDlg::onTextChange (const QString& theNewText) QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts); for (int i = 0; i < aListId.count(); i++) { - const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt()); - if (e) - newIndices.Add(e->GetID()); - myNbOkElements++; + const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt()); + if (e) + newIndices.Add(e->GetID()); + myNbOkElements++; } mySelector->AddOrRemoveIndex( anIO, newIndices, false ); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->highlight( anIO, true, true ); + aViewWindow->highlight( anIO, true, true ); myElementsId = theNewText; } @@ -743,23 +743,23 @@ void SMESHGUI_RotationDlg::SetEditCurrentArgument() myEditCurrentArgument = (QWidget*)LineEditElements; SMESH::SetPointRepresentation(false); if (CheckBoxMesh->isChecked()) { - if ( aViewWindow ) - aViewWindow->SetSelectionMode(ActorSelection); + if ( aViewWindow ) + aViewWindow->SetSelectionMode(ActorSelection); mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter); } else { - if ( aViewWindow ) - aViewWindow->SetSelectionMode( CellSelection ); - } + if ( aViewWindow ) + aViewWindow->SetSelectionMode( CellSelection ); + } } else if (send == SelectPointButton) { myEditCurrentArgument = (QWidget*)SpinBox_X; SMESH::SetPointRepresentation(true); - if ( aViewWindow ) - aViewWindow->SetSelectionMode( NodeSelection ); + if ( aViewWindow ) + aViewWindow->SetSelectionMode( NodeSelection ); } else if (send == SelectVectorButton) { myEditCurrentArgument = (QWidget*)SpinBox_DX; SMESH::SetPointRepresentation(true); - if ( aViewWindow ) - aViewWindow->SetSelectionMode( NodeSelection ); + if ( aViewWindow ) + aViewWindow->SetSelectionMode( NodeSelection ); } break; } @@ -879,8 +879,8 @@ void SMESHGUI_RotationDlg::onSelectMesh (bool toSelectMesh) bool SMESHGUI_RotationDlg::IsAxisOk() { return (SpinBox_DX->GetValue() != 0 || - SpinBox_DY->GetValue() != 0 || - SpinBox_DZ->GetValue() != 0); + SpinBox_DY->GetValue() != 0 || + SpinBox_DZ->GetValue() != 0); } //================================================================================= @@ -977,8 +977,8 @@ void SMESHGUI_RotationDlg::setFilters() { if(myMesh->_is_nil()) { SUIT_MessageBox::critical(this, - tr("SMESH_ERROR"), - tr("NO_MESH_SELECTED")); + tr("SMESH_ERROR"), + tr("NO_MESH_SELECTED")); return; } if ( !myFilterDlg ) diff --git a/src/SMESHGUI/SMESHGUI_Selection.cxx b/src/SMESHGUI/SMESHGUI_Selection.cxx index ba08f5570..8eb024b8d 100644 --- a/src/SMESHGUI/SMESHGUI_Selection.cxx +++ b/src/SMESHGUI/SMESHGUI_Selection.cxx @@ -360,7 +360,7 @@ QVariant SMESHGUI_Selection::isComputable( int ind ) const SMESH::SMESH_Mesh_var mesh = SMESH::GetMeshByIO(io); // m,sm,gr->m if ( !mesh->_is_nil() ) {*/ _PTR(SObject) so = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() ); - //FindSObject( mesh ); + //FindSObject( mesh ); if ( so ) { CORBA::Object_var obj = SMESH::SObjectToObject(so, SMESH::GetActiveStudyDocument()); if(!CORBA::is_nil(obj)){ @@ -428,7 +428,7 @@ QVariant SMESHGUI_Selection::isVisible( int ind ) const SMESH_Actor* actor = SMESH::FindActorByEntry( ent.toLatin1().data() ); if ( actor && actor->hasIO() ) { if(SVTK_ViewWindow* aViewWindow = SMESH::GetCurrentVtkView()) - return QVariant( aViewWindow->isVisible( actor->getIO() ) ); + return QVariant( aViewWindow->isVisible( actor->getIO() ) ); } } return QVariant( false ); diff --git a/src/SMESHGUI/SMESHGUI_SelectionOp.h b/src/SMESHGUI/SMESHGUI_SelectionOp.h index a6bfefe03..083df7390 100644 --- a/src/SMESHGUI/SMESHGUI_SelectionOp.h +++ b/src/SMESHGUI/SMESHGUI_SelectionOp.h @@ -107,7 +107,7 @@ protected: //! Select some nodes or elements in VTK void addOrRemoveIndex( const Handle( SALOME_InteractiveObject )&, - const TColStd_MapOfInteger&, const bool ); + const TColStd_MapOfInteger&, const bool isModeShift); SVTK_ViewWindow* viewWindow() const; SVTK_Selector* selector() const; diff --git a/src/SMESHGUI/SMESHGUI_SewingDlg.cxx b/src/SMESHGUI/SMESHGUI_SewingDlg.cxx index b42b97e50..2a94befb8 100644 --- a/src/SMESHGUI/SMESHGUI_SewingDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_SewingDlg.cxx @@ -385,9 +385,9 @@ void SMESHGUI_SewingDlg::ConstructorsClicked (int constructorId) LineEdit5->setEnabled(false); if (!CheckBoxPolygons->isVisible()) - CheckBoxPolygons->show(); + CheckBoxPolygons->show(); if (!CheckBoxPolyedrs->isVisible()) - CheckBoxPolyedrs->show(); + CheckBoxPolyedrs->show(); myOk5 = true; @@ -412,7 +412,7 @@ void SMESHGUI_SewingDlg::ConstructorsClicked (int constructorId) SMESH::SetPointRepresentation(false); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(CellSelection); + aViewWindow->SetSelectionMode(CellSelection); break; } } @@ -472,8 +472,8 @@ bool SMESHGUI_SewingDlg::ClickOnApply() LineEdit4->text().toLong(), LineEdit5->text().toLong(), LineEdit6->text().toLong(), - toCreatePolygons, - toCreatePolyedrs); + toCreatePolygons, + toCreatePolyedrs); else if (aConstructorId == 1) anError = aMeshEditor->SewConformFreeBorders(LineEdit1->text().toLong(), LineEdit2->text().toLong(), @@ -486,8 +486,8 @@ bool SMESHGUI_SewingDlg::ClickOnApply() LineEdit3->text().toLong(), LineEdit4->text().toLong(), LineEdit6->text().toLong(), - toCreatePolygons, - toCreatePolyedrs); + toCreatePolygons, + toCreatePolyedrs); else if (aConstructorId == 3) { QStringList aListElementsId1 = LineEdit1->text().split(" ", QString::SkipEmptyParts); QStringList aListElementsId2 = LineEdit4->text().split(" ", QString::SkipEmptyParts); @@ -580,10 +580,10 @@ void SMESHGUI_SewingDlg::ClickOnHelp() platform = "application"; #endif SUIT_MessageBox::warning(this, tr("WRN_WARNING"), - tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", - platform)). - arg(myHelpFileName)); + tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", + platform)). + arg(myHelpFileName)); } } @@ -632,15 +632,15 @@ void SMESHGUI_SewingDlg::onTextChange (const QString& theNewText) SMESH::SetPointRepresentation(true); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(NodeSelection); + aViewWindow->SetSelectionMode(NodeSelection); const SMDS_MeshNode * n = aMesh->FindNode(theNewText.toInt()); if (n) { - newIndices.Add(n->GetID()); - mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false); - if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->highlight( myActor->getIO(), true, true ); - + newIndices.Add(n->GetID()); + mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->highlight( myActor->getIO(), true, true ); + if (send == LineEdit1) myOk1 = true; else if (send == LineEdit2) @@ -658,7 +658,7 @@ void SMESHGUI_SewingDlg::onTextChange (const QString& theNewText) SMESH::SetPointRepresentation(false); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(CellSelection); + aViewWindow->SetSelectionMode(CellSelection); QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts); @@ -667,8 +667,8 @@ void SMESHGUI_SewingDlg::onTextChange (const QString& theNewText) for (int i = 0; i < aListId.count(); i++) { const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt()); if (e) - newIndices.Add(e->GetID()); - + newIndices.Add(e->GetID()); + if (!isEvenOneExists) isEvenOneExists = true; } @@ -676,7 +676,7 @@ void SMESHGUI_SewingDlg::onTextChange (const QString& theNewText) mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->highlight( myActor->getIO(), true, true ); + aViewWindow->highlight( myActor->getIO(), true, true ); if (isEvenOneExists) { if (send == LineEdit1) diff --git a/src/SMESHGUI/SMESHGUI_ShapeByMeshDlg.cxx b/src/SMESHGUI/SMESHGUI_ShapeByMeshDlg.cxx index 82352334b..aeae0ef73 100644 --- a/src/SMESHGUI/SMESHGUI_ShapeByMeshDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ShapeByMeshDlg.cxx @@ -129,7 +129,7 @@ QFrame* SMESHGUI_ShapeByMeshDlg::createMainFrame (QWidget* theParent) QLabel* anIdLabel = new QLabel( tr("ELEMENT_ID"), aMainGrp ); myElementId = new QLineEdit( aMainGrp ); myElementId->setValidator( new SMESHGUI_IdValidator( theParent, - !myIsMultipleAllowed ? 1 : 0 ) ); // 0 for any number of entities + !myIsMultipleAllowed ? 1 : 0 ) ); // 0 for any number of entities // shape name QLabel* aNameLabel = new QLabel( tr("GEOMETRY_NAME"), aMainGrp ); @@ -250,36 +250,36 @@ void SMESHGUI_ShapeByMeshOp::SetMesh (SMESH::SMESH_Mesh_ptr thePtr) int shapeDim = 0; // max dim with several shapes //if ( /*mySelectionMgr*/ selectionMgr()->isOk(anIObj) ) // check that the mesh has a valid shape { - _PTR(SObject) aSO = SMESH::FindSObject(myMesh.in()); - GEOM::GEOM_Object_var mainShape = SMESH::GetGeom(aSO); - if ( !mainShape->_is_nil() ) - { - TopoDS_Shape aShape; - if ( GEOMBase::GetShape(mainShape, aShape)) - { - TopAbs_ShapeEnum types[4] = { TopAbs_EDGE, TopAbs_FACE, TopAbs_SHELL, TopAbs_SOLID }; - for ( int dim = 4; dim > 0; --dim ) { - TopAbs_ShapeEnum type = types[ dim - 1 ]; - TopAbs_ShapeEnum avoid = ( type == TopAbs_SHELL ) ? TopAbs_SOLID : TopAbs_SHAPE; - TopExp_Explorer exp( aShape, type, avoid ); - for ( ; nbShapes[ type ] < 2 && exp.More(); exp.Next() ) - ++nbShapes[ type ]; - if ( nbShapes[ type ] > 1 ) { - shapeDim = dim; - break; - } - } - } - } + _PTR(SObject) aSO = SMESH::FindSObject(myMesh.in()); + GEOM::GEOM_Object_var mainShape = SMESH::GetGeom(aSO); + if ( !mainShape->_is_nil() ) + { + TopoDS_Shape aShape; + if ( GEOMBase::GetShape(mainShape, aShape)) + { + TopAbs_ShapeEnum types[4] = { TopAbs_EDGE, TopAbs_FACE, TopAbs_SHELL, TopAbs_SOLID }; + for ( int dim = 4; dim > 0; --dim ) { + TopAbs_ShapeEnum type = types[ dim - 1 ]; + TopAbs_ShapeEnum avoid = ( type == TopAbs_SHELL ) ? TopAbs_SOLID : TopAbs_SHAPE; + TopExp_Explorer exp( aShape, type, avoid ); + for ( ; nbShapes[ type ] < 2 && exp.More(); exp.Next() ) + ++nbShapes[ type ]; + if ( nbShapes[ type ] > 1 ) { + shapeDim = dim; + break; + } + } + } + } } if (shapeDim > 0) - { - if ( nbShapes[ TopAbs_SHELL ] + nbShapes[ TopAbs_SOLID ] > 1 ) - shapeDim = 3; - hasElement[ EDGE ] = shapeDim > 0 && myMesh->NbEdges(); - hasElement[ FACE ] = shapeDim > 1 && myMesh->NbFaces(); - hasElement[ VOLUME ] = shapeDim > 2 && myMesh->NbVolumes(); - } + { + if ( nbShapes[ TopAbs_SHELL ] + nbShapes[ TopAbs_SOLID ] > 1 ) + shapeDim = 3; + hasElement[ EDGE ] = shapeDim > 0 && myMesh->NbEdges(); + hasElement[ FACE ] = shapeDim > 1 && myMesh->NbFaces(); + hasElement[ VOLUME ] = shapeDim > 2 && myMesh->NbVolumes(); + } myHasSolids = nbShapes[ TopAbs_SOLID ]; } @@ -306,83 +306,83 @@ void SMESHGUI_ShapeByMeshOp::commitOperation() QStringList aListId = myDlg->myElementId->text().split( " ", QString::SkipEmptyParts); if (aListId.count() == 1) { - int elemID = (aListId.first()).toInt(); - myGeomObj = GEOM::GEOM_Object::_duplicate( - SMESHGUI::GetSMESHGen()->GetGeometryByMeshElement - ( myMesh.in(), elemID, myDlg->myGeomName->text().toLatin1().constData()) ); + int elemID = (aListId.first()).toInt(); + myGeomObj = GEOM::GEOM_Object::_duplicate( + SMESHGUI::GetSMESHGen()->GetGeometryByMeshElement + ( myMesh.in(), elemID, myDlg->myGeomName->text().toLatin1().constData()) ); } else { - GEOM::GEOM_Gen_var geomGen = SMESH::GetGEOMGen(); - _PTR(Study) aStudy = SMESH::GetActiveStudyDocument(); - - if (geomGen->_is_nil() || !aStudy) - return; - - GEOM::GEOM_IShapesOperations_var aShapesOp = - geomGen->GetIShapesOperations(aStudy->StudyId()); - if (aShapesOp->_is_nil() ) - return; - - TopAbs_ShapeEnum aGroupType = TopAbs_SHAPE; - - std::map aGeomObjectsMap; - GEOM::GEOM_Object_var aGeomObject; - - GEOM::GEOM_Object_var aMeshShape = myMesh->GetShapeToMesh(); - - for ( int i = 0; i < aListId.count(); i++ ) - { - aGeomObject = - SMESHGUI::GetSMESHGen()->FindGeometryByMeshElement(myMesh.in(), aListId[i].toInt()); - - if (aGeomObject->_is_nil()) continue; - - double anId = aShapesOp->GetSubShapeIndex(aMeshShape, aGeomObject); - if (aShapesOp->IsDone() && aGeomObjectsMap.find(anId) == aGeomObjectsMap.end()) - { - aGeomObjectsMap[anId] = aGeomObject; - - TopAbs_ShapeEnum aSubShapeType = (TopAbs_ShapeEnum)aGeomObject->GetShapeType(); - if (i == 0) - aGroupType = aSubShapeType; - else if (aSubShapeType != aGroupType) - aGroupType = TopAbs_SHAPE; - } - } - - int aNumberOfGO = aGeomObjectsMap.size(); - if (aNumberOfGO == 1) - myGeomObj = (*aGeomObjectsMap.begin()).second; - else if (aNumberOfGO > 1) - { - GEOM::GEOM_IGroupOperations_var aGroupOp = - geomGen->GetIGroupOperations(aStudy->StudyId()); - if(aGroupOp->_is_nil()) - return; - - GEOM::ListOfGO_var aGeomObjects = new GEOM::ListOfGO(); - aGeomObjects->length( aNumberOfGO ); - - int i = 0; - std::map::iterator anIter; - for (anIter = aGeomObjectsMap.begin(); anIter!=aGeomObjectsMap.end(); anIter++) - aGeomObjects[i++] = (*anIter).second; - - //create geometry group - myGeomObj = aGroupOp->CreateGroup(aMeshShape, aGroupType); - aGroupOp->UnionList(myGeomObj, aGeomObjects); - - if (!aGroupOp->IsDone()) - return; - } - - // publish the GEOM object in study - QString aNewGeomGroupName ( myDlg->myGeomName->text() ); - - SALOMEDS::SObject_var aNewGroupSO = - geomGen->AddInStudy(SMESHGUI::GetSMESHGen()->GetCurrentStudy(), myGeomObj, - aNewGeomGroupName.toLatin1().data(), aMeshShape); + GEOM::GEOM_Gen_var geomGen = SMESH::GetGEOMGen(); + _PTR(Study) aStudy = SMESH::GetActiveStudyDocument(); + + if (geomGen->_is_nil() || !aStudy) + return; + + GEOM::GEOM_IShapesOperations_var aShapesOp = + geomGen->GetIShapesOperations(aStudy->StudyId()); + if (aShapesOp->_is_nil() ) + return; + + TopAbs_ShapeEnum aGroupType = TopAbs_SHAPE; + + std::map aGeomObjectsMap; + GEOM::GEOM_Object_var aGeomObject; + + GEOM::GEOM_Object_var aMeshShape = myMesh->GetShapeToMesh(); + + for ( int i = 0; i < aListId.count(); i++ ) + { + aGeomObject = + SMESHGUI::GetSMESHGen()->FindGeometryByMeshElement(myMesh.in(), aListId[i].toInt()); + + if (aGeomObject->_is_nil()) continue; + + double anId = aShapesOp->GetSubShapeIndex(aMeshShape, aGeomObject); + if (aShapesOp->IsDone() && aGeomObjectsMap.find(anId) == aGeomObjectsMap.end()) + { + aGeomObjectsMap[anId] = aGeomObject; + + TopAbs_ShapeEnum aSubShapeType = (TopAbs_ShapeEnum)aGeomObject->GetShapeType(); + if (i == 0) + aGroupType = aSubShapeType; + else if (aSubShapeType != aGroupType) + aGroupType = TopAbs_SHAPE; + } + } + + int aNumberOfGO = aGeomObjectsMap.size(); + if (aNumberOfGO == 1) + myGeomObj = (*aGeomObjectsMap.begin()).second; + else if (aNumberOfGO > 1) + { + GEOM::GEOM_IGroupOperations_var aGroupOp = + geomGen->GetIGroupOperations(aStudy->StudyId()); + if(aGroupOp->_is_nil()) + return; + + GEOM::ListOfGO_var aGeomObjects = new GEOM::ListOfGO(); + aGeomObjects->length( aNumberOfGO ); + + int i = 0; + std::map::iterator anIter; + for (anIter = aGeomObjectsMap.begin(); anIter!=aGeomObjectsMap.end(); anIter++) + aGeomObjects[i++] = (*anIter).second; + + //create geometry group + myGeomObj = aGroupOp->CreateGroup(aMeshShape, aGroupType); + aGroupOp->UnionList(myGeomObj, aGeomObjects); + + if (!aGroupOp->IsDone()) + return; + } + + // publish the GEOM object in study + QString aNewGeomGroupName ( myDlg->myGeomName->text() ); + + SALOMEDS::SObject_var aNewGroupSO = + geomGen->AddInStudy(SMESHGUI::GetSMESHGen()->GetCurrentStudy(), myGeomObj, + aNewGeomGroupName.toLatin1().data(), aMeshShape); } } catch (const SALOME::SALOME_Exception& S_ex) { @@ -422,7 +422,7 @@ void SMESHGUI_ShapeByMeshOp::onSelectionDone() aList.First(), aString); if (nbElems > 0) { if (!myIsMultipleAllowed && nbElems != 1 ) - return; + return; setElementID( aString ); myDlg->setButtonEnabled( true, QtxDialog::OK ); } @@ -485,31 +485,31 @@ void SMESHGUI_ShapeByMeshOp::onElemIdChanged(const QString& theNewText) { if ( SMDS_Mesh* aMesh = actor->GetObject()->GetMesh() ) { - SMDSAbs_ElementType type = SMDSAbs_Edge; - switch ( myDlg->myElemTypeGroup->checkedId() ) { - case EDGE : type = SMDSAbs_Edge; break; - case FACE : type = SMDSAbs_Face; break; - case VOLUME: type = SMDSAbs_Volume; break; - default: return; - } - TColStd_MapOfInteger newIndices; - QStringList aListId = theNewText.split( " ", QString::SkipEmptyParts); - for ( int i = 0; i < aListId.count(); i++ ) { - if ( const SMDS_MeshElement * e = aMesh->FindElement( aListId[ i ].toInt() )) - if ( e->GetType() == type ) - newIndices.Add( e->GetID() ); - } - - if ( !newIndices.IsEmpty() ) - { - if (!myIsMultipleAllowed && newIndices.Extent() != 1) - return; - if ( SVTK_Selector* s = selector() ) { - s->AddOrRemoveIndex( actor->getIO(), newIndices, false ); - viewWindow()->highlight( actor->getIO(), true, true ); - myDlg->setButtonEnabled( true, QtxDialog::OK ); - } - } + SMDSAbs_ElementType type = SMDSAbs_Edge; + switch ( myDlg->myElemTypeGroup->checkedId() ) { + case EDGE : type = SMDSAbs_Edge; break; + case FACE : type = SMDSAbs_Face; break; + case VOLUME: type = SMDSAbs_Volume; break; + default: return; + } + TColStd_MapOfInteger newIndices; + QStringList aListId = theNewText.split( " ", QString::SkipEmptyParts); + for ( int i = 0; i < aListId.count(); i++ ) { + if ( const SMDS_MeshElement * e = aMesh->FindElement( aListId[ i ].toInt() )) + if ( e->GetType() == type ) + newIndices.Add( e->GetID() ); + } + + if ( !newIndices.IsEmpty() ) + { + if (!myIsMultipleAllowed && newIndices.Extent() != 1) + return; + if ( SVTK_Selector* s = selector() ) { + s->AddOrRemoveIndex( actor->getIO(), newIndices, false ); + viewWindow()->highlight( actor->getIO(), true, true ); + myDlg->setButtonEnabled( true, QtxDialog::OK ); + } + } } } } diff --git a/src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx b/src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx index 6a27b17a3..a99a2ae96 100755 --- a/src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx @@ -278,10 +278,10 @@ void SMESHGUI_SingleEditDlg::onHelp() platform = "application"; #endif SUIT_MessageBox::warning(this, tr("WRN_WARNING"), - tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", - platform)). - arg(myHelpFileName)); + tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", + platform)). + arg(myHelpFileName)); } } @@ -348,13 +348,13 @@ void SMESHGUI_SingleEditDlg::onTextChange (const QString& theNewText) int id1, id2; if ( !getNodeIds(myEdge->text(), id1, id2) ) - return; + return; const SMDS_MeshNode* aNode1 = aMesh->FindNode( id1 ); const SMDS_MeshNode* aNode2 = aMesh->FindNode( id2 ); if ( !aNode1 || !aNode2 || aNode1 == aNode2 ) - return; + return; // find a triangle and an edge index const SMDS_MeshElement* tria1; @@ -362,23 +362,23 @@ void SMESHGUI_SingleEditDlg::onTextChange (const QString& theNewText) if ( findTriangles(aNode1,aNode2,tria1,tria2) ) { - newIndices.Add(tria1->GetID()); - - const SMDS_MeshNode* a3Nodes[3]; - SMDS_ElemIteratorPtr it; - int edgeInd = 2, i; - for (i = 0, it = tria1->nodesIterator(); it->more(); i++) { - a3Nodes[ i ] = static_cast(it->next()); - if (i > 0 && ( a3Nodes[ i ] == aNode1 && a3Nodes[ i - 1] == aNode2 || - a3Nodes[ i ] == aNode2 && a3Nodes[ i - 1] == aNode1 ) ) { - edgeInd = i - 1; - break; - } - } - newIndices.Add(-edgeInd-1); - - myOkBtn->setEnabled(true); - myApplyBtn->setEnabled(true); + newIndices.Add(tria1->GetID()); + + const SMDS_MeshNode* a3Nodes[3]; + SMDS_ElemIteratorPtr it; + int edgeInd = 2, i; + for (i = 0, it = tria1->nodesIterator(); it->more(); i++) { + a3Nodes[ i ] = static_cast(it->next()); + if (i > 0 && ( a3Nodes[ i ] == aNode1 && a3Nodes[ i - 1] == aNode2 || + a3Nodes[ i ] == aNode2 && a3Nodes[ i - 1] == aNode1 ) ) { + edgeInd = i - 1; + break; + } + } + newIndices.Add(-edgeInd-1); + + myOkBtn->setEnabled(true); + myApplyBtn->setEnabled(true); } mySelector->AddOrRemoveIndex(anIO,newIndices, false); SMESH::GetViewWindow(mySMESHGUI)->highlight( anIO, true, true ); @@ -416,17 +416,17 @@ void SMESHGUI_SingleEditDlg::onSelectionDone() { const SMDS_MeshElement* tria[2]; if( SMESH::GetEdgeNodes( mySelector, aVisualObj, anId1, anId2 ) >= 1 && - findTriangles( aMesh->FindNode( anId1 ), aMesh->FindNode( anId2 ), tria[0],tria[1] ) ) + findTriangles( aMesh->FindNode( anId1 ), aMesh->FindNode( anId2 ), tria[0],tria[1] ) ) { - QString aText = QString("%1-%2").arg(anId1).arg(anId2); - myEdge->setText(aText); - - myOkBtn->setEnabled(true); - myApplyBtn->setEnabled(true); + QString aText = QString("%1-%2").arg(anId1).arg(anId2); + myEdge->setText(aText); + + myOkBtn->setEnabled(true); + myApplyBtn->setEnabled(true); } else { - myEdge->clear(); + myEdge->clear(); } } } @@ -494,8 +494,8 @@ bool SMESHGUI_SingleEditDlg::onApply() if (aMesh->_is_nil()) { SUIT_MessageBox::information(SMESH::GetDesktop(mySMESHGUI), - tr("SMESH_ERROR"), - tr("SMESHG_NO_MESH")); + tr("SMESH_ERROR"), + tr("SMESHG_NO_MESH")); return false; } diff --git a/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx b/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx index d824e32ac..1cab8d3f4 100644 --- a/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx @@ -365,19 +365,19 @@ bool SMESHGUI_SmoothingDlg::ClickOnApply() if ( CheckBoxParametric->isChecked() ) { if(CheckBoxMesh->isChecked()) - aResult = aMeshEditor->SmoothParametricObject(mySelectedObject, aNodesId.inout(), - anIterationLimit, aMaxAspectRatio, aMethod); - else - aResult = aMeshEditor->SmoothParametric(anElementsId.inout(), aNodesId.inout(), - anIterationLimit, aMaxAspectRatio, aMethod); + aResult = aMeshEditor->SmoothParametricObject(mySelectedObject, aNodesId.inout(), + anIterationLimit, aMaxAspectRatio, aMethod); + else + aResult = aMeshEditor->SmoothParametric(anElementsId.inout(), aNodesId.inout(), + anIterationLimit, aMaxAspectRatio, aMethod); } else { if(CheckBoxMesh->isChecked()) - aResult = aMeshEditor->SmoothObject(mySelectedObject, aNodesId.inout(), - anIterationLimit, aMaxAspectRatio, aMethod); - else - aResult = aMeshEditor->Smooth(anElementsId.inout(), aNodesId.inout(), - anIterationLimit, aMaxAspectRatio, aMethod); + aResult = aMeshEditor->SmoothObject(mySelectedObject, aNodesId.inout(), + anIterationLimit, aMaxAspectRatio, aMethod); + else + aResult = aMeshEditor->Smooth(anElementsId.inout(), aNodesId.inout(), + anIterationLimit, aMaxAspectRatio, aMethod); } myMesh->SetParameters( aParameters.join(":").toLatin1().constData() ); @@ -448,10 +448,10 @@ void SMESHGUI_SmoothingDlg::ClickOnHelp() platform = "application"; #endif SUIT_MessageBox::warning(this, tr("WRN_WARNING"), - tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", - platform)). - arg(myHelpFileName)); + tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", + platform)). + arg(myHelpFileName)); } } @@ -490,28 +490,28 @@ void SMESHGUI_SmoothingDlg::onTextChange (const QString& theNewText) const Handle(SALOME_InteractiveObject)& anIO = myActor->getIO(); TColStd_MapOfInteger newIndices; for (int i = 0; i < aListId.count(); i++) { - const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt()); - if (e) - newIndices.Add(e->GetID()); - myNbOkElements++; + const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt()); + if (e) + newIndices.Add(e->GetID()); + myNbOkElements++; } mySelector->AddOrRemoveIndex(anIO, newIndices, false); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->highlight( anIO, true, true ); + aViewWindow->highlight( anIO, true, true ); myElementsId = theNewText; } else if (send == LineEditNodes) { TColStd_MapOfInteger newIndices; for (int i = 0; i < aListId.count(); i++) { - const SMDS_MeshNode * n = aMesh->FindNode(aListId[ i ].toInt()); - if (n) - newIndices.Add(n->GetID()); - myNbOkNodes++; + const SMDS_MeshNode * n = aMesh->FindNode(aListId[ i ].toInt()); + if (n) + newIndices.Add(n->GetID()); + myNbOkNodes++; } mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->highlight( myActor->getIO(), true, true ); + aViewWindow->highlight( myActor->getIO(), true, true ); } } @@ -629,21 +629,21 @@ void SMESHGUI_SmoothingDlg::SetEditCurrentArgument() myEditCurrentArgument = LineEditElements; SMESH::SetPointRepresentation(false); if (CheckBoxMesh->isChecked()) { - // mySelectionMgr->setSelectionModes(ActorSelection); - if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(ActorSelection); - mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter); + // mySelectionMgr->setSelectionModes(ActorSelection); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(ActorSelection); + mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter); } else { - if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(FaceSelection); - } + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(FaceSelection); + } } else if (send == SelectNodesButton) { - LineEditNodes->clear(); + LineEditNodes->clear(); myEditCurrentArgument = LineEditNodes; SMESH::SetPointRepresentation(true); - if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) { - aViewWindow->SetSelectionMode(NodeSelection); - } + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) { + aViewWindow->SetSelectionMode(NodeSelection); + } } myEditCurrentArgument->setFocus(); @@ -782,8 +782,8 @@ void SMESHGUI_SmoothingDlg::setFilters( const bool theIsElem ) { if(myMesh->_is_nil()) { SUIT_MessageBox::critical(this, - tr("SMESH_ERROR"), - tr("NO_MESH_SELECTED")); + tr("SMESH_ERROR"), + tr("NO_MESH_SELECTED")); return; } if ( !myFilterDlg ) diff --git a/src/SMESHGUI/SMESHGUI_SpinBox.cxx b/src/SMESHGUI/SMESHGUI_SpinBox.cxx index 1b30cb08a..c617f5ec7 100644 --- a/src/SMESHGUI/SMESHGUI_SpinBox.cxx +++ b/src/SMESHGUI/SMESHGUI_SpinBox.cxx @@ -107,9 +107,9 @@ QDoubleValidator* SMESHGUI_SpinBox::validator() const // purpose : //================================================================================= void SMESHGUI_SpinBox::RangeStepAndValidator( double min, - double max, - double step, - unsigned short precision ) + double max, + double step, + unsigned short precision ) { setPrecision(precision*(-1)); // PAL8769. Minus is for using 'g' double->string conversion specifier, // see QtxDoubleSpinBox::mapValueToText( double v ) diff --git a/src/SMESHGUI/SMESHGUI_StandardMeshInfosDlg.cxx b/src/SMESHGUI/SMESHGUI_StandardMeshInfosDlg.cxx index 4b7540fc0..d62b3a702 100644 --- a/src/SMESHGUI/SMESHGUI_StandardMeshInfosDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_StandardMeshInfosDlg.cxx @@ -203,20 +203,20 @@ void SMESHGUI_StandardMeshInfosDlg::DumpMeshInfos() int aDimension = 0; double aNbDimElements = 0; if (aNbVolumes > 0) { - aNbDimElements = aNbVolumes; - aDimension = 3; + aNbDimElements = aNbVolumes; + aDimension = 3; } else if(aNbFaces > 0) { - aNbDimElements = aNbFaces; - aDimension = 2; + aNbDimElements = aNbFaces; + aDimension = 2; } else if(aNbEdges > 0) { - aNbDimElements = aNbEdges; - aDimension = 1; + aNbDimElements = aNbEdges; + aDimension = 1; } else if(aNbNodes > 0) { - aNbDimElements = aNbNodes; - aDimension = 0; + aNbDimElements = aNbNodes; + aDimension = 0; } // information about the mesh @@ -234,15 +234,15 @@ void SMESHGUI_StandardMeshInfosDlg::DumpMeshInfos() aMeshSO->FindSubObject(SMESH::Tag_NodeGroups, anObj); if (anObj) { _PTR(ChildIterator) it = aStudy->NewChildIterator(anObj); - if (it->More()) { + if (it->More()) { anInfo.append(QString("Groups:

")); hasGroup = true; } - for ( ; it->More(); it->Next()) { + for ( ; it->More(); it->Next()) { _PTR(SObject) subObj = it->Value(); CORBA::Object_var anObject = SMESH::SObjectToObject(subObj); - SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObject); - if (!aGroup->_is_nil()) { + SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObject); + if (!aGroup->_is_nil()) { anInfo.append(QString("- %1
").arg(aGroup->GetName())); anInfo.append(QString("%1
").arg("on nodes")); anInfo.append(QString("%1
").arg(aGroup->Size())); @@ -259,7 +259,7 @@ void SMESHGUI_StandardMeshInfosDlg::DumpMeshInfos() anInfo.append(QString("
")); } } - } + } } // info about groups on edges @@ -271,11 +271,11 @@ void SMESHGUI_StandardMeshInfosDlg::DumpMeshInfos() anInfo.append(QString("Groups:

")); hasGroup = true; } - for ( ; it->More(); it->Next()) { + for ( ; it->More(); it->Next()) { _PTR(SObject) subObj = it->Value(); CORBA::Object_var anObject = SMESH::SObjectToObject(subObj); - SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObject); - if (!aGroup->_is_nil()) { + SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObject); + if (!aGroup->_is_nil()) { anInfo.append(QString("- %1
").arg(aGroup->GetName())); anInfo.append(QString("%1
").arg("on edges")); anInfo.append(QString("%1
").arg(aGroup->Size())); @@ -292,7 +292,7 @@ void SMESHGUI_StandardMeshInfosDlg::DumpMeshInfos() anInfo.append(QString("
")); } } - } + } } // info about groups on faces @@ -300,15 +300,15 @@ void SMESHGUI_StandardMeshInfosDlg::DumpMeshInfos() aMeshSO->FindSubObject(SMESH::Tag_FaceGroups, anObj); if (anObj) { _PTR(ChildIterator) it = aStudy->NewChildIterator(anObj); - if (!hasGroup && it->More()) { + if (!hasGroup && it->More()) { anInfo.append(QString("Groups:

")); hasGroup = true; } - for ( ; it->More(); it->Next()) { + for ( ; it->More(); it->Next()) { _PTR(SObject) subObj = it->Value(); CORBA::Object_var anObject = SMESH::SObjectToObject(subObj); - SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObject); - if (!aGroup->_is_nil()) { + SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObject); + if (!aGroup->_is_nil()) { anInfo.append(QString("- %1
").arg(aGroup->GetName())); anInfo.append(QString("%1
").arg("on faces")); anInfo.append(QString("%1
").arg(aGroup->Size())); @@ -325,7 +325,7 @@ void SMESHGUI_StandardMeshInfosDlg::DumpMeshInfos() anInfo.append(QString("
")); } } - } + } } // info about groups on volumes @@ -333,13 +333,13 @@ void SMESHGUI_StandardMeshInfosDlg::DumpMeshInfos() aMeshSO->FindSubObject(SMESH::Tag_VolumeGroups, anObj); if (anObj) { _PTR(ChildIterator) it = aStudy->NewChildIterator(anObj); - if (!hasGroup && it->More()) + if (!hasGroup && it->More()) anInfo.append(QString("Groups:
")); - for ( ; it->More(); it->Next()) { + for ( ; it->More(); it->Next()) { _PTR(SObject) subObj = it->Value(); CORBA::Object_var anObject = SMESH::SObjectToObject(subObj); - SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObject); - if (!aGroup->_is_nil()) { + SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObject); + if (!aGroup->_is_nil()) { anInfo.append(QString("- %1
").arg(aGroup->GetName())); anInfo.append(QString("%1
").arg("on volumes")); anInfo.append(QString("%1
").arg(aGroup->Size())); @@ -356,7 +356,7 @@ void SMESHGUI_StandardMeshInfosDlg::DumpMeshInfos() anInfo.append(QString("
")); } } - } + } } myInfo->setText(anInfo); @@ -448,10 +448,10 @@ void SMESHGUI_StandardMeshInfosDlg::onHelp() platform = "application"; #endif SUIT_MessageBox::warning(this, tr("WRN_WARNING"), - tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", - platform)). - arg(myHelpFileName)); + tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", + platform)). + arg(myHelpFileName)); } } diff --git a/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx b/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx index d66f82f6e..5da44a6ae 100644 --- a/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx @@ -416,8 +416,8 @@ void SMESHGUI_SymmetryDlg::ConstructorsClicked (int constructorId) SMESH::SetPointRepresentation(false); if (!CheckBoxMesh->isChecked()) { - if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(CellSelection); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(CellSelection); } } @@ -499,8 +499,8 @@ bool SMESHGUI_SymmetryDlg::ClickOnApply() else aMeshEditor->Mirror(anElementsId, aMirror, aMirrorType, false ); - if( !myMesh->_is_nil()) - myMesh->SetParameters( aParameters.join(":").toLatin1().constData() ); + if( !myMesh->_is_nil()) + myMesh->SetParameters( aParameters.join(":").toLatin1().constData() ); break; } case COPY_ELEMS_BUTTON: { @@ -517,8 +517,8 @@ bool SMESHGUI_SymmetryDlg::ClickOnApply() else aMeshEditor->Mirror(anElementsId, aMirror, aMirrorType, true); } - if( !myMesh->_is_nil()) - myMesh->SetParameters( aParameters.join(":").toLatin1().constData() ); + if( !myMesh->_is_nil()) + myMesh->SetParameters( aParameters.join(":").toLatin1().constData() ); break; } case MAKE_MESH_BUTTON: { @@ -529,8 +529,8 @@ bool SMESHGUI_SymmetryDlg::ClickOnApply() else mesh = aMeshEditor->MirrorMakeMesh(anElementsId, aMirror, aMirrorType, makeGroups, LineEditNewMesh->text().toLatin1().data()); - if( !mesh->_is_nil()) - mesh->SetParameters( aParameters.join(":").toLatin1().constData() ); + if( !mesh->_is_nil()) + mesh->SetParameters( aParameters.join(":").toLatin1().constData() ); break; } } @@ -595,10 +595,10 @@ void SMESHGUI_SymmetryDlg::ClickOnHelp() platform = "application"; #endif SUIT_MessageBox::warning(this, tr("WRN_WARNING"), - tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", - platform)). - arg(myHelpFileName)); + tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", + platform)). + arg(myHelpFileName)); } } @@ -633,15 +633,15 @@ void SMESHGUI_SymmetryDlg::onTextChange (const QString& theNewText) if (send == LineEditElements) { for (int i = 0; i < aListId.count(); i++) { - const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt()); - if (e) - newIndices.Add(e->GetID()); - myNbOkElements++; + const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt()); + if (e) + newIndices.Add(e->GetID()); + myNbOkElements++; } mySelector->AddOrRemoveIndex( anIO, newIndices, false ); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->highlight( anIO, true, true ); + aViewWindow->highlight( anIO, true, true ); myElementsId = theNewText; } @@ -832,11 +832,11 @@ void SMESHGUI_SymmetryDlg::SetEditCurrentArgument() SMESH::SetPointRepresentation(false); if (CheckBoxMesh->isChecked()) { if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(ActorSelection); + aViewWindow->SetSelectionMode(ActorSelection); mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter); } else { if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(CellSelection); + aViewWindow->SetSelectionMode(CellSelection); } } else if (send == SelectPointButton) { myEditCurrentArgument = (QWidget*)SpinBox_X; @@ -1076,8 +1076,8 @@ void SMESHGUI_SymmetryDlg::setFilters() { if(myMesh->_is_nil()) { SUIT_MessageBox::critical(this, - tr("SMESH_ERROR"), - tr("NO_MESH_SELECTED")); + tr("SMESH_ERROR"), + tr("NO_MESH_SELECTED")); return; } if ( !myFilterDlg ) diff --git a/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx b/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx index 6956cc9fb..97d5ca582 100644 --- a/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx @@ -417,7 +417,7 @@ void SMESHGUI_TranslationDlg::ConstructorsClicked (int constructorId) SMESH::SetPointRepresentation(false); if (!CheckBoxMesh->isChecked()) if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode( CellSelection ); + aViewWindow->SetSelectionMode( CellSelection ); } myEditCurrentArgument = (QWidget*)LineEditElements; @@ -487,8 +487,8 @@ bool SMESHGUI_TranslationDlg::ClickOnApply() aMeshEditor->TranslateObject(mySelectedObject, aVector, false); else aMeshEditor->Translate(anElementsId, aVector, false); - if( !myMesh->_is_nil()) - myMesh->SetParameters( aParameters.join(":").toLatin1().constData() ); + if( !myMesh->_is_nil()) + myMesh->SetParameters( aParameters.join(":").toLatin1().constData() ); break; case COPY_ELEMS_BUTTON: if ( makeGroups ) { @@ -504,8 +504,8 @@ bool SMESHGUI_TranslationDlg::ClickOnApply() else aMeshEditor->Translate(anElementsId, aVector, true); } - if( !myMesh->_is_nil()) - myMesh->SetParameters( aParameters.join(":").toLatin1().constData() ); + if( !myMesh->_is_nil()) + myMesh->SetParameters( aParameters.join(":").toLatin1().constData() ); break; case MAKE_MESH_BUTTON: SMESH::SMESH_Mesh_var mesh; @@ -515,8 +515,8 @@ bool SMESHGUI_TranslationDlg::ClickOnApply() else mesh = aMeshEditor->TranslateMakeMesh(anElementsId, aVector, makeGroups, LineEditNewMesh->text().toLatin1().data()); - if( !mesh->_is_nil()) - mesh->SetParameters( aParameters.join(":").toLatin1().constData() ); + if( !mesh->_is_nil()) + mesh->SetParameters( aParameters.join(":").toLatin1().constData() ); } } catch (...) { } @@ -580,10 +580,10 @@ void SMESHGUI_TranslationDlg::ClickOnHelp() platform = "application"; #endif SUIT_MessageBox::warning(this, tr("WRN_WARNING"), - tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", - platform)). - arg(myHelpFileName)); + tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", + platform)). + arg(myHelpFileName)); } } @@ -618,10 +618,10 @@ void SMESHGUI_TranslationDlg::onTextChange (const QString& theNewText) if (send == LineEditElements) { for (int i = 0; i < aListId.count(); i++) { - const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt()); - if (e) - newIndices.Add(e->GetID()); - myNbOkElements++; + const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt()); + if (e) + newIndices.Add(e->GetID()); + myNbOkElements++; } } @@ -809,12 +809,12 @@ void SMESHGUI_TranslationDlg::SetEditCurrentArgument() SMESH::SetPointRepresentation(false); if (CheckBoxMesh->isChecked()) { if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode( ActorSelection ); + aViewWindow->SetSelectionMode( ActorSelection ); mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter); } else { if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode( CellSelection ); + aViewWindow->SetSelectionMode( CellSelection ); } } else if (send == SelectButton1) { myEditCurrentArgument = (QWidget*)SpinBox1_1; @@ -1024,8 +1024,8 @@ void SMESHGUI_TranslationDlg::setFilters() { if(myMesh->_is_nil()) { SUIT_MessageBox::critical(this, - tr("SMESH_ERROR"), - tr("NO_MESH_SELECTED")); + tr("SMESH_ERROR"), + tr("NO_MESH_SELECTED")); return; } if ( !myFilterDlg ) diff --git a/src/SMESHGUI/SMESHGUI_TransparencyDlg.cxx b/src/SMESHGUI/SMESHGUI_TransparencyDlg.cxx index b979ddffc..28f5af456 100644 --- a/src/SMESHGUI/SMESHGUI_TransparencyDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_TransparencyDlg.cxx @@ -172,7 +172,7 @@ void SMESHGUI_TransparencyDlg::ClickOnHelp() LightApp_Application* app = (LightApp_Application*)( SUIT_Session::session()->activeApplication() ); if ( app ) app->onHelpContextModule( mySMESHGUI ? app->moduleName( mySMESHGUI->moduleName() ) : - QString( "" ), myHelpFileName ); + QString( "" ), myHelpFileName ); else { QString platform; #ifdef WIN32 @@ -181,10 +181,10 @@ void SMESHGUI_TransparencyDlg::ClickOnHelp() platform = "application"; #endif SUIT_MessageBox::warning( this, tr( "WRN_WARNING" ), - tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ). - arg( app->resourceMgr()->stringValue( "ExternalBrowser", - platform ) ). - arg( myHelpFileName ) ); + tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ). + arg( app->resourceMgr()->stringValue( "ExternalBrowser", + platform ) ). + arg( myHelpFileName ) ); } } @@ -207,7 +207,7 @@ void SMESHGUI_TransparencyDlg::SetTransparency() Handle(SALOME_InteractiveObject) IOS = It.Value(); SMESH_Actor* anActor = SMESH::FindActorByEntry( IOS->getEntry() ); if ( anActor ) - anActor->SetOpacity( opacity ); + anActor->SetOpacity( opacity ); } myViewWindow->Repaint(); } @@ -238,31 +238,31 @@ void SMESHGUI_TransparencyDlg::onSelectionChanged() if ( aList.Extent() == 1 ) { Handle(SALOME_InteractiveObject) FirstIOS = aList.First(); if ( !FirstIOS.IsNull() ) { - SMESH_Actor* anActor = SMESH::FindActorByEntry( FirstIOS->getEntry() ); - if ( anActor ) - opacity = int( anActor->GetOpacity() * 100. + 0.5 ); + SMESH_Actor* anActor = SMESH::FindActorByEntry( FirstIOS->getEntry() ); + if ( anActor ) + opacity = int( anActor->GetOpacity() * 100. + 0.5 ); } } else if ( aList.Extent() > 1 ) { SALOME_ListIteratorOfListIO It( aList ); int setOp = -1; for ( ; It.More(); It.Next() ) { - Handle(SALOME_InteractiveObject) IO = It.Value(); - if ( !IO.IsNull() ) { - SMESH_Actor* anActor = SMESH::FindActorByEntry( IO->getEntry() ); - if ( anActor ) { - int op = int( anActor->GetOpacity() * 100. + 0.5 ); - if ( setOp < 0 ) - setOp = op; - else if ( setOp != op ) { - setOp = 100; - break; - } - } - } + Handle(SALOME_InteractiveObject) IO = It.Value(); + if ( !IO.IsNull() ) { + SMESH_Actor* anActor = SMESH::FindActorByEntry( IO->getEntry() ); + if ( anActor ) { + int op = int( anActor->GetOpacity() * 100. + 0.5 ); + if ( setOp < 0 ) + setOp = op; + else if ( setOp != op ) { + setOp = 100; + break; + } + } + } } if ( setOp >= 0 ) - opacity = setOp; + opacity = setOp; } else { } diff --git a/src/SMESHGUI/SMESHGUI_Utils.cxx b/src/SMESHGUI/SMESHGUI_Utils.cxx index 33eb25b96..7c6b279c4 100644 --- a/src/SMESHGUI/SMESHGUI_Utils.cxx +++ b/src/SMESHGUI/SMESHGUI_Utils.cxx @@ -80,11 +80,11 @@ namespace SMESH if(theOwner){ const Handle(SALOME_InteractiveObject)& anIO = theOwner->IO(); if(!anIO.IsNull()){ - if(anIO->hasEntry()){ - _PTR(Study) aStudy = GetActiveStudyDocument(); - _PTR(SObject) aSObj = aStudy->FindObjectID(anIO->getEntry()); - anObj = SObjectToObject(aSObj,aStudy); - } + if(anIO->hasEntry()){ + _PTR(Study) aStudy = GetActiveStudyDocument(); + _PTR(SObject) aSObj = aStudy->FindObjectID(anIO->getEntry()); + anObj = SObjectToObject(aSObj,aStudy); + } } } return anObj; @@ -124,9 +124,9 @@ namespace SMESH (SUIT_Session::session()->activeApplication()); if (app && !CORBA::is_nil(theObject)) { if(_PTR(Study) aStudy = GetActiveStudyDocument()){ - CORBA::String_var anIOR = app->orb()->object_to_string(theObject); - if (strcmp(anIOR.in(), "") != 0) - return aStudy->FindObjectIOR(anIOR.in()); + CORBA::String_var anIOR = app->orb()->object_to_string(theObject); + if (strcmp(anIOR.in(), "") != 0) + return aStudy->FindObjectIOR(anIOR.in()); } } return _PTR(SObject)(); @@ -187,9 +187,9 @@ namespace SMESH if (theSObject) { _PTR(GenericAttribute) anAttr; if (theSObject->FindAttribute(anAttr, "AttributeIOR")) { - _PTR(AttributeIOR) anIOR = anAttr; - CORBA::String_var aVal = anIOR->Value().c_str(); - return app->orb()->string_to_object(aVal); + _PTR(AttributeIOR) anIOR = anAttr; + CORBA::String_var aVal = anIOR->Value().c_str(); + return app->orb()->string_to_object(aVal); } } return CORBA::Object::_nil(); @@ -205,9 +205,9 @@ namespace SMESH { if (!theIO.IsNull()) { if (theIO->hasEntry()) { - _PTR(Study) aStudy = GetActiveStudyDocument(); - _PTR(SObject) anObj = aStudy->FindObjectID(theIO->getEntry()); - return SObjectToObject(anObj,aStudy); + _PTR(Study) aStudy = GetActiveStudyDocument(); + _PTR(SObject) anObj = aStudy->FindObjectID(theIO->getEntry()); + return SObjectToObject(anObj,aStudy); } } return CORBA::Object::_nil(); @@ -273,11 +273,11 @@ namespace SMESH for (int i = 1; anIter->More(); anIter->Next(), i++) { _PTR(SObject) aSObj = anIter->Value(); if (i >= 4) { - _PTR(ChildIterator) anIter1 = aStudy->NewChildIterator(aSObj); - for ( ; anIter1->More(); anIter1->Next()) { - _PTR(SObject) aSObj1 = anIter1->Value(); - anAttr = aBuilder->FindOrCreateAttribute(aSObj1, "AttributePixMap"); - aPixmap = anAttr; + _PTR(ChildIterator) anIter1 = aStudy->NewChildIterator(aSObj); + for ( ; anIter1->More(); anIter1->Next()) { + _PTR(SObject) aSObj1 = anIter1->Value(); + anAttr = aBuilder->FindOrCreateAttribute(aSObj1, "AttributePixMap"); + aPixmap = anAttr; if (theIsNotModif) { aPixmap->SetPixMap("ICON_SMESH_TREE_MESH"); } else if ( isEmptyMesh ) { @@ -285,7 +285,7 @@ namespace SMESH } else { aPixmap->SetPixMap("ICON_SMESH_TREE_MESH_PARTIAL"); } - } + } } } } @@ -300,10 +300,10 @@ namespace SMESH } else { SUIT_MessageBox::warning(0, QObject::tr("WRN_WARNING"), - QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", - "application")). - arg(theHelpFileName)); + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", + "application")). + arg(theHelpFileName)); } } diff --git a/src/SMESHGUI/SMESHGUI_Utils.h b/src/SMESHGUI/SMESHGUI_Utils.h index 77f26e3e1..2604ca57f 100644 --- a/src/SMESHGUI/SMESHGUI_Utils.h +++ b/src/SMESHGUI/SMESHGUI_Utils.h @@ -88,7 +88,7 @@ SMESHGUI_EXPORT { CORBA::Object_var anObj = DataOwnerToObject(theDataOwner); if(!CORBA::is_nil(anObj)) - return TInterface::_narrow(anObj); + return TInterface::_narrow(anObj); return TInterface::_nil(); } @@ -114,7 +114,7 @@ SMESHGUI_EXPORT SMESHGUI_EXPORT CORBA::Object_var SObjectToObject( _PTR(SObject), - _PTR(Study) ); + _PTR(Study) ); SMESHGUI_EXPORT CORBA::Object_var SObjectToObject( _PTR(SObject) ); @@ -124,7 +124,7 @@ SMESHGUI_EXPORT { CORBA::Object_var anObj = SObjectToObject(theSObject); if(!CORBA::is_nil(anObj)) - return TInterface::_narrow(anObj); + return TInterface::_narrow(anObj); return TInterface::_nil(); } @@ -136,7 +136,7 @@ SMESHGUI_EXPORT { CORBA::Object_var anObj = IObjectToObject(theIO); if(!CORBA::is_nil(anObj)) - return TInterface::_narrow(anObj); + return TInterface::_narrow(anObj); return TInterface::_nil(); } @@ -148,7 +148,7 @@ SMESHGUI_EXPORT { CORBA::Object_var anObj = IORToObject( theIOR ); if ( !CORBA::is_nil( anObj ) ) - return TInterface::_narrow( anObj ); + return TInterface::_narrow( anObj ); return TInterface::_nil(); } diff --git a/src/SMESHGUI/SMESHGUI_VTKUtils.cxx b/src/SMESHGUI/SMESHGUI_VTKUtils.cxx index 3d2840b9b..3841a194e 100644 --- a/src/SMESHGUI/SMESHGUI_VTKUtils.cxx +++ b/src/SMESHGUI/SMESHGUI_VTKUtils.cxx @@ -145,7 +145,7 @@ namespace SMESH for ( int iV = 0; iV < views.count(); ++iV ) { if(SVTK_ViewWindow* vtkWnd = GetVtkViewWindow(views[iV])) { vtkRenderer *aRenderer = vtkWnd->getRenderer(); - VTK::ActorCollectionCopy aCopy(aRenderer->GetActors()); + VTK::ActorCollectionCopy aCopy(aRenderer->GetActors()); vtkActorCollection *actors = aCopy.GetActors(); for (int i = 0; i < actors->GetNumberOfItems(); ++i ) { // size of actors changes inside the loop @@ -188,7 +188,7 @@ namespace SMESH for ( int iV = 0; iV < views.count(); ++iV ) { if(SVTK_ViewWindow* vtkWnd = GetVtkViewWindow(views[iV])) { vtkRenderer *aRenderer = vtkWnd->getRenderer(); - VTK::ActorCollectionCopy aCopy(aRenderer->GetActors()); + VTK::ActorCollectionCopy aCopy(aRenderer->GetActors()); vtkActorCollection *actors = aCopy.GetActors(); for (int i = 0; i < actors->GetNumberOfItems(); ++i ) { // size of actors changes inside the loop @@ -231,18 +231,18 @@ namespace SMESH // char* buf = new char[100*1024]; // delete [] buf; SUIT_MessageBox::warning(SMESHGUI::desktop(), QObject::tr("SMESH_WRN_WARNING"), - QObject::tr("SMESH_VISU_PROBLEM")); + QObject::tr("SMESH_VISU_PROBLEM")); } catch (...) { // no more memory at all: last resort MESSAGE_BEGIN ( "SMESHGUI_VTKUtils::OnVisuException(), exception even at showing a message!!!" << - std::endl << "Try to remove all visual data..." ); + std::endl << "Try to remove all visual data..." ); if (theVISU_MemoryReserve) { delete theVISU_MemoryReserve; theVISU_MemoryReserve = 0; } RemoveAllObjectsWithActors(); SUIT_MessageBox::warning(SMESHGUI::desktop(), QObject::tr("SMESH_WRN_WARNING"), - QObject::tr("SMESH_VISU_PROBLEM_CLEAR")); + QObject::tr("SMESH_VISU_PROBLEM_CLEAR")); MESSAGE_END ( "...done" ); } } @@ -261,59 +261,59 @@ namespace SMESH #endif TVisualObjCont::iterator anIter = VISUAL_OBJ_CONT.find(aKey); if(anIter != VISUAL_OBJ_CONT.end()){ - aVisualObj = anIter->second; + aVisualObj = anIter->second; }else{ SalomeApp_Application* app = dynamic_cast( SMESHGUI::activeStudy()->application() ); - _PTR(Study) aStudy = SMESHGUI::activeStudy()->studyDS(); - _PTR(SObject) aSObj = aStudy->FindObjectID(theEntry); - if(aSObj){ - _PTR(GenericAttribute) anAttr; - if(aSObj->FindAttribute(anAttr,"AttributeIOR")){ - _PTR(AttributeIOR) anIOR = anAttr; - CORBA::String_var aVal = anIOR->Value().c_str(); - CORBA::Object_var anObj = app->orb()->string_to_object( aVal.in() ); - if(!CORBA::is_nil(anObj)){ - //Try narrow to SMESH_Mesh interface - SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_narrow(anObj); - if(!aMesh->_is_nil()){ - aVisualObj.reset(new SMESH_MeshObj(aMesh)); - TVisualObjCont::value_type aValue(aKey,aVisualObj); - VISUAL_OBJ_CONT.insert(aValue); - } - //Try narrow to SMESH_Group interface - SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObj); - if(!aGroup->_is_nil()){ - _PTR(SObject) aFatherSObj = aSObj->GetFather(); - if(!aFatherSObj) return aVisualObj; - aFatherSObj = aFatherSObj->GetFather(); - if(!aFatherSObj) return aVisualObj; - CORBA::String_var anEntry = aFatherSObj->GetID().c_str(); - TVisualObjPtr aVisObj = GetVisualObj(theStudyId,anEntry.in()); - if(SMESH_MeshObj* aMeshObj = dynamic_cast(aVisObj.get())){ - aVisualObj.reset(new SMESH_GroupObj(aGroup,aMeshObj)); - TVisualObjCont::value_type aValue(aKey,aVisualObj); - VISUAL_OBJ_CONT.insert(aValue); - } - } - //Try narrow to SMESH_subMesh interface - SMESH::SMESH_subMesh_var aSubMesh = SMESH::SMESH_subMesh::_narrow(anObj); - if(!aSubMesh->_is_nil()){ - _PTR(SObject) aFatherSObj = aSObj->GetFather(); - if(!aFatherSObj) return aVisualObj; - aFatherSObj = aFatherSObj->GetFather(); - if(!aFatherSObj) return aVisualObj; - CORBA::String_var anEntry = aFatherSObj->GetID().c_str(); - TVisualObjPtr aVisObj = GetVisualObj(theStudyId,anEntry.in()); - if(SMESH_MeshObj* aMeshObj = dynamic_cast(aVisObj.get())){ - aVisualObj.reset(new SMESH_subMeshObj(aSubMesh,aMeshObj)); - TVisualObjCont::value_type aValue(aKey,aVisualObj); - VISUAL_OBJ_CONT.insert(aValue); - } - } - } - } - } + _PTR(Study) aStudy = SMESHGUI::activeStudy()->studyDS(); + _PTR(SObject) aSObj = aStudy->FindObjectID(theEntry); + if(aSObj){ + _PTR(GenericAttribute) anAttr; + if(aSObj->FindAttribute(anAttr,"AttributeIOR")){ + _PTR(AttributeIOR) anIOR = anAttr; + CORBA::String_var aVal = anIOR->Value().c_str(); + CORBA::Object_var anObj = app->orb()->string_to_object( aVal.in() ); + if(!CORBA::is_nil(anObj)){ + //Try narrow to SMESH_Mesh interface + SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_narrow(anObj); + if(!aMesh->_is_nil()){ + aVisualObj.reset(new SMESH_MeshObj(aMesh)); + TVisualObjCont::value_type aValue(aKey,aVisualObj); + VISUAL_OBJ_CONT.insert(aValue); + } + //Try narrow to SMESH_Group interface + SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObj); + if(!aGroup->_is_nil()){ + _PTR(SObject) aFatherSObj = aSObj->GetFather(); + if(!aFatherSObj) return aVisualObj; + aFatherSObj = aFatherSObj->GetFather(); + if(!aFatherSObj) return aVisualObj; + CORBA::String_var anEntry = aFatherSObj->GetID().c_str(); + TVisualObjPtr aVisObj = GetVisualObj(theStudyId,anEntry.in()); + if(SMESH_MeshObj* aMeshObj = dynamic_cast(aVisObj.get())){ + aVisualObj.reset(new SMESH_GroupObj(aGroup,aMeshObj)); + TVisualObjCont::value_type aValue(aKey,aVisualObj); + VISUAL_OBJ_CONT.insert(aValue); + } + } + //Try narrow to SMESH_subMesh interface + SMESH::SMESH_subMesh_var aSubMesh = SMESH::SMESH_subMesh::_narrow(anObj); + if(!aSubMesh->_is_nil()){ + _PTR(SObject) aFatherSObj = aSObj->GetFather(); + if(!aFatherSObj) return aVisualObj; + aFatherSObj = aFatherSObj->GetFather(); + if(!aFatherSObj) return aVisualObj; + CORBA::String_var anEntry = aFatherSObj->GetID().c_str(); + TVisualObjPtr aVisObj = GetVisualObj(theStudyId,anEntry.in()); + if(SMESH_MeshObj* aMeshObj = dynamic_cast(aVisObj.get())){ + aVisualObj.reset(new SMESH_subMeshObj(aSubMesh,aMeshObj)); + TVisualObjCont::value_type aValue(aKey,aVisualObj); + VISUAL_OBJ_CONT.insert(aValue); + } + } + } + } + } } }catch(...){ INFOS("GetMeshObj - There is no SMESH_Mesh object for the SALOMEDS::Strudy and Entry!!!"); @@ -354,7 +354,7 @@ namespace SMESH if ( usedMB * 10 > freeMB ) // even dont try to show SUIT_MessageBox::warning(SMESHGUI::desktop(), QObject::tr("SMESH_WRN_WARNING"), - QObject::tr("SMESH_NO_MESH_VISUALIZATION")); + QObject::tr("SMESH_NO_MESH_VISUALIZATION")); else // there is a chance to succeed continu = SUIT_MessageBox::warning @@ -362,7 +362,7 @@ namespace SMESH QObject::tr("SMESH_WRN_WARNING"), QObject::tr("SMESH_CONTINUE_MESH_VISUALIZATION"), SUIT_MessageBox::Yes | SUIT_MessageBox::No, - SUIT_MessageBox::Yes ) == SUIT_MessageBox::Yes; + SUIT_MessageBox::Yes ) == SUIT_MessageBox::Yes; if ( !continu ) { // remove the corresponding actors from all views RemoveVisualObjectWithActors( theEntry ); @@ -391,7 +391,7 @@ namespace SMESH if (anApp) { if (SVTK_ViewWindow* aView = dynamic_cast(anApp->desktop()->activeWindow())) - return aView; + return aView; SUIT_ViewManager* aViewManager = anApp->getViewManager(SVTK_Viewer::Type(), createIfNotFound); @@ -516,7 +516,7 @@ namespace SMESH SMESH_Actor* FindActorByEntry(SUIT_ViewWindow *theWindow, - const char* theEntry) + const char* theEntry) { if(SVTK_ViewWindow* aViewWindow = GetVtkViewWindow(theWindow)){ vtkRenderer *aRenderer = aViewWindow->getRenderer(); @@ -524,14 +524,14 @@ namespace SMESH vtkActorCollection *aCollection = aCopy.GetActors(); aCollection->InitTraversal(); while(vtkActor *anAct = aCollection->GetNextActor()){ - if(SMESH_Actor *anActor = dynamic_cast(anAct)){ - if(anActor->hasIO()){ - Handle(SALOME_InteractiveObject) anIO = anActor->getIO(); - if(anIO->hasEntry() && strcmp(anIO->getEntry(),theEntry) == 0){ - return anActor; - } - } - } + if(SMESH_Actor *anActor = dynamic_cast(anAct)){ + if(anActor->hasIO()){ + Handle(SALOME_InteractiveObject) anIO = anActor->getIO(); + if(anIO->hasEntry() && strcmp(anIO->getEntry(),theEntry) == 0){ + return anActor; + } + } + } } } return NULL; @@ -553,8 +553,8 @@ namespace SMESH CORBA::String_var anIOR = app->orb()->object_to_string( theObject ); _PTR(SObject) aSObject = aStudy->FindObjectIOR(anIOR.in()); if(aSObject){ - CORBA::String_var anEntry = aSObject->GetID().c_str(); - return FindActorByEntry(anEntry.in()); + CORBA::String_var anEntry = aSObject->GetID().c_str(); + return FindActorByEntry(anEntry.in()); } } return NULL; @@ -562,41 +562,41 @@ namespace SMESH SMESH_Actor* CreateActor(_PTR(Study) theStudy, - const char* theEntry, - int theIsClear) + const char* theEntry, + int theIsClear) { SMESH_Actor *anActor = NULL; CORBA::Long anId = theStudy->StudyId(); if(TVisualObjPtr aVisualObj = GetVisualObj(anId,theEntry)){ _PTR(SObject) aSObj = theStudy->FindObjectID(theEntry); if(aSObj){ - _PTR(GenericAttribute) anAttr; - if(aSObj->FindAttribute(anAttr,"AttributeName")){ - _PTR(AttributeName) aName = anAttr; - std::string aNameVal = aName->Value(); - anActor = SMESH_Actor::New(aVisualObj,theEntry,aNameVal.c_str(),theIsClear); - } - - SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow( SMESH::SObjectToObject( aSObj )); - if(!CORBA::is_nil(aGroup)) - { - SALOMEDS::Color aColor = aGroup->GetColor(); - if( !( aColor.R > 0 || aColor.G > 0 || aColor.B > 0 ) ) - { - int r = 0, g = 0, b = 0; - SMESH::GetColor( "SMESH", "fill_color", r, g, b, QColor( 0, 170, 255 ) ); - aColor.R = (float)r / 255.0; - aColor.G = (float)g / 255.0; - aColor.B = (float)b / 255.0; - aGroup->SetColor( aColor ); - } - if( aGroup->GetType() == SMESH::NODE ) - anActor->SetNodeColor( aColor.R, aColor.G, aColor.B ); - else if( aGroup->GetType() == SMESH::EDGE ) - anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B ); - else - anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B ); - } + _PTR(GenericAttribute) anAttr; + if(aSObj->FindAttribute(anAttr,"AttributeName")){ + _PTR(AttributeName) aName = anAttr; + std::string aNameVal = aName->Value(); + anActor = SMESH_Actor::New(aVisualObj,theEntry,aNameVal.c_str(),theIsClear); + } + + SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow( SMESH::SObjectToObject( aSObj )); + if(!CORBA::is_nil(aGroup)) + { + SALOMEDS::Color aColor = aGroup->GetColor(); + if( !( aColor.R > 0 || aColor.G > 0 || aColor.B > 0 ) ) + { + int r = 0, g = 0, b = 0; + SMESH::GetColor( "SMESH", "fill_color", r, g, b, QColor( 0, 170, 255 ) ); + aColor.R = (float)r / 255.0; + aColor.G = (float)g / 255.0; + aColor.B = (float)b / 255.0; + aGroup->SetColor( aColor ); + } + if( aGroup->GetType() == SMESH::NODE ) + anActor->SetNodeColor( aColor.R, aColor.G, aColor.B ); + else if( aGroup->GetType() == SMESH::EDGE ) + anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B ); + else + anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B ); + } } } return anActor; @@ -626,14 +626,14 @@ namespace SMESH if(SVTK_ViewWindow* vtkWnd = GetVtkViewWindow(theWnd)){ vtkWnd->RemoveActor(theActor); if(theActor->hasIO()){ - Handle(SALOME_InteractiveObject) anIO = theActor->getIO(); - if(anIO->hasEntry()){ - std::string anEntry = anIO->getEntry(); - SalomeApp_Study* aStudy = dynamic_cast( vtkWnd->getViewManager()->study() ); - int aStudyId = aStudy->id(); - TVisualObjCont::key_type aKey(aStudyId,anEntry); - VISUAL_OBJ_CONT.erase(aKey); - } + Handle(SALOME_InteractiveObject) anIO = theActor->getIO(); + if(anIO->hasEntry()){ + std::string anEntry = anIO->getEntry(); + SalomeApp_Study* aStudy = dynamic_cast( vtkWnd->getViewManager()->study() ); + int aStudyId = aStudy->id(); + TVisualObjCont::key_type aKey(aStudyId,anEntry); + VISUAL_OBJ_CONT.erase(aKey); + } } theActor->Delete(); vtkWnd->Repaint(); @@ -654,7 +654,7 @@ namespace SMESH vtkActorCollection *aCollection = aCopy.GetActors(); aCollection->InitTraversal(); while(vtkActor *anAct = aCollection->GetNextActor()) - if(dynamic_cast(anAct)) + if(dynamic_cast(anAct)) return false; } return true; @@ -676,37 +676,37 @@ namespace SMESH switch (theAction) { case eDisplayAll: { - while (vtkActor *anAct = aCollection->GetNextActor()) { - if (SMESH_Actor *anActor = dynamic_cast(anAct)) { - anActor->SetVisibility(true); - } - } - break; + while (vtkActor *anAct = aCollection->GetNextActor()) { + if (SMESH_Actor *anActor = dynamic_cast(anAct)) { + anActor->SetVisibility(true); + } + } + break; } case eDisplayOnly: case eEraseAll: { - while (vtkActor *anAct = aCollection->GetNextActor()) { - if (SMESH_Actor *anActor = dynamic_cast(anAct)) { - anActor->SetVisibility(false); - } - } + while (vtkActor *anAct = aCollection->GetNextActor()) { + if (SMESH_Actor *anActor = dynamic_cast(anAct)) { + anActor->SetVisibility(false); + } + } } default: { - if (SMESH_Actor *anActor = FindActorByEntry(theWnd,theEntry)) { - switch (theAction) { - case eDisplay: - case eDisplayOnly: - anActor->SetVisibility(true); - if (theAction == eDisplayOnly) aRenderer->ResetCameraClippingRange(); - break; - case eErase: - anActor->SetVisibility(false); - break; - } - } else { - switch (theAction) { - case eDisplay: - case eDisplayOnly: + if (SMESH_Actor *anActor = FindActorByEntry(theWnd,theEntry)) { + switch (theAction) { + case eDisplay: + case eDisplayOnly: + anActor->SetVisibility(true); + if (theAction == eDisplayOnly) aRenderer->ResetCameraClippingRange(); + break; + case eErase: + anActor->SetVisibility(false); + break; + } + } else { + switch (theAction) { + case eDisplay: + case eDisplayOnly: { SalomeApp_Study* aStudy = dynamic_cast(theWnd->getViewManager()->study()); _PTR(Study) aDocument = aStudy->studyDS(); @@ -725,8 +725,8 @@ namespace SMESH } break; } - } - } + } + } } } } @@ -747,24 +747,24 @@ namespace SMESH SALOME_ListIO selected; mgr->selectedObjects( selected ); if( selected.Extent() == 0){ - vtkRenderer* aRenderer = aWnd->getRenderer(); - VTK::ActorCollectionCopy aCopy(aRenderer->GetActors()); - vtkActorCollection *aCollection = aCopy.GetActors(); - aCollection->InitTraversal(); - while(vtkActor *anAct = aCollection->GetNextActor()){ - if(SMESH_Actor *anActor = dynamic_cast(anAct)){ - if(anActor->hasIO()) - if (!Update(anActor->getIO(),anActor->GetVisibility())) + vtkRenderer* aRenderer = aWnd->getRenderer(); + VTK::ActorCollectionCopy aCopy(aRenderer->GetActors()); + vtkActorCollection *aCollection = aCopy.GetActors(); + aCollection->InitTraversal(); + while(vtkActor *anAct = aCollection->GetNextActor()){ + if(SMESH_Actor *anActor = dynamic_cast(anAct)){ + if(anActor->hasIO()) + if (!Update(anActor->getIO(),anActor->GetVisibility())) break; // avoid multiple warinings if visu failed - } - } + } + } }else{ - SALOME_ListIteratorOfListIO anIter( selected ); - for( ; anIter.More(); anIter.Next()){ - Handle(SALOME_InteractiveObject) anIO = anIter.Value(); - if ( !Update(anIO,true) ) + SALOME_ListIteratorOfListIO anIter( selected ); + for( ; anIter.More(); anIter.Next()){ + Handle(SALOME_InteractiveObject) anIO = anIter.Value(); + if ( !Update(anIO,true) ) break; // avoid multiple warinings if visu failed - } + } } RepaintCurrentView(); } @@ -813,7 +813,7 @@ namespace SMESH QColor aHiColor = mgr->colorValue( "SMESH", "selection_object_color", Qt::white ), aSelColor = mgr->colorValue( "SMESH", "selection_element_color", Qt::yellow ), - aPreColor = mgr->colorValue( "SMESH", "highlight_color", Qt::cyan ); + aPreColor = mgr->colorValue( "SMESH", "highlight_color", Qt::cyan ); int SW = mgr->integerValue( "SMESH", "selection_width", 5 ), PW = mgr->integerValue( "SMESH", "highlight_width", 5 ); @@ -829,39 +829,39 @@ namespace SMESH double SP1 = mgr->doubleValue( "SMESH", "selection_precision_node", 0.025 ), SP2 = mgr->doubleValue( "SMESH", "selection_precision_element", 0.001 ), - SP3 = mgr->doubleValue( "SMESH", "selection_precision_object", 0.025 ); + SP3 = mgr->doubleValue( "SMESH", "selection_precision_object", 0.025 ); for ( int i=0, n=views.count(); iSetSelectionProp(aSelColor.red()/255., - aSelColor.green()/255., - aSelColor.blue()/255., - SW ); - // tolerances - aVtkView->SetSelectionTolerance(SP1, SP2, SP3); - - // pre-selection - aVtkView->SetPreselectionProp(aPreColor.red()/255., - aPreColor.green()/255., - aPreColor.blue()/255., - PW); - // update actors - vtkRenderer* aRenderer = aVtkView->getRenderer(); - VTK::ActorCollectionCopy aCopy(aRenderer->GetActors()); - vtkActorCollection *aCollection = aCopy.GetActors(); - aCollection->InitTraversal(); - while(vtkActor *anAct = aCollection->GetNextActor()){ - if(SMESH_Actor *anActor = dynamic_cast(anAct)){ - anActor->SetHighlightColor(aHiColor.red()/255., - aHiColor.green()/255., - aHiColor.blue()/255.); - anActor->SetPreHighlightColor(aPreColor.red()/255., - aPreColor.green()/255., - aPreColor.blue()/255.); - } - } + // mesh element selection + aVtkView->SetSelectionProp(aSelColor.red()/255., + aSelColor.green()/255., + aSelColor.blue()/255., + SW ); + // tolerances + aVtkView->SetSelectionTolerance(SP1, SP2, SP3); + + // pre-selection + aVtkView->SetPreselectionProp(aPreColor.red()/255., + aPreColor.green()/255., + aPreColor.blue()/255., + PW); + // update actors + vtkRenderer* aRenderer = aVtkView->getRenderer(); + VTK::ActorCollectionCopy aCopy(aRenderer->GetActors()); + vtkActorCollection *aCollection = aCopy.GetActors(); + aCollection->InitTraversal(); + while(vtkActor *anAct = aCollection->GetNextActor()){ + if(SMESH_Actor *anActor = dynamic_cast(anAct)){ + anActor->SetHighlightColor(aHiColor.red()/255., + aHiColor.green()/255., + aHiColor.blue()/255.); + anActor->SetPreHighlightColor(aPreColor.red()/255., + aPreColor.green()/255., + aPreColor.blue()/255.); + } + } } } } @@ -878,7 +878,7 @@ namespace SMESH } void SetFilter(const Handle(VTKViewer_Filter)& theFilter, - SVTK_Selector* theSelector) + SVTK_Selector* theSelector) { if (theSelector) theSelector->SetFilter(theFilter); @@ -906,7 +906,7 @@ namespace SMESH } bool IsValid(SALOME_Actor* theActor, int theCellId, - SVTK_Selector* theSelector) + SVTK_Selector* theSelector) { return theSelector->IsValid(theActor,theCellId); } @@ -920,11 +920,11 @@ namespace SMESH vtkActorCollection *aCollection = aCopy.GetActors(); aCollection->InitTraversal(); while(vtkActor *anAct = aCollection->GetNextActor()){ - if(SMESH_Actor *anActor = dynamic_cast(anAct)){ - if(anActor->GetVisibility()){ - anActor->SetPointRepresentation(theIsVisible); - } - } + if(SMESH_Actor *anActor = dynamic_cast(anAct)){ + if(anActor->GetVisibility()){ + anActor->SetPointRepresentation(theIsVisible); + } + } } RepaintCurrentView(); } @@ -939,14 +939,14 @@ namespace SMESH vtkActorCollection *aCollection = aCopy.GetActors(); aCollection->InitTraversal(); while(vtkActor *anAct = aCollection->GetNextActor()){ - if(SALOME_Actor *anActor = dynamic_cast(anAct)){ - if(anActor->GetVisibility()){ - anActor->SetPickable(anIsAllPickable); - } - } + if(SALOME_Actor *anActor = dynamic_cast(anAct)){ + if(anActor->GetVisibility()){ + anActor->SetPickable(anIsAllPickable); + } + } } if(theActor) - theActor->SetPickable(!anIsAllPickable); + theActor->SetPickable(!anIsAllPickable); RepaintCurrentView(); } } @@ -954,8 +954,8 @@ namespace SMESH //---------------------------------------------------------------------------- int GetNameOfSelectedNodes(SVTK_Selector* theSelector, - const Handle(SALOME_InteractiveObject)& theIO, - QString& theName) + const Handle(SALOME_InteractiveObject)& theIO, + QString& theName) { theName = ""; TColStd_IndexedMapOfInteger aMapIndex; @@ -968,8 +968,8 @@ namespace SMESH } int GetNameOfSelectedElements(SVTK_Selector* theSelector, - const Handle(SALOME_InteractiveObject)& theIO, - QString& theName) + const Handle(SALOME_InteractiveObject)& theIO, + QString& theName) { theName = ""; TColStd_IndexedMapOfInteger aMapIndex; @@ -989,9 +989,9 @@ namespace SMESH int GetEdgeNodes(SVTK_Selector* theSelector, - const TVisualObjPtr& theVisualObject, - int& theId1, - int& theId2) + const TVisualObjPtr& theVisualObject, + int& theId1, + int& theId2) { const SALOME_ListIO& selected = theSelector->StoredIObjects(); @@ -1011,9 +1011,9 @@ namespace SMESH for ( int i = 1; i <= aMapIndex.Extent(); i++ ) { int aVal = aMapIndex( i ); if ( aVal > 0 ) - anObjId = aVal; + anObjId = aVal; else - anEdgeNum = abs( aVal ) - 1; + anEdgeNum = abs( aVal ) - 1; } if ( anObjId == -1 || anEdgeNum == -1 ) @@ -1024,18 +1024,18 @@ namespace SMESH //---------------------------------------------------------------------------- int GetNameOfSelectedNodes(LightApp_SelectionMgr *theMgr, - const Handle(SALOME_InteractiveObject)& theIO, - QString& theName) + const Handle(SALOME_InteractiveObject)& theIO, + QString& theName) { theName = ""; if(theIO->hasEntry()){ if(FindActorByEntry(theIO->getEntry())){ - TColStd_IndexedMapOfInteger aMapIndex; - theMgr->GetIndexes(theIO,aMapIndex); - for(int i = 1; i <= aMapIndex.Extent(); i++){ - theName += QString(" %1").arg(aMapIndex(i)); - } - return aMapIndex.Extent(); + TColStd_IndexedMapOfInteger aMapIndex; + theMgr->GetIndexes(theIO,aMapIndex); + for(int i = 1; i <= aMapIndex.Extent(); i++){ + theName += QString(" %1").arg(aMapIndex(i)); + } + return aMapIndex.Extent(); } } return -1; @@ -1053,23 +1053,23 @@ namespace SMESH int GetNameOfSelectedElements(LightApp_SelectionMgr *theMgr, - const Handle(SALOME_InteractiveObject)& theIO, - QString& theName) + const Handle(SALOME_InteractiveObject)& theIO, + QString& theName) { theName = ""; if(theIO->hasEntry()){ if(FindActorByEntry(theIO->getEntry())){ - TColStd_IndexedMapOfInteger aMapIndex; - theMgr->GetIndexes(theIO,aMapIndex); - typedef std::set TIdContainer; - TIdContainer anIdContainer; - for( int i = 1; i <= aMapIndex.Extent(); i++) - anIdContainer.insert(aMapIndex(i)); - TIdContainer::const_iterator anIter = anIdContainer.begin(); - for( ; anIter != anIdContainer.end(); anIter++){ - theName += QString(" %1").arg(*anIter); - } - return aMapIndex.Extent(); + TColStd_IndexedMapOfInteger aMapIndex; + theMgr->GetIndexes(theIO,aMapIndex); + typedef std::set TIdContainer; + TIdContainer anIdContainer; + for( int i = 1; i <= aMapIndex.Extent(); i++) + anIdContainer.insert(aMapIndex(i)); + TIdContainer::const_iterator anIter = anIdContainer.begin(); + for( ; anIter != anIdContainer.end(); anIter++){ + theName += QString(" %1").arg(*anIter); + } + return aMapIndex.Extent(); } } return -1; @@ -1089,8 +1089,8 @@ namespace SMESH } int GetSelected(LightApp_SelectionMgr* theMgr, - TColStd_IndexedMapOfInteger& theMap, - const bool theIsElement) + TColStd_IndexedMapOfInteger& theMap, + const bool theIsElement) { theMap.Clear(); SALOME_ListIO selected; theMgr->selectedObjects( selected ); @@ -1099,7 +1099,7 @@ namespace SMESH { Handle(SALOME_InteractiveObject) anIO = selected.First(); if ( anIO->hasEntry() ) { - theMgr->GetIndexes( anIO, theMap ); + theMgr->GetIndexes( anIO, theMap ); } } return theMap.Extent(); @@ -1130,9 +1130,9 @@ namespace SMESH for ( int i = 1; i <= aMapIndex.Extent(); i++ ) { int aVal = aMapIndex( i ); if ( aVal > 0 ) - anObjId = aVal; + anObjId = aVal; else - anEdgeNum = abs( aVal ); + anEdgeNum = abs( aVal ); } if ( anObjId == -1 || anEdgeNum == -1 ) diff --git a/src/SMESHGUI/SMESHGUI_VTKUtils.h b/src/SMESHGUI/SMESHGUI_VTKUtils.h index 05d2e268b..0d49a4437 100644 --- a/src/SMESHGUI/SMESHGUI_VTKUtils.h +++ b/src/SMESHGUI/SMESHGUI_VTKUtils.h @@ -69,7 +69,7 @@ SMESHGUI_EXPORT //---------------------------------------------------------------------------- SMESHGUI_EXPORT SVTK_ViewWindow* GetViewWindow( const SalomeApp_Module* = 0, - bool = false ); + bool = false ); SMESHGUI_EXPORT SVTK_ViewWindow* FindVtkViewWindow( SUIT_ViewManager*, SUIT_ViewWindow* ); SMESHGUI_EXPORT @@ -112,7 +112,7 @@ SMESHGUI_EXPORT SMESHGUI_EXPORT bool UpdateView( SUIT_ViewWindow*, EDisplaing, const char* = "" ); -SMESHGUI_EXPORT +SMESHGUI_EXPORT bool UpdateView( EDisplaing, const char* = "" ); SMESHGUI_EXPORT @@ -153,31 +153,31 @@ SMESHGUI_EXPORT //---------------------------------------------------------------------------- SMESHGUI_EXPORT int GetNameOfSelectedNodes( SVTK_Selector*, - const Handle(SALOME_InteractiveObject)&, - QString& ); + const Handle(SALOME_InteractiveObject)&, + QString& ); SMESHGUI_EXPORT int GetNameOfSelectedElements( SVTK_Selector*, - const Handle(SALOME_InteractiveObject)&, - QString& ); + const Handle(SALOME_InteractiveObject)&, + QString& ); SMESHGUI_EXPORT int GetEdgeNodes( SVTK_Selector*, const TVisualObjPtr&, int&, int& ); //---------------------------------------------------------------------------- SMESHGUI_EXPORT int GetNameOfSelectedNodes( LightApp_SelectionMgr*, - const Handle(SALOME_InteractiveObject)&, - QString& ); + const Handle(SALOME_InteractiveObject)&, + QString& ); SMESHGUI_EXPORT int GetNameOfSelectedNodes( LightApp_SelectionMgr*, QString& ); SMESHGUI_EXPORT int GetNameOfSelectedElements( LightApp_SelectionMgr*, - const Handle(SALOME_InteractiveObject)&, - QString& ); + const Handle(SALOME_InteractiveObject)&, + QString& ); SMESHGUI_EXPORT int GetNameOfSelectedElements( LightApp_SelectionMgr*, QString& ); SMESHGUI_EXPORT int GetSelected( LightApp_SelectionMgr*, TColStd_IndexedMapOfInteger&, - const bool = true ); + const bool = true ); SMESHGUI_EXPORT int GetEdgeNodes( LightApp_SelectionMgr*, int&, int& ); diff --git a/src/SMESHGUI/SMESHGUI_WhatIsDlg.cxx b/src/SMESHGUI/SMESHGUI_WhatIsDlg.cxx index 57830cefb..f2913e836 100755 --- a/src/SMESHGUI/SMESHGUI_WhatIsDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_WhatIsDlg.cxx @@ -242,14 +242,14 @@ void SMESHGUI_WhatIsDlg::SelectionsClicked (int selectionId) { SMESH::SetPointRepresentation(true); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode( NodeSelection ); + aViewWindow->SetSelectionMode( NodeSelection ); break; } case 1: { SMESH::SetPointRepresentation(false); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode( CellSelection ); + aViewWindow->SetSelectionMode( CellSelection ); break; } } @@ -299,10 +299,10 @@ void SMESHGUI_WhatIsDlg::ClickOnHelp() app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); else { SUIT_MessageBox::warning(this, tr("WRN_WARNING"), - tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", - "application")). - arg(myHelpFileName)); + tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", + "application")). + arg(myHelpFileName)); } } @@ -329,10 +329,10 @@ void SMESHGUI_WhatIsDlg::onTextChange (const QString& theNewText) for (int i = 0; i < aListId.count(); i++) { const SMDS_MeshElement * e = RadioButtonNodes->isChecked()? - aMesh->FindNode(aListId[ i ].toInt()): - aMesh->FindElement(aListId[ i ].toInt()); + aMesh->FindNode(aListId[ i ].toInt()): + aMesh->FindElement(aListId[ i ].toInt()); if (e) - newIndices.Add(e->GetID()); + newIndices.Add(e->GetID()); } mySelector->AddOrRemoveIndex( anIO, newIndices, false ); @@ -455,22 +455,22 @@ void SMESHGUI_WhatIsDlg::SelectionIntoArgument() anInfo+=tr("SMESH_FACE")+"
"; anInfo+="" + tr("SMESH_MESHINFO_TYPE")+": "; if(!ef->IsPoly()) - anInfo+=(ef->IsQuadratic()?tr("SMESH_MESHINFO_ORDER2"):tr("SMESH_MESHINFO_ORDER1"))+" "; + anInfo+=(ef->IsQuadratic()?tr("SMESH_MESHINFO_ORDER2"):tr("SMESH_MESHINFO_ORDER1"))+" "; switch(ef->NbNodes()) { case 3: case 6: - { - anInfo+=tr("SMESH_TRIANGLE"); - break; - } + { + anInfo+=tr("SMESH_TRIANGLE"); + break; + } case 4: case 8: - { - anInfo+=tr("SMESH_QUADRANGLE"); - break; - } + { + anInfo+=tr("SMESH_QUADRANGLE"); + break; + } default: - break; + break; } anInfo+="
"; } else if(e->GetType() == SMDSAbs_Volume) { @@ -479,39 +479,39 @@ void SMESHGUI_WhatIsDlg::SelectionIntoArgument() const SMDS_MeshVolume *ev = (SMDS_MeshVolume*) e; SMDS_VolumeTool vt(ev); if(vt.GetVolumeType() != SMDS_VolumeTool::POLYHEDA) - anInfo+=(ev->IsQuadratic()?tr("SMESH_MESHINFO_ORDER2"):tr("SMESH_MESHINFO_ORDER1"))+" "; + anInfo+=(ev->IsQuadratic()?tr("SMESH_MESHINFO_ORDER2"):tr("SMESH_MESHINFO_ORDER1"))+" "; switch(vt.GetVolumeType()) { case SMDS_VolumeTool::TETRA: case SMDS_VolumeTool::QUAD_TETRA: - { - anInfo+=tr("SMESH_TETRAS"); - break; - } + { + anInfo+=tr("SMESH_TETRAS"); + break; + } case SMDS_VolumeTool::PYRAM: case SMDS_VolumeTool::QUAD_PYRAM: - { - anInfo+=tr("SMESH_PYRAMID"); - break; - } + { + anInfo+=tr("SMESH_PYRAMID"); + break; + } case SMDS_VolumeTool::PENTA: case SMDS_VolumeTool::QUAD_PENTA: - { - anInfo+=tr("SMESH_PRISM"); - break; - } + { + anInfo+=tr("SMESH_PRISM"); + break; + } case SMDS_VolumeTool::HEXA: case SMDS_VolumeTool::QUAD_HEXA: - { - anInfo+=tr("SMESH_HEXAS"); - break; - } + { + anInfo+=tr("SMESH_HEXAS"); + break; + } case SMDS_VolumeTool::POLYHEDA: - { - anInfo+=tr("SMESH_POLYEDRON"); - break; - } + { + anInfo+=tr("SMESH_POLYEDRON"); + break; + } default: - break; + break; } anInfo+="
"; } @@ -523,17 +523,17 @@ void SMESHGUI_WhatIsDlg::SelectionIntoArgument() const SMDS_MeshNode* node = static_cast( nodeIt->next() ); anXYZ.Add( gp_XYZ( node->X(), node->Y(), node->Z() ) ); if(e->GetType() != SMDSAbs_Node) - aNodesInfo+=QString("Node %1:
Id=%2, X=%3, Y=%4, Z=%5
").arg(nbNodes+1).arg(node->GetID()).arg(node->X()).arg(node->Y()).arg(node->Z()); + aNodesInfo+=QString("Node %1:
Id=%2, X=%3, Y=%4, Z=%5
").arg(nbNodes+1).arg(node->GetID()).arg(node->X()).arg(node->Y()).arg(node->Z()); // Calculate Connectivity SMDS_ElemIteratorPtr it = node->GetInverseElementIterator(); if (it) { - aNodesInfo+="" + tr("CONNECTED_ELEMENTS") + ":"; - while (it->more()) { - const SMDS_MeshElement* elem = it->next(); - aNodesInfo+=QString(" %1").arg(elem->GetID()); - } - if ( (nbNodes+1) != e->NbNodes()) - aNodesInfo+=QString("

"); + aNodesInfo+="" + tr("CONNECTED_ELEMENTS") + ":"; + while (it->more()) { + const SMDS_MeshElement* elem = it->next(); + aNodesInfo+=QString(" %1").arg(elem->GetID()); + } + if ( (nbNodes+1) != e->NbNodes()) + aNodesInfo+=QString("

"); } } if(e->GetType() != SMDSAbs_Node) diff --git a/src/SMESHGUI/SMESHGUI_XmlHandler.cxx b/src/SMESHGUI/SMESHGUI_XmlHandler.cxx index 4e1ea4eef..16833ee66 100644 --- a/src/SMESHGUI/SMESHGUI_XmlHandler.cxx +++ b/src/SMESHGUI/SMESHGUI_XmlHandler.cxx @@ -103,7 +103,7 @@ bool SMESHGUI_XmlHandler::startElement (const QString&, const QString&, { MESSAGE("Loading Resources " << aResName.toLatin1().data()); SUIT_ResourceMgr* resMgr = SMESHGUI::resourceMgr(); - QString lang = resMgr->stringValue( resMgr->langSection(), "language", "en" ); + QString lang = resMgr->stringValue( resMgr->langSection(), "language", "en" ); resMgr->loadTranslator( "resources", QString( "%1_msg_%2.qm" ).arg( aResName, lang ) ); resMgr->loadTranslator( "resources", QString( "%1_images.qm" ).arg( aResName, lang ) ); } @@ -186,7 +186,7 @@ bool SMESHGUI_XmlHandler::startElement (const QString&, const QString&, { QString aHypos = isHypo ? atts.value("hypos") : atts.value("algos"); aHypos = aHypos.remove( ' ' ); - aHypoSet->set( !isHypo, aHypos.split( ',', QString::SkipEmptyParts ) ); + aHypoSet->set( !isHypo, aHypos.split( ',', QString::SkipEmptyParts ) ); } } } diff --git a/src/SMESHGUI/SMESHGUI_XmlHandler.h b/src/SMESHGUI/SMESHGUI_XmlHandler.h index 09db44219..3c38797e8 100644 --- a/src/SMESHGUI/SMESHGUI_XmlHandler.h +++ b/src/SMESHGUI/SMESHGUI_XmlHandler.h @@ -45,7 +45,7 @@ public: bool startDocument(); bool startElement( const QString&, const QString&, - const QString&, const QXmlAttributes& ); + const QString&, const QXmlAttributes& ); bool endElement( const QString&, const QString&, const QString& ); bool characters( const QString& );