VTK  9.0.1
vtkPlotBag.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPlotBag.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 
33 #ifndef vtkPlotBag_h
34 #define vtkPlotBag_h
35 
36 #include "vtkChartsCoreModule.h" // For export macro
37 #include "vtkPlotPoints.h"
38 
39 class vtkPen;
40 
41 class VTKCHARTSCORE_EXPORT vtkPlotBag : public vtkPlotPoints
42 {
43 public:
44  vtkTypeMacro(vtkPlotBag, vtkPlotPoints);
45  void PrintSelf(ostream& os, vtkIndent indent) override;
46 
50  static vtkPlotBag* New();
51 
57  void Update() override;
58 
62  bool Paint(vtkContext2D* painter) override;
63 
70  bool PaintLegend(vtkContext2D* painter, const vtkRectf& rect, int legendIndex) override;
71 
76  vtkStringArray* GetLabels() override;
77 
83  const vtkVector2d& plotPos, vtkIdType seriesIndex, vtkIdType segmentIndex) override;
84 
86 
93  void SetInputData(vtkTable* table) override;
94  void SetInputData(
95  vtkTable* table, const vtkStdString& yColumn, const vtkStdString& densityColumn) override;
96  virtual void SetInputData(vtkTable* table, const vtkStdString& xColumn,
97  const vtkStdString& yColumn, const vtkStdString& densityColumn);
99 
100  virtual void SetInputData(
101  vtkTable* table, vtkIdType xColumn, vtkIdType yColumn, vtkIdType densityColumn);
102 
104 
108  vtkSetMacro(BagVisible, bool);
109  vtkGetMacro(BagVisible, bool);
111 
113 
116  void SetLinePen(vtkPen* pen);
117  vtkGetObjectMacro(LinePen, vtkPen);
119 
125  void SetPointPen(vtkPen* pen) { this->SetPen(pen); }
126  vtkPen* GetPointPen() { return this->GetPen(); }
127 
128 protected:
129  vtkPlotBag();
130  ~vtkPlotBag() override;
131 
133 
138 
139 private:
140  vtkPlotBag(const vtkPlotBag&) = delete;
141  void operator=(const vtkPlotBag&) = delete;
142 };
143 
144 #endif // vtkPlotBag_h
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:34
bool BagVisible
Definition: vtkPlotBag.h:134
vtkPen * LinePen
Definition: vtkPlotBag.h:137
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:50
void SetPointPen(vtkPen *pen)
Set/get the vtkPen object that controls how this plot draws points.
Definition: vtkPlotBag.h:125
a vtkAbstractArray subclass for strings
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int vtkIdType
Definition: vtkType.h:338
vtkPen * GetPen()
Set/get the vtkPen object that controls how this plot draws (out)lines.
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:52
a simple class to control print indentation
Definition: vtkIndent.h:33
represent and manipulate 2D points
Definition: vtkPoints2D.h:33
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:136
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:49
vtkPoints2D * MedianPoints
Definition: vtkPlotBag.h:135
provides a pen that draws the outlines of shapes drawn by vtkContext2D.
Definition: vtkPen.h:36
vtkPen * GetPointPen()
Definition: vtkPlotBag.h:126
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:62
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.
bool UpdateTableCache(vtkTable *table)
Update the table cache.
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:41
void Update() override
Perform any updates to the item that may be necessary before rendering.
bool Paint(vtkContext2D *painter) override
Paint event for the XY plot, called whenever the chart needs to be drawn.