30 #include "video/renderbackend.h"
31 #include "util/math/fife_math.h"
32 #include "util/log/logger.h"
33 #include "model/metamodel/grids/cellgrid.h"
34 #include "model/structures/instance.h"
35 #include "model/structures/layer.h"
36 #include "model/structures/location.h"
38 #include "view/camera.h"
39 #include "cellselectionrenderer.h"
43 static Logger _log(LM_VIEWVIEW);
55 m_color(old.m_color) {
76 std::vector<Location>::const_iterator it = m_locations.begin();
77 for (; it != m_locations.end(); it++) {
78 if (*it == *loc)
return;
81 m_locations.push_back(Location(*loc));
87 std::vector<Location>::iterator it = m_locations.begin();
88 for (; it != m_locations.end(); it++) {
90 m_locations.erase(it);
98 std::vector<Location>::const_iterator locit = m_locations.begin();
100 for (; locit != m_locations.end(); locit++) {
101 const Location loc = *locit;
102 if (layer != loc.getLayer()) {
108 FL_WARN(_log,
"No cellgrid assigned to layer, cannot draw selection");
114 std::vector<ExactModelCoordinate> vertices;
115 cg->getVertices(vertices, loc.getLayerCoordinates());
116 std::vector<ExactModelCoordinate>::const_iterator it = vertices.begin();
118 Point pt1(firstpt.x, firstpt.y);
121 for (; it != vertices.end(); it++) {
123 pt2.x = pts.x; pt2.y = pts.y;
126 m_renderbackend->drawLine(cpt1, cpt2, m_color.r, m_color.g, m_color.b);
129 m_renderbackend->drawLine(pt2,
Point(firstpt.x, firstpt.y), m_color.r, m_color.g, m_color.b);
134 void CellSelectionRenderer::setColor(Uint8 r, Uint8 g, Uint8 b) {