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 
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:45
Store vtkAlgorithm input/output information.
abstract specification for Viewports
Definition: vtkViewport.h:44
a actor that draws 2D data
Definition: vtkActor2D.h:39
record modification and/or execution time
Definition: vtkTimeStamp.h:32
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
data object that represents a "selection" in VTK.
Definition: vtkSelection.h:57
dynamic, self-adjusting array of vtkIdType
int vtkIdType
Definition: vtkType.h:347
virtual bool AddToView(vtkView *vtkNotUsed(view))
Adds the representation to the view.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
Pipeline data object that contains multiple vtkArray objects.
Definition: vtkArrayData.h:49
static vtkRenderedRepresentation * New()
2D text annotation
Definition: vtkTextMapper.h:47
Proxy object to connect input/output ports.
dynamic, self-adjusting array of double
an ordered list of Props
int vtkTypeBool
Definition: vtkABI.h:69
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
Sets theme colors for a graphical view.
Definition: vtkViewTheme.h:42
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:39
The superclass for all views.
Definition: vtkView.h:54
a simple class to control print indentation
Definition: vtkIndent.h:33
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:30
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:48
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:75
vtkSmartPointer< vtkBivariateLinearTableThreshold > LinearThreshold
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:62
vtkSmartPointer< vtkPolyDataMapper2D > PlotMapper
create and manipulate ordered lists of objects
Definition: vtkCollection.h:48
A view containing a renderer.
Definition: vtkRenderView.h:58
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.
general representation of visualization data
Definition: vtkDataObject.h:58
draw vtkPolyData onto the image plane
performs line-based thresholding for vtkTable data.
represent and manipulate 3D points
Definition: vtkPoints.h:33
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:53