FifeGUI 0.3.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// Project headers (subdirs before local)
9#include "fifechan/point.hpp"
10#include "fifechan/widget.hpp"
11
12namespace fcn
13{
14 class Graphics;
15
27 class FIFEGUI_API PointGraph : public Widget
28 {
29 public:
33 PointGraph();
39 explicit PointGraph(PointVector data);
40 ~PointGraph() override = default;
41
42 PointGraph(PointGraph const &) = delete;
43 PointGraph& operator=(PointGraph const &) = delete;
44 PointGraph(PointGraph&&) = delete;
45 PointGraph& operator=(PointGraph&&) = delete;
46
52 void setPointVector(PointVector const & data);
53
57 PointVector const & getPointVector() const;
58
62 void resetPointVector();
63
69 void setThickness(unsigned int thickness);
70
76 unsigned int getThickness() const;
77
83 void setOpaque(bool opaque);
84
88 bool isOpaque() const;
89
93 void draw(Graphics* graphics) override;
94
95 protected:
98
100 unsigned int m_thickness;
101
104 };
105}; // namespace fcn
106
107#endif // INCLUDE_FIFECHAN_WIDGETS_POINTGRAPH_HPP_
Abstract interface providing primitive drawing functions (lines, rectangles, etc.).
Definition graphics.hpp:58
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:52
Used replacement tokens by configure_file():
std::vector< Point > PointVector
A list of points.
Definition point.hpp:331