13 #ifndef QMITKCOLORTRANSFERFUNCTIONCANVAS_H_INCLUDED 14 #define QMITKCOLORTRANSFERFUNCTIONCANVAS_H_INCLUDED 19 #include <vtkColorTransferFunction.h> 28 int GetNearHandle(
int x,
int y,
unsigned int maxSquaredDistance = 32)
override;
29 void SetTitle(
const QString &title);
33 this->m_ColorTransferFunction = colorTransferFunction;
34 this->
SetMin(colorTransferFunction->GetRange()[0]);
35 this->
SetMax(colorTransferFunction->GetRange()[1]);
42 return m_ColorTransferFunction->AddRGBPoint(x,
43 m_ColorTransferFunction->GetRedValue(x),
44 m_ColorTransferFunction->GetGreenValue(x),
45 m_ColorTransferFunction->GetBlueValue(x));
51 m_ColorTransferFunction->RemovePoint(x);
54 std::cout <<
"old/new size" << old_size <<
"/" <<
GetFunctionSize() << std::endl;
55 std::cout <<
"called with x=" << x << std::endl;
59 double GetFunctionX(
int index)
override {
return m_ColorTransferFunction->GetDataPointer()[index * 4]; }
64 void AddRGB(
double x,
double r,
double g,
double b);
71 if ((m_ColorTransferFunction->GetRange()[0]) == 0)
73 range = m_ColorTransferFunction->GetRange()[1];
78 range = (m_ColorTransferFunction->GetRange()[1]) - (m_ColorTransferFunction->GetRange()[0]);
85 m_ColorTransferFunction->AddRGBSegment(this->GetFunctionMin(), 1, 0, 0, this->GetFunctionMax(), 1, 1, 0);
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