+ //----------------------------------------------------------------------------
+ int GetNameOfSelectedNodes(SVTK_Selector* theSelector,
+ const Handle(SALOME_InteractiveObject)& theIO,
+ QString& theName)
+ {
+ theName = "";
+ TColStd_IndexedMapOfInteger aMapIndex;
+ theSelector->GetIndex(theIO,aMapIndex);
+
+ for(int i = 1; i <= aMapIndex.Extent(); i++)
+ theName += QString(" %1").arg(aMapIndex(i));
+
+ return aMapIndex.Extent();
+ }
+
+ int GetNameOfSelectedElements(SVTK_Selector* theSelector,
+ const Handle(SALOME_InteractiveObject)& theIO,
+ QString& theName)
+ {
+ theName = "";
+ TColStd_IndexedMapOfInteger aMapIndex;
+ theSelector->GetIndex(theIO,aMapIndex);
+
+ typedef std::set<int> TIdContainer;
+ TIdContainer anIdContainer;
+ for( int i = 1; i <= aMapIndex.Extent(); i++)
+ anIdContainer.insert(aMapIndex(i));
+
+ TIdContainer::const_iterator anIter = anIdContainer.begin();
+ for(; anIter != anIdContainer.end(); anIter++)
+ theName += QString(" %1").arg(*anIter);
+
+ return aMapIndex.Extent();
+ }
+
+
+ int GetEdgeNodes(SVTK_Selector* theSelector,
+ const TVisualObjPtr& theVisualObject,
+ int& theId1,
+ int& theId2)
+ {
+ const SALOME_ListIO& selected = theSelector->StoredIObjects();
+
+ if ( selected.Extent() != 1 )
+ return -1;
+
+ Handle(SALOME_InteractiveObject) anIO = selected.First();
+ if ( anIO.IsNull() || !anIO->hasEntry() )
+ return -1;
+
+ TColStd_IndexedMapOfInteger aMapIndex;
+ theSelector->GetIndex( anIO, aMapIndex );
+ if ( aMapIndex.Extent() != 2 )
+ return -1;
+
+ int anObjId = -1, anEdgeNum = -1;
+ for ( int i = 1; i <= aMapIndex.Extent(); i++ ) {
+ int aVal = aMapIndex( i );
+ if ( aVal > 0 )
+ anObjId = aVal;
+ else
+ anEdgeNum = abs( aVal ) - 1;
+ }
+
+ if ( anObjId == -1 || anEdgeNum == -1 )
+ return -1;
+
+ return theVisualObject->GetEdgeNodes( anObjId, anEdgeNum, theId1, theId2 ) ? 1 : -1;
+ }
+
+ //----------------------------------------------------------------------------
+ int GetNameOfSelectedNodes(LightApp_SelectionMgr *theMgr,
+ const Handle(SALOME_InteractiveObject)& theIO,