VTK  9.2.6
vtkScalarsToColorsItem.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkScalarsToColorsItem.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 
30 #ifndef vtkScalarsToColorsItem_h
31 #define vtkScalarsToColorsItem_h
32 
33 #include "vtkChartsCoreModule.h" // For export macro
34 #include "vtkNew.h" // For vtkNew
35 #include "vtkPlot.h"
36 
37 class vtkCallbackCommand;
38 class vtkImageData;
39 class vtkPlotBar;
40 class vtkPoints2D;
41 
42 class VTKCHARTSCORE_EXPORT vtkScalarsToColorsItem : public vtkPlot
43 {
44 public:
46  void PrintSelf(ostream& os, vtkIndent indent) override;
47 
52  void GetBounds(double bounds[4]) override;
53 
55 
60  vtkSetVector4Macro(UserBounds, double);
61  vtkGetVector4Macro(UserBounds, double);
63 
69  bool Paint(vtkContext2D* painter) override;
70 
72 
77  vtkGetObjectMacro(PolyLinePen, vtkPen);
79 
81 
84  void SetHistogramTable(vtkTable* histogramTable);
85  vtkGetObjectMacro(HistogramTable, vtkTable);
87 
89 
96  vtkSetMacro(MaskAboveCurve, bool);
97  vtkGetMacro(MaskAboveCurve, bool);
99 
108  vtkIdType* segmentIndex) override;
110 
116  const vtkVector2d& plotPos, vtkIdType seriesIndex, vtkIdType segmentIndex) override;
117 
118 protected:
120  ~vtkScalarsToColorsItem() override;
121 
127  virtual void ComputeBounds(double* bounds);
128 
134  virtual void ComputeTexture() = 0;
135 
136  vtkGetMacro(TextureWidth, int);
137 
143  virtual bool ConfigurePlotBar();
144 
146 
150  virtual void ScalarsToColorsModified(vtkObject* caller, unsigned long eid, void* calldata);
151  static void OnScalarsToColorsModified(
152  vtkObject* caller, unsigned long eid, void* clientdata, void* calldata);
154 
155  double UserBounds[4];
156 
157  bool Interpolate = true;
159  vtkImageData* Texture = nullptr;
160  vtkTable* HistogramTable = nullptr;
161 
167 
168 private:
170  void operator=(const vtkScalarsToColorsItem&) = delete;
171 };
172 
173 #endif
vtkNew< vtkPlotBar > PlotBar
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:38
vtkNew< vtkPoints2D > Shape
abstract base class for most VTK objects
Definition: vtkObject.h:62
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual bool Paint(vtkContext2D *painter)
Paint event for the item, called whenever the item needs to be drawn.
virtual void GetBounds(double bounds[4])
Get the bounds for this plot as (Xmin, Xmax, Ymin, Ymax).
Definition: vtkPlot.h:352
virtual vtkIdType GetNearestPoint(const vtkVector2f &point, const vtkVector2f &tolerance, vtkVector2f *location, vtkIdType *segmentId)
Function to query a plot for the nearest point to the specified coordinate.
int vtkIdType
Definition: vtkType.h:332
Abstract class for ScalarsToColors items.
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:57
supports function callbacks
a simple class to control print indentation
Definition: vtkIndent.h:39
represent and manipulate 2D points
Definition: vtkPoints2D.h:36
topologically and geometrically regular array of data
Definition: vtkImageData.h:53
vtkNew< vtkCallbackCommand > Callback
provides a pen that draws the outlines of shapes drawn by vtkContext2D.
Definition: vtkPen.h:39
Abstract class for 2D plots.
Definition: vtkPlot.h:53
Class for drawing an XY plot given two columns from a vtkTable.
Definition: vtkPlotBar.h:45
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:73
virtual vtkStdString GetTooltipLabel(const vtkVector2d &plotPos, vtkIdType seriesIndex, vtkIdType segmentIndex)
Generate and return the tooltip label string for this plot The segmentIndex parameter is ignored...