5 #include "../canvas/MapDisplay.h"
6 #include "../canvas/Canvas.h"
9 #include <QtCore/QPropertyAnimation>
10 #include <QtGui/QPainter>
11 #include <QtCore/QVector>
32 for(
size_t i = 0; i < 256; ++i)
33 m_lut[i] = QColor(i, i, i, 255);
42 QString f = m_files[0];
43 QString file = m_dir.path() +
"/" + f;
48 double fat = ar.width() / dr.width();
50 QRectF r(0, 0, ((
double)ima.rect().width()/4.)/fat, ((double)ima.rect().height()/4.)/fat);
51 m_imaRect = m_matrix.inverted().mapRect(r);
52 m_imaRect.moveCenter(p);
58 m_animationFiles.clear();
64 size_t size = m_time.size();
66 for(
size_t i = 0; i < size; ++i)
68 if(m_time[i] == iTime || m_time[i] > iTime)
74 for(
size_t i = size-1; i >= 0; --i)
76 if(m_time[i] == fTime || m_time[i] < fTime)
83 size_t tfim = ini + size;
85 for(
size_t i = ini; i < tfim; ++i)
87 QString f = m_files[i];
88 m_animationFiles.push_back(f);
91 if(m_SRID != m_display->getSRID())
93 te::gm::Envelope env(m_imaRect.left(), m_imaRect.top(), m_imaRect.right(), m_imaRect.bottom());
94 env.
transform(m_SRID, m_display->getSRID());
95 m_imaRect = QRectF(env.m_llx, env.m_lly, env.getWidth(), env.getHeight());
101 unsigned int curTime = m_animation->currentTime();
102 if(m_curTimeDuration == curTime)
105 drawForward(curTime);
111 m_curTimeDuration = curTime;
112 calculateCurrentFile(curTime);
118 drawForward(curTime);
123 calculateCurrentFile(m_curTimeDuration);
129 double nt = (double)curTime / (
double)m_duration;
130 int ind = m_animation->getAnimationDataIndex(nt);
131 QString f = m_animationFiles[ind];
132 m_currentImageFile = m_dir.path() +
"/" + f;
133 m_curTimeDuration = curTime;
138 QRect r = m_matrix.mapRect(m_imaRect).toRect();
145 std::vector<std::pair<int, QColor> >::const_iterator it = tab.begin();
146 size_t v = (*it).first;
147 QColor c = (*it).second;
double getWidth() const
It returns the envelope width.
A class to represent time instant.
double m_llx
Lower left corner x-coordinate.
An Envelope defines a 2D rectangular region.
double m_lly
Lower left corner y-coordinate.
void transform(int oldsrid, int newsrid)
It will transform the coordinates of the Envelope from the old SRS to the new one.
double getHeight() const
It returns the envelope height.