FifeGUI 0.2.0
A C++ GUI library designed for games.
pointgraph.hpp
1// SPDX-License-Identifier: LGPL-2.1-or-later OR BSD-3-Clause
2// SPDX-FileCopyrightText: 2004 - 2008 Olof Naessén and Per Larsson
3// SPDX-FileCopyrightText: 2013 - 2026 Fifengine contributors
4
5#ifndef INCLUDE_FIFECHAN_WIDGETS_POINTGRAPH_HPP_
6#define INCLUDE_FIFECHAN_WIDGETS_POINTGRAPH_HPP_
7
8#include "fifechan/point.hpp"
9#include "fifechan/widget.hpp"
10
11namespace fcn
12{
13 class Graphics;
14
26 class FIFEGUI_API PointGraph : public Widget
27 {
28 public:
32 PointGraph();
38 explicit PointGraph(PointVector data);
39 ~PointGraph() override = default;
40
41 PointGraph(PointGraph const &) = delete;
42 PointGraph& operator=(PointGraph const &) = delete;
43 PointGraph(PointGraph&&) = delete;
44 PointGraph& operator=(PointGraph&&) = delete;
45
51 void setPointVector(PointVector const & data);
52
56 PointVector const & getPointVector() const;
57
61 void resetPointVector();
62
68 void setThickness(unsigned int thickness);
69
75 unsigned int getThickness() const;
76
82 void setOpaque(bool opaque);
83
87 bool isOpaque() const;
88
92 void draw(Graphics* graphics) override;
93
94 protected:
97
99 unsigned int m_thickness;
100
102 PointVector m_data;
103 };
104}; // namespace fcn
105
106#endif // INCLUDE_FIFECHAN_WIDGETS_POINTGRAPH_HPP_
Abstract interface providing primitive drawing functions (lines, rectangles, etc.).
Definition graphics.hpp:57
bool isOpaque() const
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.
Widget()
Constructor.
Definition widget.cpp:36