VTK  9.1.0
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 -------------------------------------------------------------------------*/
69 #ifndef vtkParallelCoordinatesRepresentation_h
70 #define vtkParallelCoordinatesRepresentation_h
71 
73 #include "vtkViewsInfovisModule.h" // For export macro
74 
75 class vtkActor;
76 class vtkActor2D;
77 class vtkArrayData;
78 class vtkAxisActor2D;
80 class vtkCollection;
81 class vtkCoordinate;
83 class vtkFieldData;
84 class vtkDataArray;
85 class vtkDataObject;
86 class vtkDoubleArray;
87 class vtkIdList;
88 class vtkIdTypeArray;
89 class vtkIntArray;
90 class vtkLookupTable;
92 class vtkPoints;
93 class vtkPolyData;
95 class vtkPropCollection;
96 class vtkSelection;
97 class vtkSelectionNode;
98 class vtkTextMapper;
99 class vtkTimeStamp;
100 class vtkUnsignedIntArray;
101 class vtkViewport;
102 class vtkWindow;
103 
105 {
106 public:
109  void PrintSelf(ostream& os, vtkIndent indent) override;
110 
116  void ApplyViewTheme(vtkViewTheme* theme) override;
117 
121  virtual std::string GetHoverString(vtkView* view, int x, int y);
122  VTK_DEPRECATED_IN_9_1_0("Use std::string GetHoverString(vtkView* view, int x, int y)")
123  virtual const char* GetHoverText(vtkView* view, int x, int y);
124 
126 
129  int SetPositionAndSize(double* position, double* size);
130  int GetPositionAndSize(double* position, double* size);
132 
134 
137  void SetAxisTitles(vtkStringArray*);
138  void SetAxisTitles(vtkAlgorithmOutput*);
140 
144  void SetPlotTitle(const char*);
145 
147 
150  vtkGetMacro(NumberOfAxes, int);
152 
154 
157  vtkGetMacro(NumberOfSamples, int);
159 
161 
164  void SetNumberOfAxisLabels(int num);
165  vtkGetMacro(NumberOfAxisLabels, int);
167 
169 
173  virtual int SwapAxisPositions(int position1, int position2);
174  int SetXCoordinateOfPosition(int position, double xcoord);
175  double GetXCoordinateOfPosition(int axis);
176  void GetXCoordinatesOfPositions(double* coords);
177  int GetPositionNearXCoordinate(double xcoord);
179 
181 
184  vtkSetMacro(UseCurves, vtkTypeBool);
185  vtkGetMacro(UseCurves, vtkTypeBool);
186  vtkBooleanMacro(UseCurves, vtkTypeBool);
188 
190 
193  vtkSetMacro(CurveResolution, int);
194  vtkGetMacro(CurveResolution, int);
196 
198 
201  vtkGetMacro(LineOpacity, double);
202  vtkGetMacro(FontSize, double);
203  vtkGetVector3Macro(LineColor, double);
204  vtkGetVector3Macro(AxisColor, double);
205  vtkGetVector3Macro(AxisLabelColor, double);
206  vtkSetMacro(LineOpacity, double);
207  vtkSetMacro(FontSize, double);
208  vtkSetVector3Macro(LineColor, double);
209  vtkSetVector3Macro(AxisColor, double);
210  vtkSetVector3Macro(AxisLabelColor, double);
212 
214 
217  vtkSetMacro(AngleBrushThreshold, double);
218  vtkGetMacro(AngleBrushThreshold, double);
220 
222 
225  vtkSetMacro(FunctionBrushThreshold, double);
226  vtkGetMacro(FunctionBrushThreshold, double);
228 
230 
233  int GetRangeAtPosition(int position, double range[2]);
234  virtual int SetRangeAtPosition(int position, double range[2]);
236 
240  void ResetAxes();
241 
243 
247  virtual void LassoSelect(int brushClass, int brushOperator, vtkPoints* brushPoints);
248  virtual void AngleSelect(int brushClass, int brushOperator, double* p1, double* p2);
249  virtual void FunctionSelect(
250  int brushClass, int brushOperator, double* p1, double* p2, double* q1, double* q2);
251  virtual void RangeSelect(int brushClass, int brushOperator, double* p1, double* p2);
253 
255  {
256  INPUT_DATA = 0,
258  NUM_INPUT_PORTS
259  };
260 
261 protected:
264 
266 
268 
270 
273  bool AddToView(vtkView* view) override;
274  bool RemoveFromView(vtkView* view) override;
275  void PrepareForRendering(vtkRenderView* view) override;
277 
282  void UpdateHoverHighlight(vtkView* view, int x, int y);
283 
287  virtual int AllocatePolyData(vtkPolyData* polyData, int numLines, int numPointsPerLine,
288  int numStrips, int numPointsPerStrip, int numQuads, int numPoints, int numCellScalars,
289  int numPointScalars);
290 
294  int PlaceAxes();
295 
297 
302  virtual int PlaceLines(vtkPolyData* polyData, vtkTable* data, vtkIdTypeArray* idsToPlot);
303  virtual int PlaceCurves(vtkPolyData* polyData, vtkTable* data, vtkIdTypeArray* idsToPlot);
305 
310  virtual int PlaceSelection(
311  vtkPolyData* polyData, vtkTable* data, vtkSelectionNode* selectionNode);
312 
316  virtual int ComputeDataProperties();
317 
321  virtual int UpdatePlotProperties(vtkStringArray* inputTitles);
322 
326  virtual int ReallocateInternals();
327 
329 
332  int ComputePointPosition(double* p);
333  int ComputeLinePosition(double* p1, double* p2);
335 
337 
340  virtual void SelectRows(vtkIdType brushClass, vtkIdType brushOperator, vtkIdTypeArray* rowIds);
341  vtkSelection* ConvertSelection(vtkView* view, vtkSelection* selection) override;
342  virtual void BuildInverseSelection();
344  vtkPolyData* input, vtkActor2D* actor, bool forceStandard = false);
346 
351  void BuildDefaultSCurve(vtkDoubleArray* array, int numValues);
352 
357  virtual void LassoSelectInternal(vtkPoints* brushPoints, vtkIdTypeArray* outIds);
358 
362  virtual void UpdateSelectionActors();
363 
366 
374 
377 
378  class Internals;
379  Internals* I;
380 
384  double YMin;
385  double YMax;
386 
392 
393  // Indexed by screen position
394  double* Xs;
395  double* Mins;
396  double* Maxs;
397  double* MinOffsets;
398  double* MaxOffsets;
399 
403 
405 
406  double LineOpacity;
407  double FontSize;
408  double LineColor[3];
409  double AxisColor[3];
410  double AxisLabelColor[3];
411 
412  vtkGetStringMacro(InternalHoverText);
413  vtkSetStringMacro(InternalHoverText);
415 
416 private:
418  void operator=(const vtkParallelCoordinatesRepresentation&) = delete;
419 };
420 
421 #endif
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:143
vtkParallelCoordinatesRepresentation::InitializePlotMapper
virtual vtkPolyDataMapper2D * InitializePlotMapper(vtkPolyData *input, vtkActor2D *actor, bool forceStandard=false)
Select a set of points using the prescribed operator (add, subtract, etc.) and class.
vtkParallelCoordinatesRepresentation::AddToView
bool AddToView(vtkView *view) override
Add/remove the props and actors to/from a view.
vtkParallelCoordinatesRepresentation::NumberOfSamples
int NumberOfSamples
Definition: vtkParallelCoordinatesRepresentation.h:383
vtkParallelCoordinatesRepresentation::BuildDefaultSCurve
void BuildDefaultSCurve(vtkDoubleArray *array, int numValues)
Build an s-curve passing through (0,0) and (1,1) with a specified number of values.
vtkParallelCoordinatesRepresentation
Data representation that takes generic multivariate data and produces a parallel coordinates plot.
Definition: vtkParallelCoordinatesRepresentation.h:105
vtkPolyDataMapper2D
draw vtkPolyData onto the image plane
Definition: vtkPolyDataMapper2D.h:154
vtkRenderView
A view containing a renderer.
Definition: vtkRenderView.h:84
vtkSelectionNode
a node in a vtkSelection the defines the selection criteria.
Definition: vtkSelectionNode.h:341
vtkParallelCoordinatesRepresentation::ConvertSelection
vtkSelection * ConvertSelection(vtkView *view, vtkSelection *selection) override
Select a set of points using the prescribed operator (add, subtract, etc.) and class.
vtkParallelCoordinatesRepresentation::InputArrayTable
vtkSmartPointer< vtkTable > InputArrayTable
Definition: vtkParallelCoordinatesRepresentation.h:401
vtkRenderedRepresentation
Definition: vtkRenderedRepresentation.h:43
vtkIdType
int vtkIdType
Definition: vtkType.h:332
vtkX3D::data
@ data
Definition: vtkX3D.h:321
vtkParallelCoordinatesRepresentation::UpdateSelectionActors
virtual void UpdateSelectionActors()
todo
vtkUnsignedIntArray
dynamic, self-adjusting array of unsigned int
Definition: vtkUnsignedIntArray.h:40
vtkExtractSelectedPolyDataIds
extract a list of cells from a polydata
Definition: vtkExtractSelectedPolyDataIds.h:34
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:145
vtkParallelCoordinatesRepresentation::INPUT_TITLES
@ INPUT_TITLES
Definition: vtkParallelCoordinatesRepresentation.h:257
vtkTable
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:172
vtkParallelCoordinatesRepresentation::ComputePointPosition
int ComputePointPosition(double *p)
Compute which screen position a point belongs to (returns the left position)
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:52
vtkParallelCoordinatesRepresentation::YMin
double YMin
Definition: vtkParallelCoordinatesRepresentation.h:384
vtkParallelCoordinatesRepresentation::FontSize
double FontSize
Definition: vtkParallelCoordinatesRepresentation.h:407
vtkParallelCoordinatesRepresentation::PrepareForRendering
void PrepareForRendering(vtkRenderView *view) override
Add/remove the props and actors to/from a view.
vtkParallelCoordinatesRepresentation::UseCurves
vtkTypeBool UseCurves
Definition: vtkParallelCoordinatesRepresentation.h:388
vtkParallelCoordinatesRepresentation::AxisTitles
vtkSmartPointer< vtkStringArray > AxisTitles
Definition: vtkParallelCoordinatesRepresentation.h:402
vtkX3D::range
@ range
Definition: vtkX3D.h:244
vtkParallelCoordinatesRepresentation::MaxOffsets
double * MaxOffsets
Definition: vtkParallelCoordinatesRepresentation.h:398
vtkSmartPointer< vtkPolyData >
vtkParallelCoordinatesRepresentation::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
VTK_DEPRECATED_IN_9_1_0
#define VTK_DEPRECATED_IN_9_1_0(reason)
Definition: vtkDeprecation.h:117
vtkParallelCoordinatesRepresentation::AllocatePolyData
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.
vtkParallelCoordinatesRepresentation::GetNumberOfSelections
int GetNumberOfSelections()
vtkParallelCoordinatesRepresentation::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Subclasses should override this to connect inputs to the internal pipeline as necessary.
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:159
vtkSelection
data object that represents a "selection" in VTK.
Definition: vtkSelection.h:163
vtkParallelCoordinatesRepresentation::FunctionTextActor
vtkSmartPointer< vtkActor2D > FunctionTextActor
Definition: vtkParallelCoordinatesRepresentation.h:373
vtkParallelCoordinatesRepresentation::FunctionTextMapper
vtkSmartPointer< vtkTextMapper > FunctionTextMapper
Definition: vtkParallelCoordinatesRepresentation.h:372
vtkArrayData
Pipeline data object that contains multiple vtkArray objects.
Definition: vtkArrayData.h:88
vtkParallelCoordinatesRepresentation::Xs
double * Xs
Definition: vtkParallelCoordinatesRepresentation.h:394
vtkParallelCoordinatesRepresentation::LassoSelectInternal
virtual void LassoSelectInternal(vtkPoints *brushPoints, vtkIdTypeArray *outIds)
same as public version, but assumes that the brushpoints coming in are all within two neighboring axe...
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:39
vtkFieldData
represent and manipulate fields of data
Definition: vtkFieldData.h:164
vtkRenderedRepresentation.h
vtkView
The superclass for all views.
Definition: vtkView.h:64
vtkParallelCoordinatesRepresentation::PlotTitleMapper
vtkSmartPointer< vtkTextMapper > PlotTitleMapper
Definition: vtkParallelCoordinatesRepresentation.h:370
vtkParallelCoordinatesRepresentation::PlaceCurves
virtual int PlaceCurves(vtkPolyData *polyData, vtkTable *data, vtkIdTypeArray *idsToPlot)
Place line primitives into a vtkPolyData from the input data.
vtkParallelCoordinatesRepresentation::SelectRows
virtual void SelectRows(vtkIdType brushClass, vtkIdType brushOperator, vtkIdTypeArray *rowIds)
Select a set of points using the prescribed operator (add, subtract, etc.) and class.
vtkViewTheme
Sets theme colors for a graphical view.
Definition: vtkViewTheme.h:132
vtkParallelCoordinatesRepresentation::LinearThreshold
vtkSmartPointer< vtkBivariateLinearTableThreshold > LinearThreshold
Definition: vtkParallelCoordinatesRepresentation.h:376
vtkX3D::position
@ position
Definition: vtkX3D.h:267
vtkX3D::port
@ port
Definition: vtkX3D.h:453
vtkParallelCoordinatesRepresentation::InputPorts
InputPorts
Definition: vtkParallelCoordinatesRepresentation.h:255
vtkParallelCoordinatesRepresentation::PlotMapper
vtkSmartPointer< vtkPolyDataMapper2D > PlotMapper
Definition: vtkParallelCoordinatesRepresentation.h:368
vtkCollection
create and manipulate ordered lists of objects
Definition: vtkCollection.h:53
vtkParallelCoordinatesRepresentation::MinOffsets
double * MinOffsets
Definition: vtkParallelCoordinatesRepresentation.h:397
vtkTextMapper
2D text annotation
Definition: vtkTextMapper.h:157
vtkParallelCoordinatesRepresentation::ReallocateInternals
virtual int ReallocateInternals()
Delete and reallocate the internals, resetting to default values.
vtkParallelCoordinatesRepresentation::New
static vtkParallelCoordinatesRepresentation * New()
vtkParallelCoordinatesRepresentation::GetHoverString
virtual std::string GetHoverString(vtkView *view, int x, int y)
Returns the hover text at an x,y location.
vtkParallelCoordinatesRepresentation::NumberOfAxes
int NumberOfAxes
Definition: vtkParallelCoordinatesRepresentation.h:381
vtkActor
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:155
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkParallelCoordinatesRepresentation::GetSelectionMapper
vtkPolyDataMapper2D * GetSelectionMapper(int idx)
vtkIntArray
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:149
vtkBivariateLinearTableThreshold
performs line-based thresholding for vtkTable data.
Definition: vtkBivariateLinearTableThreshold.h:53
vtkParallelCoordinatesRepresentation::ComputeDataProperties
virtual int ComputeDataProperties()
Compute the number of axes and their individual ranges.
vtkParallelCoordinatesRepresentation::UpdatePlotProperties
virtual int UpdatePlotProperties(vtkStringArray *inputTitles)
Set plot actor properties (line thickness, opacity, etc)
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:140
vtkCoordinate
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:186
vtkParallelCoordinatesRepresentation::PlotData
vtkSmartPointer< vtkPolyData > PlotData
Definition: vtkParallelCoordinatesRepresentation.h:367
vtkOutlineCornerSource
create wireframe outline corners around bounding box
Definition: vtkOutlineCornerSource.h:30
vtkX3D::size
@ size
Definition: vtkX3D.h:259
vtkParallelCoordinatesRepresentation::PlotActor
vtkSmartPointer< vtkActor2D > PlotActor
Definition: vtkParallelCoordinatesRepresentation.h:369
vtkParallelCoordinatesRepresentation::~vtkParallelCoordinatesRepresentation
~vtkParallelCoordinatesRepresentation() override
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:47
vtkParallelCoordinatesRepresentation::LineOpacity
double LineOpacity
Definition: vtkParallelCoordinatesRepresentation.h:406
vtkParallelCoordinatesRepresentation::ApplyViewTheme
void ApplyViewTheme(vtkViewTheme *theme) override
Apply the theme to this view.
vtkParallelCoordinatesRepresentation::PlotTitleActor
vtkSmartPointer< vtkActor2D > PlotTitleActor
Definition: vtkParallelCoordinatesRepresentation.h:371
vtkParallelCoordinatesRepresentation::YMax
double YMax
Definition: vtkParallelCoordinatesRepresentation.h:385
vtkParallelCoordinatesRepresentation::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:183
vtkParallelCoordinatesRepresentation::InternalHoverText
char * InternalHoverText
Definition: vtkParallelCoordinatesRepresentation.h:413
vtkParallelCoordinatesRepresentation::BuildTime
vtkTimeStamp BuildTime
Definition: vtkParallelCoordinatesRepresentation.h:404
vtkLookupTable
map scalar values into colors via a lookup table
Definition: vtkLookupTable.h:178
vtkX3D::info
@ info
Definition: vtkX3D.h:382
vtkX3D::string
@ string
Definition: vtkX3D.h:496
vtkActor2D
a actor that draws 2D data
Definition: vtkActor2D.h:149
vtkParallelCoordinatesRepresentation::CurveResolution
int CurveResolution
Definition: vtkParallelCoordinatesRepresentation.h:387
vtkIdTypeArray
dynamic, self-adjusting array of vtkIdType
Definition: vtkIdTypeArray.h:145
vtkParallelCoordinatesRepresentation::Axes
vtkSmartPointer< vtkAxisActor2D > * Axes
Definition: vtkParallelCoordinatesRepresentation.h:400
vtkParallelCoordinatesRepresentation::SwapThreshold
double SwapThreshold
Definition: vtkParallelCoordinatesRepresentation.h:391
vtkAlgorithmOutput
Proxy object to connect input/output ports.
Definition: vtkAlgorithmOutput.h:66
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:195
vtkAxisActor2D
Create an axis with tick marks and labels.
Definition: vtkAxisActor2D.h:70
vtkParallelCoordinatesRepresentation::FunctionBrushThreshold
double FunctionBrushThreshold
Definition: vtkParallelCoordinatesRepresentation.h:390
vtkStringArray
a vtkAbstractArray subclass for strings
Definition: vtkStringArray.h:146
vtkParallelCoordinatesRepresentation::BuildInverseSelection
virtual void BuildInverseSelection()
Select a set of points using the prescribed operator (add, subtract, etc.) and class.
vtkParallelCoordinatesRepresentation::PlaceSelection
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...
vtkDoubleArray
dynamic, self-adjusting array of double
Definition: vtkDoubleArray.h:145
vtkParallelCoordinatesRepresentation::PlaceLines
virtual int PlaceLines(vtkPolyData *polyData, vtkTable *data, vtkIdTypeArray *idsToPlot)
Place line primitives into a vtkPolyData from the input data.
vtkParallelCoordinatesRepresentation::Maxs
double * Maxs
Definition: vtkParallelCoordinatesRepresentation.h:396
vtkParallelCoordinatesRepresentation::InverseSelection
vtkSmartPointer< vtkSelection > InverseSelection
Definition: vtkParallelCoordinatesRepresentation.h:375
vtkParallelCoordinatesRepresentation::PlaceAxes
int PlaceAxes()
Put the axis actors in their correct positions.
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:169
vtkPropCollection
an ordered list of Props
Definition: vtkPropCollection.h:85
vtkParallelCoordinatesRepresentation::NumberOfAxisLabels
int NumberOfAxisLabels
Definition: vtkParallelCoordinatesRepresentation.h:382
vtkParallelCoordinatesRepresentation::I
Internals * I
Definition: vtkParallelCoordinatesRepresentation.h:378
vtkParallelCoordinatesRepresentation::Mins
double * Mins
Definition: vtkParallelCoordinatesRepresentation.h:395
vtkParallelCoordinatesRepresentation::vtkParallelCoordinatesRepresentation
vtkParallelCoordinatesRepresentation()
vtkParallelCoordinatesRepresentation::AngleBrushThreshold
double AngleBrushThreshold
Definition: vtkParallelCoordinatesRepresentation.h:389
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkParallelCoordinatesRepresentation::RemoveFromView
bool RemoveFromView(vtkView *view) override
Add/remove the props and actors to/from a view.
vtkParallelCoordinatesRepresentation::ComputeLinePosition
int ComputeLinePosition(double *p1, double *p2)
Compute which screen position a point belongs to (returns the left position)
vtkParallelCoordinatesRepresentation::UpdateHoverHighlight
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.