VTK  9.2.6
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 "vtkNew.h" // For ivars
35#include "vtkPlot.h"
36#include "vtkRenderingCoreEnums.h" // For marker enum
37#include "vtkScalarsToColors.h" // For VTK_COLOR_MODE_DEFAULT and _MAP_SCALARS
38#include "vtkStdString.h" // For color array name
39
40class vtkCharArray;
41class vtkContext2D;
42class vtkTable;
43class vtkPoints2D;
44class vtkFloatArray;
45class vtkStdString;
46class vtkImageData;
49
50class VTKCHARTSCORE_EXPORT vtkPlotPoints : public vtkPlot
51{
52public:
53 vtkTypeMacro(vtkPlotPoints, vtkPlot);
54 void PrintSelf(ostream& os, vtkIndent indent) override;
55
59 static vtkPlotPoints* New();
60
64 bool Paint(vtkContext2D* painter) override;
65
72 bool PaintLegend(vtkContext2D* painter, const vtkRectf& rect, int legendIndex) override;
73
77 void GetBounds(double bounds[4]) override;
78
82 void GetUnscaledInputBounds(double bounds[4]) override;
83
85
91
97
99
102 vtkSetMacro(ScalarVisibility, vtkTypeBool);
103 vtkGetMacro(ScalarVisibility, vtkTypeBool);
104 vtkBooleanMacro(ScalarVisibility, vtkTypeBool);
106
108
114 void SelectColorArray(const vtkStdString& arrayName);
116
121
127 vtkIdType GetNearestPoint(const vtkVector2f& point, const vtkVector2f& tolerance,
128 vtkVector2f* location, vtkIdType* segmentId) override;
130
134 bool SelectPoints(const vtkVector2f& min, const vtkVector2f& max) override;
135
139 bool SelectPointsInPolygon(const vtkContextPolygon& polygon) override;
140
144 enum
145 {
151 DIAMOND = VTK_MARKER_DIAMOND
152 };
153
155
159 vtkGetMacro(MarkerStyle, int);
160 vtkSetMacro(MarkerStyle, int);
162
164
168 vtkGetMacro(MarkerSize, float);
169 vtkSetMacro(MarkerSize, float);
171
173
176 vtkGetMacro(ValidPointMaskName, vtkStdString);
177 vtkSetMacro(ValidPointMaskName, vtkStdString);
179
186 bool UpdateCache() override;
187
188protected:
190 ~vtkPlotPoints() override;
191
195 bool GetDataArrays(vtkTable* table, vtkDataArray* array[2]);
196
200 virtual bool CacheRequiresUpdate() override;
201
206
212
219
223 void CalculateBounds(double bounds[4]);
224
229
231
237
239
242 class VectorPIMPL;
243 VectorPIMPL* Sorted;
245
251
257
262
264
270
271 bool LogX, LogY;
272
274
282
286 double UnscaledInputBounds[4];
287
288private:
289 vtkPlotPoints(const vtkPlotPoints&) = delete;
290 void operator=(const vtkPlotPoints&) = delete;
291};
292
293#endif // vtkPlotPoints_h
dynamic, self-adjusting array of char
Class for drawing 2D primitives to a graphical context.
abstract superclass for arrays of numeric data
dynamic, self-adjusting array of float
dynamic, self-adjusting array of vtkIdType
topologically and geometrically regular array of data
a simple class to control print indentation
Definition vtkIndent.h:34
Allocate and hold a VTK object.
Definition vtkNew.h:56
Class for drawing an points given two columns from a vtkTable.
void CalculateLogSeries()
Handle calculating the log of the x or y series if necessary.
int MarkerStyle
The marker style that should be used.
virtual void CreateDefaultLookupTable()
Create default lookup table.
void GetUnscaledInputBounds(double bounds[4]) override
Get the non-log-scaled bounds on chart inputs for this plot as (Xmin, Xmax, Ymin, Ymax).
void SelectColorArray(const vtkStdString &arrayName)
When ScalarMode is set to UsePointFieldData or UseCellFieldData, you can specify which array to use f...
void CalculateUnscaledInputBounds()
Calculate the unscaled input bounds from the input arrays.
virtual bool CacheRequiresUpdate() override
Test if the internal cache requires an update.
float MarkerSize
The marker style that should be used.
void FindBadPoints()
Find all of the "bad points" in the series.
bool GetDataArrays(vtkTable *table, vtkDataArray *array[2])
Populate the data arrays ready to operate on input data.
bool PaintLegend(vtkContext2D *painter, const vtkRectf &rect, int legendIndex) override
Paint legend event for the XY plot, called whenever the legend needs the plot items symbol/mark/line ...
vtkTypeBool ScalarVisibility
Lookup Table for coloring points by scalar value.
vtkStdString ColorArrayName
Lookup Table for coloring points by scalar value.
bool UpdateCache() override
Update the internal cache.
void GetBounds(double bounds[4]) override
Get the bounds for this plot as (Xmin, Xmax, Ymin, Ymax).
~vtkPlotPoints() override
void SetLookupTable(vtkScalarsToColors *lut)
Specify a lookup table for the mapper to use.
vtkIdTypeArray * BadPoints
An array containing the indices of all the "bad points", meaning any x, y pair that has an infinity,...
bool SelectPoints(const vtkVector2f &min, const vtkVector2f &max) override
Select all points in the specified rectangle.
void SelectColorArray(vtkIdType arrayNum)
When ScalarMode is set to UsePointFieldData or UseCellFieldData, you can specify which array to use f...
vtkUnsignedCharArray * Colors
Lookup Table for coloring points by scalar value.
vtkPoints2D * Points
Store a well packed set of XY coordinates for this data series.
VectorPIMPL * Sorted
vtkStdString ValidPointMaskName
Name of the valid point mask array.
bool Paint(vtkContext2D *painter) override
Paint event for the XY plot, called whenever the chart needs to be drawn.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void CalculateBounds(double bounds[4])
Calculate the bounds of the plot, ignoring the bad points.
bool SelectPointsInPolygon(const vtkContextPolygon &polygon) override
Select all points in the specified polygon.
vtkNew< vtkFloatArray > SelectedPoints
Store a well packed set of XY coordinates for this data series.
void CreateSortedPoints()
Create the sorted point list if necessary.
vtkCharArray * ValidPointMask
Array which marks valid points in the array.
static vtkPlotPoints * New()
Creates a 2D Chart object.
vtkStdString GetColorArrayName()
Get the array name to color by.
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.
vtkScalarsToColors * LookupTable
Lookup Table for coloring points by scalar value.
vtkScalarsToColors * GetLookupTable()
Specify a lookup table for the mapper to use.
Abstract class for 2D plots.
Definition vtkPlot.h:48
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:34
Superclass for mapping scalar values to colors.
Wrapper around std::string to keep symbols short.
A table, which contains similar-typed columns of data.
Definition vtkTable.h:68
dynamic, self-adjusting array of unsigned char
int vtkTypeBool
Definition vtkABI.h:69
@ VTK_MARKER_DIAMOND
@ VTK_MARKER_SQUARE
@ VTK_MARKER_PLUS
@ VTK_MARKER_CROSS
@ VTK_MARKER_CIRCLE
@ VTK_MARKER_NONE
int vtkIdType
Definition vtkType.h:332
#define max(a, b)