All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ViewZoom.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 #ifndef __TERRALIB_LAYOUT_INTERNAL_VIEWZOOM_H
21 #define __TERRALIB_LAYOUT_INTERNAL_VIEWZOOM_H
22 
23 // TerraLib
24 #include "../../../core/Config.h"
25 #include "../AbstractViewTool.h"
26 
27 namespace te
28 {
29  namespace layout
30  {
31  // Forward declarations
32  class View;
33 
34  /*!
35  \class Pan
36 
37  \brief This class implements a concrete tool to geographic pan operation.
38 
39  \ingroup widgets
40  */
42  {
43  public:
44 
45  /*!
46  \enum ViewZoomType
47 
48  \brief Defines the zoom type.
49  */
51  {
52  TypeIn, /*!< Performs the zoom in operation. */
53  TypeOut /*!< Performs the zoom out operation. */
54  };
55 
56  /** @name Initializer Methods
57  * Methods related to instantiation and destruction.
58  */
59  //@{
60 
61  /*!
62  \brief It constructs a zoom associated with the given map display.
63 
64  \param display The map display associated with the zoom operation.
65 
66  \note The class will NOT take the ownership of the given pointer.
67  */
68  ViewZoom(View* view, const double& zoomFactor = 2.0, const ViewZoomType& type = TypeIn, QObject* parent = 0);
69 
70  /*! \brief Destructor. */
71  virtual ~ViewZoom();
72 
73  //@}
74 
75  /*!
76  \brief Sets the zoom operation type.
77 
78  \param type The zoom operation type - ZoomIn | ZoomOut;
79  */
80  void setZoomType(const ViewZoomType& type);
81 
82  /*!
83  \brief Performs the zoom operation on map display, considering the zoom factor, zoom type and the given point.
84 
85  \param point A point in world coordinates.
86 
87  \note If the given point is not null, the new extent will be centered on this point. Otherwise, the current center will be kepped.
88  */
89  void applyZoom(const QPointF& point = QPointF());
90 
91  protected:
92 
93  double m_zoomFactor; //!< Factor used to zoom. i.e. A factor value of 2.0 (default) will generate a new extent twice (%) bigger or smaller, depending of ZoomType.
94  ViewZoomType m_zoomType; //!< Enum that indicates the zoom type.
95  };
96  } // end namespace layout
97 } // end namespace te
98 
99 #endif
#define TELAYOUTEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:99
ViewZoomType m_zoomType
Enum that indicates the zoom type.
Definition: ViewZoom.h:94
Class representing the view. This view is child of QGraphicsView, part of Graphics View Framework...
Definition: View.h:89
double m_zoomFactor
Factor used to zoom. i.e. A factor value of 2.0 (default) will generate a new extent twice (%) bigger...
Definition: ViewZoom.h:93
ViewZoomType
Defines the zoom type.
Definition: ViewZoom.h:50