X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_Make2DFrom3DOp.cxx;h=035ef2ac2468c1a97c7b58050febb7dc3aea5fb9;hp=b0fba16247a1bfa04f92c9d1a612e1c9a19a4f40;hb=6d32f944a0a115b6419184c50b57bf7c4eef5786;hpb=bd8f1aee7c78f7d2eb82bd4fec5e08c9e3d280ce diff --git a/src/SMESHGUI/SMESHGUI_Make2DFrom3DOp.cxx b/src/SMESHGUI/SMESHGUI_Make2DFrom3DOp.cxx index b0fba1624..035ef2ac2 100644 --- a/src/SMESHGUI/SMESHGUI_Make2DFrom3DOp.cxx +++ b/src/SMESHGUI/SMESHGUI_Make2DFrom3DOp.cxx @@ -1,9 +1,9 @@ -// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2019 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 @@ -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(); @@ -302,10 +302,9 @@ void SMESHGUI_Make2DFrom3DOp::selectionDone() bool isMesh = true; for ( int i = 0; i < ids.count() && isMesh; ++i ) { - _PTR(SObject) sobj = - SMESHGUI::activeStudy()->studyDS()->FindObjectID( ids[i].toLatin1().constData() ); + _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( ids[i].toUtf8().constData() ); mySrcMesh = SMESH::SObjectToInterface( sobj ); - isMesh = !mySrcMesh->_is_nil(); + //isMesh = !mySrcMesh->_is_nil(); // EAP - it's sometimes necessary to copy to a new mesh } myDlg->setNewMeshEnabled( isMesh ); } @@ -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,11 +369,11 @@ 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(); - for ( int j = 0; j < types->length(); ++j ) + for ( int j = 0; j < (int) types->length(); ++j ) if ( types[j] == SMESH::VOLUME ) hasVolumes = true; else if ( types[j] == SMESH::FACE ) @@ -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(), @@ -466,20 +464,15 @@ bool SMESHGUI_Make2DFrom3DOp::compute2DMesh( QStringList& theEntryList ) if ( !newMesh->_is_nil() ) { if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( newMesh ) ) theEntryList.append( aSObject->GetID().c_str() ); -#ifdef WITHGENERICOBJ - newMesh->UnRegister(); -#endif - } - if ( !newGrp->_is_nil() ) { -#ifdef WITHGENERICOBJ - newGrp->UnRegister(); -#endif } 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(); } } @@ -490,7 +483,7 @@ bool SMESHGUI_Make2DFrom3DOp::compute2DMesh( QStringList& theEntryList ) bool SMESHGUI_Make2DFrom3DOp::onApply() { - if ( isStudyLocked() ) + if ( SMESHGUI::isStudyLocked() ) return false; QString msg;