VTK  9.1.0
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
39#ifndef vtkPlotPoints_h
40#define vtkPlotPoints_h
41
42#include "vtkChartsCoreModule.h" // For export macro
43#include "vtkNew.h" // For ivars
44#include "vtkPlot.h"
45#include "vtkRenderingCoreEnums.h" // For marker enum
46#include "vtkScalarsToColors.h" // For VTK_COLOR_MODE_DEFAULT and _MAP_SCALARS
47#include "vtkStdString.h" // For color array name
48
49class vtkCharArray;
50class vtkContext2D;
51class vtkTable;
52class vtkPoints2D;
53class vtkFloatArray;
54class vtkStdString;
55class vtkImageData;
58
59class VTKCHARTSCORE_EXPORT vtkPlotPoints : public vtkPlot
60{
61public:
62 vtkTypeMacro(vtkPlotPoints, vtkPlot);
63 void PrintSelf(ostream& os, vtkIndent indent) override;
64
68 static vtkPlotPoints* New();
69
75 void Update() override;
76
80 bool Paint(vtkContext2D* painter) override;
81
88 bool PaintLegend(vtkContext2D* painter, const vtkRectf& rect, int legendIndex) override;
89
93 void GetBounds(double bounds[4]) override;
94
98 void GetUnscaledInputBounds(double bounds[4]) override;
99
101
107
113
115
118 vtkSetMacro(ScalarVisibility, vtkTypeBool);
119 vtkGetMacro(ScalarVisibility, vtkTypeBool);
120 vtkBooleanMacro(ScalarVisibility, vtkTypeBool);
122
124
130 void SelectColorArray(const vtkStdString& arrayName);
132
137
144 vtkVector2f* location, vtkIdType* segmentId) override;
146
150 bool SelectPoints(const vtkVector2f& min, const vtkVector2f& max) override;
151
155 bool SelectPointsInPolygon(const vtkContextPolygon& polygon) override;
156
160 enum
161 {
167 DIAMOND = VTK_MARKER_DIAMOND
168 };
169
171
175 vtkGetMacro(MarkerStyle, int);
176 vtkSetMacro(MarkerStyle, int);
178
180
184 vtkGetMacro(MarkerSize, float);
185 vtkSetMacro(MarkerSize, float);
187
189
192 vtkGetMacro(ValidPointMaskName, vtkStdString);
193 vtkSetMacro(ValidPointMaskName, vtkStdString);
195
196protected:
198 ~vtkPlotPoints() override;
199
203 bool GetDataArrays(vtkTable* table, vtkDataArray* array[2]);
204
209
214
220
227
231 void CalculateBounds(double bounds[4]);
232
237
239
245
247
250 class VectorPIMPL;
251 VectorPIMPL* Sorted;
253
259
265
270
275
277
283
284 bool LogX, LogY;
285
287
295
299 double UnscaledInputBounds[4];
300
301private:
302 vtkPlotPoints(const vtkPlotPoints&) = delete;
303 void operator=(const vtkPlotPoints&) = delete;
304};
305
306#endif // vtkPlotPoints_h
dynamic, self-adjusting array of char
Definition: vtkCharArray.h:58
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:63
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:59
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:45
dynamic, self-adjusting array of vtkIdType
topologically and geometrically regular array of data
Definition: vtkImageData.h:57
a simple class to control print indentation
Definition: vtkIndent.h:43
Class for drawing an points given two columns from a vtkTable.
Definition: vtkPlotPoints.h:60
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.
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.
bool UpdateTableCache(vtkTable *table)
Update the table cache.
vtkStdString ColorArrayName
Lookup Table for coloring points by scalar value.
void GetBounds(double bounds[4]) override
Get the bounds for this plot as (Xmin, Xmax, Ymin, Ymax).
~vtkPlotPoints() override
void Update() override
Perform any updates to the item that may be necessary before rendering.
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...
vtkTimeStamp BuildTime
The point cache is marked dirty until it has been initialized.
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:57
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.
Definition: vtkStdString.h:45
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:72
record modification and/or execution time
Definition: vtkTimeStamp.h:42
dynamic, self-adjusting array of unsigned char
@ point
Definition: vtkX3D.h:242
@ location
Definition: vtkX3D.h:412
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)