13 #ifndef QMITKTRANSFERFUNCTIONCANVAS_H_INCLUDED 14 #define QMITKTRANSFERFUNCTIONCANVAS_H_INCLUDED 48 void SetLower(
double lower) { this->m_Lower = lower; }
50 void SetUpper(
double upper) { this->m_Upper = upper; }
51 void mousePressEvent(QMouseEvent *mouseEvent)
override;
52 void paintEvent(QPaintEvent *e)
override;
53 virtual void DoubleClickOnHandle(
int handle) = 0;
55 void mouseMoveEvent(QMouseEvent *mouseEvent)
override;
56 void mouseReleaseEvent(QMouseEvent *mouseEvent)
override;
57 void mouseDoubleClickEvent(QMouseEvent *mouseEvent)
override;
58 void PaintHistogram(QPainter &p);
60 virtual int GetNearHandle(
int x,
int y,
unsigned int maxSquaredDistance = 32) = 0;
61 virtual int AddFunctionPoint(
double x,
double val) = 0;
62 virtual void RemoveFunctionPoint(
double x) = 0;
63 virtual void MoveFunctionPoint(
int index, std::pair<double, double> pos) = 0;
64 virtual double GetFunctionX(
int index) = 0;
65 virtual double GetFunctionY(
int index) = 0;
66 virtual int GetFunctionSize() = 0;
71 std::pair<int, int> FunctionToCanvas(std::pair<double, double>);
72 std::pair<double, double> CanvasToFunction(std::pair<int, int>);
76 void keyPressEvent(QKeyEvent *e)
override;
78 void SetImmediateUpdate(
bool state);
97 if (m_GrabbedHandle != -1)
99 this->MoveFunctionPoint(m_GrabbedHandle, ValidateCoord(std::make_pair(x, GetFunctionY(m_GrabbedHandle))));
107 if (m_GrabbedHandle != -1)
109 this->MoveFunctionPoint(m_GrabbedHandle, ValidateCoord(std::make_pair(GetFunctionX(m_GrabbedHandle), y)));
119 m_LineEditAvailable =
true;
virtual double GetMax() const =0
Returns the maximum value of the histogram.
void SetLower(double lower)
virtual double GetMin() const =0
Returns the minimal value of the histogram.
Abstract superclass for histograms with double values. Classes which are deriving from this class can...
static RenderingManager * GetInstance()
std::pair< double, double > ValidateCoord(std::pair< double, double > x)
mitk::SimpleHistogram * m_Histogram
void SetQLineEdits(QLineEdit *xEdit, QLineEdit *yEdit)
mitk::SimpleHistogram * GetHistogram()
void SetUpper(double upper)
void RequestUpdateAll(RequestType type=REQUEST_UPDATE_ALL)
void SetHistogram(mitk::SimpleHistogram *histogram)