fw4spl
SHistogramValue.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_SHISTOGRAMVALUE_HPP__
8 #define __SCENE2D_ADAPTOR_SHISTOGRAMVALUE_HPP__
9 
10 #include "scene2D/config.hpp"
11 
12 #include <fwRenderQt/data/Viewport.hpp>
13 #include <fwRenderQt/IAdaptor.hpp>
14 
15 #include <QGraphicsTextItem>
16 
17 namespace scene2D
18 {
19 namespace adaptor
20 {
21 
53 {
54 
55 public:
57 
58  SCENE2D_API SHistogramValue() noexcept;
59  SCENE2D_API virtual ~SHistogramValue() noexcept;
60 
61  SCENE2D_API ::fwServices::IService::KeyConnectionsMap getAutoConnections() const override;
62 
63 protected:
64  SCENE2D_API void configuring() override;
65  SCENE2D_API void starting() override;
66  SCENE2D_API void updating() override;
67  SCENE2D_API void stopping() override;
68 
69  SCENE2D_API void processInteraction( ::fwRenderQt::data::Event& _event ) override;
70 
72  QPen m_color;
73 
75  QGraphicsSimpleTextItem* m_text;
76 
79 
81  QFont m_font;
82 
84  ::fwRenderQt::data::Coord m_coord;
85 
87  float m_fontSize;
88 
90  QGraphicsItemGroup* m_layer;
91 
92 };
93 
94 } // namespace adaptor
95 } // namespace scene2D
96 
97 #endif // __SCENE2D_ADAPTOR_SHISTOGRAMVALUE_HPP__
98 
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
QPen m_color
Color used for graphic item&#39;s inner color.
QGraphicsItemGroup * m_layer
The layer.
bool m_isInteracting
If true, display the currently pointed intensity value.
Namespace fwServices is dedicated to (mimic) the dynamic affectation of methods to (pure data) object...
float m_fontSize
Size of the font used for rendering the current value of this tracker.
QGraphicsSimpleTextItem * m_text
An item which display the current values of the associated histogram pointed by this cursor...
This bundles contains data and services used to display a 2D Qt scene.
SCENE2D_API void configuring() override
Configure the service before starting. Apply the configuration to service.
SCENE2D_API::fwServices::IService::KeyConnectionsMap getAutoConnections() const override
Returns proposals to connect service slots to associated objects signals, this method is used for obj...
SCENE2D_API void starting() override
Initialize the service activity.
::fwRenderQt::data::Coord m_coord
Coordinates of the current event.
#define fwCoreServiceClassDefinitionsMacro(_classinfo_)
Generate common code for services classes.
SCENE2D_API void processInteraction(::fwRenderQt::data::Event &_event) override
IAdaptor implementation to show the histogram values clicked by mouse.
SCENE2D_API void stopping() override
Uninitialize the service activity. The stop() method is always invoked before destroying a service...
The namespace fwRenderQt contains classes for rendering with Qt.
Definition: Axis.hpp:12
FWSERVICES_API IService()
IService constructor.
Definition: IService.cpp:49
SCENE2D_API void updating() override
Perform some computations according to object (this service is attached to) attribute values and its ...