VTK  9.3.20240418
vtkPlotBag.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 
24 #ifndef vtkPlotBag_h
25 #define vtkPlotBag_h
26 
27 #include "vtkChartsCoreModule.h" // For export macro
28 #include "vtkPlotPoints.h"
29 
30 VTK_ABI_NAMESPACE_BEGIN
31 class vtkPen;
32 
33 class VTKCHARTSCORE_EXPORT vtkPlotBag : public vtkPlotPoints
34 {
35 public:
36  vtkTypeMacro(vtkPlotBag, vtkPlotPoints);
37  void PrintSelf(ostream& os, vtkIndent indent) override;
38 
42  static vtkPlotBag* New();
43 
47  bool Paint(vtkContext2D* painter) override;
48 
55  bool PaintLegend(vtkContext2D* painter, const vtkRectf& rect, int legendIndex) override;
56 
62 
68  const vtkVector2d& plotPos, vtkIdType seriesIndex, vtkIdType segmentIndex) override;
69 
71 
78  void SetInputData(vtkTable* table) override;
80  vtkTable* table, const vtkStdString& yColumn, const vtkStdString& densityColumn) override;
81  virtual void SetInputData(vtkTable* table, const vtkStdString& xColumn,
82  const vtkStdString& yColumn, const vtkStdString& densityColumn);
84 
85  virtual void SetInputData(
86  vtkTable* table, vtkIdType xColumn, vtkIdType yColumn, vtkIdType densityColumn);
87 
89 
93  vtkSetMacro(BagVisible, bool);
94  vtkGetMacro(BagVisible, bool);
96 
98 
101  void SetLinePen(vtkPen* pen);
102  vtkGetObjectMacro(LinePen, vtkPen);
104 
110  void SetPointPen(vtkPen* pen) { this->SetPen(pen); }
111  vtkPen* GetPointPen() { return this->GetPen(); }
112 
119  bool UpdateCache() override;
120 
121 protected:
123  ~vtkPlotBag() override;
124 
129 
130 private:
131  vtkPlotBag(const vtkPlotBag&) = delete;
132  void operator=(const vtkPlotBag&) = delete;
133 };
134 
135 VTK_ABI_NAMESPACE_END
136 #endif // vtkPlotBag_h
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:69
a simple class to control print indentation
Definition: vtkIndent.h:108
provides a pen that draws the outlines of shapes drawn by vtkContext2D.
Definition: vtkPen.h:78
Class for drawing an a bagplot.
Definition: vtkPlotBag.h:34
void SetLinePen(vtkPen *pen)
Set/get the vtkPen object that controls how this plot draws boundary lines.
void SetInputData(vtkTable *table) override
Set the input, we are expecting a vtkTable with three columns.
virtual void SetInputData(vtkTable *table, vtkIdType xColumn, vtkIdType yColumn, vtkIdType densityColumn)
void SetPointPen(vtkPen *pen)
Set/get the vtkPen object that controls how this plot draws points.
Definition: vtkPlotBag.h:110
bool UpdateCache() override
Update the internal cache.
vtkPen * GetPointPen()
Definition: vtkPlotBag.h:111
static vtkPlotBag * New()
Creates a new Bag Plot object.
bool BagVisible
Definition: vtkPlotBag.h:125
void SetInputData(vtkTable *table, const vtkStdString &yColumn, const vtkStdString &densityColumn) override
Set the input, we are expecting a vtkTable with three columns.
vtkStringArray * GetLabels() override
Get the plot labels.
bool Paint(vtkContext2D *painter) override
Paint event for the XY plot, called whenever the chart needs to be drawn.
bool PaintLegend(vtkContext2D *painter, const vtkRectf &rect, int legendIndex) override
Paint legend event for the XY plot, called whenever the legend needs the plot items symbol/mark/line ...
~vtkPlotBag() override
vtkPoints2D * MedianPoints
Definition: vtkPlotBag.h:126
vtkStdString GetTooltipLabel(const vtkVector2d &plotPos, vtkIdType seriesIndex, vtkIdType segmentIndex) override
Generate and return the tooltip label string for this plot The segmentIndex parameter is ignored,...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual void SetInputData(vtkTable *table, const vtkStdString &xColumn, const vtkStdString &yColumn, const vtkStdString &densityColumn)
Set the input, we are expecting a vtkTable with three columns.
vtkPoints2D * Q3Points
Definition: vtkPlotBag.h:127
vtkPen * LinePen
Definition: vtkPlotBag.h:128
Class for drawing an points given two columns from a vtkTable.
Definition: vtkPlotPoints.h:94
void SetPen(vtkPen *pen)
Set/get the vtkPen object that controls how this plot draws (out)lines.
vtkPen * GetPen()
Get the plot color as floating rgb values (comprised between 0.0 and 1.0)
represent and manipulate 2D points
Definition: vtkPoints2D.h:27
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:78
a vtkAbstractArray subclass for strings
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:168
int vtkIdType
Definition: vtkType.h:315