VTK  9.7.1
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 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
30 
31 VTK_ABI_NAMESPACE_BEGIN
32 class vtkPen;
33 
34 class VTKCHARTSCORE_EXPORT VTK_MARSHALAUTO vtkPlotBag : public vtkPlotPoints
35 {
36 public:
37  vtkTypeMacro(vtkPlotBag, vtkPlotPoints);
38  void PrintSelf(ostream& os, vtkIndent indent) override;
39 
43  static vtkPlotBag* New();
44 
48  bool Paint(vtkContext2D* painter) override;
49 
56  bool PaintLegend(vtkContext2D* painter, const vtkRectf& rect, int legendIndex) override;
57 
62  vtkStringArray* GetLabels() override;
63 
69  const vtkVector2d& plotPos, vtkIdType seriesIndex, vtkIdType segmentIndex) override;
70 
72 
79  void SetInputData(vtkTable* table) override;
80  void SetInputData(
81  vtkTable* table, const vtkStdString& yColumn, const vtkStdString& densityColumn) override;
82  virtual void SetInputData(vtkTable* table, const vtkStdString& xColumn,
83  const vtkStdString& yColumn, const vtkStdString& densityColumn);
85 
86  virtual void SetInputData(
87  vtkTable* table, vtkIdType xColumn, vtkIdType yColumn, vtkIdType densityColumn);
88 
90 
94  vtkSetMacro(BagVisible, bool);
95  vtkGetMacro(BagVisible, bool);
97 
99 
102  void SetLinePen(vtkPen* pen);
103  vtkGetObjectMacro(LinePen, vtkPen);
105 
111  void SetPointPen(vtkPen* pen) { this->SetPen(pen); }
112  vtkPen* GetPointPen() { return this->GetPen(); }
113 
120  bool UpdateCache() override;
121 
122 protected:
123  vtkPlotBag();
124  ~vtkPlotBag() override;
125 
130 
131 private:
132  vtkPlotBag(const vtkPlotBag&) = delete;
133  void operator=(const vtkPlotBag&) = delete;
134 };
135 
136 VTK_ABI_NAMESPACE_END
137 #endif // vtkPlotBag_h
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:27
bool BagVisible
Definition: vtkPlotBag.h:126
vtkPen * LinePen
Definition: vtkPlotBag.h:129
void SetPen(vtkPen *pen)
Set/get the vtkPen object that controls how this plot draws (out)lines.
Class for drawing an points given two columns from a vtkTable.
Definition: vtkPlotPoints.h:45
void SetPointPen(vtkPen *pen)
Set/get the vtkPen object that controls how this plot draws points.
Definition: vtkPlotBag.h:111
a vtkAbstractArray subclass for strings
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
bool UpdateCache() override
Update the internal cache.
int vtkIdType
Definition: vtkType.h:363
vtkPen * GetPen()
Get the plot color as floating rgb values (comprised between 0.0 and 1.0)
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:49
a simple class to control print indentation
Definition: vtkIndent.h:28
represent and manipulate 2D points
Definition: vtkPoints2D.h:27
virtual vtkStringArray * GetLabels()
Get the plot labels.
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 ...
vtkPoints2D * Q3Points
Definition: vtkPlotBag.h:128
vtkPoints2D * MedianPoints
Definition: vtkPlotBag.h:127
provides a pen that draws the outlines of shapes drawn by vtkContext2D.
Definition: vtkPen.h:29
vtkPen * GetPointPen()
Definition: vtkPlotBag.h:112
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:59
virtual void SetInputData(vtkTable *table)
This is a convenience function to set the input table and the x, y column for the plot...
static vtkPlotPoints * New()
Creates a 2D Chart object.
#define VTK_MARSHALAUTO
virtual vtkStdString GetTooltipLabel(const vtkVector2d &plotPos, vtkIdType seriesIndex, vtkIdType segmentIndex)
Generate and return the tooltip label string for this plot The segmentIndex parameter is ignored...
Class for drawing an a bagplot.
Definition: vtkPlotBag.h:34
bool Paint(vtkContext2D *painter) override
Paint event for the XY plot, called whenever the chart needs to be drawn.