VTK  9.3.0
vtkParallelCoordinatesRepresentation.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-FileCopyrightText: Copyright 2009 Sandia Corporation
3// SPDX-License-Identifier: LicenseRef-BSD-3-Clause-Sandia-USGov
46#ifndef vtkParallelCoordinatesRepresentation_h
47#define vtkParallelCoordinatesRepresentation_h
48
50#include "vtkViewsInfovisModule.h" // For export macro
51
52VTK_ABI_NAMESPACE_BEGIN
53class vtkActor;
54class vtkActor2D;
55class vtkArrayData;
56class vtkAxisActor2D;
58class vtkCollection;
59class vtkCoordinate;
60class vtkFieldData;
61class vtkDataArray;
62class vtkDataObject;
63class vtkDoubleArray;
64class vtkIdList;
65class vtkIdTypeArray;
66class vtkIntArray;
67class vtkLookupTable;
69class vtkPoints;
70class vtkPolyData;
73class vtkSelection;
75class vtkTextMapper;
76class vtkTimeStamp;
78class vtkViewport;
79class vtkWindow;
80
82{
83public:
86 void PrintSelf(ostream& os, vtkIndent indent) override;
87
93 void ApplyViewTheme(vtkViewTheme* theme) override;
94
98 virtual std::string GetHoverString(vtkView* view, int x, int y);
99
101
104 int SetPositionAndSize(double* position, double* size);
105 int GetPositionAndSize(double* position, double* size);
107
109
115
119 void SetPlotTitle(const char*);
120
122
125 vtkGetMacro(NumberOfAxes, int);
127
129
132 vtkGetMacro(NumberOfSamples, int);
134
136
140 vtkGetMacro(NumberOfAxisLabels, int);
142
144
148 virtual int SwapAxisPositions(int position1, int position2);
149 int SetXCoordinateOfPosition(int position, double xcoord);
150 double GetXCoordinateOfPosition(int axis);
151 void GetXCoordinatesOfPositions(double* coords);
152 int GetPositionNearXCoordinate(double xcoord);
154
156
159 vtkSetMacro(UseCurves, vtkTypeBool);
160 vtkGetMacro(UseCurves, vtkTypeBool);
161 vtkBooleanMacro(UseCurves, vtkTypeBool);
163
165
168 vtkSetMacro(CurveResolution, int);
169 vtkGetMacro(CurveResolution, int);
171
173
176 vtkGetMacro(LineOpacity, double);
177 vtkGetMacro(FontSize, double);
178 vtkGetVector3Macro(LineColor, double);
179 vtkGetVector3Macro(AxisColor, double);
180 vtkGetVector3Macro(AxisLabelColor, double);
181 vtkSetMacro(LineOpacity, double);
182 vtkSetMacro(FontSize, double);
183 vtkSetVector3Macro(LineColor, double);
184 vtkSetVector3Macro(AxisColor, double);
185 vtkSetVector3Macro(AxisLabelColor, double);
187
189
192 vtkSetMacro(AngleBrushThreshold, double);
193 vtkGetMacro(AngleBrushThreshold, double);
195
197
200 vtkSetMacro(FunctionBrushThreshold, double);
201 vtkGetMacro(FunctionBrushThreshold, double);
203
205
208 int GetRangeAtPosition(int position, double range[2]);
209 virtual int SetRangeAtPosition(int position, double range[2]);
211
215 void ResetAxes();
216
218
222 virtual void LassoSelect(int brushClass, int brushOperator, vtkPoints* brushPoints);
223 virtual void AngleSelect(int brushClass, int brushOperator, double* p1, double* p2);
224 virtual void FunctionSelect(
225 int brushClass, int brushOperator, double* p1, double* p2, double* q1, double* q2);
226 virtual void RangeSelect(int brushClass, int brushOperator, double* p1, double* p2);
228
230 {
231 INPUT_DATA = 0,
233 NUM_INPUT_PORTS
234 };
235
236protected:
239
240 int FillInputPortInformation(int port, vtkInformation* info) override;
241
243
245
248 bool AddToView(vtkView* view) override;
249 bool RemoveFromView(vtkView* view) override;
250 void PrepareForRendering(vtkRenderView* view) override;
252
257 void UpdateHoverHighlight(vtkView* view, int x, int y);
258
262 virtual int AllocatePolyData(vtkPolyData* polyData, int numLines, int numPointsPerLine,
263 int numStrips, int numPointsPerStrip, int numQuads, int numPoints, int numCellScalars,
264 int numPointScalars);
265
270
272
277 virtual int PlaceLines(vtkPolyData* polyData, vtkTable* data, vtkIdTypeArray* idsToPlot);
278 virtual int PlaceCurves(vtkPolyData* polyData, vtkTable* data, vtkIdTypeArray* idsToPlot);
280
285 virtual int PlaceSelection(
286 vtkPolyData* polyData, vtkTable* data, vtkSelectionNode* selectionNode);
287
292
296 virtual int UpdatePlotProperties(vtkStringArray* inputTitles);
297
301 virtual int ReallocateInternals();
302
304
307 int ComputePointPosition(double* p);
308 int ComputeLinePosition(double* p1, double* p2);
310
312
315 virtual void SelectRows(vtkIdType brushClass, vtkIdType brushOperator, vtkIdTypeArray* rowIds);
316 vtkSelection* ConvertSelection(vtkView* view, vtkSelection* selection) override;
317 virtual void BuildInverseSelection();
319 vtkPolyData* input, vtkActor2D* actor, bool forceStandard = false);
321
326 void BuildDefaultSCurve(vtkDoubleArray* array, int numValues);
327
332 virtual void LassoSelectInternal(vtkPoints* brushPoints, vtkIdTypeArray* outIds);
333
337 virtual void UpdateSelectionActors();
338
341
349
352
353 class Internals;
354 Internals* I;
355
359 double YMin;
360 double YMax;
361
367
368 // Indexed by screen position
369 double* Xs;
370 double* Mins;
371 double* Maxs;
372 double* MinOffsets;
373 double* MaxOffsets;
374
378
380
382 double FontSize;
383 double LineColor[3];
384 double AxisColor[3];
385 double AxisLabelColor[3];
386
387 vtkGetStringMacro(InternalHoverText);
388 vtkSetStringMacro(InternalHoverText);
390
391private:
393 void operator=(const vtkParallelCoordinatesRepresentation&) = delete;
394};
395
396VTK_ABI_NAMESPACE_END
397#endif
a actor that draws 2D data
Definition vtkActor2D.h:44
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:50
Proxy object to connect input/output ports.
Pipeline data object that contains multiple vtkArray objects.
Create an axis with tick marks and labels.
performs line-based thresholding for vtkTable data.
create and manipulate ordered lists of objects
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
abstract superclass for arrays of numeric data
general representation of visualization data
dynamic, self-adjusting array of double
represent and manipulate fields of data
list of point or cell ids
Definition vtkIdList.h:32
dynamic, self-adjusting array of vtkIdType
a simple class to control print indentation
Definition vtkIndent.h:38
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
dynamic, self-adjusting array of int
Definition vtkIntArray.h:44
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:38
draw vtkPolyData onto the image plane
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition vtkPolyData.h:89
an ordered list of Props
A view containing a renderer.
a node in a vtkSelection the defines the selection criteria.
data object that represents a "selection" in VTK.
Hold a reference to a vtkObjectBase instance.
a vtkAbstractArray subclass for strings
A table, which contains similar-typed columns of data.
Definition vtkTable.h:68
2D text annotation
record modification and/or execution time
dynamic, self-adjusting array of unsigned int
Sets theme colors for a graphical view.
The superclass for all views.
Definition vtkView.h:46
abstract specification for Viewports
Definition vtkViewport.h:54
window superclass for vtkRenderWindow
Definition vtkWindow.h:34
int vtkTypeBool
Definition vtkABI.h:64
int vtkIdType
Definition vtkType.h:315