1 /*=========================================================================
2 
3   Program:   Visualization Toolkit
4   Module:    vtkPiecewiseFunctionItem.h
5 
6   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7   All rights reserved.
8   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10      This software is distributed WITHOUT ANY WARRANTY; without even
11      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12      PURPOSE.  See the above copyright notice for more information.
13 
14 =========================================================================*/
15 
16 #ifndef vtkPiecewiseFunctionItem_h
17 #define vtkPiecewiseFunctionItem_h
18 
19 #include "vtkChartsCoreModule.h" // For export macro
20 #include "vtkScalarsToColorsItem.h"
21 
22 class vtkPiecewiseFunction;
23 class vtkImageData;
24 
25 /// vtkPiecewiseFunctionItem internal uses vtkPlot::Color, white by default
26 class VTKCHARTSCORE_EXPORT vtkPiecewiseFunctionItem: public vtkScalarsToColorsItem
27 {
28 public:
29   static vtkPiecewiseFunctionItem* New();
30   vtkTypeMacro(vtkPiecewiseFunctionItem, vtkScalarsToColorsItem);
31   void PrintSelf(ostream &os, vtkIndent indent) override;
32 
33   void SetPiecewiseFunction(vtkPiecewiseFunction* t);
34   vtkGetObjectMacro(PiecewiseFunction, vtkPiecewiseFunction);
35 
36 protected:
37   vtkPiecewiseFunctionItem();
38   ~vtkPiecewiseFunctionItem() override;
39 
40   // Description:
41   // Reimplemented to return the range of the piecewise function
42   void ComputeBounds(double bounds[4]) override;
43 
44   // Description
45   // Compute the texture from the PiecewiseFunction
46   void ComputeTexture() override;
47 
48   vtkPiecewiseFunction* PiecewiseFunction;
49 
50 private:
51   vtkPiecewiseFunctionItem(const vtkPiecewiseFunctionItem &) = delete;
52   void operator=(const vtkPiecewiseFunctionItem &) = delete;
53 };
54 
55 #endif
56