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-------------------------------------------------------------------------*/
72#ifndef vtkParallelCoordinatesRepresentation_h
73#define vtkParallelCoordinatesRepresentation_h
74
76#include "vtkViewsInfovisModule.h" // For export macro
77
78class vtkActor;
79class vtkActor2D;
80class vtkArrayData;
81class vtkAxisActor2D;
83class vtkCollection;
84class vtkCoordinate;
85class vtkFieldData;
86class vtkDataArray;
87class vtkDataObject;
88class vtkDoubleArray;
89class vtkIdList;
90class vtkIdTypeArray;
91class vtkIntArray;
92class vtkLookupTable;
94class vtkPoints;
95class vtkPolyData;
98class vtkSelection;
100class vtkTextMapper;
101class vtkTimeStamp;
103class vtkViewport;
104class vtkWindow;
105
107{
108public:
111 void PrintSelf(ostream& os, vtkIndent indent) override;
112
118 void ApplyViewTheme(vtkViewTheme* theme) override;
119
123 virtual std::string GetHoverString(vtkView* view, int x, int y);
124
126
129 int SetPositionAndSize(double* position, double* size);
130 int GetPositionAndSize(double* position, double* size);
132
134
140
144 void SetPlotTitle(const char*);
145
147
150 vtkGetMacro(NumberOfAxes, int);
152
154
157 vtkGetMacro(NumberOfSamples, int);
159
161
165 vtkGetMacro(NumberOfAxisLabels, int);
167
169
173 virtual int SwapAxisPositions(int position1, int position2);
174 int SetXCoordinateOfPosition(int position, double xcoord);
175 double GetXCoordinateOfPosition(int axis);
176 void GetXCoordinatesOfPositions(double* coords);
177 int GetPositionNearXCoordinate(double xcoord);
179
181
184 vtkSetMacro(UseCurves, vtkTypeBool);
185 vtkGetMacro(UseCurves, vtkTypeBool);
186 vtkBooleanMacro(UseCurves, vtkTypeBool);
188
190
193 vtkSetMacro(CurveResolution, int);
194 vtkGetMacro(CurveResolution, int);
196
198
201 vtkGetMacro(LineOpacity, double);
202 vtkGetMacro(FontSize, double);
203 vtkGetVector3Macro(LineColor, double);
204 vtkGetVector3Macro(AxisColor, double);
205 vtkGetVector3Macro(AxisLabelColor, double);
206 vtkSetMacro(LineOpacity, double);
207 vtkSetMacro(FontSize, double);
208 vtkSetVector3Macro(LineColor, double);
209 vtkSetVector3Macro(AxisColor, double);
210 vtkSetVector3Macro(AxisLabelColor, double);
212
214
217 vtkSetMacro(AngleBrushThreshold, double);
218 vtkGetMacro(AngleBrushThreshold, double);
220
222
225 vtkSetMacro(FunctionBrushThreshold, double);
226 vtkGetMacro(FunctionBrushThreshold, double);
228
230
233 int GetRangeAtPosition(int position, double range[2]);
234 virtual int SetRangeAtPosition(int position, double range[2]);
236
240 void ResetAxes();
241
243
247 virtual void LassoSelect(int brushClass, int brushOperator, vtkPoints* brushPoints);
248 virtual void AngleSelect(int brushClass, int brushOperator, double* p1, double* p2);
249 virtual void FunctionSelect(
250 int brushClass, int brushOperator, double* p1, double* p2, double* q1, double* q2);
251 virtual void RangeSelect(int brushClass, int brushOperator, double* p1, double* p2);
253
255 {
256 INPUT_DATA = 0,
258 NUM_INPUT_PORTS
259 };
260
261protected:
264
266
268
270
273 bool AddToView(vtkView* view) override;
274 bool RemoveFromView(vtkView* view) override;
275 void PrepareForRendering(vtkRenderView* view) override;
277
282 void UpdateHoverHighlight(vtkView* view, int x, int y);
283
287 virtual int AllocatePolyData(vtkPolyData* polyData, int numLines, int numPointsPerLine,
288 int numStrips, int numPointsPerStrip, int numQuads, int numPoints, int numCellScalars,
289 int numPointScalars);
290
295
297
302 virtual int PlaceLines(vtkPolyData* polyData, vtkTable* data, vtkIdTypeArray* idsToPlot);
303 virtual int PlaceCurves(vtkPolyData* polyData, vtkTable* data, vtkIdTypeArray* idsToPlot);
305
310 virtual int PlaceSelection(
311 vtkPolyData* polyData, vtkTable* data, vtkSelectionNode* selectionNode);
312
317
321 virtual int UpdatePlotProperties(vtkStringArray* inputTitles);
322
326 virtual int ReallocateInternals();
327
329
332 int ComputePointPosition(double* p);
333 int ComputeLinePosition(double* p1, double* p2);
335
337
340 virtual void SelectRows(vtkIdType brushClass, vtkIdType brushOperator, vtkIdTypeArray* rowIds);
341 vtkSelection* ConvertSelection(vtkView* view, vtkSelection* selection) override;
342 virtual void BuildInverseSelection();
344 vtkPolyData* input, vtkActor2D* actor, bool forceStandard = false);
346
351 void BuildDefaultSCurve(vtkDoubleArray* array, int numValues);
352
357 virtual void LassoSelectInternal(vtkPoints* brushPoints, vtkIdTypeArray* outIds);
358
362 virtual void UpdateSelectionActors();
363
366
374
377
378 class Internals;
379 Internals* I;
380
384 double YMin;
385 double YMax;
386
392
393 // Indexed by screen position
394 double* Xs;
395 double* Mins;
396 double* Maxs;
397 double* MinOffsets;
398 double* MaxOffsets;
399
403
405
407 double FontSize;
408 double LineColor[3];
409 double AxisColor[3];
410 double AxisLabelColor[3];
411
412 vtkGetStringMacro(InternalHoverText);
413 vtkSetStringMacro(InternalHoverText);
415
416private:
418 void operator=(const vtkParallelCoordinatesRepresentation&) = delete;
419};
420
421#endif
a actor that draws 2D data
Definition: vtkActor2D.h:155
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:161
Proxy object to connect input/output ports.
Pipeline data object that contains multiple vtkArray objects.
Definition: vtkArrayData.h:91
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:56
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:165
general representation of visualization data
dynamic, self-adjusting array of double
represent and manipulate fields of data
Definition: vtkFieldData.h:172
list of point or cell ids
Definition: vtkIdList.h:143
dynamic, self-adjusting array of vtkIdType
a simple class to control print indentation
Definition: vtkIndent.h:119
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:155
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)
Do a selection of the lines.
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)
Change the position of the plot.
int GetPositionNearXCoordinate(double xcoord)
Move an axis to a particular screen position.
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.
vtkPolyDataMapper2D * GetSelectionMapper(int idx)
void SetAxisTitles(vtkAlgorithmOutput *)
Set/Get the axis titles.
double GetXCoordinateOfPosition(int axis)
Move an axis to a particular screen position.
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 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.
virtual int SetRangeAtPosition(int position, double range[2])
Set/get the value range of the axis at a particular screen position.
void GetXCoordinatesOfPositions(double *coords)
Move an axis to a particular screen position.
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.
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)
Do a selection of the lines.
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)
Compute which screen position a point belongs to (returns the left position)
vtkSelection * ConvertSelection(vtkView *view, vtkSelection *selection) override
Select a set of points using the prescribed operator (add, subtract, etc.) and class.
void ApplyViewTheme(vtkViewTheme *theme) override
Apply the theme to this view.
virtual void RangeSelect(int brushClass, int brushOperator, double *p1, double *p2)
Do a selection of the lines.
virtual void UpdateSelectionActors()
todo
void PrepareForRendering(vtkRenderView *view) override
Add/remove the props and actors to/from a view.
virtual vtkPolyDataMapper2D * InitializePlotMapper(vtkPolyData *input, vtkActor2D *actor, bool forceStandard=false)
Select a set of points using the prescribed operator (add, subtract, etc.) and class.
bool RemoveFromView(vtkView *view) override
Add/remove the props and actors to/from a view.
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 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.
int SetXCoordinateOfPosition(int position, double xcoord)
Move an axis to a particular screen position.
static vtkParallelCoordinatesRepresentation * New()
represent and manipulate 3D points
Definition: vtkPoints.h:149
draw vtkPolyData onto the image plane
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:200
an ordered list of Props
A view containing a renderer.
Definition: vtkRenderView.h:84
a node in a vtkSelection the defines the selection criteria.
data object that represents a "selection" in VTK.
Definition: vtkSelection.h:169
a vtkAbstractArray subclass for strings
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:183
2D text annotation
record modification and/or execution time
Definition: vtkTimeStamp.h:55
dynamic, self-adjusting array of unsigned int
Sets theme colors for a graphical view.
Definition: vtkViewTheme.h:138
The superclass for all views.
Definition: vtkView.h:64
abstract specification for Viewports
Definition: vtkViewport.h:56
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
int vtkIdType
Definition: vtkType.h:332