Loading...
Searching...
No Matches
Style.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/Style.h
22
23 \brief The Style defines the styling that is to be applied to a geographic dataset (vector geometries or coverage).
24*/
25
26#ifndef __TERRALIB_SE_INTERNAL_STYLE_H
27#define __TERRALIB_SE_INTERNAL_STYLE_H
28
29// TerraLib
30#include "../common/BaseVisitable.h"
31#include "Config.h"
32#include "Visitor.h"
33
34// STL
35#include <string>
36#include <vector>
37
38// Boost
39#include <boost/noncopyable.hpp>
40
41namespace te
42{
43// Forward declarations
44 namespace xl { class SimpleLink; }
45
46 namespace se
47 {
48// Forward declarations
49 class Description;
50 class Rule;
51
52 /*!
53 \class Style
54
55 \brief The Style defines the styling that is to be applied to a geographic dataset (vector geometries or coverage).
56
57 The ordering to use for the Rules inside of a Style
58 is following the "painters model" with the first item in a list
59 being the first item plotted and hence being on the "bottom".
60
61 \ingroup se
62
63 \sa FeatureTypeStyle, CoverageStyle, Description, Rule
64 */
65 class TESEEXPORT Style : public te::common::BaseVisitable<Visitor>, public boost::noncopyable
66 {
67 public:
68
70
71 /** @name Initializer Methods
72 * Methods related to instantiation and destruction.
73 */
74 //@{
75
76 /*! \brief It initializes a new Style. */
78
79 /*! \brief Virtual destructor. */
80 virtual ~Style();
81
82 //@}
83
84 /** @name Accessor methods
85 * Methods used to get or set properties.
86 */
87 //@{
88
89 void setName(std::string* name);
90
91 const std::string* getName() const;
92
94
96
97 void push_back(const std::string& semanticTypeIdentifier);
98
99 const std::string& getSemanticTypeIdentifier(std::size_t i);
100
101 const std::vector<std::string>* getSemanticTypeIdentifiers() const;
102
103 void push_back(Rule* rule);
104
105 const std::vector<Rule*>& getRules() const;
106
107 Rule* getRule(std::size_t i) const;
108
109 void removeRule(std::size_t i);
110
112
113 void setRule(std::size_t i, Rule* rule);
114
115 void push_back(te::xl::SimpleLink* onlineResource);
116
117 const std::vector<te::xl::SimpleLink*>& getOnlineResources() const;
118
119 const te::xl::SimpleLink* getOnlineResource(std::size_t i) const;
120
121 void setVersion(const std::string& v);
122
123 const std::string& getVersion() const;
124
125 /*!
126 \brief It returns the style type.
127
128 \return The style type.
129 */
130 virtual const std::string& getType() const = 0;
131
132 //@}
133
134 /*! \brief It creates a new copy of this object. */
135 virtual Style* clone() const = 0;
136
137 protected:
138
139 std::string* m_name; //!< It allows the style to be referenced. Names must be unique in the context in which they are defined. (Optional)
140 Description* m_description; //!< It gives an informative description of the style. (Optional)
141 std::vector<std::string>* m_semanticTypeIdentifiers; //!< The SemanticTypeIdentifier is experimental and is intended to be used to identify what the feature style is suitable to be used for using community-controlled name(s). (Optional)
142 std::vector<Rule*> m_rules; //!< It allows conditional rendering. (Mandatory if m_onlineResource is empty, otherwise, it is optional)
143 std::vector<te::xl::SimpleLink*> m_onlineResources; //!< It refers to an external document. (Mandatory if m_rules is empty, otherwise, it is optional)
144 std::string m_version; //!< The version is an optional attribute on the FeatureTypeStyle that identifies the SE version number that the FeatureTypeStyle corresponds to. (Optional)
145 };
146
147 } // end namespace se
148} // end namespace te
149
150#endif // __TERRALIB_SE_INTERNAL_STYLE_H
#define TE_DEFINE_VISITABLE
Definition: BaseVisitable.h:75
The root of all hierarchies that can be visited.
Definition: BaseVisitable.h:54
A Description gives human-readable descriptive information for the object it is included within.
Definition: Description.h:57
A Rule is used to attach property/scale conditions to and group the individual symbols used for rende...
Definition: Rule.h:77
The Style defines the styling that is to be applied to a geographic dataset (vector geometries or cov...
Definition: Style.h:66
void setDescription(Description *d)
void setRule(std::size_t i, Rule *rule)
Description * m_description
It gives an informative description of the style. (Optional)
Definition: Style.h:140
const Description * getDescription() const
std::vector< std::string > * m_semanticTypeIdentifiers
The SemanticTypeIdentifier is experimental and is intended to be used to identify what the feature st...
Definition: Style.h:141
Style()
It initializes a new Style.
virtual Style * clone() const =0
It creates a new copy of this object.
std::vector< Rule * > m_rules
It allows conditional rendering. (Mandatory if m_onlineResource is empty, otherwise,...
Definition: Style.h:142
void setVersion(const std::string &v)
Rule * getRule(std::size_t i) const
void push_back(Rule *rule)
const std::vector< Rule * > & getRules() const
const std::string & getVersion() const
const te::xl::SimpleLink * getOnlineResource(std::size_t i) const
void push_back(const std::string &semanticTypeIdentifier)
std::vector< te::xl::SimpleLink * > m_onlineResources
It refers to an external document. (Mandatory if m_rules is empty, otherwise, it is optional)
Definition: Style.h:143
void push_back(te::xl::SimpleLink *onlineResource)
const std::string & getSemanticTypeIdentifier(std::size_t i)
void removeRule(std::size_t i)
void setName(std::string *name)
virtual ~Style()
Virtual destructor.
std::string * m_name
It allows the style to be referenced. Names must be unique in the context in which they are defined....
Definition: Style.h:139
const std::string * getName() const
const std::vector< te::xl::SimpleLink * > & getOnlineResources() const
const std::vector< std::string > * getSemanticTypeIdentifiers() const
void removeRules()
virtual const std::string & getType() const =0
It returns the style type.
std::string m_version
The version is an optional attribute on the FeatureTypeStyle that identifies the SE version number th...
Definition: Style.h:144
TerraLib.
A visitor interface for the SymbologyEncoding hierarchy.
#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).