VTK  9.0.1
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 
54 #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(
229  int brushClass, int brushOperator, double* p1, double* p2, double* q1, double* q2);
230  virtual void RangeSelect(int brushClass, int brushOperator, double* p1, double* p2);
232 
234  {
235  INPUT_DATA = 0,
237  NUM_INPUT_PORTS
238  };
239 
240 protected:
243 
244  int FillInputPortInformation(int port, vtkInformation* info) override;
245 
247 
249 
252  bool AddToView(vtkView* view) override;
253  bool RemoveFromView(vtkView* view) override;
254  void PrepareForRendering(vtkRenderView* view) override;
256 
261  void UpdateHoverHighlight(vtkView* view, int x, int y);
262 
266  virtual int AllocatePolyData(vtkPolyData* polyData, int numLines, int numPointsPerLine,
267  int numStrips, int numPointsPerStrip, int numQuads, int numPoints, int numCellScalars,
268  int numPointScalars);
269 
273  int PlaceAxes();
274 
276 
281  virtual int PlaceLines(vtkPolyData* polyData, vtkTable* data, vtkIdTypeArray* idsToPlot);
282  virtual int PlaceCurves(vtkPolyData* polyData, vtkTable* data, vtkIdTypeArray* idsToPlot);
284 
289  virtual int PlaceSelection(
290  vtkPolyData* polyData, vtkTable* data, vtkSelectionNode* selectionNode);
291 
295  virtual int ComputeDataProperties();
296 
300  virtual int UpdatePlotProperties(vtkStringArray* inputTitles);
301 
305  virtual int ReallocateInternals();
306 
308 
311  int ComputePointPosition(double* p);
312  int ComputeLinePosition(double* p1, double* p2);
314 
316 
319  virtual void SelectRows(vtkIdType brushClass, vtkIdType brushOperator, vtkIdTypeArray* rowIds);
320  vtkSelection* ConvertSelection(vtkView* view, vtkSelection* selection) override;
321  virtual void BuildInverseSelection();
322  virtual vtkPolyDataMapper2D* InitializePlotMapper(
323  vtkPolyData* input, vtkActor2D* actor, bool forceStandard = false);
325 
330  void BuildDefaultSCurve(vtkDoubleArray* array, int numValues);
331 
336  virtual void LassoSelectInternal(vtkPoints* brushPoints, vtkIdTypeArray* outIds);
337 
341  virtual void UpdateSelectionActors();
342 
343  vtkPolyDataMapper2D* GetSelectionMapper(int idx);
344  int GetNumberOfSelections();
345 
353 
356 
357  class Internals;
358  Internals* I;
359 
363  double YMin;
364  double YMax;
365 
371 
372  // Indexed by screen position
373  double* Xs;
374  double* Mins;
375  double* Maxs;
376  double* MinOffsets;
377  double* MaxOffsets;
378 
382 
384 
385  double LineOpacity;
386  double FontSize;
387  double LineColor[3];
388  double AxisColor[3];
389  double AxisLabelColor[3];
390 
391  vtkGetStringMacro(InternalHoverText);
392  vtkSetStringMacro(InternalHoverText);
393  char* InternalHoverText;
394 
395 private:
397  void operator=(const vtkParallelCoordinatesRepresentation&) = delete;
398 };
399 
400 #endif
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:33
vtkParallelCoordinatesRepresentation::NumberOfSamples
int NumberOfSamples
Definition: vtkParallelCoordinatesRepresentation.h:362
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:44
vtkDataRepresentation::AddToView
virtual bool AddToView(vtkView *vtkNotUsed(view))
Adds the representation to the view.
Definition: vtkDataRepresentation.h:306
vtkRenderView
A view containing a renderer.
Definition: vtkRenderView.h:64
vtkDataRepresentation::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Subclasses should override this to connect inputs to the internal pipeline as necessary.
Definition: vtkDataRepresentation.h:260
vtkSelectionNode
A node in a selection tree. Used to store selection results.
Definition: vtkSelectionNode.h:61
vtkParallelCoordinatesRepresentation::InputArrayTable
vtkSmartPointer< vtkTable > InputArrayTable
Definition: vtkParallelCoordinatesRepresentation.h:380
vtkRenderedRepresentation
Definition: vtkRenderedRepresentation.h:42
vtkIdType
int vtkIdType
Definition: vtkType.h:338
vtkX3D::data
@ data
Definition: vtkX3D.h:321
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
@ INPUT_TITLES
Definition: vtkParallelCoordinatesRepresentation.h:236
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:363
vtkParallelCoordinatesRepresentation::FontSize
double FontSize
Definition: vtkParallelCoordinatesRepresentation.h:386
vtkParallelCoordinatesRepresentation::UseCurves
vtkTypeBool UseCurves
Definition: vtkParallelCoordinatesRepresentation.h:367
vtkParallelCoordinatesRepresentation::AxisTitles
vtkSmartPointer< vtkStringArray > AxisTitles
Definition: vtkParallelCoordinatesRepresentation.h:381
vtkX3D::range
@ range
Definition: vtkX3D.h:244
vtkParallelCoordinatesRepresentation::MaxOffsets
double * MaxOffsets
Definition: vtkParallelCoordinatesRepresentation.h:377
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:49
vtkSelection
data object that represents a "selection" in VTK.
Definition: vtkSelection.h:57
vtkParallelCoordinatesRepresentation::FunctionTextActor
vtkSmartPointer< vtkActor2D > FunctionTextActor
Definition: vtkParallelCoordinatesRepresentation.h:352
vtkParallelCoordinatesRepresentation::FunctionTextMapper
vtkSmartPointer< vtkTextMapper > FunctionTextMapper
Definition: vtkParallelCoordinatesRepresentation.h:351
vtkArrayData
Pipeline data object that contains multiple vtkArray objects.
Definition: vtkArrayData.h:49
vtkParallelCoordinatesRepresentation::Xs
double * Xs
Definition: vtkParallelCoordinatesRepresentation.h:373
vtkDataRepresentation::RemoveFromView
virtual bool RemoveFromView(vtkView *vtkNotUsed(view))
Removes the representation to the view.
Definition: vtkDataRepresentation.h:313
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
vtkFieldData
represent and manipulate fields of data
Definition: vtkFieldData.h:53
vtkRenderedRepresentation.h
vtkView
The superclass for all views.
Definition: vtkView.h:63
vtkParallelCoordinatesRepresentation::PlotTitleMapper
vtkSmartPointer< vtkTextMapper > PlotTitleMapper
Definition: vtkParallelCoordinatesRepresentation.h:349
vtkViewTheme
Sets theme colors for a graphical view.
Definition: vtkViewTheme.h:42
vtkParallelCoordinatesRepresentation::LinearThreshold
vtkSmartPointer< vtkBivariateLinearTableThreshold > LinearThreshold
Definition: vtkParallelCoordinatesRepresentation.h:355
vtkX3D::position
@ position
Definition: vtkX3D.h:267
vtkX3D::port
@ port
Definition: vtkX3D.h:453
vtkParallelCoordinatesRepresentation::InputPorts
InputPorts
Definition: vtkParallelCoordinatesRepresentation.h:233
vtkParallelCoordinatesRepresentation::PlotMapper
vtkSmartPointer< vtkPolyDataMapper2D > PlotMapper
Definition: vtkParallelCoordinatesRepresentation.h:347
vtkCollection
create and manipulate ordered lists of objects
Definition: vtkCollection.h:52
vtkParallelCoordinatesRepresentation::MinOffsets
double * MinOffsets
Definition: vtkParallelCoordinatesRepresentation.h:376
vtkTextMapper
2D text annotation
Definition: vtkTextMapper.h:47
vtkParallelCoordinatesRepresentation::NumberOfAxes
int NumberOfAxes
Definition: vtkParallelCoordinatesRepresentation.h:360
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:76
vtkParallelCoordinatesRepresentation::PlotData
vtkSmartPointer< vtkPolyData > PlotData
Definition: vtkParallelCoordinatesRepresentation.h:346
vtkOutlineCornerSource
create wireframe outline corners around bounding box
Definition: vtkOutlineCornerSource.h:29
vtkX3D::size
@ size
Definition: vtkX3D.h:259
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:348
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:385
vtkParallelCoordinatesRepresentation::PlotTitleActor
vtkSmartPointer< vtkActor2D > PlotTitleActor
Definition: vtkParallelCoordinatesRepresentation.h:350
vtkParallelCoordinatesRepresentation::YMax
double YMax
Definition: vtkParallelCoordinatesRepresentation.h:364
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:73
vtkParallelCoordinatesRepresentation::InternalHoverText
char * InternalHoverText
Definition: vtkParallelCoordinatesRepresentation.h:392
vtkParallelCoordinatesRepresentation::BuildTime
vtkTimeStamp BuildTime
Definition: vtkParallelCoordinatesRepresentation.h:383
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
@ info
Definition: vtkX3D.h:382
vtkActor2D
a actor that draws 2D data
Definition: vtkActor2D.h:39
vtkParallelCoordinatesRepresentation::CurveResolution
int CurveResolution
Definition: vtkParallelCoordinatesRepresentation.h:366
vtkIdTypeArray
dynamic, self-adjusting array of vtkIdType
Definition: vtkIdTypeArray.h:35
vtkParallelCoordinatesRepresentation::Axes
vtkSmartPointer< vtkAxisActor2D > * Axes
Definition: vtkParallelCoordinatesRepresentation.h:379
vtkParallelCoordinatesRepresentation::SwapThreshold
double SwapThreshold
Definition: vtkParallelCoordinatesRepresentation.h:370
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:84
vtkAxisActor2D
Create an axis with tick marks and labels.
Definition: vtkAxisActor2D.h:69
vtkParallelCoordinatesRepresentation::FunctionBrushThreshold
double FunctionBrushThreshold
Definition: vtkParallelCoordinatesRepresentation.h:369
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:100
vtkParallelCoordinatesRepresentation::Maxs
double * Maxs
Definition: vtkParallelCoordinatesRepresentation.h:375
vtkParallelCoordinatesRepresentation::InverseSelection
vtkSmartPointer< vtkSelection > InverseSelection
Definition: vtkParallelCoordinatesRepresentation.h:354
vtkRenderedRepresentation::New
static vtkRenderedRepresentation * New()
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:59
vtkPropCollection
an ordered list of Props
Definition: vtkPropCollection.h:35
vtkParallelCoordinatesRepresentation::NumberOfAxisLabels
int NumberOfAxisLabels
Definition: vtkParallelCoordinatesRepresentation.h:361
vtkParallelCoordinatesRepresentation::I
Internals * I
Definition: vtkParallelCoordinatesRepresentation.h:357
vtkParallelCoordinatesRepresentation::Mins
double * Mins
Definition: vtkParallelCoordinatesRepresentation.h:374
vtkParallelCoordinatesRepresentation::AngleBrushThreshold
double AngleBrushThreshold
Definition: vtkParallelCoordinatesRepresentation.h:368
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69