Salome HOME
Access to 'Invalid value' of altitude from Bathymetry is added.
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_Tool.cxx
index 0a942119126c98e14d6a8c02e402cbafd70a6e83..d98db72a4eaea477352a23a6442de3d30d7930f8 100644 (file)
@@ -29,6 +29,8 @@
 #include <HYDROData_Document.h>
 #include <HYDROData_Iterator.h>
 
+#include <GraphicsView_Viewer.h>
+
 #include <LightApp_Application.h>
 #include <LightApp_DataOwner.h>
 #include <LightApp_SelectionMgr.h>
@@ -161,14 +163,21 @@ void HYDROGUI_Tool::SetActiveViewManager( HYDROGUI_Module* theModule,
 }
 
 void HYDROGUI_Tool::GetPrsSubObjects( HYDROGUI_Module* theModule,
-                                      const int theViewerId, // currently unused
                                       HYDROData_SequenceOfObjects& theSeq )
 {
   Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( theModule->getStudyId() );
   if( aDocument.IsNull() )
     return;
 
-  HYDROData_Iterator anIterator( aDocument, KIND_UNKNOWN );
+  HYDROData_Iterator anIterator( aDocument, KIND_IMAGE );
+  for( ; anIterator.More(); anIterator.Next() )
+  {
+    Handle(HYDROData_Object) anObject = anIterator.Current();
+    if( !anObject.IsNull() )
+      theSeq.Append( anObject );
+  }
+
+  anIterator = HYDROData_Iterator( aDocument, KIND_POLYLINE );
   for( ; anIterator.More(); anIterator.Next() )
   {
     Handle(HYDROData_Object) anObject = anIterator.Current();
@@ -278,3 +287,32 @@ QString HYDROGUI_Tool::GenerateObjectName( HYDROGUI_Module* theModule,
   }
   return aName;
 }
+
+size_t HYDROGUI_Tool::GetActiveGraphicsViewId( HYDROGUI_Module* theModule )
+{
+  size_t aViewId = 0;
+  SUIT_ViewManager* aViewMgr = theModule->getApp()->activeViewManager();
+  if( !aViewMgr || aViewMgr->getType() != GraphicsView_Viewer::Type() )
+    return aViewId;
+
+  if( SUIT_ViewModel* aViewer = aViewMgr->getViewModel() )
+    aViewId = (size_t)aViewer;
+  return aViewId;
+}
+
+QList<size_t> HYDROGUI_Tool::GetGraphicsViewIdList( HYDROGUI_Module* theModule )
+{
+  QList<size_t> aList;
+  ViewManagerList aViewMgrs;
+  theModule->getApp()->viewManagers( GraphicsView_Viewer::Type(), aViewMgrs );
+  QListIterator<SUIT_ViewManager*> anIter( aViewMgrs );
+  while( anIter.hasNext() )
+  {
+    if( SUIT_ViewManager* aViewMgr = anIter.next() )
+    {
+      if( SUIT_ViewModel* aViewer = aViewMgr->getViewModel() )
+        aList.append( (size_t)aViewer );
+    }
+  }
+  return aList;
+}