VTK
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 -------------------------------------------------------------------------*/
49 #ifndef __vtkParallelCoordinatesRepresentation_h
50 #define __vtkParallelCoordinatesRepresentation_h
51 
52 #include "vtkViewsInfovisModule.h" // For export macro
54 
55 class vtkActor;
56 class vtkActor2D;
57 class vtkArrayData;
58 class vtkAxisActor2D;
59 class vtkBivariateLinearTableThreshold;
60 class vtkCollection;
61 class vtkCoordinate;
62 class vtkExtractSelectedPolyDataIds;
63 class vtkFieldData;
64 class vtkDataArray;
65 class vtkDataObject;
66 class vtkDoubleArray;
67 class vtkIdList;
68 class vtkIdTypeArray;
69 class vtkIntArray;
70 class vtkLookupTable;
71 class vtkOutlineCornerSource;
72 class vtkPoints;
73 class vtkPolyData;
74 class vtkPolyDataMapper2D;
75 class vtkPropCollection;
76 class vtkSelection;
77 class vtkSelectionNode;
78 class vtkTextMapper;
79 class vtkTimeStamp;
80 class vtkUnsignedIntArray;
81 class vtkViewport;
82 class vtkWindow;
83 
85 {
86 public:
89  void PrintSelf(ostream& os, vtkIndent indent);
90 
94  virtual void ApplyViewTheme(vtkViewTheme* theme);
95 
97  virtual const char* GetHoverText(vtkView* view, int x, int y);
98 
100 
101  int SetPositionAndSize(double* position, double* size);
102  int GetPositionAndSize(double* position, double* size);
104 
106 
107  void SetAxisTitles(vtkStringArray*);
108  void SetAxisTitles(vtkAlgorithmOutput*);
110 
112  void SetPlotTitle(const char*);
113 
115 
116  vtkGetMacro(NumberOfAxes,int);
118 
120 
121  vtkGetMacro(NumberOfSamples,int);
123 
125 
126  void SetNumberOfAxisLabels(int num);
127  vtkGetMacro(NumberOfAxisLabels,int);
129 
131 
133  virtual int SwapAxisPositions(int position1, int position2);
134  int SetXCoordinateOfPosition(int position, double xcoord);
135  double GetXCoordinateOfPosition(int axis);
136  void GetXCoordinatesOfPositions(double* coords);
137  int GetPositionNearXCoordinate(double xcoord);
139 
141 
142  vtkSetMacro(UseCurves,int);
143  vtkGetMacro(UseCurves,int);
144  vtkBooleanMacro(UseCurves,int);
146 
148 
149  vtkSetMacro(CurveResolution,int);
150  vtkGetMacro(CurveResolution,int);
152 
154 
155  vtkGetMacro(LineOpacity,double)
156  vtkGetMacro(FontSize,double);
157  vtkGetVector3Macro(LineColor,double);
158  vtkGetVector3Macro(AxisColor,double);
159  vtkGetVector3Macro(AxisLabelColor,double);
160  vtkSetMacro(LineOpacity,double);
161  vtkSetMacro(FontSize,double);
162  vtkSetVector3Macro(LineColor,double);
163  vtkSetVector3Macro(AxisColor,double);
164  vtkSetVector3Macro(AxisLabelColor,double);
166 
168 
170  vtkSetMacro(AngleBrushThreshold,double);
171  vtkGetMacro(AngleBrushThreshold,double);
173 
175 
177  vtkSetMacro(FunctionBrushThreshold,double);
178  vtkGetMacro(FunctionBrushThreshold,double);
180 
182 
183  int GetRangeAtPosition(int position, double range[2]);
184  virtual int SetRangeAtPosition(int position, double range[2]);
186 
188  void ResetAxes();
189 
191 
193  virtual void LassoSelect(int brushClass, int brushOperator, vtkPoints* brushPoints);
194  virtual void AngleSelect(int brushClass, int brushOperator, double *p1, double *p2);
195  virtual void FunctionSelect(int brushClass, int brushOperator, double *p1, double *p2, double *q1, double *q2);
196  virtual void RangeSelect(int brushClass, int brushOperator, double *p1, double *p2);
198 
199 //BTX
201  {
202  INPUT_DATA=0,
204  NUM_INPUT_PORTS
205  };
206 //ETX
207 
208 protected:
211 
212  virtual int FillInputPortInformation(int port, vtkInformation* info);
213 
214  virtual int RequestData(
215  vtkInformation*,
216  vtkInformationVector**,
217  vtkInformationVector*);
218 
220 
221  virtual bool AddToView(vtkView* view);
222  virtual bool RemoveFromView(vtkView* view);
223  virtual void PrepareForRendering(vtkRenderView* view);
225 
228  void UpdateHoverHighlight(vtkView* view, int x, int y);
229 
231 
232  virtual int AllocatePolyData(vtkPolyData* polyData,
233  int numLines,
234  int numPointsPerLine,
235  int numStrips,
236  int numPointsPerStrip,
237  int numQuads,
238  int numPoints,
239  int numCellScalars,
240  int numPointScalars);
242 
244  int PlaceAxes();
245 
247 
250  virtual int PlaceLines(vtkPolyData* polyData, vtkTable* data, vtkIdTypeArray* idsToPlot);
251  virtual int PlaceCurves(vtkPolyData* polyData, vtkTable* data, vtkIdTypeArray* idsToPlot);
253 
257  virtual int PlaceSelection(vtkPolyData* polyData, vtkTable* data, vtkSelectionNode* selectionNode);
258 
260  virtual int ComputeDataProperties();
261 
263  virtual int UpdatePlotProperties(vtkStringArray* inputTitles);
264 
266  virtual int ReallocateInternals();
267 
269 
271  int ComputePointPosition(double* p);
272  int ComputeLinePosition(double* p1, double* p2);
274 
276 
278  virtual void SelectRows(vtkIdType brushClass, vtkIdType brushOperator, vtkIdTypeArray* rowIds);
279  virtual vtkSelection* ConvertSelection(vtkView* view, vtkSelection* selection);
280  virtual void BuildInverseSelection();
281  virtual vtkPolyDataMapper2D* InitializePlotMapper(vtkPolyData* input, vtkActor2D* actor, bool forceStandard=false);
283 
287  void BuildDefaultSCurve(vtkDoubleArray* array, int numValues);
288 
291  virtual void LassoSelectInternal(vtkPoints* brushPoints, vtkIdTypeArray* outIds);
292 
294  virtual void UpdateSelectionActors();
295 
296  vtkPolyDataMapper2D* GetSelectionMapper(int idx);
297  int GetNumberOfSelections();
298 
299 
300  //BTX
301  vtkSmartPointer<vtkPolyData> PlotData;
302  vtkSmartPointer<vtkPolyDataMapper2D> PlotMapper;
303  vtkSmartPointer<vtkActor2D> PlotActor;
304  vtkSmartPointer<vtkTextMapper> PlotTitleMapper;
305  vtkSmartPointer<vtkActor2D> PlotTitleActor;
306  vtkSmartPointer<vtkTextMapper> FunctionTextMapper;
307  vtkSmartPointer<vtkActor2D> FunctionTextActor;
308 
309  vtkSmartPointer<vtkSelection> InverseSelection;
310  vtkSmartPointer<vtkBivariateLinearTableThreshold> LinearThreshold;
311 
312  class Internals;
313  Internals* I;
314  //ETX
315 
319  double YMin;
320  double YMax;
321 
327 
328  // Indexed by screen position
329  double* Xs;
330  double* Mins;
331  double* Maxs;
332  double* MinOffsets;
333  double* MaxOffsets;
334 
335  //BTX
336  vtkSmartPointer<vtkAxisActor2D>* Axes;
337  vtkSmartPointer<vtkTable> InputArrayTable;
338  vtkSmartPointer<vtkStringArray> AxisTitles;
339  //ETX
340 
341  vtkTimeStamp BuildTime;
342 
343  double LineOpacity;
344  double FontSize;
345  double LineColor[3];
346  double AxisColor[3];
347  double AxisLabelColor[3];
348 
349  vtkGetStringMacro(InternalHoverText);
350  vtkSetStringMacro(InternalHoverText);
351  char* InternalHoverText;
352 
353 private:
355  void operator=(const vtkParallelCoordinatesRepresentation&); // Not implemented
356 };
357 
358 #endif
359 
virtual void ApplyViewTheme(vtkViewTheme *vtkNotUsed(theme))
virtual vtkSelection * ConvertSelection(vtkView *view, vtkSelection *selection)
void PrintSelf(ostream &os, vtkIndent indent)
virtual bool AddToView(vtkView *vtkNotUsed(view))
static vtkRenderedRepresentation * New()
Sets theme colors for a graphical view.
Definition: vtkViewTheme.h:47
The superclass for all views.
Definition: vtkView.h:62
virtual bool RemoveFromView(vtkView *vtkNotUsed(view))
vtkUnicodeString GetHoverText(vtkView *view, vtkProp *prop, vtkIdType cell)
virtual void PrepareForRendering(vtkRenderView *view)
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
vtkSmartPointer< vtkBivariateLinearTableThreshold > LinearThreshold
vtkSmartPointer< vtkPolyDataMapper2D > PlotMapper
A view containing a renderer.
Definition: vtkRenderView.h:63
Data representation that takes generic multivariate data and produces a parallel coordinates plot...