VTK
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 -------------------------------------------------------------------------*/
53 #ifndef vtkParallelCoordinatesRepresentation_h
54 #define vtkParallelCoordinatesRepresentation_h
55 
56 #include "vtkViewsInfovisModule.h" // For export macro
58 
59 class vtkActor;
60 class vtkActor2D;
61 class vtkArrayData;
62 class vtkAxisActor2D;
64 class vtkCollection;
65 class vtkCoordinate;
67 class vtkFieldData;
68 class vtkDataArray;
69 class vtkDataObject;
70 class vtkDoubleArray;
71 class vtkIdList;
72 class vtkIdTypeArray;
73 class vtkIntArray;
74 class vtkLookupTable;
76 class vtkPoints;
77 class vtkPolyData;
79 class vtkPropCollection;
80 class vtkSelection;
81 class vtkSelectionNode;
82 class vtkTextMapper;
83 class vtkTimeStamp;
85 class vtkViewport;
86 class vtkWindow;
87 
89 {
90 public:
93  void PrintSelf(ostream& os, vtkIndent indent) override;
94 
100  void ApplyViewTheme(vtkViewTheme* theme) override;
101 
105  virtual const char* GetHoverText(vtkView* view, int x, int y);
106 
108 
111  int SetPositionAndSize(double* position, double* size);
112  int GetPositionAndSize(double* position, double* size);
114 
116 
119  void SetAxisTitles(vtkStringArray*);
120  void SetAxisTitles(vtkAlgorithmOutput*);
122 
126  void SetPlotTitle(const char*);
127 
129 
132  vtkGetMacro(NumberOfAxes,int);
134 
136 
139  vtkGetMacro(NumberOfSamples,int);
141 
143 
146  void SetNumberOfAxisLabels(int num);
147  vtkGetMacro(NumberOfAxisLabels,int);
149 
151 
155  virtual int SwapAxisPositions(int position1, int position2);
156  int SetXCoordinateOfPosition(int position, double xcoord);
157  double GetXCoordinateOfPosition(int axis);
158  void GetXCoordinatesOfPositions(double* coords);
159  int GetPositionNearXCoordinate(double xcoord);
161 
163 
166  vtkSetMacro(UseCurves,vtkTypeBool);
167  vtkGetMacro(UseCurves,vtkTypeBool);
168  vtkBooleanMacro(UseCurves,vtkTypeBool);
170 
172 
175  vtkSetMacro(CurveResolution,int);
176  vtkGetMacro(CurveResolution,int);
178 
180 
183  vtkGetMacro(LineOpacity,double)
184  vtkGetMacro(FontSize,double);
185  vtkGetVector3Macro(LineColor,double);
186  vtkGetVector3Macro(AxisColor,double);
187  vtkGetVector3Macro(AxisLabelColor,double);
188  vtkSetMacro(LineOpacity,double);
189  vtkSetMacro(FontSize,double);
190  vtkSetVector3Macro(LineColor,double);
191  vtkSetVector3Macro(AxisColor,double);
192  vtkSetVector3Macro(AxisLabelColor,double);
194 
196 
199  vtkSetMacro(AngleBrushThreshold,double);
200  vtkGetMacro(AngleBrushThreshold,double);
202 
204 
207  vtkSetMacro(FunctionBrushThreshold,double);
208  vtkGetMacro(FunctionBrushThreshold,double);
210 
212 
215  int GetRangeAtPosition(int position, double range[2]);
216  virtual int SetRangeAtPosition(int position, double range[2]);
218 
222  void ResetAxes();
223 
225 
229  virtual void LassoSelect(int brushClass, int brushOperator, vtkPoints* brushPoints);
230  virtual void AngleSelect(int brushClass, int brushOperator, double *p1, double *p2);
231  virtual void FunctionSelect(int brushClass, int brushOperator, double *p1, double *p2, double *q1, double *q2);
232  virtual void RangeSelect(int brushClass, int brushOperator, double *p1, double *p2);
234 
236  {
237  INPUT_DATA=0,
239  NUM_INPUT_PORTS
240  };
241 
242 protected:
245 
246  int FillInputPortInformation(int port, vtkInformation* info) override;
247 
248  int RequestData(
251  vtkInformationVector*) override;
252 
254 
257  bool AddToView(vtkView* view) override;
258  bool RemoveFromView(vtkView* view) override;
259  void PrepareForRendering(vtkRenderView* view) override;
261 
266  void UpdateHoverHighlight(vtkView* view, int x, int y);
267 
271  virtual int AllocatePolyData(vtkPolyData* polyData,
272  int numLines,
273  int numPointsPerLine,
274  int numStrips,
275  int numPointsPerStrip,
276  int numQuads,
277  int numPoints,
278  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(vtkPolyData* polyData, vtkTable* data, vtkSelectionNode* selectionNode);
301 
305  virtual int ComputeDataProperties();
306 
310  virtual int UpdatePlotProperties(vtkStringArray* inputTitles);
311 
315  virtual int ReallocateInternals();
316 
318 
321  int ComputePointPosition(double* p);
322  int ComputeLinePosition(double* p1, double* p2);
324 
326 
329  virtual void SelectRows(vtkIdType brushClass, vtkIdType brushOperator, vtkIdTypeArray* rowIds);
330  vtkSelection* ConvertSelection(vtkView* view, vtkSelection* selection) override;
331  virtual void BuildInverseSelection();
332  virtual vtkPolyDataMapper2D* InitializePlotMapper(vtkPolyData* input, vtkActor2D* actor, bool forceStandard=false);
334 
339  void BuildDefaultSCurve(vtkDoubleArray* array, int numValues);
340 
345  virtual void LassoSelectInternal(vtkPoints* brushPoints, vtkIdTypeArray* outIds);
346 
350  virtual void UpdateSelectionActors();
351 
352  vtkPolyDataMapper2D* GetSelectionMapper(int idx);
353  int GetNumberOfSelections();
354 
362 
365 
366  class Internals;
367  Internals* I;
368 
372  double YMin;
373  double YMax;
374 
380 
381  // Indexed by screen position
382  double* Xs;
383  double* Mins;
384  double* Maxs;
385  double* MinOffsets;
386  double* MaxOffsets;
387 
391 
393 
394  double LineOpacity;
395  double FontSize;
396  double LineColor[3];
397  double AxisColor[3];
398  double AxisLabelColor[3];
399 
400  vtkGetStringMacro(InternalHoverText);
401  vtkSetStringMacro(InternalHoverText);
402  char* InternalHoverText;
403 
404 private:
406  void operator=(const vtkParallelCoordinatesRepresentation&) = delete;
407 };
408 
409 #endif
410 
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:39
vtkParallelCoordinatesRepresentation::NumberOfSamples
int NumberOfSamples
Definition: vtkParallelCoordinatesRepresentation.h:371
vtkParallelCoordinatesRepresentation
Data representation that takes generic multivariate data and produces a parallel coordinates plot.
Definition: vtkParallelCoordinatesRepresentation.h:88
vtkPolyDataMapper2D
draw vtkPolyData onto the image plane
Definition: vtkPolyDataMapper2D.h:51
vtkDataRepresentation::AddToView
virtual bool AddToView(vtkView *vtkNotUsed(view))
Adds the representation to the view.
Definition: vtkDataRepresentation.h:292
vtkRenderView
A view containing a renderer.
Definition: vtkRenderView.h:61
vtkDataRepresentation::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Subclasses should override this to connect inputs to the internal pipeline as necessary.
Definition: vtkDataRepresentation.h:245
vtkSelectionNode
A node in a selection tree. Used to store selection results.
Definition: vtkSelectionNode.h:67
vtkParallelCoordinatesRepresentation::InputArrayTable
vtkSmartPointer< vtkTable > InputArrayTable
Definition: vtkParallelCoordinatesRepresentation.h:389
vtkRenderedRepresentation
Definition: vtkRenderedRepresentation.h:42
vtkIdType
int vtkIdType
Definition: vtkType.h:347
vtkX3D::data
Definition: vtkX3D.h:315
vtkUnsignedIntArray
dynamic, self-adjusting array of unsigned int
Definition: vtkUnsignedIntArray.h:42
vtkExtractSelectedPolyDataIds
extract a list of cells from a polydata
Definition: vtkExtractSelectedPolyDataIds.h:36
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:41
vtkParallelCoordinatesRepresentation::INPUT_TITLES
Definition: vtkParallelCoordinatesRepresentation.h:238
vtkTable
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:68
vtkRenderedRepresentation::GetHoverText
vtkUnicodeString GetHoverText(vtkView *view, vtkProp *prop, vtkIdType cell)
Obtains the hover text for a particular prop and cell.
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:35
vtkParallelCoordinatesRepresentation::YMin
double YMin
Definition: vtkParallelCoordinatesRepresentation.h:372
vtkParallelCoordinatesRepresentation::FontSize
double FontSize
Definition: vtkParallelCoordinatesRepresentation.h:395
vtkParallelCoordinatesRepresentation::UseCurves
vtkTypeBool UseCurves
Definition: vtkParallelCoordinatesRepresentation.h:376
vtkParallelCoordinatesRepresentation::AxisTitles
vtkSmartPointer< vtkStringArray > AxisTitles
Definition: vtkParallelCoordinatesRepresentation.h:390
vtkX3D::range
Definition: vtkX3D.h:238
vtkParallelCoordinatesRepresentation::MaxOffsets
double * MaxOffsets
Definition: vtkParallelCoordinatesRepresentation.h:386
vtkSmartPointer< vtkPolyData >
vtkPassInputTypeAlgorithm::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
vtkSelection
data object that represents a "selection" in VTK.
Definition: vtkSelection.h:63
vtkParallelCoordinatesRepresentation::FunctionTextActor
vtkSmartPointer< vtkActor2D > FunctionTextActor
Definition: vtkParallelCoordinatesRepresentation.h:361
vtkParallelCoordinatesRepresentation::FunctionTextMapper
vtkSmartPointer< vtkTextMapper > FunctionTextMapper
Definition: vtkParallelCoordinatesRepresentation.h:360
vtkArrayData
Pipeline data object that contains multiple vtkArray objects.
Definition: vtkArrayData.h:52
vtkParallelCoordinatesRepresentation::Xs
double * Xs
Definition: vtkParallelCoordinatesRepresentation.h:382
vtkDataRepresentation::RemoveFromView
virtual bool RemoveFromView(vtkView *vtkNotUsed(view))
Removes the representation to the view.
Definition: vtkDataRepresentation.h:299
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
vtkFieldData
represent and manipulate fields of data
Definition: vtkFieldData.h:56
vtkRenderedRepresentation.h
vtkView
The superclass for all views.
Definition: vtkView.h:60
vtkParallelCoordinatesRepresentation::PlotTitleMapper
vtkSmartPointer< vtkTextMapper > PlotTitleMapper
Definition: vtkParallelCoordinatesRepresentation.h:358
vtkViewTheme
Sets theme colors for a graphical view.
Definition: vtkViewTheme.h:48
vtkParallelCoordinatesRepresentation::LinearThreshold
vtkSmartPointer< vtkBivariateLinearTableThreshold > LinearThreshold
Definition: vtkParallelCoordinatesRepresentation.h:364
vtkX3D::position
Definition: vtkX3D.h:261
vtkX3D::port
Definition: vtkX3D.h:447
vtkParallelCoordinatesRepresentation::InputPorts
InputPorts
Definition: vtkParallelCoordinatesRepresentation.h:235
vtkParallelCoordinatesRepresentation::PlotMapper
vtkSmartPointer< vtkPolyDataMapper2D > PlotMapper
Definition: vtkParallelCoordinatesRepresentation.h:356
vtkCollection
create and manipulate ordered lists of objects
Definition: vtkCollection.h:51
vtkParallelCoordinatesRepresentation::MinOffsets
double * MinOffsets
Definition: vtkParallelCoordinatesRepresentation.h:385
vtkTextMapper
2D text annotation
Definition: vtkTextMapper.h:53
vtkParallelCoordinatesRepresentation::NumberOfAxes
int NumberOfAxes
Definition: vtkParallelCoordinatesRepresentation.h:369
vtkActor
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:51
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkIntArray
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:45
vtkBivariateLinearTableThreshold
performs line-based thresholding for vtkTable data.
Definition: vtkBivariateLinearTableThreshold.h:52
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:36
vtkCoordinate
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:81
vtkParallelCoordinatesRepresentation::PlotData
vtkSmartPointer< vtkPolyData > PlotData
Definition: vtkParallelCoordinatesRepresentation.h:355
vtkOutlineCornerSource
create wireframe outline corners around bounding box
Definition: vtkOutlineCornerSource.h:32
vtkX3D::size
Definition: vtkX3D.h:253
vtkDataRepresentation::ConvertSelection
virtual vtkSelection * ConvertSelection(vtkView *view, vtkSelection *selection)
Convert the selection to a type appropriate for sharing with other representations through vtkAnnotat...
vtkParallelCoordinatesRepresentation::PlotActor
vtkSmartPointer< vtkActor2D > PlotActor
Definition: vtkParallelCoordinatesRepresentation.h:357
vtkRenderedRepresentation::PrepareForRendering
virtual void PrepareForRendering(vtkRenderView *view)
The view will call this method before every render.
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:47
vtkParallelCoordinatesRepresentation::LineOpacity
double LineOpacity
Definition: vtkParallelCoordinatesRepresentation.h:394
vtkParallelCoordinatesRepresentation::PlotTitleActor
vtkSmartPointer< vtkActor2D > PlotTitleActor
Definition: vtkParallelCoordinatesRepresentation.h:359
vtkParallelCoordinatesRepresentation::YMax
double YMax
Definition: vtkParallelCoordinatesRepresentation.h:373
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
vtkParallelCoordinatesRepresentation::InternalHoverText
char * InternalHoverText
Definition: vtkParallelCoordinatesRepresentation.h:401
vtkParallelCoordinatesRepresentation::BuildTime
vtkTimeStamp BuildTime
Definition: vtkParallelCoordinatesRepresentation.h:392
vtkLookupTable
map scalar values into colors via a lookup table
Definition: vtkLookupTable.h:74
vtkRenderedRepresentation::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkX3D::info
Definition: vtkX3D.h:376
vtkActor2D
a actor that draws 2D data
Definition: vtkActor2D.h:45
vtkParallelCoordinatesRepresentation::CurveResolution
int CurveResolution
Definition: vtkParallelCoordinatesRepresentation.h:375
vtkIdTypeArray
dynamic, self-adjusting array of vtkIdType
Definition: vtkIdTypeArray.h:41
vtkParallelCoordinatesRepresentation::Axes
vtkSmartPointer< vtkAxisActor2D > * Axes
Definition: vtkParallelCoordinatesRepresentation.h:388
vtkParallelCoordinatesRepresentation::SwapThreshold
double SwapThreshold
Definition: vtkParallelCoordinatesRepresentation.h:379
vtkAlgorithmOutput
Proxy object to connect input/output ports.
Definition: vtkAlgorithmOutput.h:39
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
vtkAxisActor2D
Create an axis with tick marks and labels.
Definition: vtkAxisActor2D.h:72
vtkParallelCoordinatesRepresentation::FunctionBrushThreshold
double FunctionBrushThreshold
Definition: vtkParallelCoordinatesRepresentation.h:378
vtkStringArray
a vtkAbstractArray subclass for strings
Definition: vtkStringArray.h:42
vtkDoubleArray
dynamic, self-adjusting array of double
Definition: vtkDoubleArray.h:41
vtkDataRepresentation::ApplyViewTheme
virtual void ApplyViewTheme(vtkViewTheme *vtkNotUsed(theme))
Apply a theme to this representation.
Definition: vtkDataRepresentation.h:96
vtkParallelCoordinatesRepresentation::Maxs
double * Maxs
Definition: vtkParallelCoordinatesRepresentation.h:384
vtkParallelCoordinatesRepresentation::InverseSelection
vtkSmartPointer< vtkSelection > InverseSelection
Definition: vtkParallelCoordinatesRepresentation.h:363
vtkRenderedRepresentation::New
static vtkRenderedRepresentation * New()
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:64
vtkPropCollection
an ordered list of Props
Definition: vtkPropCollection.h:41
vtkParallelCoordinatesRepresentation::NumberOfAxisLabels
int NumberOfAxisLabels
Definition: vtkParallelCoordinatesRepresentation.h:370
vtkParallelCoordinatesRepresentation::I
Internals * I
Definition: vtkParallelCoordinatesRepresentation.h:366
vtkParallelCoordinatesRepresentation::Mins
double * Mins
Definition: vtkParallelCoordinatesRepresentation.h:383
vtkParallelCoordinatesRepresentation::AngleBrushThreshold
double AngleBrushThreshold
Definition: vtkParallelCoordinatesRepresentation.h:377
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69