VTK
vtkPlotPoints.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPlotPoints.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 
30 #ifndef vtkPlotPoints_h
31 #define vtkPlotPoints_h
32 
33 #include "vtkChartsCoreModule.h" // For export macro
34 #include "vtkPlot.h"
35 #include "vtkScalarsToColors.h" // For VTK_COLOR_MODE_DEFAULT and _MAP_SCALARS
36 #include "vtkStdString.h" // For color array name
37 #include "vtkNew.h" // For ivars
38 #include "vtkRenderingCoreEnums.h" // For marker enum
39 
40 class vtkCharArray;
41 class vtkContext2D;
42 class vtkTable;
43 class vtkPoints2D;
44 class vtkFloatArray;
45 class vtkStdString;
46 class vtkImageData;
47 class vtkScalarsToColors;
49 
50 class VTKCHARTSCORE_EXPORT vtkPlotPoints : public vtkPlot
51 {
52 public:
53  vtkTypeMacro(vtkPlotPoints, vtkPlot);
54  void PrintSelf(ostream &os, vtkIndent indent) override;
55 
59  static vtkPlotPoints *New();
60 
66  void Update() override;
67 
71  bool Paint(vtkContext2D *painter) override;
72 
79  bool PaintLegend(vtkContext2D *painter, const vtkRectf& rect,
80  int legendIndex) override;
81 
85  void GetBounds(double bounds[4]) override;
86 
90  void GetUnscaledInputBounds(double bounds[4]) override;
91 
93 
96  void SetLookupTable(vtkScalarsToColors *lut);
97  vtkScalarsToColors *GetLookupTable();
99 
104  virtual void CreateDefaultLookupTable();
105 
107 
110  vtkSetMacro(ScalarVisibility,vtkTypeBool);
111  vtkGetMacro(ScalarVisibility,vtkTypeBool);
112  vtkBooleanMacro(ScalarVisibility,vtkTypeBool);
114 
116 
121  void SelectColorArray(vtkIdType arrayNum);
122  void SelectColorArray(const vtkStdString& arrayName);
124 
128  vtkStdString GetColorArrayName();
129 
136  const vtkVector2f& tolerance,
137  vtkVector2f* location) override;
138 
142  bool SelectPoints(const vtkVector2f& min, const vtkVector2f& max) override;
143 
147  bool SelectPointsInPolygon(const vtkContextPolygon &polygon) override;
148 
152  enum {
159  };
160 
162 
166  vtkGetMacro(MarkerStyle, int);
167  vtkSetMacro(MarkerStyle, int);
169 
171 
175  vtkGetMacro(MarkerSize, float);
176  vtkSetMacro(MarkerSize, float);
178 
180 
183  vtkGetMacro(ValidPointMaskName, vtkStdString)
184  vtkSetMacro(ValidPointMaskName, vtkStdString)
186 
187 protected:
188  vtkPlotPoints();
189  ~vtkPlotPoints() override;
190 
194  bool GetDataArrays(vtkTable *table, vtkDataArray *array[2]);
195 
199  bool UpdateTableCache(vtkTable *table);
200 
204  void CalculateUnscaledInputBounds();
205 
210  void CalculateLogSeries();
211 
217  void FindBadPoints();
218 
222  void CalculateBounds(double bounds[4]);
223 
227  void CreateSortedPoints();
228 
230 
236 
238 
241  class VectorPIMPL;
242  VectorPIMPL* Sorted;
244 
250 
256 
261 
266 
268 
272  float MarkerSize;
274 
275  bool LogX, LogY;
276 
278 
286 
290  double UnscaledInputBounds[4];
291 
292 private:
293  vtkPlotPoints(const vtkPlotPoints &) = delete;
294  void operator=(const vtkPlotPoints &) = delete;
295 
296 };
297 
298 #endif //vtkPlotPoints_h
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:34
vtkCharArray * ValidPointMask
Array which marks valid points in the array.
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.
vtkTypeBool ScalarVisibility
Lookup Table for coloring points by scalar value.
Class for drawing an points given two columns from a vtkTable.
Definition: vtkPlotPoints.h:50
record modification and/or execution time
Definition: vtkTimeStamp.h:32
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:35
virtual void GetBounds(double bounds[4])
Get the bounds for this plot as (Xmin, Xmax, Ymin, Ymax).
Definition: vtkPlot.h:330
dynamic, self-adjusting array of vtkIdType
int vtkIdType
Definition: vtkType.h:347
int vtkTypeBool
Definition: vtkABI.h:69
Superclass for mapping scalar values to colors.
dynamic, self-adjusting array of char
Definition: vtkCharArray.h:35
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:52
vtkStdString ColorArrayName
Lookup Table for coloring points by scalar value.
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:33
vtkStdString ValidPointMaskName
Name of the valid point mask array.
represent and manipulate 2D points
Definition: vtkPoints2D.h:33
topologically and geometrically regular array of data
Definition: vtkImageData.h:39
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:48
Abstract class for 2D plots.
Definition: vtkPlot.h:46
vtkUnsignedCharArray * Colors
Lookup Table for coloring points by scalar value.
dynamic, self-adjusting array of unsigned char
int MarkerStyle
The marker style that should be used.
virtual vtkIdType GetNearestPoint(const vtkVector2f &point, const vtkVector2f &tolerance, vtkVector2f *location)
Function to query a plot for the nearest point to the specified coordinate.
virtual bool SelectPointsInPolygon(const vtkContextPolygon &polygon)
Select all points in the specified polygon.
vtkScalarsToColors * LookupTable
Lookup Table for coloring points by scalar value.
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:62
vtkNew< vtkFloatArray > SelectedPoints
Store a well packed set of XY coordinates for this data series.
virtual void GetUnscaledInputBounds(double bounds[4])
Provide un-log-scaled bounds for the plot inputs.
Definition: vtkPlot.h:357
vtkPoints2D * Points
Store a well packed set of XY coordinates for this data series.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkTimeStamp BuildTime
The point cache is marked dirty until it has been initialized.
virtual void Update()
Perform any updates to the item that may be necessary before rendering.
float MarkerSize
The marker style that should be used.
VectorPIMPL * Sorted
#define max(a, b)
vtkIdTypeArray * BadPoints
An array containing the indices of all the "bad points", meaning any x, y pair that has an infinity,...