-// Copyright (C) 2007-2012 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
SMESHGUI_Make2DFrom3DOp::SMESHGUI_Make2DFrom3DOp()
: SMESHGUI_SelectionOp(),
- myMeshFilter(MESH),
- myGroupFilter(GROUP)
+ myMeshFilter(SMESH::MESH),
+ myGroupFilter(SMESH::GROUP)
{
}
if( !myDlg )
myDlg = new SMESHGUI_Make2DFrom3DDlg( desktop() );
- myHelpFileName = "make_2dmesh_from_3d_page.html";
+ myHelpFileName = "make_2dmesh_from_3d.html";
SMESHGUI_SelectionOp::startOperation();
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<SMESH::SMESH_Mesh>( sobj );
- isMesh = !mySrcMesh->_is_nil();
+ //isMesh = !mySrcMesh->_is_nil(); // EAP - it's sometimes necessary to copy to a new mesh
}
myDlg->setNewMeshEnabled( isMesh );
}
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<SMESH::SMESH_GroupBase>( sobj );
if ( grp->_is_nil() ) {
msg = tr( "SMESH_NOT_ONLY_GROUPS" );
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<SMESH::SMESH_IDSource>( 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 )
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<SMESH::SMESH_IDSource>( sobj );
SMESH::array_of_ElementType_var types = grp->GetTypes();
if ( types->length() < 1 || types[0] != goodType )
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(),
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();
}
}
bool SMESHGUI_Make2DFrom3DOp::onApply()
{
- if ( isStudyLocked() )
+ if ( SMESHGUI::isStudyLocked() )
return false;
QString msg;