X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_GroupOnShapeDlg.cxx;h=3c32b743eea5fa8d1accec0b353cc8044b23e2a5;hp=e62b015c2f53d0b0221642f1294a0cc3dbb6fc61;hb=8a9d91b414c3f26586dea735c22c7700898a0a1e;hpb=f5016d85b7b4b88623723027a1585c6414c4dc66 diff --git a/src/SMESHGUI/SMESHGUI_GroupOnShapeDlg.cxx b/src/SMESHGUI/SMESHGUI_GroupOnShapeDlg.cxx index e62b015c2..3c32b743e 100644 --- a/src/SMESHGUI/SMESHGUI_GroupOnShapeDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_GroupOnShapeDlg.cxx @@ -1,9 +1,9 @@ -// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2.1 of the License. +// version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -33,6 +33,7 @@ #include #include +#include #include #include @@ -76,7 +77,8 @@ SMESHGUI_GroupOnShapeDlg::SMESHGUI_GroupOnShapeDlg() // Elem geom - QGroupBox* elemsGrp = new QGroupBox( tr( "SMESH_ELEMENTS" ), mainFrame() ); + QGroupBox* elemsGrp = new QGroupBox( tr( "ELEMENTS" ), mainFrame() ); + elemsGrp->setToolTip( tr("ELEMENTS_TOOLTIP") ); QLabel* label = new QLabel( tr( "SMESH_GEOM" ), elemsGrp ); myElemGeomBtn = new QPushButton( elemsGrp ); myElemGeomBtn->setCheckable(true); @@ -204,7 +206,7 @@ LightApp_Dialog* SMESHGUI_GroupOnShapeOp::dlg() const */ //================================================================================ -static SMESH::ElementType elementType(GEOM::GEOM_Object_var& geom) +static SMESH::ElementType elementType(GEOM::GEOM_Object_var geom) { if ( !geom->_is_nil() ) { switch ( geom->GetShapeType() ) { @@ -218,18 +220,18 @@ static SMESH::ElementType elementType(GEOM::GEOM_Object_var& geom) case GEOM::COMPOUND: break; default: return SMESH::ALL; } - _PTR(Study) aStudy = SMESH::GetActiveStudyDocument(); - GEOM::GEOM_IShapesOperations_var aShapeOp = - SMESH::GetGEOMGen()->GetIShapesOperations(aStudy->StudyId()); + GEOM::GEOM_IShapesOperations_wrap aShapeOp = + SMESH::GetGEOMGen()->GetIShapesOperations(); if ( geom->GetType() == 37 ) { // geom group - GEOM::GEOM_IGroupOperations_var aGroupOp = - SMESH::GetGEOMGen()->GetIGroupOperations(aStudy->StudyId()); + GEOM::GEOM_IGroupOperations_wrap aGroupOp = + SMESH::GetGEOMGen()->GetIGroupOperations(); if ( !aGroupOp->_is_nil() ) { + // mainShape is an existing servant => GEOM_Object_var not GEOM_Object_wrap GEOM::GEOM_Object_var mainShape = aGroupOp->GetMainShape( geom ); GEOM::ListOfLong_var ids = aGroupOp->GetObjects( geom ); if ( ids->length() && !mainShape->_is_nil() && !aShapeOp->_is_nil() ) { - GEOM::GEOM_Object_var member = aShapeOp->GetSubShape( mainShape, ids[0] ); + GEOM::GEOM_Object_wrap member = aShapeOp->GetSubShape( mainShape, ids[0] ); return elementType( member ); } } @@ -237,7 +239,7 @@ static SMESH::ElementType elementType(GEOM::GEOM_Object_var& geom) else if ( !aShapeOp->_is_nil() ) { // just a compoud shape GEOM::ListOfLong_var ids = aShapeOp->SubShapeAllIDs( geom, GEOM::SHAPE, false ); if ( ids->length() ) { - GEOM::GEOM_Object_var member = aShapeOp->GetSubShape( geom, ids[0] ); + GEOM::GEOM_Object_wrap member = aShapeOp->GetSubShape( geom, ids[0] ); return elementType( member ); } } @@ -294,11 +296,11 @@ bool SMESHGUI_GroupOnShapeOp::onApply() { SUIT_OverrideCursor aWaitCursor; - if (isStudyLocked()) + if (SMESHGUI::isStudyLocked()) return false; // study - _PTR(Study) aStudy = SMESH::GetActiveStudyDocument(); + _PTR(Study) aStudy = SMESH::getStudy(); if ( !aStudy ) return false; // mesh @@ -419,7 +421,7 @@ SUIT_SelectionFilter* SMESHGUI_GroupOnShapeOp::createFilter( const int theId ) c if ( theId == _ELEM_GEOM || theId == _NODE_GEOM ) return new GEOM_SelectionFilter( (SalomeApp_Study*)study(), true ); else if ( theId == _MESH ) - return new SMESH_TypeFilter( MESH ); + return new SMESH_TypeFilter( SMESH::MESH ); else return ( SUIT_SelectionFilter*) 0; } @@ -458,7 +460,7 @@ void SMESHGUI_GroupOnShapeOp::selectionDone() QStringList goodNames, goodIds; if (nbSelected > 0) { // study - if (_PTR(Study) aStudy = SMESH::GetActiveStudyDocument()) { + if (_PTR(Study) aStudy = SMESH::getStudy()) { // mesh if (_PTR(SObject) meshSO = aStudy->FindObjectID( myMeshID.toLatin1().data() )) { // shape to mesh @@ -489,13 +491,13 @@ void SMESHGUI_GroupOnShapeOp::selectionDone() } } - if ( myDlg->myElemGeomBtn->isChecked() ) // elem geomerty selection + if ( myDlg->myElemGeomBtn->isChecked() ) // elem geometry selection { myDlg->myElemGeomList->clear(); myDlg->myElemGeomList->addItems( goodNames ); myElemGeoIDs = goodIds; } - else if ( myDlg->myNodeGeomBtn->isChecked() ) // Node geomerty selection + else if ( myDlg->myNodeGeomBtn->isChecked() ) // Node geometry selection { myDlg->myNodeGeomList->clear(); myDlg->myNodeGeomList->addItems( goodNames );