VTK  9.3.20240420
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
56#ifndef vtkParallelCoordinatesRepresentation_h
57#define vtkParallelCoordinatesRepresentation_h
58
60#include "vtkViewsInfovisModule.h" // For export macro
61
62VTK_ABI_NAMESPACE_BEGIN
63class vtkActor;
64class vtkActor2D;
65class vtkArrayData;
66class vtkAxisActor2D;
68class vtkCollection;
69class vtkCoordinate;
70class vtkFieldData;
71class vtkDataArray;
72class vtkDataObject;
73class vtkDoubleArray;
74class vtkIdList;
75class vtkIdTypeArray;
76class vtkIntArray;
77class vtkLookupTable;
79class vtkPoints;
80class vtkPolyData;
83class vtkSelection;
85class vtkTextMapper;
86class vtkTimeStamp;
88class vtkViewport;
89class vtkWindow;
90
92{
93public:
96 void PrintSelf(ostream& os, vtkIndent indent) override;
97
103 void ApplyViewTheme(vtkViewTheme* theme) override;
104
108 virtual std::string GetHoverString(vtkView* view, int x, int y);
109
111
114 int SetPositionAndSize(double* position, double* size);
115 int GetPositionAndSize(double* position, double* size);
117
119
125
129 void SetPlotTitle(const char*);
130
132
135 vtkGetMacro(NumberOfAxes, int);
137
139
142 vtkGetMacro(NumberOfSamples, int);
144
146
150 vtkGetMacro(NumberOfAxisLabels, int);
152
154
158 virtual int SwapAxisPositions(int position1, int position2);
159 int SetXCoordinateOfPosition(int position, double xcoord);
160 double GetXCoordinateOfPosition(int axis);
161 void GetXCoordinatesOfPositions(double* coords);
162 int GetPositionNearXCoordinate(double xcoord);
164
166
169 vtkSetMacro(UseCurves, vtkTypeBool);
170 vtkGetMacro(UseCurves, vtkTypeBool);
171 vtkBooleanMacro(UseCurves, vtkTypeBool);
173
175
178 vtkSetMacro(CurveResolution, int);
179 vtkGetMacro(CurveResolution, int);
181
183
186 vtkGetMacro(LineOpacity, double);
187 vtkGetMacro(FontSize, double);
188 vtkGetVector3Macro(LineColor, double);
189 vtkGetVector3Macro(AxisColor, double);
190 vtkGetVector3Macro(AxisLabelColor, double);
191 vtkSetMacro(LineOpacity, double);
192 vtkSetMacro(FontSize, double);
193 vtkSetVector3Macro(LineColor, double);
194 vtkSetVector3Macro(AxisColor, double);
195 vtkSetVector3Macro(AxisLabelColor, double);
197
199
202 vtkSetMacro(AngleBrushThreshold, double);
203 vtkGetMacro(AngleBrushThreshold, double);
205
207
210 vtkSetMacro(FunctionBrushThreshold, double);
211 vtkGetMacro(FunctionBrushThreshold, double);
213
215
218 int GetRangeAtPosition(int position, double range[2]);
219 virtual int SetRangeAtPosition(int position, double range[2]);
221
225 void ResetAxes();
226
228
232 virtual void LassoSelect(int brushClass, int brushOperator, vtkPoints* brushPoints);
233 virtual void AngleSelect(int brushClass, int brushOperator, double* p1, double* p2);
234 virtual void FunctionSelect(
235 int brushClass, int brushOperator, double* p1, double* p2, double* q1, double* q2);
236 virtual void RangeSelect(int brushClass, int brushOperator, double* p1, double* p2);
238
240 {
241 INPUT_DATA = 0,
243 NUM_INPUT_PORTS
244 };
245
246protected:
249
250 int FillInputPortInformation(int port, vtkInformation* info) override;
251
253
255
258 bool AddToView(vtkView* view) override;
259 bool RemoveFromView(vtkView* view) override;
260 void PrepareForRendering(vtkRenderView* view) override;
262
267 void UpdateHoverHighlight(vtkView* view, int x, int y);
268
272 virtual int AllocatePolyData(vtkPolyData* polyData, int numLines, int numPointsPerLine,
273 int numStrips, int numPointsPerStrip, int numQuads, int numPoints, int numCellScalars,
274 int numPointScalars);
275
280
282
287 virtual int PlaceLines(vtkPolyData* polyData, vtkTable* data, vtkIdTypeArray* idsToPlot);
288 virtual int PlaceCurves(vtkPolyData* polyData, vtkTable* data, vtkIdTypeArray* idsToPlot);
290
295 virtual int PlaceSelection(
296 vtkPolyData* polyData, vtkTable* data, vtkSelectionNode* selectionNode);
297
302
306 virtual int UpdatePlotProperties(vtkStringArray* inputTitles);
307
311 virtual int ReallocateInternals();
312
314
317 int ComputePointPosition(double* p);
318 int ComputeLinePosition(double* p1, double* p2);
320
322
325 virtual void SelectRows(vtkIdType brushClass, vtkIdType brushOperator, vtkIdTypeArray* rowIds);
326 vtkSelection* ConvertSelection(vtkView* view, vtkSelection* selection) override;
327 virtual void BuildInverseSelection();
329 vtkPolyData* input, vtkActor2D* actor, bool forceStandard = false);
331
336 void BuildDefaultSCurve(vtkDoubleArray* array, int numValues);
337
342 virtual void LassoSelectInternal(vtkPoints* brushPoints, vtkIdTypeArray* outIds);
343
347 virtual void UpdateSelectionActors();
348
351
359
362
363 class Internals;
364 Internals* I;
365
369 double YMin;
370 double YMax;
371
377
378 // Indexed by screen position
379 double* Xs;
380 double* Mins;
381 double* Maxs;
382 double* MinOffsets;
383 double* MaxOffsets;
384
388
390
392 double FontSize;
393 double LineColor[3];
394 double AxisColor[3];
395 double AxisLabelColor[3];
396
397 vtkGetStringMacro(InternalHoverText);
398 vtkSetStringMacro(InternalHoverText);
400
401private:
403 void operator=(const vtkParallelCoordinatesRepresentation&) = delete;
404};
405
406VTK_ABI_NAMESPACE_END
407#endif
a actor that draws 2D data
Definition vtkActor2D.h:145
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:151
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:133
dynamic, self-adjusting array of vtkIdType
a simple class to control print indentation
Definition vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
dynamic, self-adjusting array of int
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:139
draw vtkPolyData onto the image plane
concrete dataset represents vertices, lines, polygons, and triangle strips
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:168
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:49
abstract specification for Viewports
Definition vtkViewport.h:65
window superclass for vtkRenderWindow
Definition vtkWindow.h:48
int vtkTypeBool
Definition vtkABI.h:64
int vtkIdType
Definition vtkType.h:315