| 1 | /*************************************************************************** |
| 2 | * Copyright (C) 2009 by Guy Rutenberg * |
| 3 | * [email protected] * |
| 4 | * * |
| 5 | * This program is free software; you can redistribute it and/or modify * |
| 6 | * it under the terms of the GNU General Public License as published by * |
| 7 | * the Free Software Foundation; either version 2 of the License, or * |
| 8 | * (at your option) any later version. * |
| 9 | * * |
| 10 | * This program is distributed in the hope that it will be useful, * |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
| 13 | * GNU General Public License for more details. * |
| 14 | * * |
| 15 | * You should have received a copy of the GNU General Public License * |
| 16 | * along with this program; if not, write to the * |
| 17 | * Free Software Foundation, Inc., * |
| 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
| 19 | ***************************************************************************/ |
| 20 | |
| 21 | #include <wx/wx.h> |
| 22 | #include <vector> |
| 23 | |
| 24 | #ifndef SIMPLE_HISTOGRAM_INC |
| 25 | #define SIMPLE_HISTOGRAM_INCcxx . . $ `src/simple_pie_plot.h:25:9`! |
| 26 | |
| 27 | namespace simple_pie_plotcxx . . $ simple_pie_plot/ { |
| 28 | |
| 29 | class SimplePiePlotcxx . . $ simple_pie_plot/SimplePiePlot# : public wxPanelcxx . . $ wxPanel# { |
| 30 | public: |
| 31 | SimplePiePlotcxx . . $ simple_pie_plot/SimplePiePlot#SimplePiePlot(bcdeeae89954f8a3). (wxWindowcxx . . $ wxWindow#* parent, wxWindowIDcxx . . $ wxWindowID# id, |
| 32 | const wxPointcxx . . $ wxPoint#& pos = wxDefaultPositioncxx . . $ wxDefaultPosition., const wxSizecxx . . $ wxSize#& size = wxDefaultSizecxx . . $ wxDefaultSize., |
| 33 | long style = wxNO_BORDERcxx . . $ `<external>/14689491191722134862/defs.h:1648:9`!, const wxStringcxx . . $ wxString#& name = wxPanelNameStrcxx . . $ wxString#wxString(85c52e162fed56f9).); |
| 34 | void SetDatacxx . . $ simple_pie_plot/SimplePiePlot#SetData(9cc36d28fd3db431).(stdcxx . . $ std/::vectorcxx . . $ std/vector#<double> d, stdcxx . . $ std/::vectorcxx . . $ std/vector#<wxStringcxx . . $ wxString#> labels); |
| 35 | void OnPaintcxx . . $ simple_pie_plot/SimplePiePlot#OnPaint(954efb20b042ed11).(wxPaintEventcxx . . $ wxPaintEvent#& event); |
| 36 | void OnResizecxx . . $ simple_pie_plot/SimplePiePlot#OnResize(2b95f7f26403c12f).(wxSizeEventcxx . . $ wxSizeEvent#& event); |
| 37 | void OnMouseLeaveWindowcxx . . $ simple_pie_plot/SimplePiePlot#OnMouseLeaveWindow(7e6a1c70b0e99497).(wxMouseEventcxx . . $ wxMouseEvent#& event); |
| 38 | void OnMouseMovecxx . . $ simple_pie_plot/SimplePiePlot#OnMouseMove(7e6a1c70b0e99497).(wxMouseEventcxx . . $ wxMouseEvent#& event); |
| 39 | wxSizecxx . . $ wxSize# GetMinSizecxx . . $ simple_pie_plot/SimplePiePlot#GetMinSize(1760195b8cec6c4e).() const; |
| 40 | private: |
| 41 | /** |
| 42 | * Gets the color suiting the \a i th segment. |
| 43 | * \param i The segment number. |
| 44 | */ |
| 45 | wxColourcxx . . $ wxColour# GetSegmentColorcxx . . $ simple_pie_plot/SimplePiePlot#GetSegmentColor(2186c6a3b1551d0a).(int i); |
| 46 | |
| 47 | /** |
| 48 | * Calculate the angles in the plot and populate the m_angles array. |
| 49 | */ |
| 50 | void CalculateAnglescxx . . $ simple_pie_plot/SimplePiePlot#CalculateAngles(49f6e7a06ebc5aa8).(); |
| 51 | |
| 52 | /** |
| 53 | * Calculate the maximum widht and height for a label in the legend. |
| 54 | */ |
| 55 | void CalculateLegendDimensionscxx . . $ simple_pie_plot/SimplePiePlot#CalculateLegendDimensions(728e75216fb6696d).(wxGraphicsContextcxx . . $ wxGraphicsContext# *dc); |
| 56 | |
| 57 | /** |
| 58 | * Calculate the location and radius of the pie plot. |
| 59 | */ |
| 60 | void CalculatePiePlotLocationcxx . . $ simple_pie_plot/SimplePiePlot#CalculatePiePlotLocation(49f6e7a06ebc5aa8).(); |
| 61 | |
| 62 | void DrawLegendcxx . . $ simple_pie_plot/SimplePiePlot#DrawLegend(728e75216fb6696d).(wxGraphicsContextcxx . . $ wxGraphicsContext# *dc); |
| 63 | |
| 64 | void Highlightcxx . . $ simple_pie_plot/SimplePiePlot#Highlight(d4f767463ce0a6b3).(int i); |
| 65 | void ClearHighlightcxx . . $ simple_pie_plot/SimplePiePlot#ClearHighlight(49f6e7a06ebc5aa8).(); |
| 66 | |
| 67 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<double> m_datacxx . . $ simple_pie_plot/SimplePiePlot#m_data.; |
| 68 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<wxStringcxx . . $ wxString#> m_labelscxx . . $ simple_pie_plot/SimplePiePlot#m_labels.; |
| 69 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<double> m_anglescxx . . $ simple_pie_plot/SimplePiePlot#m_angles.; |
| 70 | double m_data_totalcxx . . $ simple_pie_plot/SimplePiePlot#m_data_total.; |
| 71 | int m_highlightcxx . . $ simple_pie_plot/SimplePiePlot#m_highlight.; |
| 72 | |
| 73 | /// maximum width for a label in the legend. |
| 74 | double m_max_legend_widthcxx . . $ simple_pie_plot/SimplePiePlot#m_max_legend_width.; |
| 75 | /// maximum height for a label in the legend. |
| 76 | double m_max_legend_heightcxx . . $ simple_pie_plot/SimplePiePlot#m_max_legend_height.; |
| 77 | /// total width of the legend |
| 78 | double m_legend_widthcxx . . $ simple_pie_plot/SimplePiePlot#m_legend_width.; |
| 79 | /// the line height of each legend entry including padding |
| 80 | double m_legend_line_heightcxx . . $ simple_pie_plot/SimplePiePlot#m_legend_line_height.; |
| 81 | |
| 82 | static const double m_legend_left_paddingcxx . . $ simple_pie_plot/SimplePiePlot#m_legend_left_padding.; |
| 83 | |
| 84 | // The center point of the pie plot |
| 85 | double m_pie_xcxx . . $ simple_pie_plot/SimplePiePlot#m_pie_x.; |
| 86 | double m_pie_ycxx . . $ simple_pie_plot/SimplePiePlot#m_pie_y.; |
| 87 | double m_radiuscxx . . $ simple_pie_plot/SimplePiePlot#m_radius.; |
| 88 | |
| 89 | }; |
| 90 | |
| 91 | } // namespace |
| 92 | |
| 93 | #endif |