VTK  9.3.1
vtkScalarsToColorsItem.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
3 
18 #ifndef vtkScalarsToColorsItem_h
19 #define vtkScalarsToColorsItem_h
20 
21 #include "vtkChartsCoreModule.h" // For export macro
22 #include "vtkNew.h" // For vtkNew
23 #include "vtkPlot.h"
24 
25 VTK_ABI_NAMESPACE_BEGIN
26 class vtkCallbackCommand;
27 class vtkImageData;
28 class vtkPlotBar;
29 class vtkPoints2D;
30 
31 class VTKCHARTSCORE_EXPORT vtkScalarsToColorsItem : public vtkPlot
32 {
33 public:
35  void PrintSelf(ostream& os, vtkIndent indent) override;
36 
41  void GetBounds(double bounds[4]) override;
42 
44 
49  vtkSetVector4Macro(UserBounds, double);
50  vtkGetVector4Macro(UserBounds, double);
52 
58  bool Paint(vtkContext2D* painter) override;
59 
61 
66  vtkGetObjectMacro(PolyLinePen, vtkPen);
68 
70 
73  void SetHistogramTable(vtkTable* histogramTable);
74  vtkGetObjectMacro(HistogramTable, vtkTable);
76 
78 
85  vtkSetMacro(MaskAboveCurve, bool);
86  vtkGetMacro(MaskAboveCurve, bool);
88 
97  vtkIdType* segmentIndex) override;
99 
105  const vtkVector2d& plotPos, vtkIdType seriesIndex, vtkIdType segmentIndex) override;
106 
107 protected:
109  ~vtkScalarsToColorsItem() override;
110 
116  virtual void ComputeBounds(double* bounds);
117 
123  virtual void ComputeTexture() = 0;
124 
125  vtkGetMacro(TextureWidth, int);
126 
132  virtual bool ConfigurePlotBar();
133 
135 
139  virtual void ScalarsToColorsModified(vtkObject* caller, unsigned long eid, void* calldata);
140  static void OnScalarsToColorsModified(
141  vtkObject* caller, unsigned long eid, void* clientdata, void* calldata);
143 
144  double UserBounds[4];
145 
146  bool Interpolate = true;
148  vtkImageData* Texture = nullptr;
149  vtkTable* HistogramTable = nullptr;
150 
156 
157 private:
159  void operator=(const vtkScalarsToColorsItem&) = delete;
160 };
161 
162 VTK_ABI_NAMESPACE_END
163 #endif
vtkNew< vtkPlotBar > PlotBar
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:28
vtkNew< vtkPoints2D > Shape
abstract base class for most VTK objects
Definition: vtkObject.h:51
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:367
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:315
Abstract class for ScalarsToColors items.
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:49
supports function callbacks
a simple class to control print indentation
Definition: vtkIndent.h:28
represent and manipulate 2D points
Definition: vtkPoints2D.h:25
topologically and geometrically regular array of data
Definition: vtkImageData.h:42
vtkNew< vtkCallbackCommand > Callback
provides a pen that draws the outlines of shapes drawn by vtkContext2D.
Definition: vtkPen.h:28
Abstract class for 2D plots.
Definition: vtkPlot.h:43
Class for drawing an XY plot given two columns from a vtkTable.
Definition: vtkPlotBar.h:34
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:58
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...