All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Mark.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/Mark.cpp
22 
23  \brief A Mark specifies a geometric shape and applies coloring to it.
24 */
25 
26 // TerraLib
27 #include "../xlink/SimpleLink.h"
28 #include "Fill.h"
29 #include "InlineContent.h"
30 #include "Mark.h"
31 #include "Stroke.h"
32 
34  : m_wellKnownName(0),
35  m_onlineResource(0),
36  m_inlineContent(0),
37  m_format(0),
38  m_markIndex(-1),
39  m_fill(0),
40  m_stroke(0)
41 {
42 }
43 
45 {
46  delete m_wellKnownName;
47  delete m_onlineResource;
48  delete m_inlineContent;
49  delete m_format;
50  delete m_fill;
51  delete m_stroke;
52 }
53 
54 void te::se::Mark::setWellKnownName(std::string* name)
55 {
56  delete m_wellKnownName;
57  m_wellKnownName = name;
58 }
59 
60 const std::string* te::se::Mark::getWellKnownName() const
61 {
62  return m_wellKnownName;
63 }
64 
66 {
67  delete m_onlineResource;
68  m_onlineResource = link;
69 }
70 
72 {
73  return m_onlineResource;
74 }
75 
77 {
78  delete m_inlineContent;
79  m_inlineContent = iContent;
80 }
81 
83 {
84  return m_inlineContent;
85 }
86 
87 void te::se::Mark::setFormat(std::string* f)
88 {
89  delete m_format;
90  m_format = f;
91 }
92 
93 const std::string* te::se::Mark::getFormat() const
94 {
95  return m_format;
96 }
97 
99 {
100  m_markIndex = i;
101 }
102 
104 {
105  return m_markIndex;
106 }
107 
109 {
110  delete m_fill;
111  m_fill = f;
112 }
113 
115 {
116  return m_fill;
117 }
118 
120 {
121  delete m_stroke;
122  m_stroke = s;
123 }
124 
126 {
127  return m_stroke;
128 }
129 
131 {
132  Mark* mark = new Mark;
133 
134  mark->setMarkIndex(m_markIndex);
135 
136  if(m_wellKnownName)
137  mark->setWellKnownName(new std::string(*m_wellKnownName));
138 
139  if(m_stroke)
140  mark->setStroke(m_stroke->clone());
141 
142  if(m_fill)
143  mark->setFill(m_fill->clone());
144 
145  if(m_onlineResource)
146  mark->setOnlineResource(new te::xl::SimpleLink(*m_onlineResource));
147 
148  if(m_inlineContent)
149  mark->setInlineContent(m_inlineContent->clone());
150 
151  if(m_format)
152  mark->setFormat(new std::string(*m_format));
153 
154  return mark;
155 }
int getMarkIndex() const
Definition: Mark.cpp:103
A Mark specifies a geometric shape and applies coloring to it.
Definition: Mark.h:84
A Fill specifies the pattern for filling an area geometry.
void setFill(Fill *f)
Definition: Mark.cpp:108
InlineContent is XML- or base64-encoded encoded content in some externally-defined format that is inc...
Definition: InlineContent.h:51
const std::string * getFormat() const
Definition: Mark.cpp:93
void setOnlineResource(te::xl::SimpleLink *link)
Definition: Mark.cpp:65
InlineContent is XML or base64 encoded content in some externally-defined format that is included in ...
void setInlineContent(InlineContent *iContent)
Definition: Mark.cpp:76
~Mark()
Destructor.
Definition: Mark.cpp:44
Mark()
It initializes a new Mark.
Definition: Mark.cpp:33
A Fill specifies the pattern for filling an area geometry.
Definition: Fill.h:59
const std::string * getWellKnownName() const
Definition: Mark.cpp:60
const Stroke * getStroke() const
Definition: Mark.cpp:125
const te::xl::SimpleLink * getOnlineResource() const
Definition: Mark.cpp:71
A Mark specifies a geometric shape and applies coloring to it.
void setMarkIndex(int i)
Definition: Mark.cpp:98
InlineContent * getInlineContent() const
Definition: Mark.cpp:82
A Stroke specifies the appearance of a linear geometry.
Definition: Stroke.h:67
void setFormat(std::string *f)
Definition: Mark.cpp:87
void setStroke(Stroke *s)
Definition: Mark.cpp:119
Mark * clone() const
It creates a new copy of this object.
Definition: Mark.cpp:130
void setWellKnownName(std::string *name)
The WellKnownName element gives the well-known name of the shape of the mark.
Definition: Mark.cpp:54
A Stroke specifies the appearance of a linear geometry.
const Fill * getFill() const
Definition: Mark.cpp:114