Commit 09142be9 authored by Marcus D. Hanwell's avatar Marcus D. Hanwell
Browse files

Generalize to the superclass - vtkScalarsToColors.

Change-Id: I3a9e3aa7ee08539d7dbeb12fc89f33accb1bcae3
parent f3804171
......@@ -15,7 +15,7 @@
#include "vtk2DHistogramItem.h"
#include "vtkImageData.h"
#include "vtkColorTransferFunction.h"
#include "vtkScalarsToColors.h"
#include "vtkContext2D.h"
#include "vtkObjectFactory.h"
......@@ -71,13 +71,13 @@ vtkImageData * vtk2DHistogramItem::GetInput()
}
//-----------------------------------------------------------------------------
void vtk2DHistogramItem::SetTransferFunction(vtkColorTransferFunction *function)
void vtk2DHistogramItem::SetTransferFunction(vtkScalarsToColors *function)
{
this->TransferFunction = function;
}
//-----------------------------------------------------------------------------
vtkColorTransferFunction * vtk2DHistogramItem::GetTransferFunction()
vtkScalarsToColors * vtk2DHistogramItem::GetTransferFunction()
{
return this->TransferFunction;
}
......
......@@ -26,7 +26,7 @@
#include "vtkVector.h" // Needed for vtkRectf
class vtkImageData;
class vtkColorTransferFunction;
class vtkScalarsToColors;
class VTK_CHARTS_EXPORT vtk2DHistogramItem : public vtkContextItem
{
......@@ -55,11 +55,11 @@ public:
// Description:
// Set the color transfer funtion that will be used to generate the 2D
// histogram.
void SetTransferFunction(vtkColorTransferFunction *transfer);
void SetTransferFunction(vtkScalarsToColors *transfer);
// Description:
// Get the color transfer function that is used to generate the histogram.
vtkColorTransferFunction * GetTransferFunction();
vtkScalarsToColors * GetTransferFunction();
virtual void GetBounds(double bounds[4]);
......@@ -77,7 +77,7 @@ protected:
vtkSmartPointer<vtkImageData> Input;
vtkSmartPointer<vtkImageData> Output;
vtkSmartPointer<vtkColorTransferFunction> TransferFunction;
vtkSmartPointer<vtkScalarsToColors> TransferFunction;
vtkRectf Position;
private:
......
......@@ -121,7 +121,7 @@ void vtkChart2DHistogram::SetInput(vtkImageData *data, vtkIdType z)
this->Histogram->SetInput(data, z);
}
void vtkChart2DHistogram::SetTransferFunction(vtkColorTransferFunction *function)
void vtkChart2DHistogram::SetTransferFunction(vtkScalarsToColors *function)
{
this->Histogram->SetTransferFunction(function);
}
......
......@@ -26,7 +26,7 @@
class vtk2DHistogramItem;
class vtkImageData;
class vtkColorTransferFunction;
class vtkScalarsToColors;
class VTK_CHARTS_EXPORT vtkChart2DHistogram : public vtkChart
{
......@@ -49,7 +49,7 @@ public:
virtual bool Paint(vtkContext2D *painter);
virtual void SetInput(vtkImageData *data, vtkIdType z = 0);
virtual void SetTransferFunction(vtkColorTransferFunction *function);
virtual void SetTransferFunction(vtkScalarsToColors *function);
// Description:
// Get the plot at the specified index, returns null if the index is invalid.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment