All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
PixmapItem.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/qt/widgets/st/PixmapItem.h
22 
23  \brief This file defines a class for a Pixmap Item.
24 */
25 
26 #ifndef __TERRALIB_QT_WIDGETS_SLIDER_INTERNAL_PIXMAP_ITEM_H
27 #define __TERRALIB_QT_WIDGETS_SLIDER_INTERNAL_PIXMAP_ITEM_H
28 
29 // TerraLib
30 #include "AnimationItem.h"
31 #include "../Config.h"
32 #include "../../../geometry.h"
33 #include "../../../datatype.h"
34 
35 // Qt
36 #include <QtCore/QAbstractAnimation>
37 #include <QtCore/QDir>
38 
39 namespace te
40 {
41  namespace dt
42  {
43  class DateTimeInstant;
44  class TimePeriod;
45  }
46 
47  namespace qt
48  {
49  namespace widgets
50  {
51  class MapDisplay;
52  class Animation;
53 
54  /*!
55  \class This class does not use QPixmap.
56  It uses an array of images already processed to make the animation.
57  Therefore, the pixmap() method returns null.
58 
59  \brief This class is a dialog for the Pixmap Item.
60  */
62  {
63  //Q_OBJECT
64  //Q_PROPERTY(QPointF pos READ pos WRITE setPos)
65 
66  public:
67 
68  /*!
69  \brief Empty Constructor.
70  */
71  PixmapItem();
72 
73  /*!
74  \brief Constructor
75  It constructs a Pixmap Item.
76  \param title The pixmap item title.
77  \param file The absolute file path name.
78  \param display Where the pixmap item is displayed.
79  */
80  PixmapItem(const QString& title, const QString& file, te::qt::widgets::MapDisplay* display);
81 
82  /*!
83  \brief Destructor
84  It destructs a Pixmap Item.
85  */
86  virtual ~PixmapItem();
87 
88  /*!
89  \brief Paint a pixmap item.
90  */
91  void paint(QPainter*, const QStyleOptionGraphicsItem*, QWidget*);
92 
93  /*!
94  \brief Calculate current file.
95 
96  \param curTime current time
97  */
98  void calculateCurrentFile(const unsigned int& curTime); // remover
99 
100  /*!
101  \brief Draw the current pixmap item.
102  */
103  void draw();
104 
105  /*!
106  \brief Create images making reprojection if necessary.
107  */
108  void createAnimationDataInDisplayProjection();
109 
110  void setImagePosition(const QPointF& p, const QRectF& dr);
111 
112  /*!
113  \brief It gets image rect in device coordinate.
114  */
115  QRect getRect();
116 
117  /*!
118  \brief Draw current pixmap item.
119  \paran curTime The animation current time.
120  */
121  void drawForward(const unsigned int& curTime);
122 
123  /*!
124  \brief Draw current pixmap item.
125  \paran curTime The animation current time.
126  */
127  void erase(const unsigned int& curTime);
128 
129  /*!
130  \brief Sets the LUT.
131  \paran tab The LUT information.
132  */
133  void setLUT(const std::vector<std::pair<int, QColor> >& tab);
134 
135  public:
136  QDir m_dir; //!< The image data directory.
137  size_t m_nlines; //!< number of lines.
138  size_t m_ncols; //!< number of colunms.
139  float m_undef; //!< undef value.
140  QVector<QString> m_files; //!< The input files.
141  QVector<QString> m_animationFiles; //!< The png files in display projection. It contains only the portions to be animated.
142  QString m_currentImageFile; //!< Image to be displayed on paint event animation.
143  QString m_baseFile; //!< Base file name.
144  QString m_suffix; //!< File suffix.
145  QRectF m_imaRect; //!< Image location.
146  std::map<uchar, QColor> m_lut; //!< LUT
147  QPointF m_imageCenterPos; //!< Center of the image.
148  };
149  } // end namespace widgets
150  } // end namespace qt
151 } // end namespace te
152 
153 #endif // __TERRALIB_QT_WIDGETS_SLIDER_INTERNAL_PIXMAP_ITEM_H
QVector< QString > m_files
The input files.
Definition: PixmapItem.h:140
QDir m_dir
The image data directory.
Definition: PixmapItem.h:136
size_t m_ncols
number of colunms.
Definition: PixmapItem.h:138
A widget to control the display of a set of layers.
Definition: MapDisplay.h:66
QVector< QString > m_animationFiles
The png files in display projection. It contains only the portions to be animated.
Definition: PixmapItem.h:141
QPointF m_imageCenterPos
Center of the image.
Definition: PixmapItem.h:147
float m_undef
undef value.
Definition: PixmapItem.h:139
This file defines a class for a Animation Item.
QString m_currentImageFile
Image to be displayed on paint event animation.
Definition: PixmapItem.h:142
QRectF m_imaRect
Image location.
Definition: PixmapItem.h:145
std::map< uchar, QColor > m_lut
LUT.
Definition: PixmapItem.h:146
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:66
This class is a dialog for the Pixmap Item.
Definition: AnimationItem.h:57
QString m_suffix
File suffix.
Definition: PixmapItem.h:144
QString m_baseFile
Base file name.
Definition: PixmapItem.h:143
size_t m_nlines
number of lines.
Definition: PixmapItem.h:137