13 #ifndef QmitkColorTransferFunctionCanvas_h
14 #define QmitkColorTransferFunctionCanvas_h
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);