VTK  9.2.6
vtkPlotBox.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkPlotBox.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
47#ifndef vtkPlotBox_h
48#define vtkPlotBox_h
49
50#include "vtkChartsCoreModule.h" // For export macro
51#include "vtkPlot.h"
52#include "vtkStdString.h" // For vtkStdString ivars
53
54class vtkBrush;
55class vtkTextProperty;
56class vtkTable;
57class vtkStdString;
59
60class VTKCHARTSCORE_EXPORT vtkPlotBox : public vtkPlot
61{
62public:
63 vtkTypeMacro(vtkPlotBox, vtkPlot);
64 void PrintSelf(ostream& os, vtkIndent indent) override;
65
69 static vtkPlotBox* New();
70
74 bool Paint(vtkContext2D* painter) override;
75
82 bool PaintLegend(vtkContext2D* painter, const vtkRectf& rect, int legendIndex) override;
83
85
88 void SetInputData(vtkTable* table) override;
89 void SetInputData(vtkTable* table, const vtkStdString&, const vtkStdString&) override
90 {
91 this->SetInputData(table);
92 }
94
100
107 vtkVector2f* location, vtkIdType* segmentId) override;
109
111
117
121 void SetColumnColor(const vtkStdString& colName, double* rgb);
122
128
130
133 vtkGetMacro(BoxWidth, float);
134 vtkSetMacro(BoxWidth, float);
136
138
141 vtkGetObjectMacro(TitleProperties, vtkTextProperty);
143
150 bool UpdateCache() override;
151
152protected:
154 ~vtkPlotBox() override;
155
156 void DrawBoxPlot(int, unsigned char*, double, vtkContext2D*);
157
159
162 class Private;
163 Private* Storage;
165
169 float BoxWidth;
170
175
180
181private:
182 vtkPlotBox(const vtkPlotBox&) = delete;
183 void operator=(const vtkPlotBox&) = delete;
184};
185
186#endif // vtkPlotBox_h
provides a brush that fills shapes drawn by vtkContext2D.
Definition: vtkBrush.h:100
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:77
a simple class to control print indentation
Definition: vtkIndent.h:119
Class for drawing box plots.
Definition: vtkPlotBox.h:61
vtkScalarsToColors * LookupTable
Lookup Table for coloring points by scalar value.
Definition: vtkPlotBox.h:174
vtkStringArray * GetLabels() override
Get the plot labels.
float BoxWidth
Width of boxes.
Definition: vtkPlotBox.h:169
void SetLookupTable(vtkScalarsToColors *lut)
Specify a lookup table for the mapper to use.
bool UpdateCache() override
Update the internal cache.
void DrawBoxPlot(int, unsigned char *, double, vtkContext2D *)
vtkScalarsToColors * GetLookupTable()
Specify a lookup table for the mapper to use.
void SetColumnColor(const vtkStdString &colName, double *rgb)
Helper function to set the color of a given column.
virtual void CreateDefaultLookupTable()
Create default lookup table.
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.
vtkTextProperty * TitleProperties
Text properties for the plot title.
Definition: vtkPlotBox.h:179
Private * Storage
Definition: vtkPlotBox.h:163
~vtkPlotBox() override
bool Paint(vtkContext2D *painter) override
Paint event for the plot, called whenever the chart needs to be drawn.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetInputData(vtkTable *table, const vtkStdString &, const vtkStdString &) override
This is a convenience function to set the input table.
Definition: vtkPlotBox.h:89
void SetInputData(vtkTable *table) override
This is a convenience function to set the input table.
static vtkPlotBox * New()
Creates a box plot.
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...
Abstract class for 2D plots.
Definition: vtkPlot.h:163
virtual void SetInputData(vtkTable *table)
This is a convenience function to set the input table and the x, y column for the plot.
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.
Superclass for mapping scalar values to colors.
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:108
a vtkAbstractArray subclass for strings
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:183
represent text properties.
@ point
Definition: vtkX3D.h:242
@ location
Definition: vtkX3D.h:412
int vtkIdType
Definition: vtkType.h:332