All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Project.h
Go to the documentation of this file.
1 /* Copyright (C) 20008-2013 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 terralib/qt/af/Project.h
22 
23  \brief This class models the concept of a project for the TerraLib Application Framework.
24 */
25 
26 #ifndef __TERRALIB_QT_AF_INTERNAL_PROJECT_H
27 #define __TERRALIB_QT_AF_INTERNAL_PROJECT_H
28 
29 // Terralib
30 #include "../../maptools/AbstractLayer.h"
31 #include "Config.h"
32 
33 // STL
34 #include <list>
35 #include <string>
36 
37 namespace te
38 {
39  namespace qt
40  {
41  namespace af
42  {
43  /*!
44  \class Project
45 
46  \brief This class models the concept of a project for the TerraLib Application Framework.
47 
48  \ingroup af
49  */
51  {
52  public:
53 
54  /*! \brief Constructor. */
55  Project();
56 
57  /*! \brief Destructor. */
58  ~Project();
59 
60  /*!
61  \brief It sets the title of the project.
62 
63  \param title The title of the project to be set.
64  */
65  void setTitle(const std::string& title);
66 
67  /*!
68  \brief It gets the title of the project.
69 
70  \return The title of the project.
71  */
72  const std::string& getTitle() const;
73 
74  /*!
75  \brief It sets the author of the project.
76 
77  \param title The author of the project to be set.
78  */
79  void setAuthor(const std::string& author);
80 
81  /*!
82  \brief It gets the author of the project.
83 
84  \return The author of the project.
85  */
86  const std::string& getAuthor() const;
87 
88  /*!
89  \brief It gets all the top layers of the project (folder and single layers).
90 
91  \return The list of all the top layers of the project (folder and single layers).
92  */
93  const std::list<te::map::AbstractLayerPtr>& getTopLayers() const;
94 
95  /*!
96  \brief It gets all the top layers of the project (folder and single layers).
97 
98  \return The list of all the top layers of the project (folder and single layers).
99  */
100  std::list<te::map::AbstractLayerPtr>& getTopLayers();
101 
102  /*!
103  \brief It gets all the layers (single and folder layers) of the project.
104 
105  \return The list of all the layers (single and folder layers) of the project.
106  */
107  std::list<te::map::AbstractLayerPtr> getAllLayers();
108 
109  /*!
110  \brief It gets all the single layers of the project.
111 
112  \return The list of all the single layers of the project.
113  */
114  std::list<te::map::AbstractLayerPtr> getSingleLayers();
115 
116  /*!
117  \brief It gets all the single layers that are visible.
118 
119  \return The list of all the single layers that are visible.
120  */
121  std::list<te::map::AbstractLayerPtr> getVisibleSingleLayers();
122 
123  /*!
124  \brief It sets the top layers of the project.
125 
126  \param layers The layers that will be set as the top layers of the project.
127  */
128  void setTopLayers(const std::list<te::map::AbstractLayerPtr>& layers);
129 
130  /*!
131  \brief It gets all the layers that are selected.
132 
133  \return The list of all the layers that are selected.
134  */
135  const std::list<te::map::AbstractLayerPtr> getSelectedLayers() const;
136 
137  /*!
138  \brief It sets all the layers that are selected.
139 
140  \param selectedLayers The list of all the layers that are selected.
141  */
142  void setSelectedLayers(const std::list<te::map::AbstractLayerPtr>& selectedLayers);
143 
144  /*!
145  \brief It adds the specified layer to the list of layers of the parent layer.
146  If the parent layer is not specified, the layer is added as a top layer of the project.
147 
148  \param layer The layer that will be added to the list of layers of the project.
149  \param parentLayer The parent layer where the layer will be added.
150  */
151  void add(const te::map::AbstractLayerPtr& layer,
153 
154  /*!
155  \brief It removes the specified layer from the project.
156 
157  \param layer The layer to be removed from the project.
158  */
159  void remove(const te::map::AbstractLayerPtr& layer);
160 
161  /*!
162  \brief It informs if the project has changed.
163 
164  \return True, if the project has changed; otherwise, it returns false.
165  */
166  bool hasChanged();
167 
168  /*!
169  \brief It sets the filename where the project will be saved.
170 
171  \param fName The file name where the project will be saved.
172  */
173  void setFileName(const std::string& fName);
174 
175  /*!
176  \brief It gets the filename where the project is saved.
177 
178  \return The file name where the project is saved.
179  */
180  const std::string& getFileName() const;
181 
182  /*!
183  \brief It sets the project status as changed or not.
184 
185  \param changed The flag that specifies if the project is to be set as changed or not.
186  */
187  void setProjectAsChanged(const bool& changed);
188 
189  /*!
190  \brief It clears the project, setting it as having no layers.
191  */
192  void clear();
193 
194  private:
195 
196  std::string m_title; //!< The title of the project.
197  std::string m_author; //!< The author of the project.
198  std::list<te::map::AbstractLayerPtr> m_topLayers; //!< The list of top layers of the project.
199  std::list<te::map::AbstractLayerPtr> m_selectedLayers; //!< The list of selected layers of the project.
200  bool m_changed; //!< Flag indicating that the project needs to be saved.
201  std::string m_fileName; //!< The project file.
202  };
203 
204  } // end namespace af
205  } // end namespace qt
206 } // end namespace te
207 
208 #endif // __TERRALIB_QT_AF_INTERNAL_PROJECT_H
std::string m_author
The author of the project.
Definition: Project.h:197
std::list< te::map::AbstractLayerPtr > m_topLayers
The list of top layers of the project.
Definition: Project.h:198
std::string m_title
The title of the project.
Definition: Project.h:196
std::list< te::map::AbstractLayerPtr > m_selectedLayers
The list of selected layers of the project.
Definition: Project.h:199
This class models the concept of a project for the TerraLib Application Framework.
Definition: Project.h:50
Configuration flags for the TerraLib Application Framework.
#define TEQTAFEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:108
std::string m_fileName
The project file.
Definition: Project.h:201
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
bool m_changed
Flag indicating that the project needs to be saved.
Definition: Project.h:200