//
// 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
//
// 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
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
QLabel* label = new QLabel( tr( "SMESH_GEOM" ), elemsGrp );
myElemGeomBtn = new QPushButton( elemsGrp );
myElemGeomBtn->setCheckable(true);
QLabel* label = new QLabel( tr( "SMESH_GEOM" ), elemsGrp );
myElemGeomBtn = new QPushButton( elemsGrp );
myElemGeomBtn->setCheckable(true);
case GEOM::EDGE: return SMESH::EDGE;
case GEOM::WIRE: return SMESH::EDGE;
case GEOM::FACE: return SMESH::FACE;
case GEOM::EDGE: return SMESH::EDGE;
case GEOM::WIRE: return SMESH::EDGE;
case GEOM::FACE: return SMESH::FACE;
- _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
- GEOM::GEOM_IShapesOperations_var aShapeOp =
- SMESH::GetGEOMGen()->GetIShapesOperations(aStudy->StudyId());
+ GEOM::GEOM_Gen_var geomGen = SMESH::GetGEOMGen( geom );
+ GEOM::GEOM_IShapesOperations_wrap aShapeOp = geomGen->GetIShapesOperations();
- if ( geom->GetType() == 37 ) { // geom group
- GEOM::GEOM_IGroupOperations_var aGroupOp =
- SMESH::GetGEOMGen()->GetIGroupOperations(aStudy->StudyId());
+ if ( geom->GetType() == 37 ) // geom group
+ {
+ GEOM::GEOM_IGroupOperations_wrap aGroupOp = geomGen->GetIGroupOperations();
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 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] );
- return elementType( member );
+ GEOM::GEOM_Object_wrap member = aShapeOp->GetSubShape( mainShape, ids[0] );
+ return ElementType( member );
- GEOM::GEOM_Object_var member = aShapeOp->GetSubShape( geom, ids[0] );
- return elementType( member );
+ GEOM::GEOM_Object_wrap member = aShapeOp->GetSubShape( geom, ids[0] );
+ return ElementType( member );
SMESH::SMESH_Mesh_var mesh = SMESH::SObjectToInterface<SMESH::SMESH_Mesh>( meshSO );
if ( mesh->_is_nil() ) return false;
SMESH::SMESH_Mesh_var mesh = SMESH::SObjectToInterface<SMESH::SMESH_Mesh>( meshSO );
if ( mesh->_is_nil() ) return false;
GEOM::GEOM_Object_var geom = SMESH::SObjectToInterface<GEOM::GEOM_Object>(geomSO);
if ( geom->_is_nil() ) continue;
// group type
GEOM::GEOM_Object_var geom = SMESH::SObjectToInterface<GEOM::GEOM_Object>(geomSO);
if ( geom->_is_nil() ) continue;
// group type
// groupNames.append( name );
//printf( "apply() %s %s\n", (*geomID).latin1(), name.latin1() );
// groupNames.append( name );
//printf( "apply() %s %s\n", (*geomID).latin1(), name.latin1() );
if( !group->_is_nil() )
if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( group ) )
anEntryList.append( aSObject->GetID().c_str() );
}
}
if( !group->_is_nil() )
if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( group ) )
anEntryList.append( aSObject->GetID().c_str() );
}
}
if( LightApp_Application* anApp =
dynamic_cast<LightApp_Application*>( SUIT_Session::session()->activeApplication() ) )
anApp->browseObjects( anEntryList, isApplyAndClose() );
if( LightApp_Application* anApp =
dynamic_cast<LightApp_Application*>( SUIT_Session::session()->activeApplication() ) )
anApp->browseObjects( anEntryList, isApplyAndClose() );
if ( theId == _ELEM_GEOM || theId == _NODE_GEOM )
return new GEOM_SelectionFilter( (SalomeApp_Study*)study(), true );
else if ( theId == _MESH )
if ( theId == _ELEM_GEOM || theId == _NODE_GEOM )
return new GEOM_SelectionFilter( (SalomeApp_Study*)study(), true );
else if ( theId == _MESH )
// shape to mesh
_PTR(SObject) anObj, shapeToMesh;
if (meshSO->FindSubObject(1, anObj) && anObj->ReferencedObject(shapeToMesh)) {
// shape to mesh
_PTR(SObject) anObj, shapeToMesh;
if (meshSO->FindSubObject(1, anObj) && anObj->ReferencedObject(shapeToMesh)) {
QStringList::iterator name = names.begin(), id = ids.begin(), idEnd = ids.end();
for (; id != idEnd; ++id, ++name ) {
// shape SO
QStringList::iterator name = names.begin(), id = ids.begin(), idEnd = ids.end();
for (; id != idEnd; ++id, ++name ) {
// shape SO
// check if shape SO is a child of shape to mesh
while ( shapeSO && shapeSO->GetID() != shapeToMesh->GetID() )
if ( shapeSO->Depth() < 2 )
// check if shape SO is a child of shape to mesh
while ( shapeSO && shapeSO->GetID() != shapeToMesh->GetID() )
if ( shapeSO->Depth() < 2 )