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
37#ifndef vtkParallelCoordinatesRepresentation_h
38#define vtkParallelCoordinatesRepresentation_h
39
41#include "vtkViewsInfovisModule.h" // For export macro
42
43VTK_ABI_NAMESPACE_BEGIN
44class vtkActor;
45class vtkActor2D;
46class vtkArrayData;
47class vtkAxisActor2D;
49class vtkCollection;
50class vtkCoordinate;
51class vtkFieldData;
52class vtkDataArray;
53class vtkDataObject;
54class vtkDoubleArray;
55class vtkIdList;
56class vtkIdTypeArray;
57class vtkIntArray;
58class vtkLookupTable;
60class vtkPoints;
61class vtkPolyData;
64class vtkSelection;
66class vtkTextMapper;
67class vtkTimeStamp;
69class vtkViewport;
70class vtkWindow;
71
73{
74public:
77 void PrintSelf(ostream& os, vtkIndent indent) override;
78
84 void ApplyViewTheme(vtkViewTheme* theme) override;
85
89 virtual std::string GetHoverString(vtkView* view, int x, int y);
90
92
95 int SetPositionAndSize(double* position, double* size);
96 int GetPositionAndSize(double* position, double* size);
98
100
106
110 void SetPlotTitle(const char*);
111
113
116 vtkGetMacro(NumberOfAxes, int);
118
120
123 vtkGetMacro(NumberOfSamples, int);
125
127
131 vtkGetMacro(NumberOfAxisLabels, int);
133
135
139 virtual int SwapAxisPositions(int position1, int position2);
140 int SetXCoordinateOfPosition(int position, double xcoord);
141 double GetXCoordinateOfPosition(int axis);
142 void GetXCoordinatesOfPositions(double* coords);
143 int GetPositionNearXCoordinate(double xcoord);
145
147
150 vtkSetMacro(UseCurves, vtkTypeBool);
151 vtkGetMacro(UseCurves, vtkTypeBool);
152 vtkBooleanMacro(UseCurves, vtkTypeBool);
154
156
159 vtkSetMacro(CurveResolution, int);
160 vtkGetMacro(CurveResolution, int);
162
164
167 vtkGetMacro(LineOpacity, double);
168 vtkGetMacro(FontSize, double);
169 vtkGetVector3Macro(LineColor, double);
170 vtkGetVector3Macro(AxisColor, double);
171 vtkGetVector3Macro(AxisLabelColor, double);
172 vtkSetMacro(LineOpacity, double);
173 vtkSetMacro(FontSize, double);
174 vtkSetVector3Macro(LineColor, double);
175 vtkSetVector3Macro(AxisColor, double);
176 vtkSetVector3Macro(AxisLabelColor, double);
178
180
183 vtkSetMacro(AngleBrushThreshold, double);
184 vtkGetMacro(AngleBrushThreshold, double);
186
188
191 vtkSetMacro(FunctionBrushThreshold, double);
192 vtkGetMacro(FunctionBrushThreshold, double);
194
196
199 int GetRangeAtPosition(int position, double range[2]);
200 virtual int SetRangeAtPosition(int position, double range[2]);
202
206 void ResetAxes();
207
209
213 virtual void LassoSelect(int brushClass, int brushOperator, vtkPoints* brushPoints);
214 virtual void AngleSelect(int brushClass, int brushOperator, double* p1, double* p2);
215 virtual void FunctionSelect(
216 int brushClass, int brushOperator, double* p1, double* p2, double* q1, double* q2);
217 virtual void RangeSelect(int brushClass, int brushOperator, double* p1, double* p2);
219
221 {
222 INPUT_DATA = 0,
224 NUM_INPUT_PORTS
225 };
226
227protected:
230
231 int FillInputPortInformation(int port, vtkInformation* info) override;
232
234
236
239 bool AddToView(vtkView* view) override;
240 bool RemoveFromView(vtkView* view) override;
241 void PrepareForRendering(vtkRenderView* view) override;
243
248 void UpdateHoverHighlight(vtkView* view, int x, int y);
249
253 virtual int AllocatePolyData(vtkPolyData* polyData, int numLines, int numPointsPerLine,
254 int numStrips, int numPointsPerStrip, int numQuads, int numPoints, int numCellScalars,
255 int numPointScalars);
256
261
263
268 virtual int PlaceLines(vtkPolyData* polyData, vtkTable* data, vtkIdTypeArray* idsToPlot);
269 virtual int PlaceCurves(vtkPolyData* polyData, vtkTable* data, vtkIdTypeArray* idsToPlot);
271
276 virtual int PlaceSelection(
277 vtkPolyData* polyData, vtkTable* data, vtkSelectionNode* selectionNode);
278
283
287 virtual int UpdatePlotProperties(vtkStringArray* inputTitles);
288
292 virtual int ReallocateInternals();
293
295
298 int ComputePointPosition(double* p);
299 int ComputeLinePosition(double* p1, double* p2);
301
303
306 virtual void SelectRows(vtkIdType brushClass, vtkIdType brushOperator, vtkIdTypeArray* rowIds);
307 vtkSelection* ConvertSelection(vtkView* view, vtkSelection* selection) override;
308 virtual void BuildInverseSelection();
310 vtkPolyData* input, vtkActor2D* actor, bool forceStandard = false);
312
317 void BuildDefaultSCurve(vtkDoubleArray* array, int numValues);
318
323 virtual void LassoSelectInternal(vtkPoints* brushPoints, vtkIdTypeArray* outIds);
324
328 virtual void UpdateSelectionActors();
329
332
340
343
344 class Internals;
345 Internals* I;
346
350 double YMin;
351 double YMax;
352
358
359 // Indexed by screen position
360 double* Xs;
361 double* Mins;
362 double* Maxs;
363 double* MinOffsets;
364 double* MaxOffsets;
365
369
371
373 double FontSize;
374 double LineColor[3];
375 double AxisColor[3];
376 double AxisLabelColor[3];
377
378 vtkGetStringMacro(InternalHoverText);
379 vtkSetStringMacro(InternalHoverText);
381
382private:
384 void operator=(const vtkParallelCoordinatesRepresentation&) = delete;
385};
386
387VTK_ABI_NAMESPACE_END
388#endif
a actor that draws 2D data
Definition vtkActor2D.h:35
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:41
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:23
dynamic, self-adjusting array of vtkIdType
a simple class to control print indentation
Definition vtkIndent.h:29
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
dynamic, self-adjusting array of int
Definition vtkIntArray.h:35
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:29
draw vtkPolyData onto the image plane
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition vtkPolyData.h:80
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:59
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:45
window superclass for vtkRenderWindow
Definition vtkWindow.h:25
int vtkTypeBool
Definition vtkABI.h:64
int vtkIdType
Definition vtkType.h:315