VTK  9.0.1
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 
107  virtual vtkIdType GetNearestPoint(const vtkVector2f& point, const vtkVector2f&,
108  vtkVector2f* location, vtkIdType* segmentIndex) override;
109 #ifndef VTK_LEGACY_REMOVE
111 #endif // VTK_LEGACY_REMOVE
112 
118  const vtkVector2d& plotPos, vtkIdType seriesIndex, vtkIdType segmentIndex) override;
119 
120 protected:
122  ~vtkScalarsToColorsItem() override;
123 
129  virtual void ComputeBounds(double* bounds);
130 
136  virtual void ComputeTexture() = 0;
137 
138  vtkGetMacro(TextureWidth, int);
139 
145  virtual bool ConfigurePlotBar();
146 
148 
152  virtual void ScalarsToColorsModified(vtkObject* caller, unsigned long eid, void* calldata);
153  static void OnScalarsToColorsModified(
154  vtkObject* caller, unsigned long eid, void* clientdata, void* calldata);
156 
157  double UserBounds[4];
158 
159  bool Interpolate = true;
161  vtkImageData* Texture = nullptr;
162  vtkTable* HistogramTable = nullptr;
163 
169 
170 private:
172  void operator=(const vtkScalarsToColorsItem&) = delete;
173 };
174 
175 #endif
vtkPoints2D
represent and manipulate 2D points
Definition: vtkPoints2D.h:33
vtkPlot::GetTooltipLabel
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,...
vtkScalarsToColorsItem
Abstract class for ScalarsToColors items.
Definition: vtkScalarsToColorsItem.h:42
vtkPlot.h
vtkIdType
int vtkIdType
Definition: vtkType.h:338
vtkTable
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:62
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:62
vtkContext2D
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:52
vtkPlot
Abstract class for 2D plots.
Definition: vtkPlot.h:46
vtkScalarsToColorsItem::Shape
vtkNew< vtkPoints2D > Shape
Definition: vtkScalarsToColorsItem.h:164
vtkVector2d
Definition: vtkVector.h:444
vtkPlot::GetNearestPoint
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.
vtkPlotBar
Class for drawing an XY plot given two columns from a vtkTable.
Definition: vtkPlotBar.h:42
vtkX3D::point
@ point
Definition: vtkX3D.h:242
vtkScalarsToColorsItem::PolyLinePen
vtkNew< vtkPen > PolyLinePen
Definition: vtkScalarsToColorsItem.h:167
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:41
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkNew< vtkPoints2D >
vtkNew.h
vtkScalarsToColorsItem::PlotBar
vtkNew< vtkPlotBar > PlotBar
Definition: vtkScalarsToColorsItem.h:166
vtkAbstractContextItem::Paint
virtual bool Paint(vtkContext2D *painter)
Paint event for the item, called whenever the item needs to be drawn.
vtkScalarsToColorsItem::Callback
vtkNew< vtkCallbackCommand > Callback
Definition: vtkScalarsToColorsItem.h:165
vtkCallbackCommand
supports function callbacks
Definition: vtkCallbackCommand.h:44
vtkX3D::location
@ location
Definition: vtkX3D.h:412
vtkPen
provides a pen that draws the outlines of shapes drawn by vtkContext2D.
Definition: vtkPen.h:36
vtkStdString
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:34
vtkPlot::GetBounds
virtual void GetBounds(double bounds[4])
Get the bounds for this plot as (Xmin, Xmax, Ymin, Ymax).
Definition: vtkPlot.h:343
vtkPlot::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkScalarsToColorsItem::TextureWidth
int TextureWidth
Definition: vtkScalarsToColorsItem.h:160
vtkVector2f
Definition: vtkVector.h:432
vtkScalarsToColorsItem::MaskAboveCurve
bool MaskAboveCurve
Definition: vtkScalarsToColorsItem.h:168