5#ifndef INCLUDE_FIFECHAN_WIDGETS_PIEGRAPH_HPP_
6#define INCLUDE_FIFECHAN_WIDGETS_PIEGRAPH_HPP_
10#include "fifechan/point.hpp"
11#include "fifechan/widget.hpp"
Abstract interface providing primitive drawing functions (lines, rectangles, etc.).
Point m_center
The center point of the pie graph.
int getCenterX() const
Get the center x-coordinate.
bool m_opaque
True if the pie graph is drawn opaque.
PieGraph()
Default constructor.
void addSegment(int startAngle, int stopAngle, Color const &color)
Add a segment to the pie graph.
void setRadius(int radius)
Set the radius of the pie graph.
void setCenterX(int x)
Set the center x-coordinate.
int getRadius() const
Get the radius of the pie graph.
int getCenterY() const
Get the center y-coordinate.
int m_radius
The radius of the pie graph in pixels.
Point const & getCenter() const
Get the center point.
std::vector< PieGraphSegment > m_segments
The list of segments that make up the pie graph.
void clearSegments()
Remove all segments from the pie graph.
void draw(Graphics *graphics) override
Draws this widget.
void setCenterY(int y)
Set the center y-coordinate.
void setOpaque(bool opaque)
Sets the opacity of the graph.
void setCenter(int x, int y)
Set the center coordinates.
Represents a 2D coordinate (X, Y).
Represents a single segment of a pie graph (angles and color).
int stopAngle
Stop angle in degrees.
Color color
Color of the segment.
int startAngle
Start angle in degrees.