VTK  9.2.6
vtkPlotFunctionalBag.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPlotFunctionalBag.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 
35 #ifndef vtkPlotFunctionalBag_h
36 #define vtkPlotFunctionalBag_h
37 
38 #include "vtkChartsCoreModule.h" // For export macro
39 #include "vtkNew.h" // Needed to hold SP ivars
40 #include "vtkPlot.h"
41 
42 class vtkDataArray;
43 class vtkPlotFuntionalBagInternal;
44 class vtkPlotLine;
45 class vtkPoints2D;
46 class vtkScalarsToColors;
47 
48 class VTKCHARTSCORE_EXPORT vtkPlotFunctionalBag : public vtkPlot
49 {
50 public:
51  vtkTypeMacro(vtkPlotFunctionalBag, vtkPlot);
52  void PrintSelf(ostream& os, vtkIndent indent) override;
53 
57  static vtkPlotFunctionalBag* New();
58 
63  virtual bool IsBag();
64 
68  bool GetVisible() override;
69 
73  bool Paint(vtkContext2D* painter) override;
74 
81  bool PaintLegend(vtkContext2D* painter, const vtkRectf& rect, int legendIndex) override;
82 
86  void GetBounds(double bounds[4]) override;
87 
92  void GetUnscaledInputBounds(double bounds[4]) override;
93 
95 
98  void SetLookupTable(vtkScalarsToColors* lut);
99  vtkScalarsToColors* GetLookupTable();
101 
106  virtual void CreateDefaultLookupTable();
107 
113  vtkIdType GetNearestPoint(const vtkVector2f& point, const vtkVector2f& tolerance,
114  vtkVector2f* location, vtkIdType* segmentId) override;
116 
120  bool SelectPoints(const vtkVector2f& min, const vtkVector2f& max) override;
121 
125  bool SelectPointsInPolygon(const vtkContextPolygon& polygon) override;
126 
133  bool UpdateCache() override;
134 
135 protected:
137  ~vtkPlotFunctionalBag() override;
138 
142  bool GetDataArrays(vtkTable* table, vtkDataArray* array[2]);
143 
147  virtual bool CacheRequiresUpdate() override;
148 
153 
158 
163 
164  bool LogX, LogY;
165 
166 private:
168  void operator=(const vtkPlotFunctionalBag&) = delete;
169 };
170 
171 #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:352
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:332
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:57
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:39
represent and manipulate 2D points
Definition: vtkPoints2D.h:36
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
virtual bool UpdateCache()
Update the internal cache.
Definition: vtkPlot.h:414
Abstract class for 2D plots.
Definition: vtkPlot.h:53
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:73
virtual void GetUnscaledInputBounds(double bounds[4])
Provide un-log-scaled bounds for the plot inputs.
Definition: vtkPlot.h:378
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:34
virtual bool GetVisible()
Get the visibility of the item (should it be drawn).
#define max(a, b)