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 -------------------------------------------------------------------------*/
50 #ifndef vtkParallelCoordinatesRepresentation_h
51 #define vtkParallelCoordinatesRepresentation_h
52 
53 #include "vtkViewsInfovisModule.h" // For export macro
55 
56 class vtkActor;
57 class vtkActor2D;
58 class vtkArrayData;
59 class vtkAxisActor2D;
61 class vtkCollection;
62 class vtkCoordinate;
64 class vtkFieldData;
65 class vtkDataArray;
66 class vtkDataObject;
67 class vtkDoubleArray;
68 class vtkIdList;
69 class vtkIdTypeArray;
70 class vtkIntArray;
71 class vtkLookupTable;
73 class vtkPoints;
74 class vtkPolyData;
76 class vtkPropCollection;
77 class vtkSelection;
78 class vtkSelectionNode;
79 class vtkTextMapper;
80 class vtkTimeStamp;
82 class vtkViewport;
83 class vtkWindow;
84 
86 {
87 public:
90  void PrintSelf(ostream& os, vtkIndent indent) override;
91 
97  void ApplyViewTheme(vtkViewTheme* theme) override;
98 
102  virtual const char* GetHoverText(vtkView* view, int x, int y);
103 
105 
108  int SetPositionAndSize(double* position, double* size);
109  int GetPositionAndSize(double* position, double* size);
111 
113 
116  void SetAxisTitles(vtkStringArray*);
117  void SetAxisTitles(vtkAlgorithmOutput*);
119 
123  void SetPlotTitle(const char*);
124 
126 
129  vtkGetMacro(NumberOfAxes,int);
131 
133 
136  vtkGetMacro(NumberOfSamples,int);
138 
140 
143  void SetNumberOfAxisLabels(int num);
144  vtkGetMacro(NumberOfAxisLabels,int);
146 
148 
152  virtual int SwapAxisPositions(int position1, int position2);
153  int SetXCoordinateOfPosition(int position, double xcoord);
154  double GetXCoordinateOfPosition(int axis);
155  void GetXCoordinatesOfPositions(double* coords);
156  int GetPositionNearXCoordinate(double xcoord);
158 
160 
163  vtkSetMacro(UseCurves,vtkTypeBool);
164  vtkGetMacro(UseCurves,vtkTypeBool);
165  vtkBooleanMacro(UseCurves,vtkTypeBool);
167 
169 
172  vtkSetMacro(CurveResolution,int);
173  vtkGetMacro(CurveResolution,int);
175 
177 
180  vtkGetMacro(LineOpacity,double)
181  vtkGetMacro(FontSize,double);
182  vtkGetVector3Macro(LineColor,double);
183  vtkGetVector3Macro(AxisColor,double);
184  vtkGetVector3Macro(AxisLabelColor,double);
185  vtkSetMacro(LineOpacity,double);
186  vtkSetMacro(FontSize,double);
187  vtkSetVector3Macro(LineColor,double);
188  vtkSetVector3Macro(AxisColor,double);
189  vtkSetVector3Macro(AxisLabelColor,double);
191 
193 
196  vtkSetMacro(AngleBrushThreshold,double);
197  vtkGetMacro(AngleBrushThreshold,double);
199 
201 
204  vtkSetMacro(FunctionBrushThreshold,double);
205  vtkGetMacro(FunctionBrushThreshold,double);
207 
209 
212  int GetRangeAtPosition(int position, double range[2]);
213  virtual int SetRangeAtPosition(int position, double range[2]);
215 
219  void ResetAxes();
220 
222 
226  virtual void LassoSelect(int brushClass, int brushOperator, vtkPoints* brushPoints);
227  virtual void AngleSelect(int brushClass, int brushOperator, double *p1, double *p2);
228  virtual void FunctionSelect(int brushClass, int brushOperator, double *p1, double *p2, double *q1, double *q2);
229  virtual void RangeSelect(int brushClass, int brushOperator, double *p1, double *p2);
231 
233  {
234  INPUT_DATA=0,
236  NUM_INPUT_PORTS
237  };
238 
239 protected:
242 
243  int FillInputPortInformation(int port, vtkInformation* info) override;
244 
245  int RequestData(
248  vtkInformationVector*) override;
249 
251 
254  bool AddToView(vtkView* view) override;
255  bool RemoveFromView(vtkView* view) override;
256  void PrepareForRendering(vtkRenderView* view) override;
258 
263  void UpdateHoverHighlight(vtkView* view, int x, int y);
264 
268  virtual int AllocatePolyData(vtkPolyData* polyData,
269  int numLines,
270  int numPointsPerLine,
271  int numStrips,
272  int numPointsPerStrip,
273  int numQuads,
274  int numPoints,
275  int numCellScalars,
276  int numPointScalars);
277 
281  int PlaceAxes();
282 
284 
289  virtual int PlaceLines(vtkPolyData* polyData, vtkTable* data, vtkIdTypeArray* idsToPlot);
290  virtual int PlaceCurves(vtkPolyData* polyData, vtkTable* data, vtkIdTypeArray* idsToPlot);
292 
297  virtual int PlaceSelection(vtkPolyData* polyData, vtkTable* data, vtkSelectionNode* selectionNode);
298 
302  virtual int ComputeDataProperties();
303 
307  virtual int UpdatePlotProperties(vtkStringArray* inputTitles);
308 
312  virtual int ReallocateInternals();
313 
315 
318  int ComputePointPosition(double* p);
319  int ComputeLinePosition(double* p1, double* p2);
321 
323 
326  virtual void SelectRows(vtkIdType brushClass, vtkIdType brushOperator, vtkIdTypeArray* rowIds);
327  vtkSelection* ConvertSelection(vtkView* view, vtkSelection* selection) override;
328  virtual void BuildInverseSelection();
329  virtual vtkPolyDataMapper2D* InitializePlotMapper(vtkPolyData* input, vtkActor2D* actor, bool forceStandard=false);
331 
336  void BuildDefaultSCurve(vtkDoubleArray* array, int numValues);
337 
342  virtual void LassoSelectInternal(vtkPoints* brushPoints, vtkIdTypeArray* outIds);
343 
347  virtual void UpdateSelectionActors();
348 
349  vtkPolyDataMapper2D* GetSelectionMapper(int idx);
350  int GetNumberOfSelections();
351 
359 
362 
363  class Internals;
364  Internals* I;
365 
369  double YMin;
370  double YMax;
371 
377 
378  // Indexed by screen position
379  double* Xs;
380  double* Mins;
381  double* Maxs;
382  double* MinOffsets;
383  double* MaxOffsets;
384 
388 
390 
391  double LineOpacity;
392  double FontSize;
393  double LineColor[3];
394  double AxisColor[3];
395  double AxisLabelColor[3];
396 
397  vtkGetStringMacro(InternalHoverText);
398  vtkSetStringMacro(InternalHoverText);
399  char* InternalHoverText;
400 
401 private:
403  void operator=(const vtkParallelCoordinatesRepresentation&) = delete;
404 };
405 
406 #endif
407 
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:33
vtkParallelCoordinatesRepresentation::NumberOfSamples
int NumberOfSamples
Definition: vtkParallelCoordinatesRepresentation.h:368
vtkParallelCoordinatesRepresentation
Data representation that takes generic multivariate data and produces a parallel coordinates plot.
Definition: vtkParallelCoordinatesRepresentation.h:85
vtkPolyDataMapper2D
draw vtkPolyData onto the image plane
Definition: vtkPolyDataMapper2D.h:45
vtkDataRepresentation::AddToView
virtual bool AddToView(vtkView *vtkNotUsed(view))
Adds the representation to the view.
Definition: vtkDataRepresentation.h:289
vtkRenderView
A view containing a renderer.
Definition: vtkRenderView.h:58
vtkDataRepresentation::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Subclasses should override this to connect inputs to the internal pipeline as necessary.
Definition: vtkDataRepresentation.h:242
vtkSelectionNode
A node in a selection tree. Used to store selection results.
Definition: vtkSelectionNode.h:61
vtkParallelCoordinatesRepresentation::InputArrayTable
vtkSmartPointer< vtkTable > InputArrayTable
Definition: vtkParallelCoordinatesRepresentation.h:386
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:39
vtkExtractSelectedPolyDataIds
extract a list of cells from a polydata
Definition: vtkExtractSelectedPolyDataIds.h:33
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:35
vtkParallelCoordinatesRepresentation::INPUT_TITLES
Definition: vtkParallelCoordinatesRepresentation.h:235
vtkTable
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:62
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:32
vtkParallelCoordinatesRepresentation::YMin
double YMin
Definition: vtkParallelCoordinatesRepresentation.h:369
vtkParallelCoordinatesRepresentation::FontSize
double FontSize
Definition: vtkParallelCoordinatesRepresentation.h:392
vtkParallelCoordinatesRepresentation::UseCurves
vtkTypeBool UseCurves
Definition: vtkParallelCoordinatesRepresentation.h:373
vtkParallelCoordinatesRepresentation::AxisTitles
vtkSmartPointer< vtkStringArray > AxisTitles
Definition: vtkParallelCoordinatesRepresentation.h:387
vtkX3D::range
Definition: vtkX3D.h:238
vtkParallelCoordinatesRepresentation::MaxOffsets
double * MaxOffsets
Definition: vtkParallelCoordinatesRepresentation.h:383
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:48
vtkSelection
data object that represents a "selection" in VTK.
Definition: vtkSelection.h:57
vtkParallelCoordinatesRepresentation::FunctionTextActor
vtkSmartPointer< vtkActor2D > FunctionTextActor
Definition: vtkParallelCoordinatesRepresentation.h:358
vtkParallelCoordinatesRepresentation::FunctionTextMapper
vtkSmartPointer< vtkTextMapper > FunctionTextMapper
Definition: vtkParallelCoordinatesRepresentation.h:357
vtkArrayData
Pipeline data object that contains multiple vtkArray objects.
Definition: vtkArrayData.h:49
vtkParallelCoordinatesRepresentation::Xs
double * Xs
Definition: vtkParallelCoordinatesRepresentation.h:379
vtkDataRepresentation::RemoveFromView
virtual bool RemoveFromView(vtkView *vtkNotUsed(view))
Removes the representation to the view.
Definition: vtkDataRepresentation.h:296
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
vtkFieldData
represent and manipulate fields of data
Definition: vtkFieldData.h:53
vtkRenderedRepresentation.h
vtkView
The superclass for all views.
Definition: vtkView.h:54
vtkParallelCoordinatesRepresentation::PlotTitleMapper
vtkSmartPointer< vtkTextMapper > PlotTitleMapper
Definition: vtkParallelCoordinatesRepresentation.h:355
vtkViewTheme
Sets theme colors for a graphical view.
Definition: vtkViewTheme.h:42
vtkParallelCoordinatesRepresentation::LinearThreshold
vtkSmartPointer< vtkBivariateLinearTableThreshold > LinearThreshold
Definition: vtkParallelCoordinatesRepresentation.h:361
vtkX3D::position
Definition: vtkX3D.h:261
vtkX3D::port
Definition: vtkX3D.h:447
vtkParallelCoordinatesRepresentation::InputPorts
InputPorts
Definition: vtkParallelCoordinatesRepresentation.h:232
vtkParallelCoordinatesRepresentation::PlotMapper
vtkSmartPointer< vtkPolyDataMapper2D > PlotMapper
Definition: vtkParallelCoordinatesRepresentation.h:353
vtkCollection
create and manipulate ordered lists of objects
Definition: vtkCollection.h:48
vtkParallelCoordinatesRepresentation::MinOffsets
double * MinOffsets
Definition: vtkParallelCoordinatesRepresentation.h:382
vtkTextMapper
2D text annotation
Definition: vtkTextMapper.h:47
vtkParallelCoordinatesRepresentation::NumberOfAxes
int NumberOfAxes
Definition: vtkParallelCoordinatesRepresentation.h:366
vtkActor
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:45
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkIntArray
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:39
vtkBivariateLinearTableThreshold
performs line-based thresholding for vtkTable data.
Definition: vtkBivariateLinearTableThreshold.h:52
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:30
vtkCoordinate
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:75
vtkParallelCoordinatesRepresentation::PlotData
vtkSmartPointer< vtkPolyData > PlotData
Definition: vtkParallelCoordinatesRepresentation.h:352
vtkOutlineCornerSource
create wireframe outline corners around bounding box
Definition: vtkOutlineCornerSource.h:29
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:354
vtkRenderedRepresentation::PrepareForRendering
virtual void PrepareForRendering(vtkRenderView *view)
The view will call this method before every render.
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:44
vtkParallelCoordinatesRepresentation::LineOpacity
double LineOpacity
Definition: vtkParallelCoordinatesRepresentation.h:391
vtkParallelCoordinatesRepresentation::PlotTitleActor
vtkSmartPointer< vtkActor2D > PlotTitleActor
Definition: vtkParallelCoordinatesRepresentation.h:356
vtkParallelCoordinatesRepresentation::YMax
double YMax
Definition: vtkParallelCoordinatesRepresentation.h:370
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:80
vtkParallelCoordinatesRepresentation::InternalHoverText
char * InternalHoverText
Definition: vtkParallelCoordinatesRepresentation.h:398
vtkParallelCoordinatesRepresentation::BuildTime
vtkTimeStamp BuildTime
Definition: vtkParallelCoordinatesRepresentation.h:389
vtkLookupTable
map scalar values into colors via a lookup table
Definition: vtkLookupTable.h:68
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:39
vtkParallelCoordinatesRepresentation::CurveResolution
int CurveResolution
Definition: vtkParallelCoordinatesRepresentation.h:372
vtkIdTypeArray
dynamic, self-adjusting array of vtkIdType
Definition: vtkIdTypeArray.h:35
vtkParallelCoordinatesRepresentation::Axes
vtkSmartPointer< vtkAxisActor2D > * Axes
Definition: vtkParallelCoordinatesRepresentation.h:385
vtkParallelCoordinatesRepresentation::SwapThreshold
double SwapThreshold
Definition: vtkParallelCoordinatesRepresentation.h:376
vtkAlgorithmOutput
Proxy object to connect input/output ports.
Definition: vtkAlgorithmOutput.h:36
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
vtkAxisActor2D
Create an axis with tick marks and labels.
Definition: vtkAxisActor2D.h:69
vtkParallelCoordinatesRepresentation::FunctionBrushThreshold
double FunctionBrushThreshold
Definition: vtkParallelCoordinatesRepresentation.h:375
vtkStringArray
a vtkAbstractArray subclass for strings
Definition: vtkStringArray.h:36
vtkDoubleArray
dynamic, self-adjusting array of double
Definition: vtkDoubleArray.h:35
vtkDataRepresentation::ApplyViewTheme
virtual void ApplyViewTheme(vtkViewTheme *vtkNotUsed(theme))
Apply a theme to this representation.
Definition: vtkDataRepresentation.h:93
vtkParallelCoordinatesRepresentation::Maxs
double * Maxs
Definition: vtkParallelCoordinatesRepresentation.h:381
vtkParallelCoordinatesRepresentation::InverseSelection
vtkSmartPointer< vtkSelection > InverseSelection
Definition: vtkParallelCoordinatesRepresentation.h:360
vtkRenderedRepresentation::New
static vtkRenderedRepresentation * New()
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:58
vtkPropCollection
an ordered list of Props
Definition: vtkPropCollection.h:35
vtkParallelCoordinatesRepresentation::NumberOfAxisLabels
int NumberOfAxisLabels
Definition: vtkParallelCoordinatesRepresentation.h:367
vtkParallelCoordinatesRepresentation::I
Internals * I
Definition: vtkParallelCoordinatesRepresentation.h:363
vtkParallelCoordinatesRepresentation::Mins
double * Mins
Definition: vtkParallelCoordinatesRepresentation.h:380
vtkParallelCoordinatesRepresentation::AngleBrushThreshold
double AngleBrushThreshold
Definition: vtkParallelCoordinatesRepresentation.h:374
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69