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 
79 #ifndef vtkPlotPoints_h
80 #define vtkPlotPoints_h
81 
82 #include "vtkChartsCoreModule.h" // For export macro
83 #include "vtkNew.h" // For ivars
84 #include "vtkPlot.h"
85 #include "vtkRenderingCoreEnums.h" // For marker enum
86 #include "vtkScalarsToColors.h" // For VTK_COLOR_MODE_DEFAULT and _MAP_SCALARS
87 #include "vtkStdString.h" // For color array name
88 
89 class vtkCharArray;
90 class vtkContext2D;
91 class vtkTable;
92 class vtkPoints2D;
93 class vtkFloatArray;
94 class vtkStdString;
95 class vtkImageData;
96 class vtkScalarsToColors;
98 
99 class VTKCHARTSCORE_EXPORT vtkPlotPoints : public vtkPlot
100 {
101 public:
102  vtkTypeMacro(vtkPlotPoints, vtkPlot);
103  void PrintSelf(ostream& os, vtkIndent indent) override;
104 
108  static vtkPlotPoints* New();
109 
115  void Update() override;
116 
120  bool Paint(vtkContext2D* painter) override;
121 
128  bool PaintLegend(vtkContext2D* painter, const vtkRectf& rect, int legendIndex) override;
129 
133  void GetBounds(double bounds[4]) override;
134 
138  void GetUnscaledInputBounds(double bounds[4]) override;
139 
141 
147 
152  virtual void CreateDefaultLookupTable();
153 
155 
158  vtkSetMacro(ScalarVisibility, vtkTypeBool);
159  vtkGetMacro(ScalarVisibility, vtkTypeBool);
160  vtkBooleanMacro(ScalarVisibility, vtkTypeBool);
162 
164 
169  void SelectColorArray(vtkIdType arrayNum);
170  void SelectColorArray(const vtkStdString& arrayName);
172 
177 
184  vtkVector2f* location, vtkIdType* segmentId) override;
186 
190  bool SelectPoints(const vtkVector2f& min, const vtkVector2f& max) override;
191 
195  bool SelectPointsInPolygon(const vtkContextPolygon& polygon) override;
196 
200  enum
201  {
207  DIAMOND = VTK_MARKER_DIAMOND
208  };
209 
211 
215  vtkGetMacro(MarkerStyle, int);
216  vtkSetMacro(MarkerStyle, int);
218 
220 
224  vtkGetMacro(MarkerSize, float);
225  vtkSetMacro(MarkerSize, float);
227 
229 
232  vtkGetMacro(ValidPointMaskName, vtkStdString);
233  vtkSetMacro(ValidPointMaskName, vtkStdString);
235 
236 protected:
238  ~vtkPlotPoints() override;
239 
243  bool GetDataArrays(vtkTable* table, vtkDataArray* array[2]);
244 
249 
254 
260 
267 
271  void CalculateBounds(double bounds[4]);
272 
277 
279 
285 
287 
290  class VectorPIMPL;
291  VectorPIMPL* Sorted;
293 
299 
305 
310 
315 
317 
321  float MarkerSize;
323 
324  bool LogX, LogY;
325 
327 
335 
339  double UnscaledInputBounds[4];
340 
341 private:
342  vtkPlotPoints(const vtkPlotPoints&) = delete;
343  void operator=(const vtkPlotPoints&) = delete;
344 };
345 
346 #endif // vtkPlotPoints_h
vtkPoints2D
represent and manipulate 2D points
Definition: vtkPoints2D.h:34
vtkStdString.h
vtkPlotPoints::FindBadPoints
void FindBadPoints()
Find all of the "bad points" in the series.
vtkPlot.h
vtkPlotPoints::ValidPointMask
vtkCharArray * ValidPointMask
Array which marks valid points in the array.
Definition: vtkPlotPoints.h:304
vtkPlotPoints::MarkerStyle
int MarkerStyle
The marker style that should be used.
Definition: vtkPlotPoints.h:320
vtkIdType
int vtkIdType
Definition: vtkType.h:332
vtkPlotPoints::vtkPlotPoints
vtkPlotPoints()
vtkFloatArray
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:145
vtkPlotPoints::New
static vtkPlotPoints * New()
Creates a 2D Chart object.
vtkTable
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:172
vtkPlotPoints::CalculateUnscaledInputBounds
void CalculateUnscaledInputBounds()
Calculate the unscaled input bounds from the input arrays.
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:52
vtkPlotPoints::PaintLegend
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 ...
vtkPlotPoints::GetDataArrays
bool GetDataArrays(vtkTable *table, vtkDataArray *array[2])
Populate the data arrays ready to operate on input data.
vtkUnsignedCharArray
dynamic, self-adjusting array of unsigned char
Definition: vtkUnsignedCharArray.h:145
vtkPlotPoints::Points
vtkPoints2D * Points
Store a well packed set of XY coordinates for this data series.
Definition: vtkPlotPoints.h:282
vtkPlotPoints::BadPoints
vtkIdTypeArray * BadPoints
An array containing the indices of all the "bad points", meaning any x, y pair that has an infinity,...
Definition: vtkPlotPoints.h:298
vtkPlotPoints::ScalarVisibility
vtkTypeBool ScalarVisibility
Lookup Table for coloring points by scalar value.
Definition: vtkPlotPoints.h:332
vtkPlotPoints::CreateSortedPoints
void CreateSortedPoints()
Create the sorted point list if necessary.
VTK_MARKER_CIRCLE
@ VTK_MARKER_CIRCLE
Definition: vtkRenderingCoreEnums.h:26
vtkPlotPoints::UpdateTableCache
bool UpdateTableCache(vtkTable *table)
Update the table cache.
vtkContext2D
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:73
vtkPlotPoints::GetUnscaledInputBounds
void GetUnscaledInputBounds(double bounds[4]) override
Get the non-log-scaled bounds on chart inputs for this plot as (Xmin, Xmax, Ymin, Ymax).
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:159
vtkPlot
Abstract class for 2D plots.
Definition: vtkPlot.h:157
vtkPlotPoints::SelectColorArray
void SelectColorArray(vtkIdType arrayNum)
When ScalarMode is set to UsePointFieldData or UseCellFieldData, you can specify which array to use f...
vtkRenderingCoreEnums.h
VTK_MARKER_CROSS
@ VTK_MARKER_CROSS
Definition: vtkRenderingCoreEnums.h:23
vtkPlotPoints::LookupTable
vtkScalarsToColors * LookupTable
Lookup Table for coloring points by scalar value.
Definition: vtkPlotPoints.h:330
vtkPlotPoints::~vtkPlotPoints
~vtkPlotPoints() override
max
#define max(a, b)
Definition: vtkX3DExporterFIWriterHelper.h:31
vtkPlotPoints::GetNearestPoint
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.
vtkCharArray
dynamic, self-adjusting array of char
Definition: vtkCharArray.h:68
vtkPlotPoints::SelectedPoints
vtkNew< vtkFloatArray > SelectedPoints
Store a well packed set of XY coordinates for this data series.
Definition: vtkPlotPoints.h:283
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
vtkPlotPoints::CalculateLogSeries
void CalculateLogSeries()
Handle calculating the log of the x or y series if necessary.
vtkPlotPoints::SelectPoints
bool SelectPoints(const vtkVector2f &min, const vtkVector2f &max) override
Select all points in the specified rectangle.
vtkPlotPoints::MarkerSize
float MarkerSize
The marker style that should be used.
Definition: vtkPlotPoints.h:321
vtkPlotPoints::SelectPointsInPolygon
bool SelectPointsInPolygon(const vtkContextPolygon &polygon) override
Select all points in the specified polygon.
VTK_MARKER_DIAMOND
@ VTK_MARKER_DIAMOND
Definition: vtkRenderingCoreEnums.h:27
vtkPlotPoints::GetBounds
void GetBounds(double bounds[4]) override
Get the bounds for this plot as (Xmin, Xmax, Ymin, Ymax).
vtkPlotPoints::SetLookupTable
void SetLookupTable(vtkScalarsToColors *lut)
Specify a lookup table for the mapper to use.
vtkPlotPoints::Paint
bool Paint(vtkContext2D *painter) override
Paint event for the XY plot, called whenever the chart needs to be drawn.
vtkPlotPoints::GetLookupTable
vtkScalarsToColors * GetLookupTable()
Specify a lookup table for the mapper to use.
vtkPlotPoints::GetColorArrayName
vtkStdString GetColorArrayName()
Get the array name to color by.
vtkPlotPoints::CalculateBounds
void CalculateBounds(double bounds[4])
Calculate the bounds of the plot, ignoring the bad points.
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:157
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
VTK_MARKER_SQUARE
@ VTK_MARKER_SQUARE
Definition: vtkRenderingCoreEnums.h:25
vtkScalarsToColors.h
vtkPlotPoints::SelectColorArray
void SelectColorArray(const vtkStdString &arrayName)
When ScalarMode is set to UsePointFieldData or UseCellFieldData, you can specify which array to use f...
vtkNew< vtkFloatArray >
vtkContextPolygon
Definition: vtkContextPolygon.h:27
vtkScalarsToColors
Superclass for mapping scalar values to colors.
Definition: vtkScalarsToColors.h:109
vtkPlotPoints::LogY
bool LogY
Definition: vtkPlotPoints.h:324
vtkPlotPoints::Sorted
VectorPIMPL * Sorted
Definition: vtkPlotPoints.h:290
vtkPlotPoints
Class for drawing an points given two columns from a vtkTable.
Definition: vtkPlotPoints.h:100
vtkIdTypeArray
dynamic, self-adjusting array of vtkIdType
Definition: vtkIdTypeArray.h:145
vtkNew.h
vtkPlotPoints::BuildTime
vtkTimeStamp BuildTime
The point cache is marked dirty until it has been initialized.
Definition: vtkPlotPoints.h:314
vtkPlotPoints::Colors
vtkUnsignedCharArray * Colors
Lookup Table for coloring points by scalar value.
Definition: vtkPlotPoints.h:331
vtkX3D::location
@ location
Definition: vtkX3D.h:412
vtkPlotPoints::ValidPointMaskName
vtkStdString ValidPointMaskName
Name of the valid point mask array.
Definition: vtkPlotPoints.h:309
VTK_MARKER_PLUS
@ VTK_MARKER_PLUS
Definition: vtkRenderingCoreEnums.h:24
vtkPlotPoints::CreateDefaultLookupTable
virtual void CreateDefaultLookupTable()
Create default lookup table.
vtkStdString
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:105
VTK_MARKER_NONE
@ VTK_MARKER_NONE
Definition: vtkRenderingCoreEnums.h:22
vtkPlotPoints::Update
void Update() override
Perform any updates to the item that may be necessary before rendering.
vtkRectf
Definition: vtkRect.h:336
vtkVector2f
Definition: vtkVector.h:491
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkPlotPoints::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkPlotPoints::ColorArrayName
vtkStdString ColorArrayName
Lookup Table for coloring points by scalar value.
Definition: vtkPlotPoints.h:333