VTK
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 "vtkPlot.h"
35 
36 class vtkCallbackCommand;
37 class vtkImageData;
38 class vtkPoints2D;
39 
40 class VTKCHARTSCORE_EXPORT vtkScalarsToColorsItem: public vtkPlot
41 {
42 public:
44  void PrintSelf(ostream &os, vtkIndent indent) override;
45 
50  void GetBounds(double bounds[4]) override;
51 
53 
58  vtkSetVector4Macro(UserBounds, double);
59  vtkGetVector4Macro(UserBounds, double)
61 
67  bool Paint(vtkContext2D *painter) override;
68 
70 
75  vtkGetObjectMacro(PolyLinePen, vtkPen);
77 
79 
86  vtkSetMacro(MaskAboveCurve, bool);
87  vtkGetMacro(MaskAboveCurve, bool);
89 
90 protected:
92  ~vtkScalarsToColorsItem() override;
93 
99  virtual void ComputeBounds(double* bounds);
100 
106  virtual void ComputeTexture() = 0;
107 
108  vtkGetMacro(TextureWidth, int);
109 
110  void TransformDataToScreen(const double dataX, const double dataY,
111  double &screenX, double &screenY);
112  void TransformScreenToData(const double screenX, const double screenY,
113  double &dataX, double &dataY);
114 
116 
120  virtual void ScalarsToColorsModified(vtkObject* caller, unsigned long eid, void* calldata);
121  static void OnScalarsToColorsModified(vtkObject* caller, unsigned long eid, void *clientdata, void* calldata);
123 
124  double UserBounds[4];
125 
131 
134 private:
136  void operator=(const vtkScalarsToColorsItem &) = delete;
137 };
138 
139 #endif
vtkPoints2D
represent and manipulate 2D points
Definition: vtkPoints2D.h:36
vtkScalarsToColorsItem
Abstract class for ScalarsToColors items.
Definition: vtkScalarsToColorsItem.h:40
vtkPlot.h
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:59
vtkContext2D
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:58
vtkPlot
Abstract class for 2D plots.
Definition: vtkPlot.h:52
vtkScalarsToColorsItem::Shape
vtkPoints2D * Shape
Definition: vtkScalarsToColorsItem.h:129
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkScalarsToColorsItem::Interpolate
bool Interpolate
Definition: vtkScalarsToColorsItem.h:128
vtkScalarsToColorsItem::Texture
vtkImageData * Texture
Definition: vtkScalarsToColorsItem.h:127
vtkAbstractContextItem::Paint
virtual bool Paint(vtkContext2D *painter)
Paint event for the item, called whenever the item needs to be drawn.
vtkScalarsToColorsItem::Callback
vtkCallbackCommand * Callback
Definition: vtkScalarsToColorsItem.h:130
vtkCallbackCommand
supports function callbacks
Definition: vtkCallbackCommand.h:50
vtkPen
provides a pen that draws the outlines of shapes drawn by vtkContext2D.
Definition: vtkPen.h:39
vtkPlot::GetBounds
virtual void GetBounds(double bounds[4])
Get the bounds for this plot as (Xmin, Xmax, Ymin, Ymax).
Definition: vtkPlot.h:336
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:126
vtkScalarsToColorsItem::MaskAboveCurve
bool MaskAboveCurve
Definition: vtkScalarsToColorsItem.h:133
vtkScalarsToColorsItem::PolyLinePen
vtkPen * PolyLinePen
Definition: vtkScalarsToColorsItem.h:132