VTK  9.0.1
vtkPlotArea.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPlotArea.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 =========================================================================*/
26 #ifndef vtkPlotArea_h
27 #define vtkPlotArea_h
28 
29 #include "vtkPlot.h"
30 
31 class VTKCHARTSCORE_EXPORT vtkPlotArea : public vtkPlot
32 {
33 public:
34  static vtkPlotArea* New();
35  vtkTypeMacro(vtkPlotArea, vtkPlot);
36  void PrintSelf(ostream& os, vtkIndent indent) override;
37 
45  using Superclass::SetInputArray;
46 
48 
51  void SetColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a) override;
52  void SetColor(double r, double g, double b) override;
54 
56 
59  vtkGetMacro(ValidPointMaskName, vtkStdString);
60  vtkSetMacro(ValidPointMaskName, vtkStdString);
62 
66  void Update() override;
67 
71  void GetBounds(double bounds[4]) override;
72 
78  void UpdateCache() override;
79 
83  bool Paint(vtkContext2D* painter) override;
84 
92  bool PaintLegend(vtkContext2D* painter, const vtkRectf& rect, int legendIndex) override;
93 
99  vtkIdType GetNearestPoint(const vtkVector2f& point, const vtkVector2f& tolerance,
101 #ifndef VTK_LEGACY_REMOVE
102  vtkIdType* segmentId) override;
103 #else
104  vtkIdType* segmentId = nullptr) override;
105 #endif // VTK_LEGACY_REMOVE
106 
107 #ifndef VTK_LEGACY_REMOVE
109 #endif // VTK_LEGACY_REMOVE
110 
116  const vtkVector2d& plotPos, vtkIdType seriesIndex, vtkIdType segmentIndex) override;
117 
118 protected:
119  vtkPlotArea();
120  ~vtkPlotArea() override;
121 
126 
127 private:
128  vtkPlotArea(const vtkPlotArea&) = delete;
129  void operator=(const vtkPlotArea&) = delete;
130 
131  class vtkTableCache;
132  vtkTableCache* TableCache;
133 
134  vtkTimeStamp UpdateTime;
135 };
136 
137 #endif
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:34
vtkStdString ValidPointMaskName
Name of the valid point mask array.
Definition: vtkPlotArea.h:125
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual bool PaintLegend(vtkContext2D *painter, const vtkRectf &rect, int legendIndex)
Paint legend event for the plot, called whenever the legend needs the plot items symbol/mark/line dra...
virtual void UpdateCache()
Subclasses that build data caches to speed up painting should override this method to update such cac...
Definition: vtkPlot.h:382
virtual bool Paint(vtkContext2D *painter)
Paint event for the item, called whenever the item needs to be drawn.
record modification and/or execution time
Definition: vtkTimeStamp.h:32
virtual void GetBounds(double bounds[4])
Get the bounds for this plot as (Xmin, Xmax, Ymin, Ymax).
Definition: vtkPlot.h:343
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:338
virtual void SetColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a)
Set the plot color.
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:52
a simple class to control print indentation
Definition: vtkIndent.h:33
Abstract class for 2D plots.
Definition: vtkPlot.h:46
draws an area plot.
Definition: vtkPlotArea.h:31
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
virtual void Update()
Perform any updates to the item that may be necessary before rendering.
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...