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) 2011-2012 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/canvas/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 file The icon file.
70  \param display Where the icon item is displayed.
71  */
72  TrajectoryItem(const QString& title, const QString& file, te::qt::widgets::MapDisplay* display);
73 
74  /*!
75  \brief Destructor
76  It destructs a Trajectory Icon Item.
77  */
78  virtual ~TrajectoryItem();
79 
80  /*!
81  \brief Paint a piece of trajectory trail.
82  */
83  void paint(QPainter*, const QStyleOptionGraphicsItem*, QWidget*);
84 
85  /*!
86  \brief Draw the trajectory long trail.
87  It draws the beginning until the current time.
88  The beginning depends on the direction (forward or backward).
89  */
90  void draw();
91 
92  /*!
93  \brief Create route points making reprojection if necessary.
94  */
95  void createAnimationDataInDisplayProjection();
96 
97  /*!
98  \brief Draw a piece of tracktrajectory trail.
99  It draws from the previous time to the current time.
100 
101  \paran curTime The trajectory current time.
102  */
103  void drawForward(const unsigned int& curTime);
104 
105  /*!
106  \brief erase a piece of tracktrajectory trail.
107 
108  \paran curTime The trajectory current time.
109  */
110  void erase(const unsigned int& curTime);
111 
112  public:
113  QColor m_forwardColor; //!< The forward trail color.
114  QColor m_backwardColor; //!< The backward trail color.
115  int m_lineWidth; //!< The route/trail line width in pixels.
116  bool m_erasePerfectly; //!< flag to erase trajectory piece perfectly (default = false).
117  QPointF m_posOld; //!< Auxiliar point
118  };
119  } // end namespace widgets
120  } // end namespace qt
121 } // end namespace te
122 
123 #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:65
QColor m_backwardColor
The backward trail color.
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.