VTK  9.3.0
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 
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 
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();
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 
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);
381 
382 private:
384  void operator=(const vtkParallelCoordinatesRepresentation&) = delete;
385 };
386 
387 VTK_ABI_NAMESPACE_END
388 #endif
a actor that draws 2D data
Definition: vtkActor2D.h:35
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:41
Proxy object to connect input/output ports.
Pipeline data object that contains multiple vtkArray objects.
Definition: vtkArrayData.h:36
Create an axis with tick marks and labels.
performs line-based thresholding for vtkTable data.
create and manipulate ordered lists of objects
Definition: vtkCollection.h:45
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:69
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:45
general representation of visualization data
Definition: vtkDataObject.h:55
dynamic, self-adjusting array of double
represent and manipulate fields of data
Definition: vtkFieldData.h:52
list of point or cell ids
Definition: vtkIdList.h:23
dynamic, self-adjusting array of vtkIdType
a simple class to control print indentation
Definition: vtkIndent.h:29
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:35
map scalar values into colors via a lookup table
create wireframe outline corners around bounding box
Data representation that takes generic multivariate data and produces a parallel coordinates plot.
int SetPositionAndSize(double *position, double *size)
Change the position of the plot.
virtual int SwapAxisPositions(int position1, int position2)
Move an axis to a particular screen position.
virtual int AllocatePolyData(vtkPolyData *polyData, int numLines, int numPointsPerLine, int numStrips, int numPointsPerStrip, int numQuads, int numPoints, int numCellScalars, int numPointScalars)
Allocate the cells/points/scalars for a vtkPolyData.
virtual void AngleSelect(int brushClass, int brushOperator, double *p1, double *p2)
Do a selection of the lines.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Subclasses should override this to connect inputs to the internal pipeline as necessary.
int GetPositionAndSize(double *position, double *size)
Change the position of the plot.
int GetPositionNearXCoordinate(double xcoord)
Move an axis to a particular screen position.
virtual void LassoSelect(int brushClass, int brushOperator, vtkPoints *brushPoints)
Do a selection of the lines.
vtkSmartPointer< vtkBivariateLinearTableThreshold > LinearThreshold
void SetAxisTitles(vtkStringArray *)
Set/Get the axis titles.
virtual void SelectRows(vtkIdType brushClass, vtkIdType brushOperator, vtkIdTypeArray *rowIds)
Select a set of points using the prescribed operator (add, subtract, etc.) and class.
void SetAxisTitles(vtkAlgorithmOutput *)
Set/Get the axis titles.
double GetXCoordinateOfPosition(int axis)
Move an axis to a particular screen position.
virtual vtkPolyDataMapper2D * InitializePlotMapper(vtkPolyData *input, vtkActor2D *actor, bool forceStandard=false)
Select a set of points using the prescribed operator (add, subtract, etc.) and class.
int GetRangeAtPosition(int position, double range[2])
Set/get the value range of the axis at a particular screen position.
void ResetAxes()
Reset the axes to their default positions and orders.
virtual void BuildInverseSelection()
Select a set of points using the prescribed operator (add, subtract, etc.) and class.
virtual int UpdatePlotProperties(vtkStringArray *inputTitles)
Set plot actor properties (line thickness, opacity, etc)
virtual int ReallocateInternals()
Delete and reallocate the internals, resetting to default values.
virtual int SetRangeAtPosition(int position, double range[2])
Set/get the value range of the axis at a particular screen position.
void GetXCoordinatesOfPositions(double *coords)
Move an axis to a particular screen position.
int ComputePointPosition(double *p)
Compute which screen position a point belongs to (returns the left position)
void UpdateHoverHighlight(vtkView *view, int x, int y)
This function is not actually used, but as left as a stub in case it becomes useful at some point.
vtkSelection * ConvertSelection(vtkView *view, vtkSelection *selection) override
Select a set of points using the prescribed operator (add, subtract, etc.) and class.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkSmartPointer< vtkPolyDataMapper2D > PlotMapper
int PlaceAxes()
Put the axis actors in their correct positions.
virtual int PlaceSelection(vtkPolyData *polyData, vtkTable *data, vtkSelectionNode *selectionNode)
Takes the selection list (assumed to be a vtkIdTypeArray) from a vtkSelectionNode and plots lines/cur...
virtual void FunctionSelect(int brushClass, int brushOperator, double *p1, double *p2, double *q1, double *q2)
Do a selection of the lines.
void SetNumberOfAxisLabels(int num)
Set/Get the number of labels to display on each axis.
bool AddToView(vtkView *view) override
Add/remove the props and actors to/from a view.
virtual void LassoSelectInternal(vtkPoints *brushPoints, vtkIdTypeArray *outIds)
same as public version, but assumes that the brushpoints coming in are all within two neighboring axe...
int ComputeLinePosition(double *p1, double *p2)
Compute which screen position a point belongs to (returns the left position)
void ApplyViewTheme(vtkViewTheme *theme) override
Apply the theme to this view.
vtkPolyDataMapper2D * GetSelectionMapper(int idx)
virtual void RangeSelect(int brushClass, int brushOperator, double *p1, double *p2)
Do a selection of the lines.
virtual void UpdateSelectionActors()
todo
static vtkParallelCoordinatesRepresentation * New()
void PrepareForRendering(vtkRenderView *view) override
Add/remove the props and actors to/from a view.
bool RemoveFromView(vtkView *view) override
Add/remove the props and actors to/from a view.
void SetPlotTitle(const char *)
Set the title for the entire plot.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
virtual int PlaceLines(vtkPolyData *polyData, vtkTable *data, vtkIdTypeArray *idsToPlot)
Place line primitives into a vtkPolyData from the input data.
virtual std::string GetHoverString(vtkView *view, int x, int y)
Returns the hover text at an x,y location.
virtual int PlaceCurves(vtkPolyData *polyData, vtkTable *data, vtkIdTypeArray *idsToPlot)
Place line primitives into a vtkPolyData from the input data.
virtual int ComputeDataProperties()
Compute the number of axes and their individual ranges.
void BuildDefaultSCurve(vtkDoubleArray *array, int numValues)
Build an s-curve passing through (0,0) and (1,1) with a specified number of values.
int SetXCoordinateOfPosition(int position, double xcoord)
Move an axis to a particular screen position.
represent and manipulate 3D points
Definition: vtkPoints.h:29
draw vtkPolyData onto the image plane
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:80
an ordered list of Props
A view containing a renderer.
Definition: vtkRenderView.h:50
a node in a vtkSelection the defines the selection criteria.
data object that represents a "selection" in VTK.
Definition: vtkSelection.h:50
a vtkAbstractArray subclass for strings
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:59
2D text annotation
Definition: vtkTextMapper.h:40
record modification and/or execution time
Definition: vtkTimeStamp.h:25
dynamic, self-adjusting array of unsigned int
Sets theme colors for a graphical view.
Definition: vtkViewTheme.h:34
The superclass for all views.
Definition: vtkView.h:49
abstract specification for Viewports
Definition: vtkViewport.h:45
window superclass for vtkRenderWindow
Definition: vtkWindow.h:28
@ info
Definition: vtkX3D.h:376
@ port
Definition: vtkX3D.h:447
@ range
Definition: vtkX3D.h:238
@ position
Definition: vtkX3D.h:261
@ size
Definition: vtkX3D.h:253
@ data
Definition: vtkX3D.h:315
@ string
Definition: vtkX3D.h:490
int vtkTypeBool
Definition: vtkABI.h:64
int vtkIdType
Definition: vtkType.h:315