VTK  9.3.1
vtkParallelCoordinatesRepresentation.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-FileCopyrightText: Copyright 2009 Sandia Corporation
3 // SPDX-License-Identifier: LicenseRef-BSD-3-Clause-Sandia-USGov
37 #ifndef vtkParallelCoordinatesRepresentation_h
38 #define vtkParallelCoordinatesRepresentation_h
39 
41 #include "vtkViewsInfovisModule.h" // For export macro
42 
43 VTK_ABI_NAMESPACE_BEGIN
44 class vtkActor;
45 class vtkActor2D;
46 class vtkArrayData;
47 class vtkAxisActor2D;
49 class vtkCollection;
50 class vtkCoordinate;
51 class vtkFieldData;
52 class vtkDataArray;
53 class vtkDataObject;
54 class vtkDoubleArray;
55 class vtkIdList;
56 class vtkIdTypeArray;
57 class vtkIntArray;
58 class vtkLookupTable;
60 class vtkPoints;
61 class vtkPolyData;
63 class vtkPropCollection;
64 class vtkSelection;
65 class vtkSelectionNode;
66 class vtkTextMapper;
67 class vtkTimeStamp;
69 class vtkViewport;
70 class vtkWindow;
71 
73 {
74 public:
77  void PrintSelf(ostream& os, vtkIndent indent) override;
78 
84  void ApplyViewTheme(vtkViewTheme* theme) override;
85 
89  virtual std::string GetHoverString(vtkView* view, int x, int y);
90 
92 
95  int SetPositionAndSize(double* position, double* size);
96  int GetPositionAndSize(double* position, double* size);
98 
100 
103  void SetAxisTitles(vtkStringArray*);
104  void SetAxisTitles(vtkAlgorithmOutput*);
106 
110  void SetPlotTitle(const char*);
111 
113 
116  vtkGetMacro(NumberOfAxes, int);
118 
120 
123  vtkGetMacro(NumberOfSamples, int);
125 
127 
130  void SetNumberOfAxisLabels(int num);
131  vtkGetMacro(NumberOfAxisLabels, int);
133 
135 
139  virtual int SwapAxisPositions(int position1, int position2);
140  int SetXCoordinateOfPosition(int position, double xcoord);
141  double GetXCoordinateOfPosition(int axis);
142  void GetXCoordinatesOfPositions(double* coords);
143  int GetPositionNearXCoordinate(double xcoord);
145 
147 
150  vtkSetMacro(UseCurves, vtkTypeBool);
151  vtkGetMacro(UseCurves, vtkTypeBool);
152  vtkBooleanMacro(UseCurves, vtkTypeBool);
154 
156 
159  vtkSetMacro(CurveResolution, int);
160  vtkGetMacro(CurveResolution, int);
162 
164 
167  vtkGetMacro(LineOpacity, double);
168  vtkGetMacro(FontSize, double);
169  vtkGetVector3Macro(LineColor, double);
170  vtkGetVector3Macro(AxisColor, double);
171  vtkGetVector3Macro(AxisLabelColor, double);
172  vtkSetMacro(LineOpacity, double);
173  vtkSetMacro(FontSize, double);
174  vtkSetVector3Macro(LineColor, double);
175  vtkSetVector3Macro(AxisColor, double);
176  vtkSetVector3Macro(AxisLabelColor, double);
178 
180 
183  vtkSetMacro(AngleBrushThreshold, double);
184  vtkGetMacro(AngleBrushThreshold, double);
186 
188 
191  vtkSetMacro(FunctionBrushThreshold, double);
192  vtkGetMacro(FunctionBrushThreshold, double);
194 
196 
199  int GetRangeAtPosition(int position, double range[2]);
200  virtual int SetRangeAtPosition(int position, double range[2]);
202 
206  void ResetAxes();
207 
209 
213  virtual void LassoSelect(int brushClass, int brushOperator, vtkPoints* brushPoints);
214  virtual void AngleSelect(int brushClass, int brushOperator, double* p1, double* p2);
215  virtual void FunctionSelect(
216  int brushClass, int brushOperator, double* p1, double* p2, double* q1, double* q2);
217  virtual void RangeSelect(int brushClass, int brushOperator, double* p1, double* p2);
219 
221  {
222  INPUT_DATA = 0,
224  NUM_INPUT_PORTS
225  };
226 
227 protected:
230 
231  int FillInputPortInformation(int port, vtkInformation* info) override;
232 
234 
236 
239  bool AddToView(vtkView* view) override;
240  bool RemoveFromView(vtkView* view) override;
241  void PrepareForRendering(vtkRenderView* view) override;
243 
248  void UpdateHoverHighlight(vtkView* view, int x, int y);
249 
253  virtual int AllocatePolyData(vtkPolyData* polyData, int numLines, int numPointsPerLine,
254  int numStrips, int numPointsPerStrip, int numQuads, int numPoints, int numCellScalars,
255  int numPointScalars);
256 
260  int PlaceAxes();
261 
263 
268  virtual int PlaceLines(vtkPolyData* polyData, vtkTable* data, vtkIdTypeArray* idsToPlot);
269  virtual int PlaceCurves(vtkPolyData* polyData, vtkTable* data, vtkIdTypeArray* idsToPlot);
271 
276  virtual int PlaceSelection(
277  vtkPolyData* polyData, vtkTable* data, vtkSelectionNode* selectionNode);
278 
282  virtual int ComputeDataProperties();
283 
287  virtual int UpdatePlotProperties(vtkStringArray* inputTitles);
288 
292  virtual int ReallocateInternals();
293 
295 
298  int ComputePointPosition(double* p);
299  int ComputeLinePosition(double* p1, double* p2);
301 
303 
306  virtual void SelectRows(vtkIdType brushClass, vtkIdType brushOperator, vtkIdTypeArray* rowIds);
307  vtkSelection* ConvertSelection(vtkView* view, vtkSelection* selection) override;
308  virtual void BuildInverseSelection();
309  virtual vtkPolyDataMapper2D* InitializePlotMapper(
310  vtkPolyData* input, vtkActor2D* actor, bool forceStandard = false);
312 
317  void BuildDefaultSCurve(vtkDoubleArray* array, int numValues);
318 
323  virtual void LassoSelectInternal(vtkPoints* brushPoints, vtkIdTypeArray* outIds);
324 
328  virtual void UpdateSelectionActors();
329 
330  vtkPolyDataMapper2D* GetSelectionMapper(int idx);
331  int GetNumberOfSelections();
332 
340 
343 
344  class Internals;
345  Internals* I;
346 
350  double YMin;
351  double YMax;
352 
358 
359  // Indexed by screen position
360  double* Xs;
361  double* Mins;
362  double* Maxs;
363  double* MinOffsets;
364  double* MaxOffsets;
365 
369 
371 
372  double LineOpacity;
373  double FontSize;
374  double LineColor[3];
375  double AxisColor[3];
376  double AxisLabelColor[3];
377 
378  vtkGetStringMacro(InternalHoverText);
379  vtkSetStringMacro(InternalHoverText);
380  char* InternalHoverText;
381 
382 private:
384  void operator=(const vtkParallelCoordinatesRepresentation&) = delete;
385 };
386 
387 VTK_ABI_NAMESPACE_END
388 #endif
a node in a vtkSelection the defines the selection criteria.
virtual void ApplyViewTheme(vtkViewTheme *vtkNotUsed(theme))
Apply a theme to this representation.
virtual vtkSelection * ConvertSelection(vtkView *view, vtkSelection *selection)
Convert the selection to a type appropriate for sharing with other representations through vtkAnnotat...
dynamic, self-adjusting array of unsigned int
create wireframe outline corners around bounding box
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:40
Store vtkAlgorithm input/output information.
abstract specification for Viewports
Definition: vtkViewport.h:44
a actor that draws 2D data
Definition: vtkActor2D.h:34
record modification and/or execution time
Definition: vtkTimeStamp.h:24
map scalar values into colors via a lookup table
std::string GetHoverString(vtkView *view, vtkProp *prop, vtkIdType cell)
Obtains the hover text for a particular prop and cell.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Subclasses should override this to connect inputs to the internal pipeline as necessary.
Create an axis with tick marks and labels.
a vtkAbstractArray subclass for strings
data object that represents a "selection" in VTK.
Definition: vtkSelection.h:49
dynamic, self-adjusting array of vtkIdType
int vtkIdType
Definition: vtkType.h:315
virtual bool AddToView(vtkView *vtkNotUsed(view))
Adds the representation to the view.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
Pipeline data object that contains multiple vtkArray objects.
Definition: vtkArrayData.h:35
static vtkRenderedRepresentation * New()
2D text annotation
Definition: vtkTextMapper.h:39
Proxy object to connect input/output ports.
dynamic, self-adjusting array of double
an ordered list of Props
int vtkTypeBool
Definition: vtkABI.h:64
window superclass for vtkRenderWindow
Definition: vtkWindow.h:27
Sets theme colors for a graphical view.
Definition: vtkViewTheme.h:33
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:34
The superclass for all views.
Definition: vtkView.h:48
a simple class to control print indentation
Definition: vtkIndent.h:28
virtual bool RemoveFromView(vtkView *vtkNotUsed(view))
Removes the representation to the view.
virtual void PrepareForRendering(vtkRenderView *view)
The view will call this method before every render.
list of point or cell ids
Definition: vtkIdList.h:22
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:44
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems ...
Definition: vtkCoordinate.h:68
vtkSmartPointer< vtkBivariateLinearTableThreshold > LinearThreshold
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:58
vtkSmartPointer< vtkPolyDataMapper2D > PlotMapper
create and manipulate ordered lists of objects
Definition: vtkCollection.h:44
A view containing a renderer.
Definition: vtkRenderView.h:49
Store zero or more vtkInformation instances.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
general representation of visualization data
Definition: vtkDataObject.h:54
draw vtkPolyData onto the image plane
performs line-based thresholding for vtkTable data.
represent and manipulate 3D points
Definition: vtkPoints.h:28
Data representation that takes generic multivariate data and produces a parallel coordinates plot...
represent and manipulate fields of data
Definition: vtkFieldData.h:51