AbstractMarkRenderer.h
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/maptools/AbstractMarkRenderer.h
22 
23  \brief An abstract class for conversion of Symbology Enconding Mark elements to an image pattern.
24 */
25 
26 #ifndef __TERRALIB_MAPTOOLS_INTERNAL_ABSTRACTMARKRENDERER_H
27 #define __TERRALIB_MAPTOOLS_INTERNAL_ABSTRACTMARKRENDERER_H
28 
29 // TerraLib
30 #include "../color/RGBAColor.h"
31 #include "Config.h"
32 
33 namespace te
34 {
35 // Forward declarations
36  namespace se
37  {
38  class Mark;
39  }
40 
41  namespace map
42  {
44  {
45  MarkRendererParams(const te::se::Mark* mark, std::size_t size, double angle = 0., bool isFill = false)
46  : m_mark(mark)
47  , m_size(size)
48  , m_angle(angle)
49  , m_isFill(isFill)
50  {
51 
52  }
53 
54  const te::se::Mark* m_mark; //!< The Symbology Enconding Mark element that will be used as base to build the image pattern.
55  std::size_t m_size; //!< The size of image pattern that will be generated.
56  double m_angle; //!< The angle of image pattern that will be generated.
57  bool m_isFill; //!< TRUE if this image will be used for filling an area. Some marks may need this information to create the image considering its continuity
58  };
59 
60 
61  /*!
62  \class AbstractMarkRenderer
63 
64  \brief An abstract class for conversion of Symbology Enconding Mark elements to an image pattern.
65  */
67  {
68  public:
69 
70  /*! \brief Constructor. */
72 
73  /*! \brief Virtual destructor. */
74  virtual ~AbstractMarkRenderer() { }
75 
76  /*!
77  \brief It generates the image pattern from the given Symbology Enconding Mark element.
78 
79  \param markRendererParams The parameters that will be used to render the mark
80 
81  \return The RGBA image that represents the mark.
82 
83  \note The caller will take the ownership of the returned pointer.
84  */
85  virtual te::color::RGBAColor** render(const MarkRendererParams& markRendererParams) = 0;
86 
87  /*!
88  \brief Method that informs the set of supported marks by a specific concrete mark renderer.
89 
90  \param marks A pre-created vector of string that will be filled with the supported marks names.
91  */
92  virtual void getSupportedMarks(std::vector<std::string>& marks) const = 0;
93  };
94 
95  } // end namespace map
96 } // end namespace te
97 
98 #endif // __TERRALIB_MAPTOOLS_INTERNAL_ABSTRACTMARKRENDERER_H
te
TerraLib.
Definition: AddressGeocodingOp.h:52
te::map::MarkRendererParams::m_mark
const te::se::Mark * m_mark
The Symbology Enconding Mark element that will be used as base to build the image pattern.
Definition: AbstractMarkRenderer.h:54
te::map::AbstractMarkRenderer::~AbstractMarkRenderer
virtual ~AbstractMarkRenderer()
Virtual destructor.
Definition: AbstractMarkRenderer.h:74
te::map::AbstractMarkRenderer::getSupportedMarks
virtual void getSupportedMarks(std::vector< std::string > &marks) const =0
Method that informs the set of supported marks by a specific concrete mark renderer.
te::map::MarkRendererParams::m_angle
double m_angle
The angle of image pattern that will be generated.
Definition: AbstractMarkRenderer.h:56
te::map::AbstractMarkRenderer::render
virtual te::color::RGBAColor ** render(const MarkRendererParams &markRendererParams)=0
It generates the image pattern from the given Symbology Enconding Mark element.
te::map::MarkRendererParams
Definition: AbstractMarkRenderer.h:44
te::se::Mark
A Mark specifies a geometric shape and applies coloring to it.
Definition: Mark.h:85
te::map::MarkRendererParams::m_isFill
bool m_isFill
TRUE if this image will be used for filling an area. Some marks may need this information to create t...
Definition: AbstractMarkRenderer.h:57
te::color::RGBAColor
A helper class for 32-bit RGBA (Red-Green-Blue-Alpha channel) color.
Definition: RGBAColor.h:58
TEMAPEXPORT
#define TEMAPEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:60
Config.h
Proxy configuration file for TerraView (see terraview_config.h).
te::map::AbstractMarkRenderer
An abstract class for conversion of Symbology Enconding Mark elements to an image pattern.
Definition: AbstractMarkRenderer.h:67
te::map::MarkRendererParams::MarkRendererParams
MarkRendererParams(const te::se::Mark *mark, std::size_t size, double angle=0., bool isFill=false)
Definition: AbstractMarkRenderer.h:45
te::map::MarkRendererParams::m_size
std::size_t m_size
The size of image pattern that will be generated.
Definition: AbstractMarkRenderer.h:55
te::map::AbstractMarkRenderer::AbstractMarkRenderer
AbstractMarkRenderer()
Constructor.
Definition: AbstractMarkRenderer.h:71