17 #ifndef __QmlMitkColorTransferFunctionCanvas_h
18 #define __QmlMitkColorTransferFunctionCanvas_h
23 #include <vtkColorTransferFunction.h>
28 Q_PROPERTY(
double greyValue READ getGreyValue WRITE setGreyValue)
33 virtual void paint(QPainter* painter )
override;
34 int GetNearHandle(
int x,
int y,
unsigned int maxSquaredDistance = 32)
override;
35 void SetTitle(
const QString& title);
37 void setGreyValue(
double value);
38 double getGreyValue();
42 this->m_ColorTransferFunction = colorTransferFunction;
43 this->
SetMin(colorTransferFunction->GetRange()[0]);
44 this->
SetMax(colorTransferFunction->GetRange()[1]);
51 return m_ColorTransferFunction->AddRGBPoint(x,m_ColorTransferFunction->GetRedValue(x),m_ColorTransferFunction->GetGreenValue(x),m_ColorTransferFunction->GetBlueValue(x));
57 m_ColorTransferFunction->RemovePoint(x);
60 std::cout <<
"old/new size" << old_size <<
"/" <<
GetFunctionSize() << std::endl;
61 std::cout <<
"called with x=" << x << std::endl;
67 return m_ColorTransferFunction->GetDataPointer()[index*4];
72 return m_ColorTransferFunction->GetSize();
78 void AddRGB(
double x,
double r,
double g,
double b);
82 return m_ColorTransferFunction->GetRange()[1];
87 return m_ColorTransferFunction->GetRange()[0];
93 if((m_ColorTransferFunction->GetRange()[0])==0)
95 range = m_ColorTransferFunction->GetRange()[1];
100 range = (m_ColorTransferFunction->GetRange()[1])-(m_ColorTransferFunction->GetRange()[0]);
107 m_ColorTransferFunction->AddRGBSegment(this->GetFunctionMin(),1,0,0,this->GetFunctionMax(),1,1,0);
115 static void create();
int GetFunctionSize() override
int AddFunctionPoint(double x, double) override
double GetFunctionRange()
#define MITKQMLITEMS_EXPORT
void SetColorTransferFunction(vtkColorTransferFunction *colorTransferFunction)
double GetFunctionX(int index) override
double GetFunctionY(int) override
virtual int GetFunctionSize()=0
virtual void DoubleClickOnHandle(int handle)=0
virtual int GetNearHandle(int x, int y, unsigned int maxSquaredDistance=32)=0
void RemoveFunctionPoint(double x) override
virtual void MoveFunctionPoint(int index, std::pair< double, double > pos)=0
void RemoveAllFunctionPoints()
vtkColorTransferFunction * m_ColorTransferFunction
virtual void paint(QPainter *painter)=0