VTK  9.2.6
vtkParallelCoordinatesRepresentation.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkParallelCoordinatesRepresentation.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 /*-------------------------------------------------------------------------
16  Copyright 2009 Sandia Corporation.
17  Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
18  the U.S. Government retains certain rights in this software.
19 -------------------------------------------------------------------------*/
62 #ifndef vtkParallelCoordinatesRepresentation_h
63 #define vtkParallelCoordinatesRepresentation_h
64 
66 #include "vtkViewsInfovisModule.h" // For export macro
67 
68 class vtkActor;
69 class vtkActor2D;
70 class vtkArrayData;
71 class vtkAxisActor2D;
73 class vtkCollection;
74 class vtkCoordinate;
75 class vtkFieldData;
76 class vtkDataArray;
77 class vtkDataObject;
78 class vtkDoubleArray;
79 class vtkIdList;
80 class vtkIdTypeArray;
81 class vtkIntArray;
82 class vtkLookupTable;
84 class vtkPoints;
85 class vtkPolyData;
87 class vtkPropCollection;
88 class vtkSelection;
89 class vtkSelectionNode;
90 class vtkTextMapper;
91 class vtkTimeStamp;
93 class vtkViewport;
94 class vtkWindow;
95 
97 {
98 public:
101  void PrintSelf(ostream& os, vtkIndent indent) override;
102 
108  void ApplyViewTheme(vtkViewTheme* theme) override;
109 
113  virtual std::string GetHoverString(vtkView* view, int x, int y);
114 
116 
119  int SetPositionAndSize(double* position, double* size);
120  int GetPositionAndSize(double* position, double* size);
122 
124 
130 
134  void SetPlotTitle(const char*);
135 
137 
140  vtkGetMacro(NumberOfAxes, int);
142 
144 
147  vtkGetMacro(NumberOfSamples, int);
149 
151 
154  void SetNumberOfAxisLabels(int num);
155  vtkGetMacro(NumberOfAxisLabels, int);
157 
159 
163  virtual int SwapAxisPositions(int position1, int position2);
164  int SetXCoordinateOfPosition(int position, double xcoord);
165  double GetXCoordinateOfPosition(int axis);
166  void GetXCoordinatesOfPositions(double* coords);
167  int GetPositionNearXCoordinate(double xcoord);
169 
171 
174  vtkSetMacro(UseCurves, vtkTypeBool);
175  vtkGetMacro(UseCurves, vtkTypeBool);
176  vtkBooleanMacro(UseCurves, vtkTypeBool);
178 
180 
183  vtkSetMacro(CurveResolution, int);
184  vtkGetMacro(CurveResolution, int);
186 
188 
191  vtkGetMacro(LineOpacity, double);
192  vtkGetMacro(FontSize, double);
193  vtkGetVector3Macro(LineColor, double);
194  vtkGetVector3Macro(AxisColor, double);
195  vtkGetVector3Macro(AxisLabelColor, double);
196  vtkSetMacro(LineOpacity, double);
197  vtkSetMacro(FontSize, double);
198  vtkSetVector3Macro(LineColor, double);
199  vtkSetVector3Macro(AxisColor, double);
200  vtkSetVector3Macro(AxisLabelColor, double);
202 
204 
207  vtkSetMacro(AngleBrushThreshold, double);
208  vtkGetMacro(AngleBrushThreshold, double);
210 
212 
215  vtkSetMacro(FunctionBrushThreshold, double);
216  vtkGetMacro(FunctionBrushThreshold, double);
218 
220 
223  int GetRangeAtPosition(int position, double range[2]);
224  virtual int SetRangeAtPosition(int position, double range[2]);
226 
230  void ResetAxes();
231 
233 
237  virtual void LassoSelect(int brushClass, int brushOperator, vtkPoints* brushPoints);
238  virtual void AngleSelect(int brushClass, int brushOperator, double* p1, double* p2);
239  virtual void FunctionSelect(
240  int brushClass, int brushOperator, double* p1, double* p2, double* q1, double* q2);
241  virtual void RangeSelect(int brushClass, int brushOperator, double* p1, double* p2);
243 
245  {
246  INPUT_DATA = 0,
248  NUM_INPUT_PORTS
249  };
250 
251 protected:
254 
256 
258 
260 
263  bool AddToView(vtkView* view) override;
264  bool RemoveFromView(vtkView* view) override;
265  void PrepareForRendering(vtkRenderView* view) override;
267 
272  void UpdateHoverHighlight(vtkView* view, int x, int y);
273 
277  virtual int AllocatePolyData(vtkPolyData* polyData, int numLines, int numPointsPerLine,
278  int numStrips, int numPointsPerStrip, int numQuads, int numPoints, int numCellScalars,
279  int numPointScalars);
280 
284  int PlaceAxes();
285 
287 
292  virtual int PlaceLines(vtkPolyData* polyData, vtkTable* data, vtkIdTypeArray* idsToPlot);
293  virtual int PlaceCurves(vtkPolyData* polyData, vtkTable* data, vtkIdTypeArray* idsToPlot);
295 
300  virtual int PlaceSelection(
301  vtkPolyData* polyData, vtkTable* data, vtkSelectionNode* selectionNode);
302 
306  virtual int ComputeDataProperties();
307 
311  virtual int UpdatePlotProperties(vtkStringArray* inputTitles);
312 
316  virtual int ReallocateInternals();
317 
319 
322  int ComputePointPosition(double* p);
323  int ComputeLinePosition(double* p1, double* p2);
325 
327 
330  virtual void SelectRows(vtkIdType brushClass, vtkIdType brushOperator, vtkIdTypeArray* rowIds);
331  vtkSelection* ConvertSelection(vtkView* view, vtkSelection* selection) override;
332  virtual void BuildInverseSelection();
334  vtkPolyData* input, vtkActor2D* actor, bool forceStandard = false);
336 
341  void BuildDefaultSCurve(vtkDoubleArray* array, int numValues);
342 
347  virtual void LassoSelectInternal(vtkPoints* brushPoints, vtkIdTypeArray* outIds);
348 
352  virtual void UpdateSelectionActors();
353 
356 
364 
367 
368  class Internals;
369  Internals* I;
370 
374  double YMin;
375  double YMax;
376 
382 
383  // Indexed by screen position
384  double* Xs;
385  double* Mins;
386  double* Maxs;
387  double* MinOffsets;
388  double* MaxOffsets;
389 
393 
395 
396  double LineOpacity;
397  double FontSize;
398  double LineColor[3];
399  double AxisColor[3];
400  double AxisLabelColor[3];
401 
402  vtkGetStringMacro(InternalHoverText);
403  vtkSetStringMacro(InternalHoverText);
405 
406 private:
408  void operator=(const vtkParallelCoordinatesRepresentation&) = delete;
409 };
410 
411 #endif
a actor that draws 2D data
Definition: vtkActor2D.h:55
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:61
Proxy object to connect input/output ports.
Pipeline data object that contains multiple vtkArray objects.
Definition: vtkArrayData.h:61
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:56
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:89
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:65
general representation of visualization data
Definition: vtkDataObject.h:75
dynamic, self-adjusting array of double
represent and manipulate fields of data
Definition: vtkFieldData.h:72
list of point or cell ids
Definition: vtkIdList.h:43
dynamic, self-adjusting array of vtkIdType
a simple class to control print indentation
Definition: vtkIndent.h:49
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:55
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:49
draw vtkPolyData onto the image plane
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:100
an ordered list of Props
A view containing a renderer.
Definition: vtkRenderView.h:74
a node in a vtkSelection the defines the selection criteria.
data object that represents a "selection" in VTK.
Definition: vtkSelection.h:69
a vtkAbstractArray subclass for strings
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:83
2D text annotation
Definition: vtkTextMapper.h:60
record modification and/or execution time
Definition: vtkTimeStamp.h:45
dynamic, self-adjusting array of unsigned int
Sets theme colors for a graphical view.
Definition: vtkViewTheme.h:58
The superclass for all views.
Definition: vtkView.h:64
abstract specification for Viewports
Definition: vtkViewport.h:65
window superclass for vtkRenderWindow
Definition: vtkWindow.h:48
@ info
Definition: vtkX3D.h:382
@ port
Definition: vtkX3D.h:453
@ range
Definition: vtkX3D.h:244
@ position
Definition: vtkX3D.h:267
@ size
Definition: vtkX3D.h:259
@ data
Definition: vtkX3D.h:321
@ string
Definition: vtkX3D.h:496
int vtkTypeBool
Definition: vtkABI.h:69
int vtkIdType
Definition: vtkType.h:332