All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
FeatureTypeStyle.cpp
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/FeatureTypeStyle.cpp
22 
23  \brief The FeatureTypeStyle defines the styling that is to be applied to a dataset that can be viewed as a feature type.
24 */
25 
26 // TerraLib
27 #include "../xlink/SimpleLink.h"
28 #include "Description.h"
29 #include "FeatureTypeStyle.h"
30 #include "Rule.h"
31 
32 const std::string te::se::FeatureTypeStyle::sm_type("FeatureTypeStyle");
33 
35  : m_featureTypeName(0)
36 {
37 }
38 
40 {
41  delete m_featureTypeName;
42 }
43 
45 {
46  delete m_featureTypeName;
47  m_featureTypeName = name;
48 }
49 
51 {
52  return m_featureTypeName;
53 }
54 
55 const std::string& te::se::FeatureTypeStyle::getType() const
56 {
57  return sm_type;
58 }
59 
61 {
62  FeatureTypeStyle* style = new FeatureTypeStyle();
63 
64  if(m_name)
65  style->setName(new std::string(*m_name));
66 
67  if(m_description)
68  style->setDescription(m_description->clone());
69 
70  if(m_semanticTypeIdentifiers)
71  {
72  for(std::size_t i = 0; i < m_semanticTypeIdentifiers->size(); ++i)
73  {
74  style->m_semanticTypeIdentifiers->push_back(m_semanticTypeIdentifiers->at(i));
75  }
76  }
77 
78  for(std::size_t i = 0; i < m_rules.size(); ++i)
79  {
80  if(m_rules[i])
81  style->m_rules.push_back(m_rules[i]->clone());
82  }
83 
84  for(std::size_t i = 0; i < m_onlineResources.size(); ++i)
85  {
86  if(m_onlineResources[i])
87  style->m_onlineResources.push_back(m_onlineResources[i]->clone());
88  }
89 
90  style->m_version = m_version;
91 
92  if(m_featureTypeName)
93  style->setFeatureTypeName(new std::string(*m_featureTypeName));
94 
95  return style;
96 }
const std::string * getFeatureTypeName() const
The Style defines the styling that is to be applied to a geographic dataset (vector geometries or cov...
Definition: Style.h:65
std::vector< Rule * > m_rules
It allows conditional rendering. (Mandatory if m_onlineResource is empty, otherwise, it is optional)
Definition: Style.h:136
void setDescription(Description *d)
Definition: Style.cpp:64
A Rule is used to attach property/scale conditions to and group the individual symbols used for rende...
static const std::string sm_type
A static data member used in the implementation of getType method.
A Description gives human-readable descriptive information for the object it is included within...
void setFeatureTypeName(std::string *name)
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:135
The FeatureTypeStyle defines the styling that is to be applied to a dataset that can be viewed as a f...
void setName(std::string *name)
Definition: Style.cpp:53
const std::string & getType() const
It returns the style type.
The FeatureTypeStyle defines the styling that is to be applied to a dataset that can be viewed as a f...
std::string m_version
The version is an optional attribute on the FeatureTypeStyle that identifies the SE version number th...
Definition: Style.h:138
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:137
FeatureTypeStyle()
It initializes a new FeatureTypeStyle.
Style * clone() const
It creates a new copy of this object.