VTK  9.7.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 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
30 
31 VTK_ABI_NAMESPACE_BEGIN
32 class vtkDataArray;
33 class vtkPlotFuntionalBagInternal;
34 class vtkPlotLine;
35 class vtkPoints2D;
36 class vtkScalarsToColors;
37 
38 class VTKCHARTSCORE_EXPORT VTK_MARSHALAUTO vtkPlotFunctionalBag : public vtkPlot
39 {
40 public:
41  vtkTypeMacro(vtkPlotFunctionalBag, vtkPlot);
42  void PrintSelf(ostream& os, vtkIndent indent) override;
43 
47  static vtkPlotFunctionalBag* New();
48 
53  virtual bool IsBag();
54 
58  bool GetVisible() override;
59 
63  bool Paint(vtkContext2D* painter) override;
64 
71  bool PaintLegend(vtkContext2D* painter, const vtkRectf& rect, int legendIndex) override;
72 
76  void GetBounds(double bounds[4]) override;
77 
82  void GetUnscaledInputBounds(double bounds[4]) override;
83 
85 
88  void SetLookupTable(vtkScalarsToColors* lut);
89  vtkScalarsToColors* GetLookupTable();
91 
96  virtual void CreateDefaultLookupTable();
97 
103  vtkIdType GetNearestPoint(const vtkVector2f& point, const vtkVector2f& tolerance,
104  vtkVector2f* location, vtkIdType* segmentId) override;
106 
110  bool SelectPoints(const vtkVector2f& min, const vtkVector2f& max) override;
111 
115  bool SelectPointsInPolygon(const vtkContextPolygon& polygon) override;
116 
123  bool UpdateCache() override;
124 
125 protected:
127  ~vtkPlotFunctionalBag() override;
128 
132  bool GetDataArrays(vtkTable* table, vtkDataArray* array[2]);
133 
137  bool CacheRequiresUpdate() override;
138 
143 
148 
153 
154  bool LogX, LogY;
155 
156 private:
158  void operator=(const vtkPlotFunctionalBag&) = delete;
159 };
160 
161 VTK_ABI_NAMESPACE_END
162 #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:393
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:363
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:27
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:44
virtual bool UpdateCache()
Update the internal cache.
Definition: vtkPlot.h:455
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:59
virtual void GetUnscaledInputBounds(double bounds[4])
Provide un-log-scaled bounds for the plot inputs.
Definition: vtkPlot.h:419
#define VTK_MARSHALAUTO
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:24
virtual bool GetVisible()
Get the visibility of the item (should it be drawn).
#define max(a, b)