-// Copyright (C) 2009-2013 CEA/DEN, EDF R&D
+// Copyright (C) 2009-2024 CEA, EDF
//
// 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 <SOCC_ViewModel.h>
-// #include <SOCC_ViewWindow.h>
-// #include <OCCViewer_ViewWindow.h>
-
-#include "MyGEOMBase_Helper.hxx"
+//#include "klinkitemselectionmodel.hxx"
-#include "klinkitemselectionmodel.hxx"
+#include "HEXABLOCKGUI_DocumentModel.hxx"
class OCCViewer_ViewWindow;
namespace GUI
{
- class SelectionModel: public QItemSelectionModel
+ class HEXABLOCK_EXPORT SelectionModel: public QItemSelectionModel
{
Q_OBJECT
SelectionModel( QAbstractItemModel * model );
virtual ~SelectionModel();
- QModelIndex indexBy( int role, const QString& value );
- QModelIndex indexBy( int role, const QVariant& var );
- QModelIndex indexOf( const QString& anIOEntry, int role );
+ QModelIndex indexBy( int role, const QString& value );
+ QModelIndex indexBy( int role, const QVariant& var );
+ QModelIndex indexOf( const QString& anIOEntry, int role );
QModelIndexList indexListOf( const QString& anEntry, int role );
- void setIgnoreSignal(bool state) { ignoreSignal = state; }
+ DocumentModel* getDocModel() const;
+ void showEltInfo(QModelIndex& elt);
virtual void geomSelectionChanged( const Handle(SALOME_InteractiveObject)& anIObject ) {}
virtual void vtkSelectionChanged( const Handle(SALOME_InteractiveObject)& anIObject ) {}
- bool salomeNothingSelected;
+ void clearHighlightedItems() { currentHighlightedItems.clear(); }
+
+ void setInfoMode(bool isOn) { infoMode = isOn; }
protected slots:
protected:
QModelIndexList getSelectionFromModel(const Handle(SALOME_InteractiveObject)& anIObject);
- QModelIndexList getSelectionAssociactions(const Handle(SALOME_InteractiveObject)& anIObject);
-
- bool ignoreSignal;
-// bool _theModelSelectionChanged;
-// bool _theVtkSelectionChanged;
-// bool _theGeomSelectionChanged;
- };
-
- class PatternBuilderSelectionModel: public KLinkItemSelectionModel
- {
- public:
- PatternBuilderSelectionModel( QAbstractItemModel *model,
- QItemSelectionModel *proxySelector, QObject *parent = 0 ):
- KLinkItemSelectionModel( model, proxySelector, parent )
- {
- }
+ QModelIndexList currentHighlightedItems;
+ static bool infoMode;
};
- 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
PatternDataSelectionModel( QAbstractItemModel * model );
virtual ~PatternDataSelectionModel();
- void highlightEltsWithAssocs(const QModelIndexList& elts);
+ void highlightTreeItems(QModelIndexList& indexes,
+ Qt::GlobalColor bgColor = Qt::darkGreen,
+ Qt::GlobalColor fgColor = Qt::white, bool only=true);
+ void unhighlightTreeItems(bool clearSelected=true);
QModelIndexList getGeomAssociations(const QModelIndex& dataIndex);
//Salome
};
- class PatternGeomSelectionModel : public SelectionModel
+ class HEXABLOCK_EXPORT PatternGeomSelectionModel : public SelectionModel
{
Q_OBJECT
virtual ~PatternGeomSelectionModel();
QModelIndex getModelIndex(const Handle(SALOME_InteractiveObject)& anIObject);
-
-// void highlightEltsWithAssocs(const QModelIndexList& elts);
-//
-// //Salome
-// virtual void geomSelectionChanged( const Handle(SALOME_InteractiveObject)& anIObject );
-// virtual void vtkSelectionChanged( const Handle(SALOME_InteractiveObject)& anIObject );
+ void highlightTreeItems(QModelIndexList& indexes,
+ Qt::GlobalColor bgColor = Qt::darkGreen,
+ Qt::GlobalColor fgColor = Qt::white, bool only=true);
+ void unhighlightTreeItems(bool clearSelected=true);
protected slots:
virtual void onCurrentChanged( const QModelIndex & current, const QModelIndex & previous );
};
- class GroupsSelectionModel : public SelectionModel
+ class HEXABLOCK_EXPORT GroupsSelectionModel : public SelectionModel
{
Q_OBJECT
virtual ~GroupsSelectionModel();
protected slots:
-// virtual void onCurrentChanged( const QModelIndex & current, const QModelIndex & previous );
virtual void onSelectionChanged( const QItemSelection & selected,
const QItemSelection & deselected );
};
- class MeshSelectionModel : public SelectionModel
+ class HEXABLOCK_EXPORT MeshSelectionModel : public SelectionModel
{
Q_OBJECT
virtual ~MeshSelectionModel();
protected slots:
-// virtual void onCurrentChanged( const QModelIndex & current, const QModelIndex & previous );
virtual void onSelectionChanged( const QItemSelection & selected,
const QItemSelection & deselected );