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 
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 
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();
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 
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);
394 
395 private:
397  void operator=(const vtkParallelCoordinatesRepresentation&) = delete;
398 };
399 
400 #endif
a actor that draws 2D data
Definition: vtkActor2D.h:40
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:46
Proxy object to connect input/output ports.
Pipeline data object that contains multiple vtkArray objects.
Definition: vtkArrayData.h:50
Create an axis with tick marks and labels.
performs line-based thresholding for vtkTable data.
create and manipulate ordered lists of objects
Definition: vtkCollection.h:53
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:77
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:50
general representation of visualization data
Definition: vtkDataObject.h:60
dynamic, self-adjusting array of double
extract a list of cells from a polydata
represent and manipulate fields of data
Definition: vtkFieldData.h:54
list of point or cell ids
Definition: vtkIdList.h:31
dynamic, self-adjusting array of vtkIdType
a simple class to control print indentation
Definition: vtkIndent.h:34
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:40
map scalar values into colors via a lookup table
create wireframe outline corners around bounding box
Data representation that takes generic multivariate data and produces a parallel coordinates plot.
int SetPositionAndSize(double *position, double *size)
Change the position of the plot.
virtual int SwapAxisPositions(int position1, int position2)
Move an axis to a particular screen position.
virtual int AllocatePolyData(vtkPolyData *polyData, int numLines, int numPointsPerLine, int numStrips, int numPointsPerStrip, int numQuads, int numPoints, int numCellScalars, int numPointScalars)
Allocate the cells/points/scalars for a vtkPolyData.
virtual void AngleSelect(int brushClass, int brushOperator, double *p1, double *p2)
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Subclasses should override this to connect inputs to the internal pipeline as necessary.
int GetPositionAndSize(double *position, double *size)
int GetPositionNearXCoordinate(double xcoord)
virtual void LassoSelect(int brushClass, int brushOperator, vtkPoints *brushPoints)
Do a selection of the lines.
vtkSmartPointer< vtkBivariateLinearTableThreshold > LinearThreshold
void SetAxisTitles(vtkStringArray *)
Set/Get the axis titles.
virtual void SelectRows(vtkIdType brushClass, vtkIdType brushOperator, vtkIdTypeArray *rowIds)
Select a set of points using the prescribed operator (add, subtract, etc.) and class.
void SetAxisTitles(vtkAlgorithmOutput *)
virtual vtkPolyDataMapper2D * InitializePlotMapper(vtkPolyData *input, vtkActor2D *actor, bool forceStandard=false)
int GetRangeAtPosition(int position, double range[2])
Set/get the value range of the axis at a particular screen position.
void ResetAxes()
Reset the axes to their default positions and orders.
virtual int UpdatePlotProperties(vtkStringArray *inputTitles)
Set plot actor properties (line thickness, opacity, etc)
virtual int ReallocateInternals()
Delete and reallocate the internals, resetting to default values.
virtual int SetRangeAtPosition(int position, double range[2])
void GetXCoordinatesOfPositions(double *coords)
int ComputePointPosition(double *p)
Compute which screen position a point belongs to (returns the left position)
void UpdateHoverHighlight(vtkView *view, int x, int y)
This function is not actually used, but as left as a stub in case it becomes useful at some point.
vtkSelection * ConvertSelection(vtkView *view, vtkSelection *selection) override
Convert the selection to a type appropriate for sharing with other representations through vtkAnnotat...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkSmartPointer< vtkPolyDataMapper2D > PlotMapper
int PlaceAxes()
Put the axis actors in their correct positions.
virtual int PlaceSelection(vtkPolyData *polyData, vtkTable *data, vtkSelectionNode *selectionNode)
Takes the selection list (assumed to be a vtkIdTypeArray) from a vtkSelectionNode and plots lines/cur...
virtual void FunctionSelect(int brushClass, int brushOperator, double *p1, double *p2, double *q1, double *q2)
void SetNumberOfAxisLabels(int num)
Set/Get the number of labels to display on each axis.
bool AddToView(vtkView *view) override
Add/remove the props and actors to/from a view.
virtual void LassoSelectInternal(vtkPoints *brushPoints, vtkIdTypeArray *outIds)
same as public version, but assumes that the brushpoints coming in are all within two neighboring axe...
int ComputeLinePosition(double *p1, double *p2)
void ApplyViewTheme(vtkViewTheme *theme) override
Apply the theme to this view.
vtkPolyDataMapper2D * GetSelectionMapper(int idx)
virtual void RangeSelect(int brushClass, int brushOperator, double *p1, double *p2)
virtual const char * GetHoverText(vtkView *view, int x, int y)
Returns the hover text at an x,y location.
virtual void UpdateSelectionActors()
todo
static vtkParallelCoordinatesRepresentation * New()
void PrepareForRendering(vtkRenderView *view) override
The view will call this method before every render.
bool RemoveFromView(vtkView *view) override
void SetPlotTitle(const char *)
Set the title for the entire plot.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
virtual int PlaceLines(vtkPolyData *polyData, vtkTable *data, vtkIdTypeArray *idsToPlot)
Place line primitives into a vtkPolyData from the input data.
virtual int PlaceCurves(vtkPolyData *polyData, vtkTable *data, vtkIdTypeArray *idsToPlot)
virtual int ComputeDataProperties()
Compute the number of axes and their individual ranges.
void BuildDefaultSCurve(vtkDoubleArray *array, int numValues)
Build an s-curve passing through (0,0) and (1,1) with a specified number of values.
int SetXCoordinateOfPosition(int position, double xcoord)
represent and manipulate 3D points
Definition: vtkPoints.h:34
draw vtkPolyData onto the image plane
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
an ordered list of Props
A view containing a renderer.
Definition: vtkRenderView.h:59
A node in a selection tree.
data object that represents a "selection" in VTK.
Definition: vtkSelection.h:58
a vtkAbstractArray subclass for strings
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:63
2D text annotation
Definition: vtkTextMapper.h:48
record modification and/or execution time
Definition: vtkTimeStamp.h:33
dynamic, self-adjusting array of unsigned int
Sets theme colors for a graphical view.
Definition: vtkViewTheme.h:43
The superclass for all views.
Definition: vtkView.h:55
abstract specification for Viewports
Definition: vtkViewport.h:45
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
@ info
Definition: vtkX3D.h:382
@ port
Definition: vtkX3D.h:453
@ range
Definition: vtkX3D.h:244
@ position
Definition: vtkX3D.h:267
@ size
Definition: vtkX3D.h:259
@ data
Definition: vtkX3D.h:321
int vtkTypeBool
Definition: vtkABI.h:69
int vtkIdType
Definition: vtkType.h:338