Main Page
Modules
Namespaces
Classes
Files
File List
File Members
Element.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/annotationtext/Element.cpp
22
23
\brief An Text Element consists of a string, location, leader line and may have attribute.
24
*/
25
26
// TerraLib
27
#include "
Element.h
"
28
#include "
Attributes.h
"
29
#include "../geometry/Geometry.h"
30
31
te::at::Element::Element
()
32
{
33
m_value
.clear();
34
m_location
= 0;
35
m_leaderLine
= 0;
36
m_attribute
= 0;
37
}
38
39
te::at::Element::Element
(
const
std::string& value,
te::gm::Geometry
* location,
te::gm::Geometry
* leaderLine)
40
{
41
m_value = value;
42
m_location = location;
43
m_leaderLine = leaderLine;
44
m_attribute = 0;
45
}
46
47
te::at::Element::~Element
()
48
{
49
delete
m_location;
50
delete
m_leaderLine;
51
delete
m_attribute;
52
}
53
54
te::at::Element
*
te::at::Element::clone
()
const
55
{
56
Element
* e =
new
Element
;
57
e->
setValue
(m_value);
58
e->
setLocation
(m_location);
59
e->
setLeaderLine
(m_leaderLine);
60
e->
setAttributes
(m_attribute);
61
return
e;
62
}
63
64
void
te::at::Element::setValue
(
const
std::string& value)
65
{
66
m_value = value;
67
}
68
69
const
std::string&
te::at::Element::getValue
()
const
70
{
71
return
m_value;
72
}
73
74
void
te::at::Element::setLocation
(
te::gm::Geometry
* location)
75
{
76
delete
m_location;
77
m_location = location;
78
}
79
80
const
te::gm::Geometry
*
te::at::Element::getLocation
()
const
81
{
82
return
m_location;
83
}
84
85
void
te::at::Element::setLeaderLine
(
te::gm::Geometry
* leaderLine)
86
{
87
delete
m_leaderLine;
88
m_leaderLine = leaderLine;
89
}
90
91
const
te::gm::Geometry
*
te::at::Element::getLeaderLine
()
const
92
{
93
return
m_leaderLine;
94
}
95
96
void
te::at::Element::setAttributes
(
Attributes
* attribute)
97
{
98
delete
m_attribute;
99
m_attribute = attribute;
100
}
101
102
const
te::at::Attributes
*
te::at::Element::getAttributes
()
const
103
{
104
return
m_attribute;
105
}
106
te::at::Element::clone
Element * clone() const
It clones the Element.
Definition:
Element.cpp:54
te::at::Element::m_value
std::string m_value
text value
Definition:
Element.h:173
te::at::Element::m_attribute
Attributes * m_attribute
attributes
Definition:
Element.h:176
te::at::Element
Definition:
Element.h:55
Attributes.h
te::at::Element::getAttributes
const Attributes * getAttributes() const
it returns the text attributes.
Definition:
Element.cpp:102
te::at::Element::getLeaderLine
const te::gm::Geometry * getLeaderLine() const
it returns the text leader line.
Definition:
Element.cpp:91
te::at::Attributes
Definition:
Attributes.h:52
te::at::Element::m_location
te::gm::Geometry * m_location
location
Definition:
Element.h:174
te::at::Element::setAttributes
void setAttributes(Attributes *attribute)
it sets the text attributes.
Definition:
Element.cpp:96
te::at::Element::~Element
~Element()
Text Element destructor.
Definition:
Element.cpp:47
te::at::Element::getValue
const std::string & getValue() const
it returns the text string.
Definition:
Element.cpp:69
te::gm::Geometry
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
Definition:
Geometry.h:73
te::at::Element::setLeaderLine
void setLeaderLine(te::gm::Geometry *leaderLine)
it sets the text leader line.
Definition:
Element.cpp:85
te::at::Element::setValue
void setValue(const std::string &value)
it sets the text string.
Definition:
Element.cpp:64
te::at::Element::getLocation
const te::gm::Geometry * getLocation() const
it returns the text location.
Definition:
Element.cpp:80
te::at::Element::Element
Element()
Text Element constructor.
Definition:
Element.cpp:31
te::at::Element::m_leaderLine
te::gm::Geometry * m_leaderLine
leader line
Definition:
Element.h:175
te::at::Element::setLocation
void setLocation(te::gm::Geometry *location)
it sets the text location.
Definition:
Element.cpp:74
Element.h
An Text Element consists of a string, location, leader line and may have attribute.
git_master
terralib5
src
terralib
annotationtext
Element.cpp
Generated on Tue Jan 12 2016 08:40:53 for TerraLib by
1.8.9.1