VTK  9.3.1
vtkPlotFunctionalBag.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 
23 #ifndef vtkPlotFunctionalBag_h
24 #define vtkPlotFunctionalBag_h
25 
26 #include "vtkChartsCoreModule.h" // For export macro
27 #include "vtkNew.h" // Needed to hold SP ivars
28 #include "vtkPlot.h"
29 
30 VTK_ABI_NAMESPACE_BEGIN
31 class vtkDataArray;
32 class vtkPlotFuntionalBagInternal;
33 class vtkPlotLine;
34 class vtkPoints2D;
35 class vtkScalarsToColors;
36 
37 class VTKCHARTSCORE_EXPORT vtkPlotFunctionalBag : public vtkPlot
38 {
39 public:
40  vtkTypeMacro(vtkPlotFunctionalBag, vtkPlot);
41  void PrintSelf(ostream& os, vtkIndent indent) override;
42 
46  static vtkPlotFunctionalBag* New();
47 
52  virtual bool IsBag();
53 
57  bool GetVisible() override;
58 
62  bool Paint(vtkContext2D* painter) override;
63 
70  bool PaintLegend(vtkContext2D* painter, const vtkRectf& rect, int legendIndex) override;
71 
75  void GetBounds(double bounds[4]) override;
76 
81  void GetUnscaledInputBounds(double bounds[4]) override;
82 
84 
87  void SetLookupTable(vtkScalarsToColors* lut);
88  vtkScalarsToColors* GetLookupTable();
90 
95  virtual void CreateDefaultLookupTable();
96 
102  vtkIdType GetNearestPoint(const vtkVector2f& point, const vtkVector2f& tolerance,
103  vtkVector2f* location, vtkIdType* segmentId) override;
105 
109  bool SelectPoints(const vtkVector2f& min, const vtkVector2f& max) override;
110 
114  bool SelectPointsInPolygon(const vtkContextPolygon& polygon) override;
115 
122  bool UpdateCache() override;
123 
124 protected:
126  ~vtkPlotFunctionalBag() override;
127 
131  bool GetDataArrays(vtkTable* table, vtkDataArray* array[2]);
132 
136  bool CacheRequiresUpdate() override;
137 
142 
147 
152 
153  bool LogX, LogY;
154 
155 private:
157  void operator=(const vtkPlotFunctionalBag&) = delete;
158 };
159 
160 VTK_ABI_NAMESPACE_END
161 #endif // vtkPlotFunctionalBag_h
Class for drawing an XY line plot or bag given two columns from a vtkTable.
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 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
vtkScalarsToColors * LookupTable
Lookup Table for coloring points by scalar value.
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
vtkNew< vtkPoints2D > BagPoints
The bag points ordered in quadstrip fashion.
Superclass for mapping scalar values to colors.
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:49
virtual bool SelectPoints(const vtkVector2f &min, const vtkVector2f &max)
Select all points in the specified rectangle.
a simple class to control print indentation
Definition: vtkIndent.h:28
represent and manipulate 2D points
Definition: vtkPoints2D.h:25
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:44
virtual bool UpdateCache()
Update the internal cache.
Definition: vtkPlot.h:429
Abstract class for 2D plots.
Definition: vtkPlot.h:43
virtual bool SelectPointsInPolygon(const vtkContextPolygon &polygon)
Select all points in the specified polygon.
vtkNew< vtkPlotLine > Line
The plot line delegate for line series.
virtual bool CacheRequiresUpdate()
Test if the internal cache requires an update.
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:58
virtual void GetUnscaledInputBounds(double bounds[4])
Provide un-log-scaled bounds for the plot inputs.
Definition: vtkPlot.h:393
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
Class for drawing an XY line plot given two columns from a vtkTable.
Definition: vtkPlotLine.h:23
virtual bool GetVisible()
Get the visibility of the item (should it be drawn).
#define max(a, b)