Loading...
Searching...
No Matches
SymbologyManager.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 terralib/se/SymbologyManager.h
22
23 \brief The SymbologyManager is a singleton that can be used to manage all loaded symbols in TerraLib.
24*/
25
26#ifndef __TERRALIB_SE_INTERNAL_SYMBOLOGYMANAGER_H
27#define __TERRALIB_SE_INTERNAL_SYMBOLOGYMANAGER_H
28
29// TerraLib
30#include "../common/Singleton.h"
31#include "Config.h"
32
33// STL
34#include <map>
35#include <string>
36#include <vector>
37
38namespace te
39{
40 namespace se
41 {
42// Forward declarations
43 class Symbolizer;
44
45 /*!
46 \class SymbologyManager
47
48 \brief The SymbologyManager is a singleton that can be used to manage all loaded symbols in TerraLib.
49
50 \sa Singleton
51
52 \todo Sera que nao devia ser uma classe chamada StyleManager? Eu acho que nao pois soh tem serventia p/ os tipos basicos de desenho que a pessoa poderia escolher previamente e neste caso nao sao estilos e sim simbolos!
53 \todo Talvez seria interessante criar uma classe StyleManager com estilos completos ou pelo menos que a partir de simbolos ele jah defina tudinho: tracejado-vazado-linhas-amarelas...
54 */
55 class TESEEXPORT SymbologyManager : public te::common::Singleton<SymbologyManager>
56 {
58
59 public:
60
61 /** @name ColorManager Accessor Method
62 * Method used to access the data stored on this manager.
63 */
64 //@{
65
66 /*!
67 \brief It inserts a new catalog that will be managed by ColorManager.
68
69 \param c The new catalog to be managed by this manager.
70
71 \exception Exception If the catalog already exists it will raise an exception.
72
73 \note Don't free the resources used by the catalog, the manager will take the ownership of it.
74 */
75 //void insert(Symbolizer* c);
76
77 /*! \brief It removes the catalog from the system. It will not delete it from disk.
78
79 \param c The catalog to be removed.
80
81 \exception Exception If the catalog doesn't exist it will raise an exception.
82
83 \note The memory pointed by c will be deallocated. Don't reference it anymore.
84 */
85 //void remove(Symbolizer* c);
86
87 /*! \brief It returns the catalog identified by a given name or NULL if none is found.
88
89 \param name The name of the catalog we are looking for.
90
91 \return A pointer to a catalog (don't free the pointer) or NULL if none is found.
92 */
93 //Symbolizer* findByName(const std::string& name) const;
94
95 /*! \brief It returns a pair of iterators over the catalogs of this manager.
96
97 \return A pair of iterators over the catalogs of this manager where pair.first will be
98 the beginning and pair.second will be the end iterator.
99 */
100 //std::pair<std::vector<Symbolizer*>::const_iterator,
101 // std::vector<Symbolizer*>::const_iterator> getIterator() const;
102
103 /*! \brief It unloads all symbols managed by SymbologyManager. */
104 void clear();
105
106 //@}
107
108 /** @name Initializer Methods
109 * Methods related to instantiation and destruction.
110 */
111 //@{
112
113 /*! \brief Destructor. */
115
116 //@}
117
118 protected:
119
120 /** @name Initializer Methods
121 * Methods related to instantiation and destruction.
122 */
123 //@{
124
125 /*! \brief It initializes the Singleton. */
127
128 //@}
129
130 private:
131
132 std::map<std::string, Symbolizer*> m_catalogIdxByName; //!< An index from catalog's name to catalog's instance (note: we can not have duplicated names).
133 };
134
135 } // end namespace se
136} // end namespace te
137
138#endif // __TERRALIB_SE_INTERNAL_SYMBOLOGYMANAGER_H
139
Template support for singleton pattern.
Definition: Singleton.h:101
The SymbologyManager is a singleton that can be used to manage all loaded symbols in TerraLib.
SymbologyManager()
It initializes the Singleton.
~SymbologyManager()
Destructor.
std::map< std::string, Symbolizer * > m_catalogIdxByName
An index from catalog's name to catalog's instance (note: we can not have duplicated names).
void clear()
It inserts a new catalog that will be managed by ColorManager.
TerraLib.
#define TESEEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:201
Proxy configuration file for TerraView (see terraview_config.h).