21 #ifndef OPHIDIAN_GUI_CANVAS_H
22 #define OPHIDIAN_GUI_CANVAS_H
24 #include <SFML/Graphics.hpp>
25 #include "../geometry/geometry.h"
26 #include "drawable_batch.h"
32 entity_system::entity entity;
36 entity_system::entity entity;
37 bool operator==(
const quad & o)
const {
38 return entity == o.entity;
43 std::array<line, 4> lines;
54 template<>
struct hash<ophidian::gui::quad>
57 typedef std::size_t result_type;
58 result_type operator()(argument_type
const& s)
const
60 hash<ophidian::entity_system::entity> hash1;
61 return hash1(s.entity);
78 std::vector< arrow > m_arrows;
83 void draw(sf::RenderTarget& target, sf::RenderStates states)
const;
85 line line_create(
const geometry::point<double> & p1,
const geometry::point<double> & p2);
86 void destroy(
line the_line);
87 void transform(
line the_line,
const sf::Transform & transformation);
88 void paint(
line the_line, sf::Color color);
90 quad quad_create(
const geometry::point<double> & p1,
const geometry::point<double> & p2,
const geometry::point<double> & p3,
const geometry::point<double> & p4);
91 void destroy(
quad the_quad);
92 void transform(
quad the_quad,
const sf::Transform & transformation);
93 void paint(
quad the_quad, sf::Color color);
95 thick_line thick_line_create(
const geometry::point<double> & p1,
const geometry::point<double> & p2, std::size_t thickness);
97 void transform(
thick_line the_line,
const sf::Transform & transformation);
98 void paint(
thick_line the_line, sf::Color color);
99 void thick_line_update(
thick_line the_line,
const geometry::point<double> & p1,
const geometry::point<double> & p2);
102 void arrow_create(
thick_line line,
quad q1,
quad q2,
const geometry::point<double> & offset1,
const geometry::point<double> & offset2);
106 void quad_update(
quad the_quad,
const geometry::point<double> & p1,
const geometry::point<double> & p2,
const geometry::point<double> & p3,
const geometry::point<double> & p4);
108 const std::array<sf::Vertex, 4> & quad_points(
quad the_quad)
const {
109 return m_quads.points(the_quad.entity);
115 void destroy(
const wire_quad & the_wirequad);
124 bool has_animation()
const;
133 geometry::point<double> offset;
144 #endif // OPHIDIAN_GUI_CANVAS_H
Definition: drawable_batch.h:12