17 #ifndef QMITKCOLORTRANSFERFUNCTIONCANVAS_H_INCLUDED
18 #define QMITKCOLORTRANSFERFUNCTIONCANVAS_H_INCLUDED
23 #include <vtkColorTransferFunction.h>
31 virtual void paintEvent(QPaintEvent *e)
override;
32 int GetNearHandle(
int x,
int y,
unsigned int maxSquaredDistance = 32)
override;
33 void SetTitle(
const QString &title);
37 this->m_ColorTransferFunction = colorTransferFunction;
38 this->
SetMin(colorTransferFunction->GetRange()[0]);
39 this->
SetMax(colorTransferFunction->GetRange()[1]);
46 return m_ColorTransferFunction->AddRGBPoint(x,
47 m_ColorTransferFunction->GetRedValue(x),
48 m_ColorTransferFunction->GetGreenValue(x),
49 m_ColorTransferFunction->GetBlueValue(x));
55 m_ColorTransferFunction->RemovePoint(x);
58 std::cout <<
"old/new size" << old_size <<
"/" <<
GetFunctionSize() << std::endl;
59 std::cout <<
"called with x=" << x << std::endl;
63 double GetFunctionX(
int index)
override {
return m_ColorTransferFunction->GetDataPointer()[index * 4]; }
68 void AddRGB(
double x,
double r,
double g,
double b);
75 if ((m_ColorTransferFunction->GetRange()[0]) == 0)
77 range = m_ColorTransferFunction->GetRange()[1];
82 range = (m_ColorTransferFunction->GetRange()[1]) - (m_ColorTransferFunction->GetRange()[0]);
89 m_ColorTransferFunction->AddRGBSegment(this->GetFunctionMin(), 1, 0, 0, this->GetFunctionMax(), 1, 1, 0);
virtual void paintEvent(QPaintEvent *e) override
void RemoveAllFunctionPoints()
virtual void MoveFunctionPoint(int index, std::pair< double, double > pos)=0
double GetFunctionY(int) override
virtual int GetNearHandle(int x, int y, unsigned int maxSquaredDistance=32)=0
void RemoveFunctionPoint(double x) override
int AddFunctionPoint(double x, double) override
virtual void DoubleClickOnHandle(int handle)=0
void SetColorTransferFunction(vtkColorTransferFunction *colorTransferFunction)
double GetFunctionX(int index) override
int GetFunctionSize() override
vtkColorTransferFunction * m_ColorTransferFunction
double GetFunctionRange()
virtual int GetFunctionSize()=0