5#include <fifechan/widgets/pointgraph.hpp>
7#include <fifechan/exception.hpp>
8#include <fifechan/graphics.hpp>
62 ((
getSelectionMode() & Widget::SelectionMode::Background) == Widget::SelectionMode::Background)) {
75 if (active && (
getSelectionMode() & Widget::SelectionMode::Border) == Widget::SelectionMode::Border) {
97 for (; pit !=
m_data.end(); ++pit) {
98 int const x2 = (*pit).x;
99 int const y2 = (*pit).y;
105 for (; pit !=
m_data.end(); ++pit) {
106 int const x2 = (*pit).x;
107 int const y2 = (*pit).y;
116 unsigned int const markerRadius = std::max(4U,
m_thickness);
118 for (; pit !=
m_data.end(); ++pit) {
Abstract interface providing primitive drawing functions (lines, rectangles, etc.).
virtual void drawLine(int x1, int y1, int x2, int y2)=0
Draws a line.
virtual void drawFillCircle(Point const &p, unsigned int radius)=0
Draws a filled circle.
virtual void setColor(Color const &color)=0
Sets the color to use when drawing.
virtual void fillRectangle(Rectangle const &rectangle)=0
Draws a filled rectangle.
virtual void drawRoundStroke(int x1, int y1, int x2, int y2, unsigned int width)
Draws a round brush stroke along the line segment.
unsigned int m_thickness
Line thickness in pixels.
PointVector m_data
The point data used to draw the graph.
PointGraph()
Default constructor.
unsigned int getThickness() const
Get the thickness of the lines drawn between points.
void draw(Graphics *graphics) override
Draws this widget.
PointVector const & getPointVector() const
void setOpaque(bool opaque)
Sets the opacity of the graph.
void resetPointVector()
Resets the data to draw.
bool m_opaque
True if the graph is drawn opaque.
void setThickness(unsigned int thickness)
Set the thickness of the lines drawn between points.
void setPointVector(PointVector const &data)
Sets the data to draw.