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 -------------------------------------------------------------------------*/
53 #ifndef vtkParallelCoordinatesRepresentation_h
54 #define vtkParallelCoordinatesRepresentation_h
55 
56 #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;
67 class vtkFieldData;
68 class vtkDataArray;
69 class vtkDataObject;
70 class vtkDoubleArray;
71 class vtkIdList;
72 class vtkIdTypeArray;
73 class vtkIntArray;
74 class vtkLookupTable;
76 class vtkPoints;
77 class vtkPolyData;
79 class vtkPropCollection;
80 class vtkSelection;
81 class vtkSelectionNode;
82 class vtkTextMapper;
83 class vtkTimeStamp;
85 class vtkViewport;
86 class vtkWindow;
87 
89 {
90 public:
93  void PrintSelf(ostream& os, vtkIndent indent);
94 
100  virtual void ApplyViewTheme(vtkViewTheme* theme);
101 
105  virtual const char* GetHoverText(vtkView* view, int x, int y);
106 
108 
111  int SetPositionAndSize(double* position, double* size);
112  int GetPositionAndSize(double* position, double* size);
114 
116 
122 
126  void SetPlotTitle(const char*);
127 
129 
132  vtkGetMacro(NumberOfAxes,int);
134 
136 
139  vtkGetMacro(NumberOfSamples,int);
141 
143 
146  void SetNumberOfAxisLabels(int num);
147  vtkGetMacro(NumberOfAxisLabels,int);
149 
151 
155  virtual int SwapAxisPositions(int position1, int position2);
156  int SetXCoordinateOfPosition(int position, double xcoord);
157  double GetXCoordinateOfPosition(int axis);
158  void GetXCoordinatesOfPositions(double* coords);
159  int GetPositionNearXCoordinate(double xcoord);
161 
163 
166  vtkSetMacro(UseCurves,int);
167  vtkGetMacro(UseCurves,int);
168  vtkBooleanMacro(UseCurves,int);
170 
172 
175  vtkSetMacro(CurveResolution,int);
176  vtkGetMacro(CurveResolution,int);
178 
180 
183  vtkGetMacro(LineOpacity,double)
184  vtkGetMacro(FontSize,double);
185  vtkGetVector3Macro(LineColor,double);
186  vtkGetVector3Macro(AxisColor,double);
187  vtkGetVector3Macro(AxisLabelColor,double);
188  vtkSetMacro(LineOpacity,double);
189  vtkSetMacro(FontSize,double);
190  vtkSetVector3Macro(LineColor,double);
191  vtkSetVector3Macro(AxisColor,double);
192  vtkSetVector3Macro(AxisLabelColor,double);
194 
196 
199  vtkSetMacro(AngleBrushThreshold,double);
200  vtkGetMacro(AngleBrushThreshold,double);
202 
204 
207  vtkSetMacro(FunctionBrushThreshold,double);
208  vtkGetMacro(FunctionBrushThreshold,double);
210 
212 
215  int GetRangeAtPosition(int position, double range[2]);
216  virtual int SetRangeAtPosition(int position, double range[2]);
218 
222  void ResetAxes();
223 
225 
229  virtual void LassoSelect(int brushClass, int brushOperator, vtkPoints* brushPoints);
230  virtual void AngleSelect(int brushClass, int brushOperator, double *p1, double *p2);
231  virtual void FunctionSelect(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 
248  virtual int RequestData(
252 
254 
257  virtual bool AddToView(vtkView* view);
258  virtual bool RemoveFromView(vtkView* view);
259  virtual void PrepareForRendering(vtkRenderView* view);
261 
266  void UpdateHoverHighlight(vtkView* view, int x, int y);
267 
271  virtual int AllocatePolyData(vtkPolyData* polyData,
272  int numLines,
273  int numPointsPerLine,
274  int numStrips,
275  int numPointsPerStrip,
276  int numQuads,
277  int numPoints,
278  int numCellScalars,
279  int numPointScalars);
280 
284  int PlaceAxes();
285 
287 
292  virtual int PlaceLines(vtkPolyData* polyData, vtkTable* data, vtkIdTypeArray* idsToPlot);
293  virtual int PlaceCurves(vtkPolyData* polyData, vtkTable* data, vtkIdTypeArray* idsToPlot);
295 
300  virtual int PlaceSelection(vtkPolyData* polyData, vtkTable* data, vtkSelectionNode* selectionNode);
301 
305  virtual int ComputeDataProperties();
306 
310  virtual int UpdatePlotProperties(vtkStringArray* inputTitles);
311 
315  virtual int ReallocateInternals();
316 
318 
321  int ComputePointPosition(double* p);
322  int ComputeLinePosition(double* p1, double* p2);
324 
326 
329  virtual void SelectRows(vtkIdType brushClass, vtkIdType brushOperator, vtkIdTypeArray* rowIds);
330  virtual vtkSelection* ConvertSelection(vtkView* view, vtkSelection* selection);
331  virtual void BuildInverseSelection();
332  virtual vtkPolyDataMapper2D* InitializePlotMapper(vtkPolyData* input, vtkActor2D* actor, bool forceStandard=false);
334 
339  void BuildDefaultSCurve(vtkDoubleArray* array, int numValues);
340 
345  virtual void LassoSelectInternal(vtkPoints* brushPoints, vtkIdTypeArray* outIds);
346 
350  virtual void UpdateSelectionActors();
351 
354 
362 
365 
366  class Internals;
367  Internals* I;
368 
372  double YMin;
373  double YMax;
374 
380 
381  // Indexed by screen position
382  double* Xs;
383  double* Mins;
384  double* Maxs;
385  double* MinOffsets;
386  double* MaxOffsets;
387 
391 
393 
394  double LineOpacity;
395  double FontSize;
396  double LineColor[3];
397  double AxisColor[3];
398  double AxisLabelColor[3];
399 
400  vtkGetStringMacro(InternalHoverText);
401  vtkSetStringMacro(InternalHoverText);
403 
404 private:
406  void operator=(const vtkParallelCoordinatesRepresentation&) VTK_DELETE_FUNCTION;
407 };
408 
409 #endif
410 
a actor that draws 2D data
Definition: vtkActor2D.h:46
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:52
Proxy object to connect input/output ports.
Pipeline data object that contains multiple vtkArray objects.
Definition: vtkArrayData.h:53
Create an axis with tick marks and labels.
performs line-based thresholding for vtkTable data.
create and manipulate unsorted lists of objects
Definition: vtkCollection.h:52
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:71
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
general representation of visualization data
Definition: vtkDataObject.h:65
dynamic, self-adjusting array of double
extract a list of cells from a polydata
represent and manipulate fields of data
Definition: vtkFieldData.h:57
list of point or cell ids
Definition: vtkIdList.h:37
dynamic, self-adjusting array of vtkIdType
a simple class to control print indentation
Definition: vtkIndent.h:40
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:46
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.
int GetPositionAndSize(double *position, double *size)
int GetPositionNearXCoordinate(double xcoord)
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 int FillInputPortInformation(int port, vtkInformation *info)
Fill the input port information objects for this algorithm.
virtual vtkPolyDataMapper2D * InitializePlotMapper(vtkPolyData *input, vtkActor2D *actor, bool forceStandard=false)
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
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.
void GetXCoordinatesOfPositions(double *coords)
int ComputePointPosition(double *p)
Compute which screen position a point belongs to (returns the left position)
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
Subclasses should override this to connect inputs to the internal pipeline as necessary.
virtual void PrepareForRendering(vtkRenderView *view)
The view will call this method before every render.
virtual vtkSelection * ConvertSelection(vtkView *view, vtkSelection *selection)
Convert the selection to a type appropriate for sharing with other representations through vtkAnnotat...
virtual bool AddToView(vtkView *view)
Add/remove the props and actors to/from a view.
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.
vtkSmartPointer< vtkPolyDataMapper2D > PlotMapper
int PlaceAxes()
Put the axis actors in their correct positions.
virtual void ApplyViewTheme(vtkViewTheme *theme)
Apply the theme to this view.
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...
void SetNumberOfAxisLabels(int num)
Set/Get the number of labels to display on each axis.
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)
virtual bool RemoveFromView(vtkView *view)
vtkPolyDataMapper2D * GetSelectionMapper(int idx)
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 SetPlotTitle(const char *)
Set the title for the entire plot.
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:40
draw vtkPolyData onto the image plane
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:86
a list of Props
A view containing a renderer.
Definition: vtkRenderView.h:62
A node in a selection tree.
A node in a selection tree.
Definition: vtkSelection.h:44
a vtkAbstractArray subclass for strings
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:69
2D text annotation
Definition: vtkTextMapper.h:54
record modification and/or execution time
Definition: vtkTimeStamp.h:36
dynamic, self-adjusting array of unsigned int
Sets theme colors for a graphical view.
Definition: vtkViewTheme.h:49
The superclass for all views.
Definition: vtkView.h:61
abstract specification for Viewports
Definition: vtkViewport.h:48
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
@ info
Definition: vtkX3D.h:376
@ port
Definition: vtkX3D.h:447
@ range
Definition: vtkX3D.h:238
@ position
Definition: vtkX3D.h:261
@ size
Definition: vtkX3D.h:253
@ data
Definition: vtkX3D.h:315
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
int vtkIdType
Definition: vtkType.h:287