7 #ifndef __SCENE2D_ADAPTOR_SCURVEDHISTOGRAM_HPP__ 8 #define __SCENE2D_ADAPTOR_SCURVEDHISTOGRAM_HPP__ 10 #include "scene2D/config.hpp" 12 #include <fwData/Histogram.hpp> 13 #include <fwData/Point.hpp> 15 #include <fwRenderQt/IAdaptor.hpp> 60 typedef ::fwRenderQt::IAdaptor::Point2DType Point;
61 typedef std::vector< Point > Points;
67 SCENE2D_API
void configuring() override;
68 SCENE2D_API
void starting() override;
69 SCENE2D_API
void updating() override;
70 SCENE2D_API
void stopping() override;
72 SCENE2D_API
void processInteraction( ::
fwRenderQt::data::Event& _event ) override;
83 static const
float SCALE;
86 static const
float NB_POINTS_BEZIER;
90 Points getControlPoints(const ::
fwData::Histogram::csptr& _histogram ) const;
92 Points getBSplinePoints( const Points& _controlPoints ) const;
94 Points getResampledBSplinePoints( const Points& _bSplinePoints ) const;
96 void buildBSplineFromPoints( Points& _bSplinePoints );
98 void computePointToPathLengthMapFromBSplinePoints( Points& _bSplinePoints );
101 void updateCurrentPoint(const ::
fwRenderQt::data::Event& _event, const ::
fwData::Point::sptr&
point );
104 void addBorderItem( const QPainterPath& _path );
107 void addInnerItem( const QPainterPath& _path );
109 Points linearInterpolation( const Point _p1, const Point _p2 );
111 Points cosinusInterpolation( const Point _p0, const Point _p1 );
113 Points quadraticInterpolation( const Point _p0, const Point _p1, const Point _p2 );
115 Points cubicInterpolation(const Point _p0, const Point _p1, const Point _p2, const Point _p3 );
118 std::map<
double,
double> m_positionsToPathLength;
137 QPainterPath* m_painterPath;
148 QGraphicsItemGroup* m_layer;
155 #endif // __SCENE2D_ADAPTOR_SCURVEDHISTOGRAM_HPP__ Root class for all scene2d adaptors.
This class is a helper to define the connections of a service and its data.
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.
#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.