VTK  9.3.20240418
vtkPlotParallelCoordinates.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
3 
16 #ifndef vtkPlotParallelCoordinates_h
17 #define vtkPlotParallelCoordinates_h
18 
19 #include "vtkChartsCoreModule.h" // For export macro
20 #include "vtkPlot.h"
21 #include "vtkScalarsToColors.h" // For VTK_COLOR_MODE_DEFAULT and _MAP_SCALARS
22 #include "vtkStdString.h" // For vtkStdString ivars
23 
24 VTK_ABI_NAMESPACE_BEGIN
26 class vtkScalarsToColors;
27 class vtkTable;
29 
30 class VTKCHARTSCORE_EXPORT vtkPlotParallelCoordinates : public vtkPlot
31 {
32 public:
34  void PrintSelf(ostream& os, vtkIndent indent) override;
35 
40 
44  bool Paint(vtkContext2D* painter) override;
45 
52  bool PaintLegend(vtkContext2D* painter, const vtkRectf& rect, int legendIndex) override;
53 
57  void GetBounds(double bounds[4]) override;
58 
63  bool SetSelectionRange(int axis, float low, float high);
64 
69  bool SetSelectionRange(int axis, std::vector<float> axisSelection);
70 
75 
77 
80  void SetInputData(vtkTable* table) override;
81  void SetInputData(vtkTable* table, const vtkStdString&, const vtkStdString&) override
82  {
83  this->SetInputData(table);
84  }
86 
88 
94 
99  virtual void CreateDefaultLookupTable();
100 
102 
105  vtkSetMacro(ScalarVisibility, vtkTypeBool);
106  vtkGetMacro(ScalarVisibility, vtkTypeBool);
107  vtkBooleanMacro(ScalarVisibility, vtkTypeBool);
109 
111 
116  void SelectColorArray(vtkIdType arrayNum);
117  void SelectColorArray(const vtkStdString& arrayName);
119 
121 
131  vtkSetMacro(ColorMode, int);
132  void SetColorModeToDefault() { this->SetColorMode(VTK_COLOR_MODE_DEFAULT); }
133  void SetColorModeToMapScalars() { this->SetColorMode(VTK_COLOR_MODE_MAP_SCALARS); }
135  vtkGetMacro(ColorMode, int);
137 
142 
149  bool UpdateCache() override;
150 
151 protected:
154 
156 
159  class Private;
160  Private* Storage;
162 
164 
173 
174 private:
176  void operator=(const vtkPlotParallelCoordinates&) = delete;
177 };
178 
179 VTK_ABI_NAMESPACE_END
180 #endif // vtkPlotParallelCoordinates_h
Factory class for drawing 2D charts.
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:69
a simple class to control print indentation
Definition: vtkIndent.h:108
Class for drawing a parallel coordinate plot given columns from a vtkTable.
void SetColorModeToDefault()
Set/Get the color mode for the plot.
void SetColorModeToDirectScalars()
Set/Get the color mode for the plot.
virtual void CreateDefaultLookupTable()
Create default lookup table.
void SetColorModeToMapScalars()
Set/Get the color mode for the plot.
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 ...
void GetBounds(double bounds[4]) override
Get the bounds for this mapper as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
bool Paint(vtkContext2D *painter) override
Paint event for the XY plot, called whenever the chart needs to be drawn.
vtkUnsignedCharArray * Colors
Lookup Table for coloring points by scalar value.
static vtkPlotParallelCoordinates * New()
Creates a parallel coordinates chart.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkStdString ColorArrayName
Lookup Table for coloring points by scalar value.
void SetInputData(vtkTable *table) override
This is a convenience function to set the input table.
vtkStdString GetColorArrayName()
Get the array name to color by.
bool UpdateCache() override
Update the internal cache.
bool ResetSelectionRange()
Reset the selection criteria for the chart.
~vtkPlotParallelCoordinates() override
bool SetSelectionRange(int axis, std::vector< float > axisSelection)
Set the selection criteria on the given axis in normalized space [0.0 ; 1.0] axisSelection should be ...
void SetLookupTable(vtkScalarsToColors *lut)
Specify a lookup table for the mapper to use.
vtkScalarsToColors * GetLookupTable()
Specify a lookup table for the mapper to use.
void SelectColorArray(vtkIdType arrayNum)
When ScalarMode is set to UsePointFieldData or UseCellFieldData, you can specify which array to use f...
void SelectColorArray(const vtkStdString &arrayName)
When ScalarMode is set to UsePointFieldData or UseCellFieldData, you can specify which array to use f...
void SetInputData(vtkTable *table, const vtkStdString &, const vtkStdString &) override
This is a convenience function to set the input table.
int ColorMode
Lookup Table for coloring points by scalar value.
vtkScalarsToColors * LookupTable
Lookup Table for coloring points by scalar value.
vtkTypeBool ScalarVisibility
Lookup Table for coloring points by scalar value.
bool SetSelectionRange(int axis, float low, float high)
Set the selection criteria on the given axis in normalized space (0.0 - 1.0) for a specific range.
Abstract class for 2D plots.
Definition: vtkPlot.h:153
virtual void SetInputData(vtkTable *table)
This is a convenience function to set the input table and the x, y column for the plot.
Superclass for mapping scalar values to colors.
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:78
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:168
dynamic, self-adjusting array of unsigned char
int vtkTypeBool
Definition: vtkABI.h:64
#define VTK_COLOR_MODE_MAP_SCALARS
#define VTK_COLOR_MODE_DEFAULT
#define VTK_COLOR_MODE_DIRECT_SCALARS
int vtkIdType
Definition: vtkType.h:315