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
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:338
virtual bool AddToView(vtkView *vtkNotUsed(view))
Adds the representation to the view.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:84
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:37
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:63
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:49
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:76
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:52
A view containing a renderer.
Definition: vtkRenderView.h:64
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:59
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