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,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 
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 
A node in a selection tree.
virtual void ApplyViewTheme(vtkViewTheme *vtkNotUsed(theme))
Apply a theme to this representation.
virtual vtkSelection * ConvertSelection(vtkView *view, vtkSelection *selection)
Convert the selection to a type appropriate for sharing with other representations through vtkAnnotat...
dynamic, self-adjusting array of unsigned int
create wireframe outline corners around bounding box
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:51
Store vtkAlgorithm input/output information.
abstract specification for Viewports
Definition: vtkViewport.h:47
a actor that draws 2D data
Definition: vtkActor2D.h:45
record modification and/or execution time
Definition: vtkTimeStamp.h:35
map scalar values into colors via a lookup table
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Subclasses should override this to connect inputs to the internal pipeline as necessary.
Create an axis with tick marks and labels.
a vtkAbstractArray subclass for strings
A node in a selection tree.
Definition: vtkSelection.h:43
dynamic, self-adjusting array of vtkIdType
int vtkIdType
Definition: vtkType.h:345
virtual bool AddToView(vtkView *vtkNotUsed(view))
Adds the representation to the view.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
Pipeline data object that contains multiple vtkArray objects.
Definition: vtkArrayData.h:52
static vtkRenderedRepresentation * New()
2D text annotation
Definition: vtkTextMapper.h:53
Proxy object to connect input/output ports.
dynamic, self-adjusting array of double
an ordered list of Props
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
Sets theme colors for a graphical view.
Definition: vtkViewTheme.h:48
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:45
The superclass for all views.
Definition: vtkView.h:60
a simple class to control print indentation
Definition: vtkIndent.h:39
virtual bool RemoveFromView(vtkView *vtkNotUsed(view))
Removes the representation to the view.
vtkUnicodeString GetHoverText(vtkView *view, vtkProp *prop, vtkIdType cell)
Obtains the hover text for a particular prop and cell.
virtual void PrepareForRendering(vtkRenderView *view)
The view will call this method before every render.
list of point or cell ids
Definition: vtkIdList.h:36
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:78
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
vtkSmartPointer< vtkBivariateLinearTableThreshold > LinearThreshold
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:68
vtkSmartPointer< vtkPolyDataMapper2D > PlotMapper
create and manipulate ordered lists of objects
Definition: vtkCollection.h:51
A view containing a renderer.
Definition: vtkRenderView.h:61
Store zero or more vtkInformation instances.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
general representation of visualization data
Definition: vtkDataObject.h:64
draw vtkPolyData onto the image plane
performs line-based thresholding for vtkTable data.
represent and manipulate 3D points
Definition: vtkPoints.h:39
Data representation that takes generic multivariate data and produces a parallel coordinates plot.
extract a list of cells from a polydata
represent and manipulate fields of data
Definition: vtkFieldData.h:56