All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
AbstractScene.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 AbstractScene.h
22 
23  \brief Abstract scene for Scene, a QGraphicsScene class, part of Graphics View Framework.
24 
25  \ingroup layout
26 */
27 
28 #ifndef __TERRALIB_LAYOUT_INTERNAL_ABSTRACT_SCENE_H
29 #define __TERRALIB_LAYOUT_INTERNAL_ABSTRACT_SCENE_H
30 
31 // TerraLib
32 #include "../../geometry/Envelope.h"
33 #include "Config.h"
34 
35 namespace te
36 {
37  namespace layout
38  {
39  class ItemObserver;
40 
41  /*!
42  \class AbstractScene
43 
44  \brief Abstract scene for Scene, a QGraphicsScene class, part of Graphics View Framework.
45 
46  \ingroup layout
47  */
49  {
50  public:
51 
52  /*!
53  \brief Constructor
54  */
55  AbstractScene();
56 
57  /*!
58  \brief Destructor
59  */
60  virtual ~AbstractScene(void) {};
61 
62  /*!
63  \brief Method that inserts a graphic object in the scene. Inverts the matrix of the object if necessary, ex.: TextItem.
64 
65  \param item graphic object
66  */
67  virtual void insertItem(ItemObserver* item) = 0;
68 
69  /*!
70  \brief Method that return the scene box.
71 
72  \param graphic object
73  */
74  virtual te::gm::Envelope getSceneBox();
75 
76  /*!
77  \brief Method that starts the scene and configures. Calculates the transformation matrix of the scene and calculates the ratio of the size of the scene with the paper size.
78 
79  \param screenWMM width of physical screen in millimeters
80  \param screenHMM height of physical screen in millimeters
81  */
82  virtual void init(double screenWMM, double screenHMM) = 0;
83 
84  protected:
85 
86  /*!
87  \brief Method that calculates the transformation matrix of the scene. This matrix will be set in each QGraphicsView class that watches this scene.
88  */
89  virtual void calculateMatrixViewScene() = 0;
90 
91  /*!
92  \brief Method that calculates the ratio of the size of the scene with the paper size. This calculation is necessary so that the paper always is centered in the scene.
93 
94  \param wMM width of physical screen in millimeters
95  \param hMM height of physical screen in millimeters
96  */
97  virtual void calculateWindow(double wMM, double hMM) = 0;
98 
99  protected:
100 
101  te::gm::Envelope m_box; //!< scene box.
102  };
103  }
104 }
105 
106 #endif
#define TELAYOUTEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:99
virtual ~AbstractScene(void)
Destructor.
Definition: AbstractScene.h:60
Abstract class to represent an observer. "View" part of MVC component. All classes representing the g...
Definition: ItemObserver.h:52
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:51
Abstract scene for Scene, a QGraphicsScene class, part of Graphics View Framework.
Definition: AbstractScene.h:48
Configuration flags for the Terrralib Layout module.
te::gm::Envelope m_box
scene box.