VTK
vtkChartPie.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkChartPie.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 
27 #ifndef vtkChartPie_h
28 #define vtkChartPie_h
29 
30 #include "vtkChartsCoreModule.h" // For export macro
31 #include "vtkChart.h"
32 
33 class vtkChartLegend;
34 class vtkTooltipItem;
35 class vtkChartPiePrivate;
36 
37 class VTKCHARTSCORE_EXPORT vtkChartPie : public vtkChart
38 {
39 public:
40  vtkTypeMacro(vtkChartPie, vtkChart);
41  virtual void PrintSelf(ostream &os, vtkIndent indent);
42 
46  static vtkChartPie *New();
47 
53  virtual void Update();
54 
58  virtual bool Paint(vtkContext2D *painter);
59 
63  virtual vtkPlot * AddPlot(int type);
64 
68  virtual vtkIdType AddPlot(vtkPlot* plot)
69  { return Superclass::AddPlot(plot); }
70 
75 
80 
84  virtual void SetShowLegend(bool visible);
85 
91 
95  virtual void SetScene(vtkContextScene *scene);
96 
100  virtual bool Hit(const vtkContextMouseEvent &mouse);
101 
105  virtual bool MouseEnterEvent(const vtkContextMouseEvent &mouse);
106 
110  virtual bool MouseMoveEvent(const vtkContextMouseEvent &mouse);
111 
115  virtual bool MouseLeaveEvent(const vtkContextMouseEvent &mouse);
116 
120  virtual bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse);
121 
125  virtual bool MouseButtonReleaseEvent(const vtkContextMouseEvent &mouse);
126 
130  virtual bool MouseWheelEvent(const vtkContextMouseEvent &mouse, int delta);
131 
132 protected:
135 
140 
145 
150 
155 
156 private:
157  vtkChartPie(const vtkChartPie &) VTK_DELETE_FUNCTION;
158  void operator=(const vtkChartPie &) VTK_DELETE_FUNCTION;
159 
163  bool LocatePointInPlots(const vtkContextMouseEvent &mouse);
164 
168  vtkChartPiePrivate *Private;
169 
170 };
171 
172 #endif //vtkChartPie_h
vtkChart
Factory class for drawing 2D charts.
Definition: vtkChart.h:51
vtkChartPie
Factory class for drawing pie charts.
Definition: vtkChartPie.h:38
vtkChartPie::RecalculatePlotTransforms
void RecalculatePlotTransforms()
Recalculate the necessary transforms.
vtkChartPie::AddPlot
virtual vtkIdType AddPlot(vtkPlot *plot)
Add a plot to the chart.
Definition: vtkChartPie.h:68
vtkContextMouseEvent
data structure to represent mouse events.
Definition: vtkContextMouseEvent.h:41
vtkChartPie::Hit
virtual bool Hit(const vtkContextMouseEvent &mouse)
Return true if the supplied x, y coordinate is inside the item.
vtkChartPie::GetPlot
virtual vtkPlot * GetPlot(vtkIdType index)
Get the plot at the specified index, returns null if the index is invalid.
vtkChartPie::Legend
vtkChartLegend * Legend
The legend for the chart.
Definition: vtkChartPie.h:144
vtkX3D::type
@ type
Definition: vtkX3D.h:516
vtkIdType
int vtkIdType
Definition: vtkType.h:287
vtkChartPie::PlotTransformValid
bool PlotTransformValid
Does the plot area transform need to be recalculated?
Definition: vtkChartPie.h:154
vtkChartPie::AddPlot
virtual vtkPlot * AddPlot(int type)
Add a plot to the chart.
vtkChartPie::SetShowLegend
virtual void SetShowLegend(bool visible)
Set whether the chart should draw a legend.
vtkChartPie::MouseMoveEvent
virtual bool MouseMoveEvent(const vtkContextMouseEvent &mouse)
Mouse move event.
vtkChartLegend
draw the chart legend
Definition: vtkChartLegend.h:43
vtkChart.h
vtkChartPie::SetScene
virtual void SetScene(vtkContextScene *scene)
Set the vtkContextScene for the item, always set for an item in a scene.
vtkChartPie::PrintSelf
virtual void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkTooltipItem
takes care of drawing 2D axes
Definition: vtkTooltipItem.h:40
vtkChartPie::GetLegend
virtual vtkChartLegend * GetLegend()
Get the legend for the chart, if available.
vtkContext2D
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:58
vtkPlot
Abstract class for 2D plots.
Definition: vtkPlot.h:53
vtkChartPie::GetNumberOfPlots
virtual vtkIdType GetNumberOfPlots()
Get the number of plots the chart contains.
vtkContextScene
Provides a 2D scene for vtkContextItem objects.
Definition: vtkContextScene.h:51
vtkChartPie::Update
virtual void Update()
Perform any updates to the item that may be necessary before rendering.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkChartPie::MouseButtonReleaseEvent
virtual bool MouseButtonReleaseEvent(const vtkContextMouseEvent &mouse)
Mouse button release event.
vtkChartPie::vtkChartPie
vtkChartPie()
vtkChartPie::MouseButtonPressEvent
virtual bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse)
Mouse button down event.
vtkChartPie::~vtkChartPie
~vtkChartPie()
vtkChartPie::Tooltip
vtkTooltipItem * Tooltip
The tooltip item for the chart - can be used to display extra information.
Definition: vtkChartPie.h:149
vtkChartPie::MouseLeaveEvent
virtual bool MouseLeaveEvent(const vtkContextMouseEvent &mouse)
Mouse leave event.
vtkChartPie::MouseWheelEvent
virtual bool MouseWheelEvent(const vtkContextMouseEvent &mouse, int delta)
Mouse wheel event, positive delta indicates forward movement of the wheel.
vtkX3D::index
@ index
Definition: vtkX3D.h:246
vtkChartPie::New
static vtkChartPie * New()
Creates a 2D Chart object.
vtkChartPie::Paint
virtual bool Paint(vtkContext2D *painter)
Paint event for the chart, called whenever the chart needs to be drawn.
vtkChartPie::MouseEnterEvent
virtual bool MouseEnterEvent(const vtkContextMouseEvent &mouse)
Mouse enter event.