1 // Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 // SMESH SMESHGUI_Selection
24 // File : SMESHGUI_Selection.cxx
25 // Author : Alexander SOLOVYOV, Open CASCADE S.A.S.
29 #include "SMESHGUI_Selection.h"
31 #include "SMESHGUI_Utils.h"
32 #include "SMESHGUI_VTKUtils.h"
33 #include "SMESHGUI_GEOMGenUtils.h"
34 #include "SMESHGUI_ComputeDlg.h"
36 #include <SMESH_Type.h>
37 #include <SMESH_Actor.h>
38 #include <SMESH_ScalarBarActor.h>
40 // SALOME GUI includes
41 #include <SalomeApp_Study.h>
42 #include <LightApp_VTKSelector.h>
43 #include <SVTK_ViewWindow.h>
46 #include <SALOMEconfig.h>
47 #include CORBA_CLIENT_HEADER(SMESH_Gen)
48 #include CORBA_CLIENT_HEADER(SMESH_Mesh)
49 #include CORBA_CLIENT_HEADER(SMESH_Group)
51 //=======================================================================
52 //function : SMESHGUI_Selection
54 //=======================================================================
55 SMESHGUI_Selection::SMESHGUI_Selection()
56 : LightApp_Selection()
60 //=======================================================================
61 //function : ~SMESHGUI_Selection
63 //=======================================================================
64 SMESHGUI_Selection::~SMESHGUI_Selection()
68 //=======================================================================
71 //=======================================================================
72 void SMESHGUI_Selection::init( const QString& client, LightApp_SelectionMgr* mgr )
74 LightApp_Selection::init( client, mgr );
78 SalomeApp_Study* aSStudy = dynamic_cast<SalomeApp_Study*>(study());
81 _PTR(Study) aStudy = aSStudy->studyDS();
83 for( int i=0, n=count(); i<n; i++ ) {
84 myTypes.append( typeName( type( entry( i ), aStudy ) ) );
85 myControls.append( controlMode( i ) );
90 //=======================================================================
91 //function : processOwner
93 //=======================================================================
94 bool SMESHGUI_Selection::processOwner( const LightApp_DataOwner* ow )
96 const LightApp_SVTKDataOwner* owner =
97 dynamic_cast<const LightApp_SVTKDataOwner*> ( ow );
99 myActors.append( dynamic_cast<SMESH_Actor*>( owner->GetActor() ) );
101 else if ( ow ) { // SVTK selection disabled
102 QString entry = ow->entry();
103 myActors.append( SMESH::FindActorByEntry( entry.toStdString().c_str() ));
106 myActors.append( 0 );
111 //=======================================================================
112 //function : parameter
114 //=======================================================================
115 QVariant SMESHGUI_Selection::parameter( const int ind, const QString& p ) const
118 if ( p=="client" ) val = QVariant( LightApp_Selection::parameter( p ) );
119 else if ( p=="type" ) val = QVariant( myTypes[ind] );
120 else if ( p=="elemTypes" ) val = QVariant( elemTypes( ind ) );
121 else if ( p=="isAutoColor" ) val = QVariant( isAutoColor( ind ) );
122 else if ( p=="numberOfNodes" ) val = QVariant( numberOfNodes( ind ) );
123 else if ( p=="dim" ) val = QVariant( dim( ind ) );
124 else if ( p=="labeledTypes" ) val = QVariant( labeledTypes( ind ) );
125 else if ( p=="shrinkMode" ) val = QVariant( shrinkMode( ind ) );
126 else if ( p=="entityMode" ) val = QVariant( entityMode( ind ) );
127 else if ( p=="isNumFunctor" ) val = QVariant( isNumFunctor( ind ) );
128 else if ( p=="displayMode" ) val = QVariant( displayMode( ind ) );
129 else if ( p=="isComputable" ) val = QVariant( isComputable( ind ) );
130 else if ( p=="isPreComputable" ) val = QVariant( isPreComputable( ind ) );
131 else if ( p=="hasReference" ) val = QVariant( hasReference( ind ) );
132 else if ( p=="isImported" ) val = QVariant( isImported( ind ) );
133 else if ( p=="facesOrientationMode" ) val = QVariant( facesOrientationMode( ind ) );
134 else if ( p=="groupType" ) val = QVariant( groupType( ind ) );
135 else if ( p=="quadratic2DMode") val = QVariant( quadratic2DMode( ind ) );
136 else if ( p=="isDistributionVisible") val = QVariant( isDistributionVisible( ind ) );
137 else if ( p=="hasChildren") val = QVariant( hasChildren( ind ) );
138 else if ( p=="nbChildren") val = QVariant( nbChildren( ind ) );
139 else if ( p=="isContainer") val = QVariant( isContainer( ind ) );
144 return LightApp_Selection::parameter( ind, p );
147 //=======================================================================
148 //function : parameter
150 //=======================================================================
151 QVariant SMESHGUI_Selection::parameter( const QString& p ) const
154 if ( p=="controlMode" ) val = QVariant( controlMode() );
159 return LightApp_Selection::parameter( p );
162 //=======================================================================
163 //function : getVtkOwner
165 //=======================================================================
167 SMESH_Actor* SMESHGUI_Selection::getActor( int ind ) const
169 if( ind >= 0 && ind < count() )
170 return myActors.isEmpty() ? 0 : myActors.at( ind );
175 //=======================================================================
176 //function : elemTypes
177 //purpose : may return {'Elem0d' 'Edge' 'Face' 'Volume' 'BallElem'} at most
178 //=======================================================================
180 QList<QVariant> SMESHGUI_Selection::elemTypes( int ind ) const
182 QList<QVariant> types;
183 SMESH_Actor* actor = getActor( ind );
185 TVisualObjPtr object = actor->GetObject();
187 if ( object->GetNbEntities( SMDSAbs_0DElement )) types.append( "Elem0d" );
188 if ( object->GetNbEntities( SMDSAbs_Ball )) types.append( "BallElem" );
189 if ( object->GetNbEntities( SMDSAbs_Edge )) types.append( "Edge" );
190 if ( object->GetNbEntities( SMDSAbs_Face )) types.append( "Face" );
191 if ( object->GetNbEntities( SMDSAbs_Volume )) types.append( "Volume" );
197 //=======================================================================
198 //function : labeledTypes
199 //purpose : may return {'Point' 'Cell'} at most
200 //=======================================================================
202 QList<QVariant> SMESHGUI_Selection::labeledTypes( int ind ) const
204 QList<QVariant> types;
205 SMESH_Actor* actor = getActor( ind );
207 if ( actor->GetPointsLabeled()) types.append( "Point" );
208 if ( actor->GetCellsLabeled()) types.append( "Cell" );
213 //=======================================================================
214 //function : displayMode
215 //purpose : return SMESH_Actor::EReperesent
216 //=======================================================================
218 QString SMESHGUI_Selection::displayMode( int ind ) const
220 SMESH_Actor* actor = getActor( ind );
222 switch( actor->GetRepresentation() ) {
223 case SMESH_Actor::eEdge: return "eEdge";
224 case SMESH_Actor::eSurface: return "eSurface";
225 case SMESH_Actor::ePoint: return "ePoint";
233 //=======================================================================
234 //function : quadratic2DMode
235 //purpose : return SMESH_Actor::EQuadratic2DRepresentation
236 //=======================================================================
237 QString SMESHGUI_Selection::quadratic2DMode( int ind ) const
239 SMESH_Actor* actor = getActor( ind );
241 switch( actor->GetQuadratic2DRepresentation() ) {
242 case SMESH_Actor::eLines: return "eLines";
243 case SMESH_Actor::eArcs: return "eArcs";
250 //=======================================================================
251 //function : isDistributionVisible
252 //purpose : Visible/Invisible distribution of the ScalarBar Actor
253 //=======================================================================
255 bool SMESHGUI_Selection::isDistributionVisible(int ind) const {
256 SMESH_Actor* actor = getActor( ind );
257 return (actor && actor->GetScalarBarActor() && actor->GetScalarBarActor()->GetDistributionVisibility());
260 //=======================================================================
261 //function : shrinkMode
262 //purpose : return either 'IsSrunk', 'IsNotShrunk' or 'IsNotShrinkable'
263 //=======================================================================
265 QString SMESHGUI_Selection::shrinkMode( int ind ) const
267 SMESH_Actor* actor = getActor( ind );
268 if ( actor && actor->IsShrunkable() ) {
269 return actor->IsShrunk() ? "IsShrunk" : "IsNotShrunk";
271 return "IsNotShrinkable";
274 //=======================================================================
275 //function : entityMode
276 //purpose : may return {'Elem0d' 'Edge' 'Face' 'Volume' 'BallElem' } at most
277 //=======================================================================
279 QList<QVariant> SMESHGUI_Selection::entityMode( int ind ) const
281 QList<QVariant> types;
282 SMESH_Actor* actor = getActor( ind );
284 unsigned int aMode = actor->GetEntityMode();
285 if ( aMode & SMESH_Actor::eVolumes ) types.append( "Volume" );
286 if ( aMode & SMESH_Actor::eFaces ) types.append( "Face" );
287 if ( aMode & SMESH_Actor::eEdges ) types.append( "Edge" );
288 if ( aMode & SMESH_Actor::e0DElements ) types.append( "Elem0d" );
289 if ( aMode & SMESH_Actor::eBallElem ) types.append( "BallElem" );
294 //=======================================================================
295 //function : controlMode
296 //purpose : return SMESH_Actor::eControl
297 //=======================================================================
299 QString SMESHGUI_Selection::controlMode( int ind ) const
301 SMESH_Actor* actor = getActor( ind );
302 QString mode = "eNone";
304 switch( actor->GetControlMode() ) {
305 case SMESH_Actor::eLength: mode = "eLength"; break;
306 case SMESH_Actor::eLength2D: mode = "eLength2D"; break;
307 case SMESH_Actor::eFreeEdges: mode = "eFreeEdges"; break;
308 case SMESH_Actor::eFreeNodes: mode = "eFreeNodes"; break;
309 case SMESH_Actor::eFreeBorders: mode = "eFreeBorders"; break;
310 case SMESH_Actor::eFreeFaces: mode = "eFreeFaces"; break;
311 case SMESH_Actor::eMultiConnection: mode = "eMultiConnection"; break;
312 case SMESH_Actor::eMultiConnection2D: mode = "eMultiConnection2D"; break;
313 case SMESH_Actor::eArea: mode = "eArea"; break;
314 case SMESH_Actor::eVolume3D: mode = "eVolume3D"; break;
315 case SMESH_Actor::eMaxElementLength2D: mode = "eMaxElementLength2D"; break;
316 case SMESH_Actor::eMaxElementLength3D: mode = "eMaxElementLength3D"; break;
317 case SMESH_Actor::eTaper: mode = "eTaper"; break;
318 case SMESH_Actor::eAspectRatio: mode = "eAspectRatio"; break;
319 case SMESH_Actor::eAspectRatio3D: mode = "eAspectRatio3D"; break;
320 case SMESH_Actor::eMinimumAngle: mode = "eMinimumAngle"; break;
321 case SMESH_Actor::eWarping: mode = "eWarping"; break;
322 case SMESH_Actor::eSkew: mode = "eSkew"; break;
323 case SMESH_Actor::eBareBorderFace: mode = "eBareBorderFace"; break;
324 case SMESH_Actor::eBareBorderVolume: mode = "eBareBorderVolume"; break;
325 case SMESH_Actor::eOverConstrainedFace: mode = "eOverConstrainedFace"; break;
326 case SMESH_Actor::eOverConstrainedVolume: mode = "eOverConstrainedVolume"; break;
327 case SMESH_Actor::eCoincidentNodes: mode = "eCoincidentNodes"; break;
328 case SMESH_Actor::eCoincidentElems1D: mode = "eCoincidentElems1D"; break;
329 case SMESH_Actor::eCoincidentElems2D: mode = "eCoincidentElems2D"; break;
330 case SMESH_Actor::eCoincidentElems3D: mode = "eCoincidentElems3D"; break;
337 //=======================================================================
338 //function : controlMode
339 //purpose : gets global control mode; return SMESH_Actor::eControl
340 //=======================================================================
341 QString SMESHGUI_Selection::controlMode() const
343 if( myControls.count() > 0 ) {
344 QString mode = myControls[0];
345 for( int ind = 1; ind < myControls.count(); ind++ ) {
346 if( mode != myControls[ind] )
354 bool SMESHGUI_Selection::isNumFunctor( int ind ) const
357 SMESH_Actor* actor = getActor( ind );
359 switch( actor->GetControlMode() ) {
360 case SMESH_Actor::eLength:
361 case SMESH_Actor::eLength2D:
362 case SMESH_Actor::eMultiConnection:
363 case SMESH_Actor::eMultiConnection2D:
364 case SMESH_Actor::eArea:
365 case SMESH_Actor::eVolume3D:
366 case SMESH_Actor::eMaxElementLength2D:
367 case SMESH_Actor::eMaxElementLength3D:
368 case SMESH_Actor::eTaper:
369 case SMESH_Actor::eAspectRatio:
370 case SMESH_Actor::eAspectRatio3D:
371 case SMESH_Actor::eMinimumAngle:
372 case SMESH_Actor::eWarping:
373 case SMESH_Actor::eSkew:
383 //=======================================================================
384 //function : facesOrientationMode
386 //=======================================================================
388 QString SMESHGUI_Selection::facesOrientationMode( int ind ) const
390 SMESH_Actor* actor = getActor( ind );
392 return actor->GetFacesOriented() ? "IsOriented" : "IsNotOriented";
397 //=======================================================================
398 //function : isAutoColor
400 //=======================================================================
402 bool SMESHGUI_Selection::isAutoColor( int ind ) const
404 if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] != "Unknown" )
406 _PTR(SObject) sobj = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
407 CORBA::Object_var obj = SMESH::SObjectToObject( sobj, SMESH::GetActiveStudyDocument() );
409 if ( !CORBA::is_nil( obj ) ) {
410 SMESH::SMESH_Mesh_var mesh = SMESH::SMESH_Mesh::_narrow( obj );
411 if ( !CORBA::is_nil( mesh ) )
412 return mesh->GetAutoColor();
418 //=======================================================================
419 //function : numberOfNodes
420 //purpose : this method is actually used to check if an object is empty or not
421 //=======================================================================
423 int SMESHGUI_Selection::numberOfNodes( int ind ) const
425 if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] != "Unknown" )
427 _PTR(SObject) sobj = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
428 CORBA::Object_var obj = SMESH::SObjectToObject( sobj, SMESH::GetActiveStudyDocument() );
430 if ( !CORBA::is_nil( obj ) ) {
431 SMESH::SMESH_Mesh_var mesh = SMESH::SMESH_Mesh::_narrow( obj );
432 if ( !CORBA::is_nil( mesh ) )
433 return mesh->NbNodes();
434 SMESH::SMESH_subMesh_var aSubMeshObj = SMESH::SMESH_subMesh::_narrow( obj );
435 if ( !CORBA::is_nil( aSubMeshObj ) )
436 return aSubMeshObj->GetNumberOfNodes(true);
437 SMESH::SMESH_GroupBase_var aGroupObj = SMESH::SMESH_GroupBase::_narrow( obj );
438 if ( !CORBA::is_nil( aGroupObj ) )
439 return aGroupObj->IsEmpty() ? 0 : 1; // aGroupObj->Size();
445 //================================================================================
447 * \brief return dimension of elements of the selected object
449 * \retval int - 0 for 0D elements, -1 for an empty object (the rest as usual)
451 //================================================================================
453 int SMESHGUI_Selection::dim( int ind ) const
456 if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] != "Unknown" )
458 _PTR(SObject) sobj = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
459 CORBA::Object_var obj = SMESH::SObjectToObject( sobj, SMESH::GetActiveStudyDocument() );
461 if ( !CORBA::is_nil( obj ) ) {
462 SMESH::SMESH_IDSource_var idSrc = SMESH::SMESH_IDSource::_narrow( obj );
463 if ( !CORBA::is_nil( idSrc ) )
465 SMESH::array_of_ElementType_var types = idSrc->GetTypes();
466 for ( int i = 0; i < types->length(); ++ i) {
467 switch ( types[i] ) {
468 case SMESH::EDGE : dim = std::max( dim, 1 ); break;
469 case SMESH::FACE : dim = std::max( dim, 2 ); break;
470 case SMESH::VOLUME: dim = std::max( dim, 3 ); break;
471 case SMESH::ELEM0D: dim = std::max( dim, 0 ); break;
472 case SMESH::BALL : dim = std::max( dim, 0 ); break;
482 //=======================================================================
483 //function : isComputable
485 //=======================================================================
487 QVariant SMESHGUI_Selection::isComputable( int ind ) const
489 if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] != "Unknown" )
491 _PTR(SObject) so = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
492 CORBA::Object_var obj = SMESH::SObjectToObject( so, SMESH::GetActiveStudyDocument() );
493 if( !CORBA::is_nil( obj ) ) {
494 SMESH::SMESH_Mesh_var mesh = SMESH::SMESH_Mesh::_narrow( obj );
495 if ( !CORBA::is_nil( mesh ) ) {
496 if ( mesh->HasShapeToMesh() ) {
497 GEOM::GEOM_Object_var shape = SMESH::GetShapeOnMeshOrSubMesh( so );
498 return QVariant( !shape->_is_nil() );
502 return QVariant( mesh->NbFaces() !=0 );
507 GEOM::GEOM_Object_var shape = SMESH::GetShapeOnMeshOrSubMesh( so );
508 return QVariant( !shape->_is_nil() );
512 return QVariant( false );
515 //=======================================================================
516 //function : isPreComputable
518 //=======================================================================
520 QVariant SMESHGUI_Selection::isPreComputable( int ind ) const
522 if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] != "Unknown" )
524 QMap<int,int> modeMap;
525 _PTR(SObject) pMesh = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
526 SMESHGUI_PrecomputeOp::getAssignedAlgos( pMesh, modeMap );
527 return QVariant( modeMap.size() > 1 );
529 return QVariant( false );
532 //=======================================================================
533 //function : hasReference
535 //=======================================================================
537 QVariant SMESHGUI_Selection::hasReference( int ind ) const
539 return QVariant( isReference( ind ) );
542 //=======================================================================
543 //function : isVisible
545 //=======================================================================
547 QVariant SMESHGUI_Selection::isVisible( int ind ) const
549 if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] != "Unknown" )
551 SMESH_Actor* actor = SMESH::FindActorByEntry( entry( ind ).toLatin1().data() );
552 if ( actor && actor->hasIO() ) {
553 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetCurrentVtkView() )
554 return QVariant( aViewWindow->isVisible( actor->getIO() ) );
557 return QVariant( false );
560 //=======================================================================
561 //function : hasChildren
563 //=======================================================================
565 bool SMESHGUI_Selection::hasChildren( int ind ) const
569 _PTR(SObject) sobj = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
571 return SMESH::GetActiveStudyDocument()->GetUseCaseBuilder()->HasChildren( sobj );
576 //=======================================================================
577 //function : hasChildren
579 //=======================================================================
581 int SMESHGUI_Selection::nbChildren( int ind ) const
586 _PTR(SObject) sobj = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
587 if ( sobj && sobj->GetStudy()->GetUseCaseBuilder()->IsUseCaseNode( sobj ) ) {
588 _PTR(UseCaseIterator) it = sobj->GetStudy()->GetUseCaseBuilder()->GetUseCaseIterator( sobj );
589 for ( it->Init( false ); it->More(); it->Next() ) nb++;
595 //=======================================================================
596 //function : isContainer
598 //=======================================================================
600 bool SMESHGUI_Selection::isContainer( int ind ) const
602 return ind >= 0 && ind < myTypes.count() && myTypes[ind] == "Unknown";
605 //=======================================================================
608 //=======================================================================
610 int SMESHGUI_Selection::type( const QString& entry, _PTR(Study) study )
613 _PTR(SObject) obj = study->FindObjectID( entry.toLatin1().data() );
616 if ( obj->ReferencedObject( ref ) )
619 _PTR(SObject) objFather = obj->GetFather();
620 _PTR(SComponent) objComponent = obj->GetFatherComponent();
622 if ( objComponent->ComponentDataType() == "SMESH" ) {
623 if ( objComponent->GetIOR() == obj->GetIOR() ) {
624 res = SMESH::COMPONENT;
627 int aLevel = obj->Depth() - objComponent->Depth(),
628 aFTag = objFather->Tag(),
634 if ( anOTag >= SMESH::Tag_FirstMeshRoot )
640 case SMESH::Tag_HypothesisRoot: res = SMESH::HYPOTHESIS; break;
641 case SMESH::Tag_AlgorithmsRoot: res = SMESH::ALGORITHM; break;
648 case SMESH::Tag_SubMeshOnVertex: res = SMESH::SUBMESH_VERTEX; break;
649 case SMESH::Tag_SubMeshOnEdge: res = SMESH::SUBMESH_EDGE; break;
650 case SMESH::Tag_SubMeshOnFace: res = SMESH::SUBMESH_FACE; break;
651 case SMESH::Tag_SubMeshOnSolid: res = SMESH::SUBMESH_SOLID; break;
652 case SMESH::Tag_SubMeshOnCompound: res = SMESH::SUBMESH_COMPOUND; break;
654 if ( aFTag >= SMESH::Tag_FirstGroup) res = SMESH::GROUP;
655 else res = SMESH::SUBMESH;
666 //=======================================================================
667 //function : typeName
669 //=======================================================================
671 QString SMESHGUI_Selection::typeName( const int t )
673 QString res = "Unknown";
676 case SMESH::HYPOTHESIS:
677 res = "Hypothesis"; break;
678 case SMESH::ALGORITHM:
679 res = "Algorithm"; break;
683 res = "SubMesh"; break;
684 case SMESH::MESHorSUBMESH:
685 res = "Mesh or submesh"; break;
686 case SMESH::SUBMESH_VERTEX:
687 res = "Mesh vertex"; break;
688 case SMESH::SUBMESH_EDGE:
689 res = "Mesh edge"; break;
690 case SMESH::SUBMESH_FACE:
691 res = "Mesh face"; break;
692 case SMESH::SUBMESH_SOLID:
693 res = "Mesh solid"; break;
694 case SMESH::SUBMESH_COMPOUND:
695 res = "Mesh compound"; break;
697 res = "Group"; break;
698 case SMESH::COMPONENT:
699 res = "Component"; break;
706 bool SMESHGUI_Selection::isImported( const int ind ) const
709 _PTR(SObject) sobj = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().constData() );
712 SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_narrow( SMESH::SObjectToObject( sobj ) );
713 if( !aMesh->_is_nil() )
715 SMESH::MedFileInfo_var inf = aMesh->GetMEDFileInfo();
716 res = strlen( (char*)inf->fileName ) > 0;
722 //=======================================================================
723 //function : groupType
725 //=======================================================================
727 QString SMESHGUI_Selection::groupType( int ind ) const
729 _PTR(SObject) sobj = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().constData() );
732 SMESH::SMESH_Group_var g = SMESH::SObjectToInterface<SMESH::SMESH_Group>( sobj );
733 if ( !CORBA::is_nil( g ) )
735 SMESH::SMESH_GroupOnGeom_var gog = SMESH::SObjectToInterface<SMESH::SMESH_GroupOnGeom>( sobj );
736 if( !CORBA::is_nil( gog ) )
737 return "GroupOnGeom";
738 SMESH::SMESH_GroupOnFilter_var gof = SMESH::SObjectToInterface<SMESH::SMESH_GroupOnFilter>( sobj );
739 if ( !CORBA::is_nil( gof ) )
740 return "GroupOnFilter";