VTK  9.2.6
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 
57 #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;
66 class vtkFieldData;
67 class vtkDataArray;
68 class vtkDataObject;
69 class vtkDoubleArray;
70 class vtkIdList;
71 class vtkIdTypeArray;
72 class vtkIntArray;
73 class vtkLookupTable;
75 class vtkPoints;
76 class vtkPolyData;
78 class vtkPropCollection;
79 class vtkSelection;
80 class vtkSelectionNode;
81 class vtkTextMapper;
82 class vtkTimeStamp;
84 class vtkViewport;
85 class vtkWindow;
86 
88 {
89 public:
92  void PrintSelf(ostream& os, vtkIndent indent) override;
93 
99  void ApplyViewTheme(vtkViewTheme* theme) override;
100 
104  virtual std::string GetHoverString(vtkView* view, int x, int y);
105 
107 
110  int SetPositionAndSize(double* position, double* size);
111  int GetPositionAndSize(double* position, double* size);
113 
115 
118  void SetAxisTitles(vtkStringArray*);
119  void SetAxisTitles(vtkAlgorithmOutput*);
121 
125  void SetPlotTitle(const char*);
126 
128 
131  vtkGetMacro(NumberOfAxes, int);
133 
135 
138  vtkGetMacro(NumberOfSamples, int);
140 
142 
145  void SetNumberOfAxisLabels(int num);
146  vtkGetMacro(NumberOfAxisLabels, int);
148 
150 
154  virtual int SwapAxisPositions(int position1, int position2);
155  int SetXCoordinateOfPosition(int position, double xcoord);
156  double GetXCoordinateOfPosition(int axis);
157  void GetXCoordinatesOfPositions(double* coords);
158  int GetPositionNearXCoordinate(double xcoord);
160 
162 
165  vtkSetMacro(UseCurves, vtkTypeBool);
166  vtkGetMacro(UseCurves, vtkTypeBool);
167  vtkBooleanMacro(UseCurves, vtkTypeBool);
169 
171 
174  vtkSetMacro(CurveResolution, int);
175  vtkGetMacro(CurveResolution, int);
177 
179 
182  vtkGetMacro(LineOpacity, double);
183  vtkGetMacro(FontSize, double);
184  vtkGetVector3Macro(LineColor, double);
185  vtkGetVector3Macro(AxisColor, double);
186  vtkGetVector3Macro(AxisLabelColor, double);
187  vtkSetMacro(LineOpacity, double);
188  vtkSetMacro(FontSize, double);
189  vtkSetVector3Macro(LineColor, double);
190  vtkSetVector3Macro(AxisColor, double);
191  vtkSetVector3Macro(AxisLabelColor, double);
193 
195 
198  vtkSetMacro(AngleBrushThreshold, double);
199  vtkGetMacro(AngleBrushThreshold, double);
201 
203 
206  vtkSetMacro(FunctionBrushThreshold, double);
207  vtkGetMacro(FunctionBrushThreshold, double);
209 
211 
214  int GetRangeAtPosition(int position, double range[2]);
215  virtual int SetRangeAtPosition(int position, double range[2]);
217 
221  void ResetAxes();
222 
224 
228  virtual void LassoSelect(int brushClass, int brushOperator, vtkPoints* brushPoints);
229  virtual void AngleSelect(int brushClass, int brushOperator, double* p1, double* p2);
230  virtual void FunctionSelect(
231  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 
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, int numLines, int numPointsPerLine,
269  int numStrips, int numPointsPerStrip, int numQuads, int numPoints, int numCellScalars,
270  int numPointScalars);
271 
275  int PlaceAxes();
276 
278 
283  virtual int PlaceLines(vtkPolyData* polyData, vtkTable* data, vtkIdTypeArray* idsToPlot);
284  virtual int PlaceCurves(vtkPolyData* polyData, vtkTable* data, vtkIdTypeArray* idsToPlot);
286 
291  virtual int PlaceSelection(
292  vtkPolyData* polyData, vtkTable* data, vtkSelectionNode* selectionNode);
293 
297  virtual int ComputeDataProperties();
298 
302  virtual int UpdatePlotProperties(vtkStringArray* inputTitles);
303 
307  virtual int ReallocateInternals();
308 
310 
313  int ComputePointPosition(double* p);
314  int ComputeLinePosition(double* p1, double* p2);
316 
318 
321  virtual void SelectRows(vtkIdType brushClass, vtkIdType brushOperator, vtkIdTypeArray* rowIds);
322  vtkSelection* ConvertSelection(vtkView* view, vtkSelection* selection) override;
323  virtual void BuildInverseSelection();
324  virtual vtkPolyDataMapper2D* InitializePlotMapper(
325  vtkPolyData* input, vtkActor2D* actor, bool forceStandard = false);
327 
332  void BuildDefaultSCurve(vtkDoubleArray* array, int numValues);
333 
338  virtual void LassoSelectInternal(vtkPoints* brushPoints, vtkIdTypeArray* outIds);
339 
343  virtual void UpdateSelectionActors();
344 
345  vtkPolyDataMapper2D* GetSelectionMapper(int idx);
346  int GetNumberOfSelections();
347 
355 
358 
359  class Internals;
360  Internals* I;
361 
365  double YMin;
366  double YMax;
367 
373 
374  // Indexed by screen position
375  double* Xs;
376  double* Mins;
377  double* Maxs;
378  double* MinOffsets;
379  double* MaxOffsets;
380 
384 
386 
387  double LineOpacity;
388  double FontSize;
389  double LineColor[3];
390  double AxisColor[3];
391  double AxisLabelColor[3];
392 
393  vtkGetStringMacro(InternalHoverText);
394  vtkSetStringMacro(InternalHoverText);
395  char* InternalHoverText;
396 
397 private:
399  void operator=(const vtkParallelCoordinatesRepresentation&) = delete;
400 };
401 
402 #endif
a node in a vtkSelection the defines the selection criteria.
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:55
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
std::string GetHoverString(vtkView *view, vtkProp *prop, vtkIdType cell)
Obtains the hover text for a particular prop and cell.
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:59
dynamic, self-adjusting array of vtkIdType
int vtkIdType
Definition: vtkType.h:332
virtual bool AddToView(vtkView *vtkNotUsed(view))
Adds the representation to the view.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:90
Pipeline data object that contains multiple vtkArray objects.
Definition: vtkArrayData.h:51
static vtkRenderedRepresentation * New()
2D text annotation
Definition: vtkTextMapper.h:50
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:38
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:63
a simple class to control print indentation
Definition: vtkIndent.h:39
virtual bool RemoveFromView(vtkView *vtkNotUsed(view))
Removes the representation to the view.
virtual void PrepareForRendering(vtkRenderView *view)
The view will call this method before every render.
list of point or cell ids
Definition: vtkIdList.h:33
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
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:79
vtkSmartPointer< vtkBivariateLinearTableThreshold > LinearThreshold
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:73
vtkSmartPointer< vtkPolyDataMapper2D > PlotMapper
create and manipulate ordered lists of objects
Definition: vtkCollection.h:55
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:65
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...
represent and manipulate fields of data
Definition: vtkFieldData.h:62