All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
GraphicStroke.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/GraphicStroke.cpp
22 
23  \brief A GraphicStroke defines a repeated-linear graphic pattern to be used for stroking a line.
24 */
25 
26 // TerraLib
27 #include "Graphic.h"
28 #include "GraphicStroke.h"
29 #include "ParameterValue.h"
30 
32  : m_graphic(0),
33  m_initialGap(0),
34  m_gap(0)
35 {
36 }
37 
39 {
40  delete m_graphic;
41  delete m_initialGap;
42  delete m_gap;
43 }
44 
46 {
47  delete m_graphic;
48  m_graphic = g;
49 }
50 
52 {
53  return m_graphic;
54 }
55 
57 {
58  delete m_initialGap;
59  m_initialGap = initialGap;
60 }
61 
63 {
64  return m_initialGap;
65 }
66 
68 {
69  delete m_gap;
70  m_gap = gap;
71 }
72 
74 {
75  return m_gap;
76 }
77 
79 {
80  GraphicStroke* graphicStroke = new GraphicStroke;
81 
82  if(m_graphic)
83  graphicStroke->setGraphic(m_graphic->clone());
84 
85  if(m_initialGap)
86  graphicStroke->setInitialGap(new ParameterValue(*m_initialGap));
87 
88  if(m_gap)
89  graphicStroke->setGap(new ParameterValue(*m_gap));
90 
91  return graphicStroke;
92 }
GraphicStroke * clone() const
It creates a new copy of this object.
const ParameterValue * getGap() const
const ParameterValue * getInitialGap() const
The ParameterValueType uses WFS-Filter expressions to give values for SE graphic parameters.
void setInitialGap(ParameterValue *initialGap)
It specifies how far away the first graphic will be drawn relative to the start of the rendering line...
A Graphic is a graphic symbol with an inherent shape, color(s), and possibly size.
Definition: Graphic.h:66
The "ParameterValueType" uses WFS-Filter expressions to give values for SE graphic parameters...
GraphicStroke()
It initializes a new GraphicStroke.
void setGraphic(Graphic *g)
It specifies the linear graphic.
~GraphicStroke()
Destructor.
A GraphicStroke defines a repeated-linear graphic pattern to be used for stroking a line...
void setGap(ParameterValue *gap)
It sets the distance between two graphics.
A Graphic is a graphic symbol with an inherent shape, color(s), and possibly size.
const Graphic * getGraphic() const
A GraphicStroke defines a repeated-linear graphic pattern to be used for stroking a line...
Definition: GraphicStroke.h:50