-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 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.
+// 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.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// SMESH SMESHGUI : GUI for SMESH component
#include <GeometryGUI.h>
#include <GEOM_SelectionFilter.h>
+#include <GEOM_wrap.hxx>
#include <SUIT_Session.h>
#include <SUIT_OverrideCursor.h>
+#include <LightApp_Application.h>
#include <LightApp_UpdateFlags.h>
#include <SUIT_ResourceMgr.h>
*/
//================================================================================
-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() ) {
default: return SMESH::ALL;
}
_PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
- GEOM::GEOM_IShapesOperations_var aShapeOp =
+ GEOM::GEOM_IShapesOperations_wrap aShapeOp =
SMESH::GetGEOMGen()->GetIShapesOperations(aStudy->StudyId());
if ( geom->GetType() == 37 ) { // geom group
- GEOM::GEOM_IGroupOperations_var aGroupOp =
+ GEOM::GEOM_IGroupOperations_wrap aGroupOp =
SMESH::GetGEOMGen()->GetIGroupOperations(aStudy->StudyId());
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 );
}
}
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 );
}
}
// create groups
SMESH::SMESH_GroupOnGeom_var group;
+ QStringList anEntryList;
for ( int isNode = 0; isNode < 2; ++isNode ) // elems and then nodes
{
QStringList::iterator geomID = isNode ? myNodeGeoIDs.begin() : myElemGeoIDs.begin();
//printf( "apply() %s %s\n", (*geomID).latin1(), name.latin1() );
group = mesh->CreateGroupFromGEOM( elemType, name.toLatin1().data(), geom );
+ if( !group->_is_nil() )
+ if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( group ) )
+ anEntryList.append( aSObject->GetID().c_str() );
}
}
SMESHGUI::Modified();
myDlg->myNodeGeomBtn->setChecked(false);
myDlg->updateButtons();
+ if( LightApp_Application* anApp =
+ dynamic_cast<LightApp_Application*>( SUIT_Session::session()->activeApplication() ) )
+ anApp->browseObjects( anEntryList, isApplyAndClose() );
+
return !group->_is_nil();
}
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;
}
}
}
- 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 );