VTK  9.1.0
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 std::string GetHoverString(vtkView* view, int x, int y);
103  VTK_DEPRECATED_IN_9_1_0("Use std::string GetHoverString(vtkView* view, int x, int y)")
104  virtual const char* GetHoverText(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 
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();
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 
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);
396 
397 private:
399  void operator=(const vtkParallelCoordinatesRepresentation&) = delete;
400 };
401 
402 #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:49
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:55
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.
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.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Subclasses should override this to connect inputs to the internal pipeline as necessary.
vtkSmartPointer< vtkBivariateLinearTableThreshold > LinearThreshold
virtual void SelectRows(vtkIdType brushClass, vtkIdType brushOperator, vtkIdTypeArray *rowIds)
Select a set of points using the prescribed operator (add, subtract, etc.) and class.
virtual vtkPolyDataMapper2D * InitializePlotMapper(vtkPolyData *input, vtkActor2D *actor, bool forceStandard=false)
Select a set of points using the prescribed operator (add, subtract, etc.) and class.
virtual void BuildInverseSelection()
Select a set of points using the prescribed operator (add, subtract, etc.) and class.
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.
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
Select a set of points using the prescribed operator (add, subtract, etc.) and class.
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...
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)
Compute which screen position a point belongs to (returns the left position)
void ApplyViewTheme(vtkViewTheme *theme) override
Apply the theme to this view.
vtkPolyDataMapper2D * GetSelectionMapper(int idx)
virtual void UpdateSelectionActors()
todo
static vtkParallelCoordinatesRepresentation * New()
void PrepareForRendering(vtkRenderView *view) override
Add/remove the props and actors to/from a view.
bool RemoveFromView(vtkView *view) override
Add/remove the props and actors to/from a view.
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 std::string GetHoverString(vtkView *view, int x, int y)
Returns the hover text at an x,y location.
virtual int PlaceCurves(vtkPolyData *polyData, vtkTable *data, vtkIdTypeArray *idsToPlot)
Place line primitives into a vtkPolyData from the input data.
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.
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:86
an ordered list of Props
A view containing a renderer.
Definition: vtkRenderView.h:65
a node in a vtkSelection the defines the selection criteria.
data object that represents a "selection" in VTK.
Definition: vtkSelection.h:54
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:64
abstract specification for Viewports
Definition: vtkViewport.h:47
window superclass for vtkRenderWindow
Definition: vtkWindow.h:39
@ 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
@ string
Definition: vtkX3D.h:496
int vtkTypeBool
Definition: vtkABI.h:69
#define VTK_DEPRECATED_IN_9_1_0(reason)
int vtkIdType
Definition: vtkType.h:332