AbstractRenderer.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 AbstractRenderer.h
22 
23  \brief This is the base class for renderers.
24  */
25 
26 #ifndef __TERRALIB_MAPTOOLS_INTERNAL_ABSTRACTRENDERER_H
27 #define __TERRALIB_MAPTOOLS_INTERNAL_ABSTRACTRENDERER_H
28 
29 // TerraLib
30 #include "Config.h"
31 
32 namespace te
33 {
34 // Forward declarations
35  namespace gm { class Envelope; }
36  namespace se { class Style; }
37 
38  namespace map
39  {
40 // Forward declarations
41  class AbstractLayer;
42  class Canvas;
43 
44  /*!
45  \class AbstractRenderer
46 
47  \brief It renders the objects associated to a layer.
48 
49  The renderer will be responsible for:
50  <ul>
51  <li>locate/retrieve the objects associated to the layer</li>
52  <li>set the canvas with the appropriated style rules to draw the objects</li>
53  <li>make use of a canvas to draw the objects</li>
54  </ul>
55 
56  \ingroup map
57 
58  \sa AbstractLayer, Canvas, RendererFactory, FeatureTypeStyleRenderer,
59  CoverageStyleRenderer, DataSetLayerRenderer, QueryLayerRenderer
60  */
62  {
63  public:
64 
65  /** @name Initializer Methods
66  * Methods related to instantiation and destruction.
67  */
68  //@{
69 
70  /*! \brief Default Constructor. */
72 
73  /*! \brief Virtual Destructor. */
74  virtual ~AbstractRenderer(){};
75 
76  //@}
77 
78  /** @name Pure Virtual Methods
79  * Methods that subclasses must implement.
80  */
81  //@{
82 
83  /*!
84  \brief It draws the layer geographic objects in the given canvas using the SRS informed.
85 
86  The informed bounding box (bbox) is used to constraint the Layer objects to be drawn.
87  The bbox coordinates must be in the Spatial Reference System given by srid.
88 
89  \param layer The layer that will be drawn.
90  \param canvas The canvas were the layer objects will be drawn.
91  \param bbox The interest area to render the map.
92  \param srid The SRS to be used to draw the layer objects.
93  \param scale The current scale to draw the layer.
94  */
95  virtual void draw(AbstractLayer* layer, Canvas* canvas, const te::gm::Envelope& bbox, int srid, const double& scale, bool* cancel) = 0;
96 
97  //@}
98 
99  private:
100 
101  /** @name Copy Constructor and Assignment Operator
102  * Copy constructor and assignment operator not allowed.
103  */
104  //@{
105 
106  /*!
107  \brief Copy constructor not allowed.
108 
109  \param rhs The renderer that would be copied.
110  */
112 
113  /*!
114  \brief Assignment operator not allowed.
115 
116  \param rhs The renderer whose contents would be assigned to this renderer.
117 
118  \return A reference to this renderer.
119  */
120  AbstractRenderer& operator=(const AbstractRenderer& rhs);
121 
122  //@}
123 
124  };
125 
126  } // end namespace map
127 } // end namespace te
128 
129 #endif // __TERRALIB_MAPTOOLS_INTERNAL_ABSTRACTRENDERER_H
130 
This is the base class for layers.
Definition: AbstractLayer.h:76
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:51
URI C++ Library.
AbstractRenderer()
Default Constructor.
#define TEMAPEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:60
A canvas is an abstraction of a drawing area.
Definition: Canvas.h:92
virtual ~AbstractRenderer()
Virtual Destructor.
It renders the objects associated to a layer.