fw4spl
SHistogramCursor.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_SHISTOGRAMCURSOR_HPP__
8 #define __SCENE2D_ADAPTOR_SHISTOGRAMCURSOR_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 
54 {
55 
56 public:
58 
59  SCENE2D_API SHistogramCursor() noexcept;
60  SCENE2D_API virtual ~SHistogramCursor() noexcept;
61 
62  SCENE2D_API ::fwServices::IService::KeyConnectionsMap getAutoConnections() const override;
63 
64 protected:
65  SCENE2D_API void configuring() override;
66  SCENE2D_API void starting() override;
67  SCENE2D_API void updating() override;
68  SCENE2D_API void stopping() override;
69 
70  SCENE2D_API void processInteraction( ::fwRenderQt::data::Event& _event ) override;
71 
73  QPen m_color;
74 
77 
78  // A graphics item that is located onto hsitogram's upper border and moves along this border
79  // according to the position of mouse's cursor. The goal of this graphical index is to show
80  // the associated value within the histogram pointed buy this index.
81  QGraphicsEllipseItem* m_index;
82 
84  ::fwRenderQt::data::Coord m_coord;
85 
87  float m_pointSize;
88 
90  QGraphicsItemGroup* m_layer;
91 };
92 
93 } // namespace adaptor
94 } // namespace scene2D
95 
96 #endif // __SCENE2D_ADAPTOR_SHISTOGRAMCURSOR_HPP__
97 
Root class for all scene2d adaptors.
SCENE2D_API void updating() override
Perform some computations according to object (this service is attached to) attribute values and its ...
This class is a helper to define the connections of a service and its data.
Definition: IService.hpp:454
SCENE2D_API::fwServices::IService::KeyConnectionsMap getAutoConnections() const override
Returns proposals to connect service slots to associated objects signals, this method is used for obj...
QPen m_color
Color used for graphic item&#39;s inner color.
Namespace fwServices is dedicated to (mimic) the dynamic affectation of methods to (pure data) object...
QPen m_borderColor
Color used for graphic item&#39;s border color.
This bundles contains data and services used to display a 2D Qt scene.
QGraphicsItemGroup * m_layer
The layer.
SCENE2D_API void stopping() override
Uninitialize the service activity. The stop() method is always invoked before destroying a service...
::fwRenderQt::data::Coord m_coord
Coordinates of the current event.
#define fwCoreServiceClassDefinitionsMacro(_classinfo_)
Generate common code for services classes.
SCENE2D_API void configuring() override
Configure the service before starting. Apply the configuration to service.
IAdaptor implementation to show a cursor on histogram pointed by mouse.
The namespace fwRenderQt contains classes for rendering with Qt.
Definition: Axis.hpp:12
SCENE2D_API void starting() override
Initialize the service activity.
FWSERVICES_API IService()
IService constructor.
Definition: IService.cpp:49
SCENE2D_API void processInteraction(::fwRenderQt::data::Event &_event) override