32 #include "../../ContextItem.h"
33 #include "../singleton/Context.h"
34 #include "../../../../maptools/Canvas.h"
35 #include "../factory/ItemParamsCreate.h"
36 #include "../factory/AbstractItemFactory.h"
125 m_view = (
Observer*)factory->
make(m_model->getType(), params);
virtual void setPosition(const double &x, const double &y)
Change coordinate llx,lly of the MVC component.
Abstract class to represent an observable. "Model" part of MVC component.
Class responsible for maintaining the drawing context of a MVC component. It is always used by the "M...
Abstract Factory provide an interface for creating families of related or dependent graphic objects (...
Abstract class to represent a controller. "Controller" part of MVC component. All classes representin...
virtual void setCanvas(te::map::Canvas *canvas)
Change canvas.
virtual bool contains(const te::gm::Coord2D &coord) const
Checks if the coordinate is contained within the bounding rectangle.
Abstract class to represent an observer. "View" part of MVC component. All classes representing the g...
const Observer * getView()
Returns the "View" part of the MVC component.
Abstract class to represent an observer. "View" part of MVC component.
Abstract class to represent an observable. "Model" part of MVC component. All classes representing th...
virtual void setUtils(Utils *utils)
virtual void clear()=0
It clears the canvas content and fills with the background color.
Abstract class to represent an observer. "View" part of MVC component. All classes representing the g...
An utility struct for representing 2D coordinates.
virtual Observer * make(EnumType *type, ItemParamsCreate params=ItemParamsCreate())=0
Method that builds and returns a new object (MVC component) of the type defined as parameter...
virtual void setPosition(const double &x, const double &y)
Change coordinate llx,lly of the MVC component.
const Observable * getModel()
Returns the "Model" part of the MVC component.
virtual void resetCanvas()
Clears the canvas content and fills with the background color. Sets all width with 1...
Abstract class to represent an observer. "View" part of MVC component.
static Context & getInstance()
It returns a reference to the singleton instance.
An Envelope defines a 2D rectangular region.
Utils * getUtils()
Returns pointer with functions to manipulate the canvas and conversion between projections.
virtual void refresh(bool pos=true)
Updated model state.
ItemController(Observable *o)
Constructor.
AbstractItemFactory * getItemFactory()
Returns Abstract Factory that provide an interface for creating families of related or dependent grap...
A canvas is an abstraction of a drawing area.
Abstract class to represent an observable. "Model" part of MVC component. All classes representing th...
virtual void setDpiX(double dpi)
virtual ~ItemController()
Destructor.
virtual void create()
Call factory to create the "View" part of the MVC component and passes the model and himself as contr...
virtual void setDpiY(double dpi)
double getZoomFactor()
Returns current zoom factor. Ex.: 0.5 (50%)
Parameters to creation new object. Ex.: "Model" and "Controller" of the new object (MVC component)...
virtual void draw(ContextItem context)
Drawing method of the MVC component.
Utility class with functions to manipulate the canvas and conversion between projections.
virtual bool contains(const te::gm::Coord2D &coord) const
Checks if the coordinate is contained within the bounding rectangle.
virtual void setBox(te::gm::Envelope box)
Change the bounding rectangle.
virtual void redraw()
Redraws the MVC component. Creates the ContextItem object and configures it. Calls the draw method of...
te::map::Canvas * getCanvas()
Returns abstraction of a drawing area.
virtual void setBox(te::gm::Envelope box)
Change the bounding rectangle.