VTK  9.3.0
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 
32 #ifndef vtkPlotFunctionalBag_h
33 #define vtkPlotFunctionalBag_h
34 
35 #include "vtkChartsCoreModule.h" // For export macro
36 #include "vtkNew.h" // Needed to hold SP ivars
37 #include "vtkPlot.h"
38 
39 VTK_ABI_NAMESPACE_BEGIN
40 class vtkDataArray;
41 class vtkPlotFuntionalBagInternal;
42 class vtkPlotLine;
43 class vtkPoints2D;
44 class vtkScalarsToColors;
45 
46 class VTKCHARTSCORE_EXPORT vtkPlotFunctionalBag : public vtkPlot
47 {
48 public:
49  vtkTypeMacro(vtkPlotFunctionalBag, vtkPlot);
50  void PrintSelf(ostream& os, vtkIndent indent) override;
51 
56 
61  virtual bool IsBag();
62 
66  bool GetVisible() override;
67 
71  bool Paint(vtkContext2D* painter) override;
72 
79  bool PaintLegend(vtkContext2D* painter, const vtkRectf& rect, int legendIndex) override;
80 
84  void GetBounds(double bounds[4]) override;
85 
90  void GetUnscaledInputBounds(double bounds[4]) override;
91 
93 
99 
104  virtual void CreateDefaultLookupTable();
105 
112  vtkVector2f* location, vtkIdType* segmentId) override;
114 
118  bool SelectPoints(const vtkVector2f& min, const vtkVector2f& max) override;
119 
123  bool SelectPointsInPolygon(const vtkContextPolygon& polygon) override;
124 
131  bool UpdateCache() override;
132 
133 protected:
136 
140  bool GetDataArrays(vtkTable* table, vtkDataArray* array[2]);
141 
145  bool CacheRequiresUpdate() override;
146 
151 
156 
161 
162  bool LogX, LogY;
163 
164 private:
166  void operator=(const vtkPlotFunctionalBag&) = delete;
167 };
168 
169 VTK_ABI_NAMESPACE_END
170 #endif // vtkPlotFunctionalBag_h
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:59
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
a simple class to control print indentation
Definition: vtkIndent.h:38
Class for drawing an XY line plot or bag given two columns from a vtkTable.
bool PaintLegend(vtkContext2D *painter, const vtkRectf &rect, int legendIndex) override
Paint legend event for the plot, called whenever the legend needs the plot items symbol/mark/line dra...
static vtkPlotFunctionalBag * New()
Creates a functional bag plot object.
~vtkPlotFunctionalBag() override
vtkScalarsToColors * LookupTable
Lookup Table for coloring points by scalar value.
void GetUnscaledInputBounds(double bounds[4]) override
Get the non-log-scaled bounds on chart inputs for this plot as (Xmin, Xmax, Ymin, Ymax).
bool GetDataArrays(vtkTable *table, vtkDataArray *array[2])
Populate the data arrays ready to operate on input data.
bool SelectPoints(const vtkVector2f &min, const vtkVector2f &max) override
Select all points in the specified rectangle.
virtual bool IsBag()
Returns true if the plot is a functional bag, false if it is a simple line.
void GetBounds(double bounds[4]) override
Get the bounds for this plot as (Xmin, Xmax, Ymin, Ymax).
void SetLookupTable(vtkScalarsToColors *lut)
Specify a lookup table for the mapper to use.
bool SelectPointsInPolygon(const vtkContextPolygon &polygon) override
Select all points in the specified polygon.
virtual void CreateDefaultLookupTable()
Create default lookup table.
bool UpdateCache() override
Update the internal cache.
bool Paint(vtkContext2D *painter) override
Paint event for the plot, called whenever the chart needs to be drawn.
vtkIdType GetNearestPoint(const vtkVector2f &point, const vtkVector2f &tolerance, vtkVector2f *location, vtkIdType *segmentId) override
Function to query a plot for the nearest point to the specified coordinate.
vtkNew< vtkPoints2D > BagPoints
The bag points ordered in quadstrip fashion.
vtkScalarsToColors * GetLookupTable()
Specify a lookup table for the mapper to use.
bool GetVisible() override
Reimplemented to enforce visibility when selected.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
bool CacheRequiresUpdate() override
Test if the internal cache requires an update.
vtkNew< vtkPlotLine > Line
The plot line delegate for line series.
Class for drawing an XY line plot given two columns from a vtkTable.
Definition: vtkPlotLine.h:24
Abstract class for 2D plots.
Definition: vtkPlot.h:53
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.
represent and manipulate 2D points
Definition: vtkPoints2D.h:26
Superclass for mapping scalar values to colors.
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:68
@ point
Definition: vtkX3D.h:236
@ location
Definition: vtkX3D.h:406
int vtkIdType
Definition: vtkType.h:315
#define max(a, b)