fw4spl
RepresentationEditor.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 "uiReconstructionQt/config.hpp"
10 
11 #include <fwCom/Signal.hpp>
12 #include <fwCom/Signals.hpp>
13 
14 #include <fwData/Material.hpp>
15 
16 #include <fwGui/editor/IEditor.hpp>
17 
18 #include <fwTools/Failed.hpp>
19 
20 #include <QObject>
21 #include <QPointer>
22 
23 class QRadioButton;
24 class QCheckBox;
25 class QButtonGroup;
26 class QAbstractButton;
27 
28 namespace uiReconstructionQt
29 {
30 
44 class UIRECONSTRUCTIONQT_CLASS_API RepresentationEditor : public QObject,
46 {
47 Q_OBJECT
48 
49 public:
50 
52 
54  UIRECONSTRUCTIONQT_API RepresentationEditor() noexcept;
55 
57  UIRECONSTRUCTIONQT_API virtual ~RepresentationEditor() noexcept;
58 
59 protected:
60 
61  typedef ::fwRuntime::ConfigurationElement::sptr Configuration;
62 
64  virtual void starting() override;
65 
67  virtual void stopping() override;
68 
70  virtual void updating() override;
71 
73  virtual void configuring() override;
74 
81  virtual KeyConnectionsMap getAutoConnections() const override;
82 
84  void notifyMaterial();
85 
86 protected Q_SLOTS:
87 
88  void onChangeRepresentation( int id );
89  void onChangeShading( int id );
90  void onShowNormals(int state );
91 
92 private:
93 
94  void refreshNormals();
95  void refreshRepresentation();
96  void refreshShading();
97 
98  QPointer<QButtonGroup> m_buttonGroup;
99  QPointer<QButtonGroup> m_buttonGroupShading;
100  QPointer<QButtonGroup> m_normalsRadioBox;
101 
102  ::fwData::Material::sptr m_material;
103 
104 };
105 
106 } // uiReconstructionQt
This class is a helper to define the connections of a service and its data.
Definition: IService.hpp:454
The namespace uiReconstructionQt contains several editors using Qt related on reconstruction.
Defines the service interface managing the editor service for object.
Definition: IEditor.hpp:25
The namespace fwRuntime contains classes to manage bundle, configuration element, extension point in ...
Display a widget to change the reconstruction representation (surface, point, edge, ...).
#define fwCoreServiceClassDefinitionsMacro(_classinfo_)
Generate common code for services classes.
Contains the representation of the data objects used in the framework.