Salome HOME
Copyright update 2022
[modules/hexablock.git] / src / HEXABLOCKGUI / HEXABLOCKGUI_DocumentSelectionModel.hxx
old mode 100755 (executable)
new mode 100644 (file)
index 4f8fb56..3416495
@@ -1,9 +1,9 @@
-// Copyright (C) 2009-2013  CEA/DEN, EDF R&D
+// Copyright (C) 2009-2022  CEA/DEN, EDF R&D
 //
 // 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.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
 #ifndef _HEXABLOCKGUI_DOCUMENTSELECTIONMODEL_HXX_
 #define _HEXABLOCKGUI_DOCUMENTSELECTIONMODEL_HXX_
 
+#include "HEXABLOCKGUI_Export.hxx"
+
 #include <QItemSelectionModel>
-#include <LightApp_SelectionMgr.h>
+//#include <LightApp_SelectionMgr.h>
 
-#include <SVTK_ViewWindow.h>
+//#include <SVTK_ViewWindow.h>
 #include <SVTK_Selector.h>
 
-#include "klinkitemselectionmodel.hxx"
+//#include "klinkitemselectionmodel.hxx"
+
+#include "HEXABLOCKGUI_DocumentModel.hxx"
 
 class OCCViewer_ViewWindow;
 
@@ -36,7 +40,7 @@ namespace HEXABLOCK
   namespace GUI
   {
 
-    class SelectionModel: public QItemSelectionModel
+    class HEXABLOCK_EXPORT SelectionModel: public QItemSelectionModel
     {
         Q_OBJECT
 
@@ -49,12 +53,16 @@ namespace HEXABLOCK
             QModelIndex     indexBy( int role, const QVariant& var );
             QModelIndex     indexOf( const QString& anIOEntry, int role );
             QModelIndexList indexListOf( const QString& anEntry, int role );
+            DocumentModel*  getDocModel() const;
+            void            showEltInfo(QModelIndex& elt);
 
             virtual void geomSelectionChanged( const Handle(SALOME_InteractiveObject)& anIObject ) {}
             virtual void vtkSelectionChanged( const Handle(SALOME_InteractiveObject)& anIObject ) {}
 
             void clearHighlightedItems() { currentHighlightedItems.clear(); }
 
+            void setInfoMode(bool isOn) { infoMode = isOn; }
+
        protected slots:
 
             virtual void onCurrentChanged( const QModelIndex & current,
@@ -67,21 +75,21 @@ namespace HEXABLOCK
 
        protected:
             QModelIndexList getSelectionFromModel(const Handle(SALOME_InteractiveObject)& anIObject);
-
             QModelIndexList currentHighlightedItems;
+            static bool infoMode;
     };
 
-    class PatternBuilderSelectionModel: public KLinkItemSelectionModel
-    {
-      public:
-        PatternBuilderSelectionModel( QAbstractItemModel *model, 
-                                      QItemSelectionModel *proxySelector, QObject *parent = 0 ):
-        KLinkItemSelectionModel( model, proxySelector, parent )
-        {
-        }
-    };
-
-    class PatternDataSelectionModel : public SelectionModel
+//    class PatternBuilderSelectionModel: public KLinkItemSelectionModel
+//    {
+//      public:
+//        PatternBuilderSelectionModel( QAbstractItemModel *model,
+//                                      QItemSelectionModel *proxySelector, QObject *parent = 0 ):
+//        KLinkItemSelectionModel( model, proxySelector, parent )
+//        {
+//        }
+//    };
+
+    class HEXABLOCK_EXPORT PatternDataSelectionModel : public SelectionModel
     {
       Q_OBJECT
 
@@ -105,7 +113,7 @@ namespace HEXABLOCK
 
     };
 
-    class PatternGeomSelectionModel : public SelectionModel
+    class HEXABLOCK_EXPORT PatternGeomSelectionModel : public SelectionModel
     {
         Q_OBJECT
 
@@ -126,7 +134,7 @@ namespace HEXABLOCK
     };
 
 
-    class GroupsSelectionModel : public SelectionModel
+    class HEXABLOCK_EXPORT GroupsSelectionModel : public SelectionModel
     {
       Q_OBJECT
 
@@ -141,7 +149,7 @@ namespace HEXABLOCK
     };
 
 
-    class MeshSelectionModel : public SelectionModel
+    class HEXABLOCK_EXPORT MeshSelectionModel : public SelectionModel
     {
       Q_OBJECT