fw4spl
SHistogram.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2017.
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 #ifndef __SCENE2D_ADAPTOR_SHISTOGRAM_HPP__
8 #define __SCENE2D_ADAPTOR_SHISTOGRAM_HPP__
9 
10 #include "scene2D/config.hpp"
11 
12 #include <fwData/Point.hpp>
13 
14 #include <fwRenderQt/IAdaptor.hpp>
15 
16 namespace scene2D
17 {
18 
19 namespace adaptor
20 {
21 
50 class SCENE2D_CLASS_API SHistogram : public ::fwRenderQt::IAdaptor
51 {
52 public:
54 
55  SCENE2D_API SHistogram() noexcept;
56  SCENE2D_API virtual ~SHistogram() noexcept;
57 
58 protected:
59  SCENE2D_API void configuring() override;
60  SCENE2D_API void starting() override;
61  SCENE2D_API void updating() override;
62  SCENE2D_API void stopping() override;
63 
64  SCENE2D_API void processInteraction( ::fwRenderQt::data::Event& _event ) override;
65 
72  SCENE2D_API ::fwServices::IService::KeyConnectionsMap getAutoConnections() const override;
73 
75  static const float SCALE;
76 
77 private:
79  void updateCurrentPoint( ::fwRenderQt::data::Event& _event, const ::fwData::Point::sptr& point );
80 
82  QPen m_color;
83 
85  float m_opacity;
86 
88  float m_scale;
89 
90  // Graphics items contained into m_items are also added to this group item,
91  // which is then added to the scene.
92  // (This is the only graphic item which has to be added into the scene).
93  QGraphicsItemGroup* m_layer;
94 };
95 
96 } // namespace adaptor
97 
98 } // namespace scene2D
99 
100 #endif // __SCENE2D_ADAPTOR_SHISTOGRAM_HPP__
101 
Root class for all scene2d adaptors.
This class is a helper to define the connections of a service and its data.
Definition: IService.hpp:454
Namespace fwServices is dedicated to (mimic) the dynamic affectation of methods to (pure data) object...
This bundles contains data and services used to display a 2D Qt scene.
IAdaptor implementation for histogram data.
Definition: SHistogram.hpp:50
#define fwCoreServiceClassDefinitionsMacro(_classinfo_)
Generate common code for services classes.
Contains the representation of the data objects used in the framework.
The namespace fwRenderQt contains classes for rendering with Qt.
Definition: Axis.hpp:12