fw4spl
SSelector.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2018.
3  * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4  * published by the Free Software Foundation.
5  * ****** END LICENSE BLOCK ****** */
6 
7 #pragma once
8 
9 #include "uiMedDataQt/config.hpp"
10 #include "uiMedDataQt/widget/Selector.hpp"
11 
12 #include <fwCom/Slot.hpp>
13 #include <fwCom/Slots.hpp>
14 
15 #include <fwData/Vector.hpp>
16 
17 #include <fwGui/editor/IEditor.hpp>
18 
19 #include <fwMedData/SeriesDB.hpp>
20 
21 #include <QAbstractItemView>
22 #include <QObject>
23 #include <QPointer>
24 #include <QVector>
25 
26 namespace uiMedDataQt
27 {
28 namespace editor
29 {
61 class UIMEDDATAQT_CLASS_API SSelector : public QObject,
63 {
64 Q_OBJECT
65 public:
67 
69  UIMEDDATAQT_API SSelector();
70 
72  UIMEDDATAQT_API virtual ~SSelector() noexcept;
73 
74  typedef ::fwCom::Signal< void ( SPTR( ::fwMedData::Series ) ) > SeriesDoubleClickedSignalType;
75 
77  UIMEDDATAQT_API static const ::fwCom::Signals::SignalKeyType s_SERIES_DOUBLE_CLICKED_SIG;
78 
86  UIMEDDATAQT_API virtual KeyConnectionsMap getAutoConnections() const override;
87 
88 protected:
89 
91  virtual void starting() override;
92 
94  virtual void stopping() override;
95 
97  virtual void configuring() override;
98 
100  virtual void updating() override;
101 
102  virtual void info( std::ostream& _sstream ) override;
103 
104 protected Q_SLOTS:
105 
111  void onSelectedSeries(QVector< ::fwMedData::Series::sptr > selection,
112  QVector< ::fwMedData::Series::sptr > deselection);
113 
120  void onDoubleClick(const QModelIndex& index);
121 
126  void onRemoveSeries(QVector< ::fwMedData::Series::sptr > selection);
127 
128 private:
129 
134  static const ::fwCom::Slots::SlotKeyType s_ADD_SERIES_SLOT;
135  static const ::fwCom::Slots::SlotKeyType s_REMOVE_SERIES_SLOT;
136  typedef ::fwCom::Slot<void (::fwMedData::SeriesDB::ContainerType)> RemoveSeriesSlotType;
137 
139  void addSeries(::fwMedData::SeriesDB::ContainerType addedSeries);
141  void removeSeries(::fwMedData::SeriesDB::ContainerType removedSeries);
142 
144  RemoveSeriesSlotType::sptr m_slotRemoveSeries;
149  ::fwData::Vector::sptr getSelection();
151 
153  std::string m_selectionId;
154 
156  QPointer< ::uiMedDataQt::widget::Selector > m_selectorWidget;
157 
159  SeriesDoubleClickedSignalType::sptr m_sigSeriesDoubleClicked;
160 
162  ::uiMedDataQt::widget::Selector::SeriesIconType m_seriesIcons;
163 
165  bool m_allowedRemove;
166 
168  QAbstractItemView::SelectionMode m_selectionMode;
169 
171  bool m_insertMode;
172 
173 };
174 } // namespace editor
175 } // namespace uiMedDataQt
The namespace uiMedDataQt contains editors for medical data.
#define SPTR(_cls_)
This class is a helper to define the connections of a service and its data.
Definition: IService.hpp:454
Namespace containing medical data.
Namespace containing fw4spl communication tools.
Definition: DumpEditor.hpp:30
Defines the service interface managing the editor service for object.
Definition: IEditor.hpp:25
STL namespace.
This editor shows information about the medical data. It allows to manipulate (select, erase, ...) studies and series.
Definition: SSelector.hpp:61
#define fwCoreServiceClassDefinitionsMacro(_classinfo_)
Generate common code for services classes.
Contains the representation of the data objects used in the framework.