All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TrajectoryItem.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/TrajectoryItem.h
22 
23  \brief This file defines a class for a Trajectory Item.
24 */
25 
26 #ifndef __TERRALIB_QT_WIDGETS_SLIDER_INTERNAL_TRAJECTORY_ITEM_H
27 #define __TERRALIB_QT_WIDGETS_SLIDER_INTERNAL_TRAJECTORY_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 
38 namespace te
39 {
40  namespace dt
41  {
42  class DateTimeInstant;
43  class TimePeriod;
44  }
45 
46  namespace qt
47  {
48  namespace widgets
49  {
50  class MapDisplay;
51  class Animation;
52 
53  /*!
54  \class TrajectoryItem
55 
56  \brief This class is a dialog for the Trajectory Icon Item.
57  */
59  {
60  //Q_OBJECT
61  //Q_PROPERTY(QPointF pos READ pos WRITE setPos)
62 
63  public:
64 
65  /*!
66  \brief Constructor
67  It constructs a Trajectory Icon Item.
68  \param title The icon item title.
69  \param display Where the icon item is displayed.
70  \param file The icon file.
71  \param size icon size.
72  */
73  TrajectoryItem(const QString& title, te::qt::widgets::MapDisplay* display, const QString& file, const QSize& size);
74 
75  /*!
76  \brief Destructor
77  It destructs a Trajectory Icon Item.
78  */
79  virtual ~TrajectoryItem();
80 
81  /*!
82  \brief Paint a piece of trajectory trail.
83  */
84  void paint(QPainter*, const QStyleOptionGraphicsItem*, QWidget*);
85 
86  /*!
87  \brief Draw the trajectory long trail.
88  It draws the beginning until the current time.
89  The beginning depends on the direction (forward or backward).
90  */
91  void draw();
92 
93  /*!
94  \brief Create route points making reprojection if necessary.
95  */
96  void createAnimationDataInDisplayProjection();
97 
98  /*!
99  \brief Draw a piece of tracktrajectory trail.
100  It draws from the previous time to the current time.
101 
102  \paran curTime The trajectory current time.
103  */
104  void drawForward(const unsigned int& curTime);
105 
106  /*!
107  \brief erase a piece of tracktrajectory trail.
108 
109  \paran curTime The trajectory current time.
110  */
111  void erase(const unsigned int& curTime);
112 
113  public:
114  QString m_iconFile; //!< file that generated the pixmap
115  QSize m_iconSize; //!< icon size
116  bool m_drawTrail; //!< flag to draw trail
117  QColor m_forwardColor; //!< The forward trail color.
118  QColor m_backwardColor; //!< The backward trail color.
119  int m_lineWidth; //!< The route/trail line width in pixels.
120  bool m_erasePerfectly; //!< flag to erase trajectory piece perfectly (default = false).
121  QPointF m_posOld; //!< Auxiliar point
122  };
123  } // end namespace widgets
124  } // end namespace qt
125 } // end namespace te
126 
127 #endif // __TERRALIB_QT_WIDGETS_SLIDER_INTERNAL_TRAJECTORY_ITEM_H
This class is a dialog for the Trajectory Icon Item.
A widget to control the display of a set of layers.
Definition: MapDisplay.h:66
QString m_iconFile
file that generated the pixmap
QColor m_backwardColor
The backward trail color.
This file defines a class for a Animation Item.
QColor m_forwardColor
The forward trail color.
int m_lineWidth
The route/trail line width in pixels.
bool m_erasePerfectly
flag to erase trajectory piece perfectly (default = false).
#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
QPointF m_posOld
Auxiliar point.
bool m_drawTrail
flag to draw trail