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);
94 
100  virtual void ApplyViewTheme(vtkViewTheme* theme);
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 
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,int);
167  vtkGetMacro(UseCurves,int);
168  vtkBooleanMacro(UseCurves,int);
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 
247 
248  virtual int RequestData(
252 
254 
257  virtual bool AddToView(vtkView* view);
258  virtual bool RemoveFromView(vtkView* view);
259  virtual void PrepareForRendering(vtkRenderView* view);
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  virtual vtkSelection* ConvertSelection(vtkView* view, vtkSelection* selection);
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 
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);
403 
404 private:
406  void operator=(const vtkParallelCoordinatesRepresentation&) VTK_DELETE_FUNCTION;
407 };
408 
409 #endif
410 
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:40
vtkParallelCoordinatesRepresentation::InitializePlotMapper
virtual vtkPolyDataMapper2D * InitializePlotMapper(vtkPolyData *input, vtkActor2D *actor, bool forceStandard=false)
vtkParallelCoordinatesRepresentation::GetXCoordinateOfPosition
double GetXCoordinateOfPosition(int axis)
vtkParallelCoordinatesRepresentation::NumberOfSamples
int NumberOfSamples
Definition: vtkParallelCoordinatesRepresentation.h:371
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:89
vtkPolyDataMapper2D
draw vtkPolyData onto the image plane
Definition: vtkPolyDataMapper2D.h:52
vtkParallelCoordinatesRepresentation::GetPositionNearXCoordinate
int GetPositionNearXCoordinate(double xcoord)
vtkRenderView
A view containing a renderer.
Definition: vtkRenderView.h:62
vtkParallelCoordinatesRepresentation::SetAxisTitles
void SetAxisTitles(vtkAlgorithmOutput *)
vtkParallelCoordinatesRepresentation::UseCurves
int UseCurves
Definition: vtkParallelCoordinatesRepresentation.h:376
vtkSelectionNode
A node in a selection tree.
Definition: vtkSelectionNode.h:68
vtkParallelCoordinatesRepresentation::InputArrayTable
vtkSmartPointer< vtkTable > InputArrayTable
Definition: vtkParallelCoordinatesRepresentation.h:389
vtkRenderedRepresentation
Definition: vtkRenderedRepresentation.h:43
vtkParallelCoordinatesRepresentation::SetAxisTitles
void SetAxisTitles(vtkStringArray *)
Set/Get the axis titles.
vtkIdType
int vtkIdType
Definition: vtkType.h:287
vtkX3D::data
@ data
Definition: vtkX3D.h:315
vtkParallelCoordinatesRepresentation::UpdateSelectionActors
virtual void UpdateSelectionActors()
todo
vtkUnsignedIntArray
dynamic, self-adjusting array of unsigned int
Definition: vtkUnsignedIntArray.h:43
vtkExtractSelectedPolyDataIds
extract a list of cells from a polydata
Definition: vtkExtractSelectedPolyDataIds.h:37
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:42
vtkParallelCoordinatesRepresentation::INPUT_TITLES
@ INPUT_TITLES
Definition: vtkParallelCoordinatesRepresentation.h:238
vtkTable
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:69
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:36
vtkParallelCoordinatesRepresentation::YMin
double YMin
Definition: vtkParallelCoordinatesRepresentation.h:372
vtkParallelCoordinatesRepresentation::FontSize
double FontSize
Definition: vtkParallelCoordinatesRepresentation.h:395
vtkParallelCoordinatesRepresentation::AxisTitles
vtkSmartPointer< vtkStringArray > AxisTitles
Definition: vtkParallelCoordinatesRepresentation.h:390
vtkX3D::range
@ range
Definition: vtkX3D.h:238
vtkParallelCoordinatesRepresentation::MaxOffsets
double * MaxOffsets
Definition: vtkParallelCoordinatesRepresentation.h:386
vtkSmartPointer< vtkPolyData >
vtkParallelCoordinatesRepresentation::SwapAxisPositions
virtual int SwapAxisPositions(int position1, int position2)
Move an axis to a particular screen position.
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()
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
vtkSelection
A node in a selection tree.
Definition: vtkSelection.h:44
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:53
vtkParallelCoordinatesRepresentation::GetXCoordinatesOfPositions
void GetXCoordinatesOfPositions(double *coords)
vtkParallelCoordinatesRepresentation::SetPlotTitle
void SetPlotTitle(const char *)
Set the title for the entire plot.
vtkParallelCoordinatesRepresentation::Xs
double * Xs
Definition: vtkParallelCoordinatesRepresentation.h:382
vtkParallelCoordinatesRepresentation::SetXCoordinateOfPosition
int SetXCoordinateOfPosition(int position, double xcoord)
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:35
vtkFieldData
represent and manipulate fields of data
Definition: vtkFieldData.h:57
vtkRenderedRepresentation.h
vtkView
The superclass for all views.
Definition: vtkView.h:61
vtkParallelCoordinatesRepresentation::PlotTitleMapper
vtkSmartPointer< vtkTextMapper > PlotTitleMapper
Definition: vtkParallelCoordinatesRepresentation.h:358
vtkParallelCoordinatesRepresentation::PlaceCurves
virtual int PlaceCurves(vtkPolyData *polyData, vtkTable *data, vtkIdTypeArray *idsToPlot)
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:49
vtkParallelCoordinatesRepresentation::LinearThreshold
vtkSmartPointer< vtkBivariateLinearTableThreshold > LinearThreshold
Definition: vtkParallelCoordinatesRepresentation.h:364
vtkX3D::position
@ position
Definition: vtkX3D.h:261
vtkX3D::port
@ port
Definition: vtkX3D.h:447
vtkParallelCoordinatesRepresentation::ApplyViewTheme
virtual void ApplyViewTheme(vtkViewTheme *theme)
Apply the theme to this view.
vtkParallelCoordinatesRepresentation::InputPorts
InputPorts
Definition: vtkParallelCoordinatesRepresentation.h:236
vtkParallelCoordinatesRepresentation::PlotMapper
vtkSmartPointer< vtkPolyDataMapper2D > PlotMapper
Definition: vtkParallelCoordinatesRepresentation.h:356
vtkCollection
create and manipulate unsorted lists of objects
Definition: vtkCollection.h:52
vtkParallelCoordinatesRepresentation::MinOffsets
double * MinOffsets
Definition: vtkParallelCoordinatesRepresentation.h:385
vtkTextMapper
2D text annotation
Definition: vtkTextMapper.h:54
vtkParallelCoordinatesRepresentation::ReallocateInternals
virtual int ReallocateInternals()
Delete and reallocate the internals, resetting to default values.
vtkParallelCoordinatesRepresentation::~vtkParallelCoordinatesRepresentation
virtual ~vtkParallelCoordinatesRepresentation()
vtkParallelCoordinatesRepresentation::New
static vtkParallelCoordinatesRepresentation * New()
vtkParallelCoordinatesRepresentation::NumberOfAxes
int NumberOfAxes
Definition: vtkParallelCoordinatesRepresentation.h:369
vtkActor
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:52
vtkParallelCoordinatesRepresentation::AddToView
virtual bool AddToView(vtkView *view)
Add/remove the props and actors to/from a view.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkParallelCoordinatesRepresentation::GetSelectionMapper
vtkPolyDataMapper2D * GetSelectionMapper(int idx)
vtkParallelCoordinatesRepresentation::GetHoverText
virtual const char * GetHoverText(vtkView *view, int x, int y)
Returns the hover text at an x,y location.
vtkIntArray
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:46
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:37
vtkCoordinate
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:71
vtkParallelCoordinatesRepresentation::PlotData
vtkSmartPointer< vtkPolyData > PlotData
Definition: vtkParallelCoordinatesRepresentation.h:355
vtkOutlineCornerSource
create wireframe outline corners around bounding box
Definition: vtkOutlineCornerSource.h:33
vtkX3D::size
@ size
Definition: vtkX3D.h:253
vtkParallelCoordinatesRepresentation::PrepareForRendering
virtual void PrepareForRendering(vtkRenderView *view)
The view will call this method before every render.
vtkParallelCoordinatesRepresentation::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkParallelCoordinatesRepresentation::PlotActor
vtkSmartPointer< vtkActor2D > PlotActor
Definition: vtkParallelCoordinatesRepresentation.h:357
vtkGetStringMacro
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
vtkParallelCoordinatesRepresentation::RemoveFromView
virtual bool RemoveFromView(vtkView *view)
vtkParallelCoordinatesRepresentation::SetPositionAndSize
int SetPositionAndSize(double *position, double *size)
Change the position of the plot.
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:48
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
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:87
vtkParallelCoordinatesRepresentation::InternalHoverText
char * InternalHoverText
Definition: vtkParallelCoordinatesRepresentation.h:401
vtkParallelCoordinatesRepresentation::BuildTime
vtkTimeStamp BuildTime
Definition: vtkParallelCoordinatesRepresentation.h:392
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkParallelCoordinatesRepresentation::RequestData
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
Subclasses should override this to connect inputs to the internal pipeline as necessary.
vtkLookupTable
map scalar values into colors via a lookup table
Definition: vtkLookupTable.h:75
vtkX3D::info
@ info
Definition: vtkX3D.h:376
vtkParallelCoordinatesRepresentation::GetPositionAndSize
int GetPositionAndSize(double *position, double *size)
vtkActor2D
a actor that draws 2D data
Definition: vtkActor2D.h:46
vtkParallelCoordinatesRepresentation::CurveResolution
int CurveResolution
Definition: vtkParallelCoordinatesRepresentation.h:375
vtkParallelCoordinatesRepresentation::SetNumberOfAxisLabels
void SetNumberOfAxisLabels(int num)
Set/Get the number of labels to display on each axis.
vtkParallelCoordinatesRepresentation::FillInputPortInformation
virtual int FillInputPortInformation(int port, vtkInformation *info)
Fill the input port information objects for this algorithm.
vtkIdTypeArray
dynamic, self-adjusting array of vtkIdType
Definition: vtkIdTypeArray.h:42
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:40
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:86
vtkAxisActor2D
Create an axis with tick marks and labels.
Definition: vtkAxisActor2D.h:73
vtkParallelCoordinatesRepresentation::FunctionBrushThreshold
double FunctionBrushThreshold
Definition: vtkParallelCoordinatesRepresentation.h:378
vtkStringArray
a vtkAbstractArray subclass for strings
Definition: vtkStringArray.h:43
vtkParallelCoordinatesRepresentation::BuildInverseSelection
virtual void BuildInverseSelection()
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:42
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:384
vtkParallelCoordinatesRepresentation::InverseSelection
vtkSmartPointer< vtkSelection > InverseSelection
Definition: vtkParallelCoordinatesRepresentation.h:363
vtkParallelCoordinatesRepresentation::PlaceAxes
int PlaceAxes()
Put the axis actors in their correct positions.
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:65
vtkPropCollection
a list of Props
Definition: vtkPropCollection.h:39
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::vtkParallelCoordinatesRepresentation
vtkParallelCoordinatesRepresentation()
vtkParallelCoordinatesRepresentation::AngleBrushThreshold
double AngleBrushThreshold
Definition: vtkParallelCoordinatesRepresentation.h:377
vtkParallelCoordinatesRepresentation::ConvertSelection
virtual vtkSelection * ConvertSelection(vtkView *view, vtkSelection *selection)
Convert the selection to a type appropriate for sharing with other representations through vtkAnnotat...
vtkParallelCoordinatesRepresentation::ComputeLinePosition
int ComputeLinePosition(double *p1, double *p2)
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.