79 std::vector<Location>::const_iterator it =
m_locations.begin();
92 std::vector<Location>::iterator it =
m_locations.begin();
107 std::vector<Location>::const_iterator locit =
m_locations.begin();
116 FL_WARN(
_log,
"No cellgrid assigned to layer, cannot draw selection");
120 std::vector<ExactModelCoordinate> vertices;
122 std::vector<ExactModelCoordinate>::const_iterator it = vertices.begin();
124 Point pt1(firstpt.
x, firstpt.
y);
127 for (; it != vertices.end(); it++) {
129 pt2.
x = pts.
x; pt2.
y = pts.
y;
#define FL_WARN(logger, msg)
SDL_Color m_color
currently used color
Abstract interface for all the renderbackends.
std::vector< RenderItem * > RenderList
Layer * getLayer() const
Gets the layer where this location is pointing to.
RendererBase * clone()
Makes copy of this renderer.
Interface to class owning the renderers Used to get correct subclass of renderer in scripting side (v...
static Logger _log(LM_AUDIO)
virtual RendererBase * getRenderer(const std::string &renderername)=0
Returns renderer with given name.
Camera describes properties of a view port shown in the main screen Main screen can have multiple cam...
void deselectLocation(const Location *loc)
Deselects given location on map.
virtual void getVertices(std::vector< ExactModelCoordinate > &vtx, const ModelCoordinate &cell)=0
Fills given point vector with vertices from selected cell.
std::vector< Location > m_locations
selected locations
RenderBackend * m_renderbackend
PointType2D< int32_t > Point
static CellSelectionRenderer * getInstance(IRendererContainer *cnt)
Gets instance for interface access.
virtual ~CellSelectionRenderer()
Destructor.
Base class for all view renderers View renderer renders one aspect of the view shown on screen...
CellSelectionRenderer(RenderBackend *renderbackend, int32_t position)
Constructor.
virtual void drawLine(const Point &p1, const Point &p2, uint8_t r, uint8_t g, uint8_t b, uint8_t a=255)=0
Draws line between given points with given RGBA.
virtual void setEnabled(bool enabled)
Enables renderer.
CellSelectionRenderer renders a frame around selected cells.
void reset()
Deselects all locations.
void selectLocation(const Location *loc)
Selects given location on map.
CellGrid * getCellGrid() const
Get the Cellgrid.
ScreenPoint toScreenCoordinates(const ExactModelCoordinate &map_coords)
Transforms given point from map coordinates to screen coordinates.
ModelCoordinate getLayerCoordinates() const
Gets cell precision layer coordinates set to this location.
ExactModelCoordinate toMapCoordinates(const ModelCoordinate &layer_coords)
Transforms given point from layer coordinates to map coordinates.
void render(Camera *cam, Layer *layer, RenderList &instances)
This method is called by the view to ask renderer to draw its rendering aspect based on given paramet...
void setColor(uint8_t r, uint8_t g, uint8_t b)
Changes the used color.