X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_Make2DFrom3DOp.cxx;h=ae0eea4da3ef55ef160ae5fdc7a69b5805528dce;hp=199bdf420e29ce3ff830d3d64cc28956da8e89a3;hb=a274ade365bd0f0e19d56c577acc4a13aa1972a7;hpb=d4c58513204d48121786c215b09b0517da90c08e diff --git a/src/SMESHGUI/SMESHGUI_Make2DFrom3DOp.cxx b/src/SMESHGUI/SMESHGUI_Make2DFrom3DOp.cxx index 199bdf420..ae0eea4da 100644 --- a/src/SMESHGUI/SMESHGUI_Make2DFrom3DOp.cxx +++ b/src/SMESHGUI/SMESHGUI_Make2DFrom3DOp.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2021 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 @@ -238,7 +238,7 @@ void SMESHGUI_Make2DFrom3DOp::startOperation() if( !myDlg ) myDlg = new SMESHGUI_Make2DFrom3DDlg( desktop() ); - myHelpFileName = "make_2dmesh_from_3d_page.html"; + myHelpFileName = "make_2dmesh_from_3d.html"; SMESHGUI_SelectionOp::startOperation(); @@ -299,14 +299,13 @@ void SMESHGUI_Make2DFrom3DOp::selectionDone() myDlg->selectObject( names, types, ids ); // enable/desable "new mesh" button - bool isMesh = true; // EAP - it's sometimes necessary to copy to a new mesh - // for ( int i = 0; i < ids.count() && isMesh; ++i ) - // { - // _PTR(SObject) sobj = - // SMESHGUI::activeStudy()->studyDS()->FindObjectID( ids[i].toLatin1().constData() ); - // mySrcMesh = SMESH::SObjectToInterface( sobj ); - // isMesh = !mySrcMesh->_is_nil(); - // } + bool isMesh = true; + for ( int i = 0; i < ids.count() && isMesh; ++i ) + { + _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( ids[i].toUtf8().constData() ); + mySrcMesh = SMESH::SObjectToInterface( sobj ); + //isMesh = !mySrcMesh->_is_nil(); // EAP - it's sometimes necessary to copy to a new mesh + } myDlg->setNewMeshEnabled( isMesh ); } catch ( const SALOME::SALOME_Exception& S_ex ) { @@ -317,7 +316,7 @@ void SMESHGUI_Make2DFrom3DOp::selectionDone() } } -SUIT_SelectionFilter* SMESHGUI_Make2DFrom3DOp::createFilter( const int theId ) const +SUIT_SelectionFilter* SMESHGUI_Make2DFrom3DOp::createFilter( const int /*theId*/ ) const { SMESHGUI_Make2DFrom3DOp* me = (SMESHGUI_Make2DFrom3DOp*) this; @@ -356,7 +355,7 @@ bool SMESHGUI_Make2DFrom3DOp::isValid( QString& msg ) const for ( int i = 0; i < entries.count(); ++i ) { SMESH::SMESH_GroupBase_var grp; - if ( _PTR(SObject) sobj = SMESHGUI::activeStudy()->studyDS()->FindObjectID( entries[i].toLatin1().constData() )) + if ( _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( entries[i].toUtf8().constData() )) grp = SMESH::SObjectToInterface( sobj ); if ( grp->_is_nil() ) { msg = tr( "SMESH_NOT_ONLY_GROUPS" ); @@ -370,7 +369,7 @@ bool SMESHGUI_Make2DFrom3DOp::isValid( QString& msg ) const for ( int i = 0; i < entries.count(); ++i ) { SMESH::SMESH_IDSource_var idSource; - if ( _PTR(SObject) sobj = SMESHGUI::activeStudy()->studyDS()->FindObjectID( entries[i].toLatin1().constData() )) + if ( _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( entries[i].toUtf8().constData() )) idSource = SMESH::SObjectToInterface( sobj ); if ( !idSource->_is_nil() ) { SMESH::array_of_ElementType_var types = idSource->GetTypes(); @@ -428,8 +427,7 @@ bool SMESHGUI_Make2DFrom3DOp::compute2DMesh( QStringList& theEntryList ) groups->length( entries.count() ); for ( int i = 0; i < entries.count(); ++i ) { - _PTR(SObject) sobj = - SMESHGUI::activeStudy()->studyDS()->FindObjectID( entries[i].toLatin1().constData() ); + _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( entries[i].toUtf8().constData() ); SMESH::SMESH_IDSource_var grp = SMESH::SObjectToInterface( sobj ); SMESH::array_of_ElementType_var types = grp->GetTypes(); if ( types->length() < 1 || types[0] != goodType ) @@ -452,8 +450,8 @@ bool SMESHGUI_Make2DFrom3DOp::compute2DMesh( QStringList& theEntryList ) SMESH::SMESH_Group_var newGrp; SMESH::SMESH_Mesh_var newMesh; CORBA::Long nbAdded = aMeshEditor->MakeBoundaryElements( mode, - groupName.toLatin1().constData(), - meshName.toLatin1().constData(), + groupName.toUtf8().constData(), + meshName.toUtf8().constData(), copyAll, groups, newMesh.out(), @@ -470,8 +468,11 @@ bool SMESHGUI_Make2DFrom3DOp::compute2DMesh( QStringList& theEntryList ) ok = true; for ( int i = 0; i < entries.count(); ++i ) - if ( SMESH_Actor* actor = SMESH::FindActorByEntry( entries[i].toLatin1().constData() )) - SMESH::Update(actor->getIO(),actor->GetVisibility()); + if ( SMESH_Actor* actor = SMESH::FindActorByEntry( entries[i].toUtf8().constData() )) + { + actor->SetEntityMode( actor->GetEntityMode() | SMESH_Actor::eFaces ); + SMESH::Update( actor->getIO(), actor->GetVisibility() ); + } SMESH::RepaintCurrentView(); } } @@ -482,7 +483,7 @@ bool SMESHGUI_Make2DFrom3DOp::compute2DMesh( QStringList& theEntryList ) bool SMESHGUI_Make2DFrom3DOp::onApply() { - if ( isStudyLocked() ) + if ( SMESHGUI::isStudyLocked() ) return false; QString msg;