58 m_color(old.m_color) {
76 FL_WARN(
_log,
"No cellgrid assigned to layer, cannot draw grid");
150 int32_t cvx2 = round((cv.
x+cv.
w) * 1.25);
151 int32_t cvy2 = round((cv.
y+cv.
h) * 1.25);
152 cv.
x -= round((cv.
x+cv.
w) * 0.125);
153 cv.
y -= round((cv.
y+cv.
h) * 0.125);
154 RenderList::const_iterator instance_it = instances.begin();
155 for (;instance_it != instances.end(); ++instance_it) {
156 Instance* instance = (*instance_it)->instance;
157 std::vector<ExactModelCoordinate> vertices;
159 std::vector<ExactModelCoordinate>::const_iterator it = vertices.begin();
161 Point pt1(firstpt.
x, firstpt.
y);
164 for (; it != vertices.end(); it++) {
171 if (cpt1.
x < cv.
x) cpt1.
x = cv.
x;
172 if (cpt2.
x < cv.
x) cpt2.
x = cv.
x;
173 if (cpt1.
y < cv.
y) cpt1.
y = cv.
y;
174 if (cpt2.
y < cv.
y) cpt2.
y = cv.
y;
175 if (cpt1.
x > cvx2) cpt1.
x = cvx2;
176 if (cpt2.
x > cvx2) cpt2.
x = cvx2;
177 if (cpt1.
y > cvy2) cpt1.
y = cvy2;
178 if (cpt2.
y > cvy2) cpt2.
y = cvy2;
183 if ((pt2.
x >= cv.
x) && (pt2.
x <= cvx2) && (pt2.
y >= cv.
y) && (pt2.
y <= cvy2)) {
184 if ((firstpt.
x >= cv.
x) && (firstpt.
x <= cvx2) && (firstpt.
y >= cv.
y) && (firstpt.
y <= cvy2)) {
#define FL_WARN(logger, msg)
Abstract interface for all the renderbackends.
std::vector< RenderItem * > RenderList
T h
Height of the rectangle.
Interface to class owning the renderers Used to get correct subclass of renderer in scripting side (v...
static Logger _log(LM_AUDIO)
virtual ~GridRenderer()
Destructor.
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...
Location & getLocationRef()
Gets reference of current location of instance.
ModelCoordinate getLayerCoordinates() const
Gets cell precision layer coordinates set to this location.
virtual void getVertices(std::vector< ExactModelCoordinate > &vtx, const ModelCoordinate &cell)=0
Fills given point vector with vertices from selected cell.
RenderBackend * m_renderbackend
PointType2D< int32_t > Point
const Rect & getViewPort() const
Gets the viewport for camera in pixel coordinates.
Base class for all view renderers View renderer renders one aspect of the view shown on screen...
static GridRenderer * getInstance(IRendererContainer *cnt)
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.
CellGrid * getCellGrid() const
Get the Cellgrid.
GridRenderer(RenderBackend *renderbackend, int32_t position)
constructor.
ScreenPoint toScreenCoordinates(const ExactModelCoordinate &map_coords)
Transforms given point from map coordinates to screen 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 r, Uint8 g, Uint8 b)
RendererBase * clone()
Makes copy of this renderer.
ExactModelCoordinate toMapCoordinates(const ModelCoordinate &layer_coords)
Transforms given point from layer coordinates to map coordinates.
T w
Width of the rectangle.
An Instance is an "instantiation" of an Object at a Location.