fw4spl
SModelSeriesList.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 
11 #include <fwCom/Signal.hpp>
12 #include <fwCom/Signals.hpp>
13 #include <fwCom/Slot.hpp>
14 #include <fwCom/Slots.hpp>
15 
16 #include <fwData/Reconstruction.hpp>
17 
18 #include <fwGui/editor/IEditor.hpp>
19 
20 #include <fwTools/Failed.hpp>
21 
22 #include <QObject>
23 #include <QPointer>
24 #include <QPushButton>
25 
26 class QTreeWidget;
27 class QCheckBox;
28 class QListWidgetItem;
29 class QTreeWidgetItem;
30 
31 namespace uiMedDataQt
32 {
33 namespace editor
34 {
35 
36 class ValueView;
37 
78 class UIMEDDATAQT_CLASS_API SModelSeriesList : public QObject,
80 {
81 Q_OBJECT
82 public:
83 
85 
87  UIMEDDATAQT_API SModelSeriesList() noexcept;
88 
90  UIMEDDATAQT_API virtual ~SModelSeriesList() noexcept;
91 
100  UIMEDDATAQT_API virtual KeyConnectionsType getObjSrvConnections() const override;
101 
102 protected:
103 
105  virtual void starting() override;
106 
108  virtual void stopping() override;
109 
110  virtual void updating() override;
111 
112  virtual void swapping() override;
113 
115  virtual void configuring() override;
116 
125  UIMEDDATAQT_API virtual KeyConnectionsMap getAutoConnections() const override;
126 
127  typedef std::map< std::string, ValueView* > DisplayedInformation;
128 
129  void updateReconstructions();
130 
131  void fillTree();
132 
133  static const ::fwCom::Signals::SignalKeyType s_RECONSTRUCTION_SELECTED_SIG;
134  typedef ::fwCom::Signal< void (::fwData::Object::sptr) > ReconstructionSelectedSignalType;
135  static const ::fwCom::Signals::SignalKeyType s_EMPTIED_SELECTION_SIG;
136  typedef ::fwCom::Signal< void () > EmptiedSelectionSignalType;
137  static const ::fwCom::Slots::SlotKeyType s_SHOW_RECONSTRUCTIONS_SLOT;
138  typedef ::fwCom::Slot< void (bool) > ShowReconstructionsSlotType;
139 
140 protected Q_SLOTS:
141 
143  void onCurrentItemChanged ( QTreeWidgetItem* current, QTreeWidgetItem* previous );
144 
145  void onCurrentItemChanged ( QTreeWidgetItem* current, int column );
146 
147  void onShowReconstructions(int state);
148 
149  void onOrganChoiceVisibility(QTreeWidgetItem* item, int column);
150 
151  void onCheckAllCheckBox();
152  void onUnCheckAllCheckBox();
153 
154 private:
155 
157  void showReconstructions(bool show);
158 
159  void refreshVisibility();
160 
161  void onCheckAllBoxes(bool visible);
162 
163  QPointer<QPushButton> m_checkAllButton;
164  QPointer<QPushButton> m_unCheckAllButton;
165 
166  QPointer< QCheckBox > m_showCheckBox;
167  QPointer< QTreeWidget > m_tree;
168  DisplayedInformation m_displayedInfo;
169 
170  bool m_enableHideAll;
171 
173  ReconstructionSelectedSignalType::sptr m_sigReconstructionSelected;
174 
176  EmptiedSelectionSignalType::sptr m_sigEmptiedSelection;
177 
179  ShowReconstructionsSlotType::sptr m_slotShowReconstuctions;
180 };
181 
182 } // namespace editor
183 } // namespace uiMedDataQt
The namespace uiMedDataQt contains editors for medical data.
This class is a helper to define the connections of a service and its data.
Definition: IService.hpp:454
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.
::fwCom::helper::SigSlotConnection::KeyConnectionsType KeyConnectionsType
Returns proposals to connect service slots to associated object signals, this method is used for obj/...
Definition: IService.hpp:449
#define fwCoreServiceClassDefinitionsMacro(_classinfo_)
Generate common code for services classes.
Contains the representation of the data objects used in the framework.
Editor displaying the list of the organs in a ModelSeries.