VTK  9.7.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 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
25 
26 VTK_ABI_NAMESPACE_BEGIN
27 class vtkCallbackCommand;
28 class vtkImageData;
29 class vtkPlotBar;
30 class vtkPoints2D;
31 
32 class VTKCHARTSCORE_EXPORT VTK_MARSHALAUTO vtkScalarsToColorsItem : public vtkPlot
33 {
34 public:
36  void PrintSelf(ostream& os, vtkIndent indent) override;
37 
42  void GetBounds(double bounds[4]) override;
43 
45 
50  vtkSetVector4Macro(UserBounds, double);
51  vtkGetVector4Macro(UserBounds, double);
53 
59  bool Paint(vtkContext2D* painter) override;
60 
62 
67  vtkGetObjectMacro(PolyLinePen, vtkPen);
69 
71 
74  void SetHistogramTable(vtkTable* histogramTable);
75  vtkGetObjectMacro(HistogramTable, vtkTable);
77 
79 
86  vtkSetMacro(MaskAboveCurve, bool);
87  vtkGetMacro(MaskAboveCurve, bool);
89 
98  vtkIdType* segmentIndex) override;
100 
106  const vtkVector2d& plotPos, vtkIdType seriesIndex, vtkIdType segmentIndex) override;
107 
108 protected:
110  ~vtkScalarsToColorsItem() override;
111 
117  virtual void ComputeBounds(double* bounds);
118 
124  virtual void ComputeTexture() = 0;
125 
126  vtkGetMacro(TextureWidth, int);
127 
133  virtual bool ConfigurePlotBar();
134 
136 
140  virtual void ScalarsToColorsModified(vtkObject* caller, unsigned long eid, void* calldata);
141  static void OnScalarsToColorsModified(
142  vtkObject* caller, unsigned long eid, void* clientdata, void* calldata);
144 
145  double UserBounds[4];
146 
147  bool Interpolate = true;
149  vtkImageData* Texture = nullptr;
150  vtkTable* HistogramTable = nullptr;
151 
157 
158 private:
160  void operator=(const vtkScalarsToColorsItem&) = delete;
161 };
162 
163 VTK_ABI_NAMESPACE_END
164 #endif
vtkNew< vtkPlotBar > PlotBar
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:27
vtkNew< vtkPoints2D > Shape
abstract base class for most VTK objects
Definition: vtkObject.h:52
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:393
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:363
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:27
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
vtkNew< vtkCallbackCommand > Callback
provides a pen that draws the outlines of shapes drawn by vtkContext2D.
Definition: vtkPen.h:29
Abstract class for 2D plots.
Definition: vtkPlot.h:43
Class for drawing an XY plot given two columns from a vtkTable.
Definition: vtkPlotBar.h:35
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:59
#define VTK_MARSHALAUTO
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...