VTK: Charts/Core/vtkPlotBox.h Source File

| VTK 9.3.1

vtkPlotBox.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
3
25 #ifndef vtkPlotBox_h
26 #define vtkPlotBox_h
27
28 #include "vtkChartsCoreModule.h" // For export macro
29 #include "vtkPlot.h"
30
31 VTK_ABI_NAMESPACE_BEGIN
32 class vtkBrush;
33 class vtkTextProperty;
34 class vtkTable;
35 class vtkStdString;
36 class vtkScalarsToColors;
37
38 class VTKCHARTSCORE_EXPORT vtkPlotBox : public vtkPlot
39 {
40 public:
41 vtkTypeMacro(vtkPlotBox, vtkPlot);
42 void PrintSelf(ostream& os, vtkIndent indent) override;
43
47 static vtkPlotBox* New();
48
52 bool Paint(vtkContext2D* painter) override;
53
60 bool PaintLegend(vtkContext2D* painter, const vtkRectf& rect, int legendIndex) override;
61
63
66 void SetInputData(vtkTable* table) override;
67 void SetInputData(vtkTable* table, const vtkStdString&, const vtkStdString&) override
68 {
69 this->SetInputData(table);
70 }
72
77 vtkStringArray* GetLabels() override;
78
84 vtkIdType GetNearestPoint(const vtkVector2f& point, const vtkVector2f& tolerance,
85 vtkVector2f* location, vtkIdType* segmentId) override;
86 using vtkPlot::GetNearestPoint;
87
89
92 void SetLookupTable(vtkScalarsToColors* lut);
93 vtkScalarsToColors* GetLookupTable();
95
99 void SetColumnColor(const vtkStdString& colName, double* rgb);
100
105 virtual void CreateDefaultLookupTable();
106
108
111 vtkGetMacro(BoxWidth, float);
112 vtkSetMacro(BoxWidth, float);
114
116
119 vtkGetObjectMacro(TitleProperties, vtkTextProperty);
121
128 bool UpdateCache() override;
129
130 protected:
131 vtkPlotBox();
132 ~vtkPlotBox() override;
133
134 void DrawBoxPlot(int, unsigned char*, double, vtkContext2D*);
135
137
140 class Private;
141 Private* Storage;
143
147 float BoxWidth;
148
152 vtkScalarsToColors* LookupTable;
153
157 vtkTextProperty* TitleProperties;
158
159 private:
160 vtkPlotBox(const vtkPlotBox&) = delete;
161 void operator=(const vtkPlotBox&) = delete;
162 };
163
164 VTK_ABI_NAMESPACE_END
165 #endif // vtkPlotBox_h
vtkBrush
provides a brush that fills shapes drawn by vtkContext2D.
Definition: vtkBrush.h:39
vtkContext2D
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:59
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkPlotBox
Class for drawing box plots.
Definition: vtkPlotBox.h:39
vtkPlotBox::LookupTable
vtkScalarsToColors * LookupTable
Lookup Table for coloring points by scalar value.
Definition: vtkPlotBox.h:152
vtkPlotBox::BoxWidth
float BoxWidth
Width of boxes.
Definition: vtkPlotBox.h:147
vtkPlotBox::GetLabels
vtkStringArray * GetLabels() override
Get the plot labels.
vtkPlotBox::SetLookupTable
void SetLookupTable(vtkScalarsToColors *lut)
Specify a lookup table for the mapper to use.
vtkPlotBox::UpdateCache
bool UpdateCache() override
Update the internal cache.
vtkPlotBox::DrawBoxPlot
void DrawBoxPlot(int, unsigned char *, double, vtkContext2D *)
vtkPlotBox::vtkPlotBox
vtkPlotBox()
vtkPlotBox::SetColumnColor
void SetColumnColor(const vtkStdString &colName, double *rgb)
Helper function to set the color of a given column.
vtkPlotBox::CreateDefaultLookupTable
virtual void CreateDefaultLookupTable()
Create default lookup table.
vtkPlotBox::GetNearestPoint
vtkIdType GetNearestPoint(const vtkVector2f &point, const vtkVector2f &tolerance, vtkVector2f *location, vtkIdType *segmentId) override
Function to query a plot for the nearest point to the specified coordinate.
vtkPlotBox::TitleProperties
vtkTextProperty * TitleProperties
Text properties for the plot title.
Definition: vtkPlotBox.h:157
vtkPlotBox::Storage
Private * Storage
Definition: vtkPlotBox.h:140
vtkPlotBox::New
static vtkPlotBox * New()
Creates a box plot.
vtkPlotBox::~vtkPlotBox
~vtkPlotBox() override
vtkPlotBox::Paint
bool Paint(vtkContext2D *painter) override
Paint event for the plot, called whenever the chart needs to be drawn.
vtkPlotBox::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkPlotBox::SetInputData
void SetInputData(vtkTable *table, const vtkStdString &, const vtkStdString &) override
This is a convenience function to set the input table.
Definition: vtkPlotBox.h:67
vtkPlotBox::SetInputData
void SetInputData(vtkTable *table) override
This is a convenience function to set the input table.
vtkPlotBox::PaintLegend
bool PaintLegend(vtkContext2D *painter, const vtkRectf &rect, int legendIndex) override
Paint legend event for the plot, called whenever the legend needs the plot items symbol/mark/line dra...
vtkPlotBox::GetLookupTable
vtkScalarsToColors * GetLookupTable()
Specify a lookup table for the mapper to use.
vtkPlot
Abstract class for 2D plots.
Definition: vtkPlot.h:53
vtkPlot::SetInputData
virtual void SetInputData(vtkTable *table)
This is a convenience function to set the input table and the x, y column for the plot.
vtkPlot::GetNearestPoint
virtual vtkIdType GetNearestPoint(const vtkVector2f &point, const vtkVector2f &tolerance, vtkVector2f *location, vtkIdType *segmentId)
Function to query a plot for the nearest point to the specified coordinate.
vtkRectf
Definition: vtkRect.h:328
vtkScalarsToColors
Superclass for mapping scalar values to colors.
Definition: vtkScalarsToColors.h:65
vtkStdString
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:38
vtkStringArray
a vtkAbstractArray subclass for strings
Definition: vtkStringArray.h:41
vtkTable
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:68
vtkTextProperty
represent text properties.
Definition: vtkTextProperty.h:35
vtkVector2f
Definition: vtkVector.h:463
vtkX3D::point
@ point
Definition: vtkX3D.h:236
vtkX3D::location
@ location
Definition: vtkX3D.h:406
vtkPlot.h
vtkIdType
int vtkIdType
Definition: vtkType.h:315