Main Page
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
ExternalGraphic.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/ExternalGraphic.cpp
22
23
\brief The ExternalGraphic allows a reference to be made to an external graphic file with a Web URL or to in-line content.
24
*/
25
26
// TerraLib
27
#include "../common/STLUtils.h"
28
#include "../xlink/SimpleLink.h"
29
#include "
ExternalGraphic.h
"
30
#include "
InlineContent.h
"
31
#include "
Recode.h
"
32
33
te::se::ExternalGraphic::ExternalGraphic
()
34
: m_onlineResource(0),
35
m_inlineContent(0)
36
{
37
}
38
39
te::se::ExternalGraphic::~ExternalGraphic
()
40
{
41
delete
m_onlineResource;
42
delete
m_inlineContent;
43
44
te::common::FreeContents
(m_colorReplacements);
45
}
46
47
void
te::se::ExternalGraphic::setOnlineResource
(
te::xl::SimpleLink
* onlineResource)
48
{
49
delete
m_onlineResource;
50
m_onlineResource = onlineResource;
51
}
52
53
const
te::xl::SimpleLink
*
te::se::ExternalGraphic::getOnlineResource
()
const
54
{
55
return
m_onlineResource;
56
}
57
58
void
te::se::ExternalGraphic::setInlineContent
(
InlineContent
* inlineContent)
59
{
60
delete
m_inlineContent;
61
m_inlineContent = inlineContent;
62
}
63
64
const
te::se::InlineContent
*
te::se::ExternalGraphic::getInlineContent
()
const
65
{
66
return
m_inlineContent;
67
}
68
69
void
te::se::ExternalGraphic::setFormat
(
const
std::string& f)
70
{
71
m_format = f;
72
}
73
74
const
std::string&
te::se::ExternalGraphic::getFormat
()
const
75
{
76
return
m_format;
77
}
78
79
void
te::se::ExternalGraphic::add
(
Recode
* r)
80
{
81
m_colorReplacements.push_back(r);
82
}
83
84
te::se::ExternalGraphic
*
te::se::ExternalGraphic::clone
()
const
85
{
86
ExternalGraphic
* externalGraphic =
new
ExternalGraphic
;
87
88
externalGraphic->
setFormat
(m_format);
89
90
if
(m_onlineResource)
91
externalGraphic->
setOnlineResource
(
new
te::xl::SimpleLink
(*m_onlineResource));
92
93
if
(m_inlineContent)
94
externalGraphic->
setInlineContent
(m_inlineContent->clone());
95
96
// TODO: std::vector<Recode*>
97
98
return
externalGraphic;
99
}
te::xl::SimpleLink
Simple link.
Definition:
SimpleLink.h:48
te::se::ExternalGraphic::setInlineContent
void setInlineContent(InlineContent *inlineContent)
Definition:
ExternalGraphic.cpp:58
te::se::InlineContent
InlineContent is XML- or base64-encoded encoded content in some externally-defined format that is inc...
Definition:
InlineContent.h:51
te::se::ExternalGraphic::getOnlineResource
const te::xl::SimpleLink * getOnlineResource() const
Definition:
ExternalGraphic.cpp:53
te::se::ExternalGraphic
The ExternalGraphic allows a reference to be made to an external graphic file with a Web URL or to in...
Definition:
ExternalGraphic.h:86
te::se::ExternalGraphic::clone
ExternalGraphic * clone() const
It creates a new copy of this object.
Definition:
ExternalGraphic.cpp:84
InlineContent.h
InlineContent is XML or base64 encoded content in some externally-defined format that is included in ...
te::se::ExternalGraphic::getInlineContent
const InlineContent * getInlineContent() const
Definition:
ExternalGraphic.cpp:64
te::se::ExternalGraphic::getFormat
const std::string & getFormat() const
Definition:
ExternalGraphic.cpp:74
te::se::ExternalGraphic::add
void add(Recode *r)
Definition:
ExternalGraphic.cpp:79
te::se::Recode
Transformation of discrete values to other values.
Definition:
Recode.h:75
ExternalGraphic.h
The ExternalGraphic allows a reference to be made to an external graphic file with a Web URL or to in...
te::se::ExternalGraphic::setFormat
void setFormat(const std::string &f)
Definition:
ExternalGraphic.cpp:69
te::se::ExternalGraphic::~ExternalGraphic
~ExternalGraphic()
Destructor.
Definition:
ExternalGraphic.cpp:39
te::se::ExternalGraphic::setOnlineResource
void setOnlineResource(te::xl::SimpleLink *onlineResource)
Definition:
ExternalGraphic.cpp:47
te::common::FreeContents
void FreeContents(boost::unordered_map< K, V * > &m)
This function can be applied to a map of pointers. It will delete each pointer in the map...
Definition:
BoostUtils.h:55
te::se::ExternalGraphic::ExternalGraphic
ExternalGraphic()
It initializes a new ExternalGraphic.
Definition:
ExternalGraphic.cpp:33
Recode.h
Transformation of discrete values to other values.
TL5_2015_release
terralib5
src
terralib
se
ExternalGraphic.cpp
Generated on Wed Jun 3 2015 10:23:55 for TerraLib by
1.8.7