All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
MapModel.h
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file MapModel.h
22 
23  \brief Class that represents a "Model" part of Map MVC component.
24  Its coordinate system is the same of scene (millimeters).
25  This is also son of ItemModelObservable, so it can become observable, and son of Visitable, so it can become visitable.
26 
27  \ingroup layout
28 */
29 
30 #ifndef __TERRALIB_LAYOUT_INTERNAL_MAP_MODEL_H
31 #define __TERRALIB_LAYOUT_INTERNAL_MAP_MODEL_H
32 
33 // TerraLib
34 #include "../core/pattern/mvc/ItemModelObservable.h"
35 #include "../core/ContextItem.h"
36 #include "../core/pattern/derivativevisitor/Visitable.h"
37 #include "../../maptools/AbstractLayer.h"
38 #include "../../common/UnitOfMeasure.h"
39 #include "../../geometry/Point.h"
40 #include "../core/Config.h"
41 
42 // STL
43 #include <map>
44 #include <string>
45 
46 namespace te
47 {
48  namespace layout
49  {
50  class Systematic;
51 
52  /*!
53  \brief Class that represents a "Model" part of Map MVC component.
54  Its coordinate system is the same of scene (millimeters).
55  This is also son of ItemModelObservable, so it can become observable, and son of Visitable, so it can become visitable.
56 
57  \ingroup layout
58 
59  \sa te::layout::ItemModelObservable , te::layout::Visitable
60  */
62  {
63  public:
64 
65  /*!
66  \brief Constructor
67  */
68  MapModel();
69 
70  /*!
71  \brief Destructor
72  */
73  virtual ~MapModel();
74 
75  virtual void draw( ContextItem context );
76 
77  virtual te::layout::Properties* getProperties() const;
78 
79  virtual void updateProperties(te::layout::Properties* properties);
80 
81  virtual bool refreshLayer(te::map::AbstractLayerPtr layer);
82 
83  virtual te::map::AbstractLayerPtr getLayer();
84 
85  virtual double getScale();
86 
87  virtual te::gm::Envelope getWorldInMeters();
88 
89  virtual te::gm::Envelope getWorldInDegrees();
90 
91  virtual te::common::UnitOfMeasurePtr unitMeasureLayer();
92 
93  virtual void setBox(te::gm::Envelope box);
94 
95  virtual te::gm::Envelope getMapBox();
96 
97  virtual void setPosition(const double& x, const double& y);
98 
99  virtual double getDisplacementX();
100 
101  virtual double getDisplacementY();
102 
103  virtual void setSystematic(Systematic* systematic);
104 
105  virtual void generateSystematic(te::gm::Coord2D coord);
106 
107  virtual bool isFixedScale();
108 
109  virtual void setFixedScale(bool fixed);
110 
111  virtual bool isPlanar();
112 
113  virtual te::gm::Envelope getWorldBox();
114 
115  virtual std::map<te::gm::Point*, std::string> getTextMapAsObjectInfo();
116 
117  virtual void setMapBackgroundColor(te::color::RGBAColor color);
118 
119  virtual te::color::RGBAColor getMapBackgroundColor();
120 
121  virtual std::string getNameLayer();
122 
123  virtual bool isLoadedLayer();
124 
125  protected:
126 
135  std::string m_nameLayer;
137  };
138  }
139 }
140 
141 #endif
Class to represent a visitable. All classes representing a visitable must inherit from this class...
Definition: Visitable.h:45
Class responsible for maintaining the drawing context of a MVC component. It is always used by the "M...
Definition: ContextItem.h:49
std::string m_nameLayer
Definition: MapModel.h:135
#define TELAYOUTEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:99
te::gm::Envelope m_mapBoxMM
Definition: MapModel.h:128
Abstract class to represent an observable. "Model" part of MVC component. All classes representing th...
te::gm::Envelope m_worldBox
Definition: MapModel.h:133
The Properties class represents a persistent set of properties. The Properties can be saved to a file...
Definition: Properties.h:52
Systematic * m_systematic
Definition: MapModel.h:131
An utility struct for representing 2D coordinates.
Definition: Coord2D.h:40
te::color::RGBAColor m_mapbackgroundColor
Definition: MapModel.h:134
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:51
Class that represents a "Model" part of Map MVC component. Its coordinate system is the same of scene...
Definition: MapModel.h:61
double m_mapDisplacementX
Definition: MapModel.h:129
boost::shared_ptr< UnitOfMeasure > UnitOfMeasurePtr
A helper class for 32-bit RGBA (Red-Green-Blue-Alpha channel) color.
Definition: RGBAColor.h:57
te::map::AbstractLayerPtr m_layer
Definition: MapModel.h:127
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
double m_mapDisplacementY
Definition: MapModel.h:130