VTK
vtkChartBox.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkChartBox.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
27#ifndef vtkChartBox_h
28#define vtkChartBox_h
29
30#include "vtkChartsCoreModule.h" // For export macro
31#include "vtkChart.h"
32
33class vtkIdTypeArray;
34class vtkPlotBox;
35class vtkStdString;
36class vtkStringArray;
37class vtkTooltipItem;
38
39class VTKCHARTSCORE_EXPORT vtkChartBox : public vtkChart
40{
41public:
42 vtkTypeMacro(vtkChartBox, vtkChart);
43 virtual void PrintSelf(ostream &os, vtkIndent indent);
44
48 static vtkChartBox* New();
49
55 virtual void Update();
56
60 virtual bool Paint(vtkContext2D *painter);
61
63
66 void SetColumnVisibility(const vtkStdString& name, bool visible);
67 void SetColumnVisibility(vtkIdType column, bool visible);
69
74 void SetColumnVisibilityAll(bool visible);
75
77
83
88
90
93 vtkGetObjectMacro(VisibleColumns, vtkStringArray);
95
96 // Index of the selected column in the visible columns list.
97 vtkGetMacro(SelectedColumn, int);
98 vtkSetMacro(SelectedColumn, int);
99
104
109
113 virtual vtkAxis* GetYAxis();
114
118 virtual float GetXPosition(int index);
119
124
129 virtual void SetPlot(vtkPlotBox *plot);
130
134 virtual bool Hit(const vtkContextMouseEvent &mouse);
135
139 virtual bool MouseMoveEvent(const vtkContextMouseEvent &mouse);
140
144 virtual bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse);
145
150
154 virtual void SetTooltip(vtkTooltipItem *tooltip);
155
160
165 const vtkVector2d &,
167 vtkIdType segmentIndex = -1);
168
169protected:
172
174
177 class Private;
178 Private *Storage;
180
182
187
192
194
200
205
210
214 void SwapAxes(int a1, int a2);
215
222 int invokeEvent = -1);
223
225 const vtkVector2f &tolerance, vtkVector2f &plotPos,
226 vtkPlot *plot, vtkIdType &segmentIndex);
227
228private:
229 vtkChartBox(const vtkChartBox &) VTK_DELETE_FUNCTION;
230 void operator=(const vtkChartBox &) VTK_DELETE_FUNCTION;
231
232};
233
235
241{
245 int Index;
246};
248
249#endif //vtkChartBox_h
takes care of drawing 2D axes
Definition: vtkAxis.h:72
Factory class for drawing box plot charts.
Definition: vtkChartBox.h:40
void CalculatePlotTransform()
float SelectedColumnDelta
Definition: vtkChartBox.h:198
void SwapAxes(int a1, int a2)
virtual bool MouseMoveEvent(const vtkContextMouseEvent &mouse)
Mouse move event.
void ResetSelection()
vtkSmartPointer< vtkTooltipItem > Tooltip
The tooltip item for the chart - can be used to display extra information.
Definition: vtkChartBox.h:209
int SelectedColumn
Index of the selected column in the visible columns list.
Definition: vtkChartBox.h:197
virtual void SetTooltip(vtkTooltipItem *tooltip)
Set the vtkTooltipItem object that will be displayed by the chart.
virtual bool MouseButtonReleaseEvent(const vtkContextMouseEvent &mouse)
Mouse button release event.
static vtkChartBox * New()
Creates a parallel coordinates chart.
vtkStringArray * VisibleColumns
A list of the visible columns in the chart.
Definition: vtkChartBox.h:191
bool GetColumnVisibility(const vtkStdString &name)
Get the visibility of the specified column.
vtkTimeStamp BuildTime
The point cache is marked dirty until it has been initialized.
Definition: vtkChartBox.h:204
bool GetColumnVisibility(vtkIdType column)
Private * Storage
Definition: vtkChartBox.h:178
int LocatePointInPlot(const vtkVector2f &position, const vtkVector2f &tolerance, vtkVector2f &plotPos, vtkPlot *plot, vtkIdType &segmentIndex)
bool GeometryValid
Definition: vtkChartBox.h:181
vtkIdTypeArray * Selection
Selected indices for the table the plot is rendering.
Definition: vtkChartBox.h:186
void UpdateGeometry(vtkContext2D *)
void SetColumnVisibilityAll(bool visible)
Set the visibility of all columns (true will make them all visible, false will remove all visible col...
virtual bool Paint(vtkContext2D *painter)
Paint event for the chart, called whenever the chart needs to be drawn.
virtual bool Hit(const vtkContextMouseEvent &mouse)
Return true if the supplied x, y coordinate is inside the item.
virtual void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
virtual void SetTooltipInfo(const vtkContextMouseEvent &, const vtkVector2d &, vtkIdType, vtkPlot *, vtkIdType segmentIndex=-1)
Set the information passed to the tooltip.
virtual float GetXPosition(int index)
Get the column X position by index in the visible set.
bool LocatePointInPlots(const vtkContextMouseEvent &mouse, int invokeEvent=-1)
Try to locate a point within the plots to display in a tooltip.
virtual vtkPlot * GetPlot(vtkIdType index)
Get the plot at the specified index, returns null if the index is invalid.
virtual vtkIdType GetNumberOfPlots()
Get the number of plots the chart contains.
virtual void Update()
Perform any updates to the item that may be necessary before rendering.
virtual vtkTooltipItem * GetTooltip()
Get the vtkTooltipItem object that will be displayed by the chart.
virtual vtkAxis * GetYAxis()
Get the chart Y axis.
vtkIdType GetColumnId(const vtkStdString &name)
Get the input table column id of a column by its name.
virtual vtkIdType GetNumberOfVisibleColumns()
Get the number of visible box plots in the current chart.
void SetColumnVisibility(const vtkStdString &name, bool visible)
Set the visibility of the specified column.
virtual void SetPlot(vtkPlotBox *plot)
Set plot to use for the chart.
void SetColumnVisibility(vtkIdType column, bool visible)
virtual bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse)
Mouse button down event.
Factory class for drawing 2D charts.
Definition: vtkChart.h:51
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:58
data structure to represent mouse events.
dynamic, self-adjusting array of vtkIdType
a simple class to control print indentation
Definition: vtkIndent.h:40
Class for drawing box plots.
Definition: vtkPlotBox.h:42
Abstract class for 2D plots.
Definition: vtkPlot.h:53
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:49
a vtkAbstractArray subclass for strings
record modification and/or execution time
Definition: vtkTimeStamp.h:36
takes care of drawing 2D axes
Some derived classes for the different vectors commonly used.
Definition: vtkVector.h:328
@ name
Definition: vtkX3D.h:219
@ position
Definition: vtkX3D.h:261
@ index
Definition: vtkX3D.h:246
Small struct used by InvokeEvent to send some information about the point that was clicked on.
Definition: vtkChartBox.h:241
vtkVector2i ScreenPosition
Definition: vtkChartBox.h:244
vtkStdString SeriesName
Definition: vtkChartBox.h:242
vtkVector2f Position
Definition: vtkChartBox.h:243
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
int vtkIdType
Definition: vtkType.h:287