VTK  9.0.1
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 
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 class vtkDataArray;
40 class vtkPlotFuntionalBagInternal;
41 class vtkPlotLine;
42 class vtkPoints2D;
43 class vtkScalarsToColors;
44 
45 class VTKCHARTSCORE_EXPORT vtkPlotFunctionalBag : public vtkPlot
46 {
47 public:
48  vtkTypeMacro(vtkPlotFunctionalBag, vtkPlot);
49  void PrintSelf(ostream& os, vtkIndent indent) override;
50 
54  static vtkPlotFunctionalBag* New();
55 
60  virtual bool IsBag();
61 
65  bool GetVisible() override;
66 
72  void Update() override;
73 
77  bool Paint(vtkContext2D* painter) override;
78 
85  bool PaintLegend(vtkContext2D* painter, const vtkRectf& rect, int legendIndex) override;
86 
90  void GetBounds(double bounds[4]) override;
91 
96  void GetUnscaledInputBounds(double bounds[4]) override;
97 
99 
102  void SetLookupTable(vtkScalarsToColors* lut);
103  vtkScalarsToColors* GetLookupTable();
105 
110  virtual void CreateDefaultLookupTable();
111 
117  vtkIdType GetNearestPoint(const vtkVector2f& point, const vtkVector2f& tolerance,
119 #ifndef VTK_LEGACY_REMOVE
120  vtkIdType* segmentId) override;
121 #else
122  vtkIdType* segmentId = nullptr) override;
123 #endif // VTK_LEGACY_REMOVE
124 
125 #ifndef VTK_LEGACY_REMOVE
127 #endif // VTK_LEGACY_REMOVE
128 
132  bool SelectPoints(const vtkVector2f& min, const vtkVector2f& max) override;
133 
137  bool SelectPointsInPolygon(const vtkContextPolygon& polygon) override;
138 
139 protected:
141  ~vtkPlotFunctionalBag() override;
142 
146  bool GetDataArrays(vtkTable* table, vtkDataArray* array[2]);
147 
151  bool UpdateTableCache(vtkTable*);
152 
157 
162 
167 
172 
173  bool LogX, LogY;
174 
175 private:
177  void operator=(const vtkPlotFunctionalBag&) = delete;
178 };
179 
180 #endif // vtkPlotFunctionalBag_h
vtkPoints2D
represent and manipulate 2D points
Definition: vtkPoints2D.h:33
vtkPlotFunctionalBag::LookupTable
vtkScalarsToColors * LookupTable
Lookup Table for coloring points by scalar value.
Definition: vtkPlotFunctionalBag.h:161
vtkAbstractContextItem::GetVisible
virtual bool GetVisible()
Get the visibility of the item (should it be drawn).
vtkPlot.h
vtkIdType
int vtkIdType
Definition: vtkType.h:338
vtkTable
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:62
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkPlotFunctionalBag::LogY
bool LogY
Definition: vtkPlotFunctionalBag.h:173
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:32
vtkContext2D
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:52
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:49
vtkPlot
Abstract class for 2D plots.
Definition: vtkPlot.h:46
max
#define max(a, b)
Definition: vtkX3DExporterFIWriterHelper.h:31
vtkPlotFunctionalBag::Line
vtkNew< vtkPlotLine > Line
The plot line delegate for line series.
Definition: vtkPlotFunctionalBag.h:166
vtkPlot::GetNearestPoint
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.
vtkX3D::point
@ point
Definition: vtkX3D.h:242
vtkPlot::SelectPoints
virtual bool SelectPoints(const vtkVector2f &min, const vtkVector2f &max)
Select all points in the specified rectangle.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkPlotFunctionalBag
Class for drawing an XY line plot or bag given two columns from a vtkTable.
Definition: vtkPlotFunctionalBag.h:45
vtkPlotFunctionalBag::BagPoints
vtkNew< vtkPoints2D > BagPoints
The bag points ordered in quadstrip fashion.
Definition: vtkPlotFunctionalBag.h:171
vtkPlotFunctionalBag::BuildTime
vtkTimeStamp BuildTime
The cache is marked dirty until it has been initialized.
Definition: vtkPlotFunctionalBag.h:156
vtkPlotLine
Class for drawing an XY line plot given two columns from a vtkTable.
Definition: vtkPlotLine.h:31
vtkNew< vtkPlotLine >
vtkContextPolygon
Definition: vtkContextPolygon.h:26
vtkScalarsToColors
Superclass for mapping scalar values to colors.
Definition: vtkScalarsToColors.h:59
vtkPlot::PaintLegend
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...
vtkNew.h
vtkAbstractContextItem::Paint
virtual bool Paint(vtkContext2D *painter)
Paint event for the item, called whenever the item needs to be drawn.
vtkPlot::GetUnscaledInputBounds
virtual void GetUnscaledInputBounds(double bounds[4])
Provide un-log-scaled bounds for the plot inputs.
Definition: vtkPlot.h:369
vtkX3D::location
@ location
Definition: vtkX3D.h:412
vtkPlot::SelectPointsInPolygon
virtual bool SelectPointsInPolygon(const vtkContextPolygon &polygon)
Select all points in the specified polygon.
vtkPlot::GetBounds
virtual void GetBounds(double bounds[4])
Get the bounds for this plot as (Xmin, Xmax, Ymin, Ymax).
Definition: vtkPlot.h:343
vtkPlot::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkRectf
Definition: vtkRect.h:326
vtkVector2f
Definition: vtkVector.h:432
vtkAbstractContextItem::Update
virtual void Update()
Perform any updates to the item that may be necessary before rendering.