VTK  9.3.1
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 
74  bool ResetSelectionRange();
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 
91  void SetLookupTable(vtkScalarsToColors* lut);
92  vtkScalarsToColors* GetLookupTable();
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 
141  vtkStdString GetColorArrayName();
142 
149  bool UpdateCache() override;
150 
151 protected:
153  ~vtkPlotParallelCoordinates() override;
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
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:28
#define VTK_COLOR_MODE_DIRECT_SCALARS
int ColorMode
Lookup Table for coloring points by scalar value.
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.
virtual void GetBounds(double bounds[4])
Get the bounds for this plot as (Xmin, Xmax, Ymin, Ymax).
Definition: vtkPlot.h:367
Class for drawing a parallel coordinate plot given columns from a vtkTable.
void SetInputData(vtkTable *table, const vtkStdString &, const vtkStdString &) override
This is a convenience function to set the input table.
int vtkIdType
Definition: vtkType.h:315
vtkUnsignedCharArray * Colors
Lookup Table for coloring points by scalar value.
int vtkTypeBool
Definition: vtkABI.h:64
Superclass for mapping scalar values to colors.
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:49
vtkScalarsToColors * LookupTable
Lookup Table for coloring points by scalar value.
#define VTK_COLOR_MODE_MAP_SCALARS
a simple class to control print indentation
Definition: vtkIndent.h:28
virtual bool UpdateCache()
Update the internal cache.
Definition: vtkPlot.h:429
vtkStdString ColorArrayName
Lookup Table for coloring points by scalar value.
#define VTK_COLOR_MODE_DEFAULT
void SetColorModeToDefault()
Set/Get the color mode for the plot.
void SetColorModeToDirectScalars()
Set/Get the color mode for the plot.
vtkTypeBool ScalarVisibility
Lookup Table for coloring points by scalar value.
Abstract class for 2D plots.
Definition: vtkPlot.h:43
dynamic, self-adjusting array of unsigned char
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:58
virtual void SetInputData(vtkTable *table)
This is a convenience function to set the input table and the x, y column for the plot...
void SetColorModeToMapScalars()
Set/Get the color mode for the plot.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
Factory class for drawing 2D charts.