All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
GraphicScaleFrame.cpp
Go to the documentation of this file.
1 /* Copyright (C) 2001-2009 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/ScaleFrame.h
22 
23  \brief The frame data....
24 */
25 
26 // TerraLib
27 #include "GraphicScaleFrame.h"
28 #include "LayoutEditor.h"
29 #include "DataFrame.h"
30 #include "../canvas/MultiThreadMapDisplay.h"
31 
32 #include <terralib/geometry.h>
33 #include <terralib/common.h>
34 #include <terralib/srs.h>
36 
37 // Qt
38 #include <QApplication>
39 #include <QAction>
40 #include <QMenu>
41 #include <QMessageBox>
42 
43 #include <QPainter>
44 #include <QColor>
45 #include <QRect>
46 #include <QWidget>
47 #include <QColorDialog>
48 #include <QFontDialog>
49 #include <QInputDialog>
50 #include <QMenu>
51 #include <QAction>
52 #include <QToolTip>
53 #include <QResizeEvent>
54 #include <QBoxLayout>
55 #include <QCoreApplication>
56 #include <QtCore/qmath.h>
57 
59  te::qt::widgets::Frame(df->getLayoutEditor(), f),
60  m_dataFrame(df),
61  m_type(4),
62  m_font(QFont("Linux Libertine G")),
63  m_pointSize(12),
64  m_labelColor(QColor(Qt::blue)),
65  m_barColor(QColor(Qt::red)),
66  m_step(0),
67  m_divisions(4),
68  m_subDivisions(4),
69  m_labelAbove(true),
70  m_subTickSize(3),
71  m_tickCentralized(true),
72  m_space(1),
73  m_unit("Kilometers"),
74  m_unitAbove(false),
75  m_offsetOrigin(false)
76 {
77  setWindowTitle("GraphicScaleFrame");
78  setMouseTracking(true);
79 
80  QRectF r = m_dataFrame->getFrameRect();
81  m_frameRect = QRectF(0, 0, r.width() / 2, 30);
82  m_frameRect.moveCenter(QPointF(r.center().x(), r.center().y() - r.height() / 2 - 30));
83  m_barRect = QRectF(m_frameRect.width() / 4 , 0, m_frameRect.width() / 2, 3);
84 
85  // calcular o tamanho do widget e coloque sobre o map editor
86  adjust();
87 
88  draw();
89  show();
90  createMenu();
91 }
92 
94  te::qt::widgets::Frame(rhs.m_layoutEditor, rhs.windowFlags())
95 {
97  setWindowTitle("GraphicScaleFrame");
98  setMouseTracking(true);
99 
100  m_dataFrame = rhs.m_dataFrame;
101  m_type = rhs.m_type;
102  m_font = rhs.m_font;
103  m_pointSize = rhs.m_pointSize;
105  m_labels = rhs.m_labels;
108  m_barColor = rhs.m_barColor;
109  m_barRect = rhs.m_barRect;
110  m_step = rhs.m_step;
111  m_divisions = rhs.m_divisions;
118  m_space = rhs.m_space;
119  m_unit = rhs.m_unit;
120  m_unitAbove = rhs.m_unitAbove;
122 
123  // calcular o tamanho do widget e coloque sobre o map editor
124  adjust();
125 
126  draw();
127  show();
128  createMenu();
129 }
130 
132 {
133  hide();
134 }
135 
137 {
138  if(this != &rhs)
139  {
141  setWindowTitle("GraphicScaleFrame");
142 
143  m_dataFrame = rhs.m_dataFrame;
144  m_type = rhs.m_type;
145  m_font = rhs.m_font;
146  m_pointSize = rhs.m_pointSize;
147  m_labelColor = rhs.m_labelColor;
148  m_labels = rhs.m_labels;
149  m_labelLengths = rhs.m_labelLengths;
150  m_labelHeight = rhs.m_labelHeight;
151  m_barColor = rhs.m_barColor;
152  m_barRect = rhs.m_barRect;
153  m_step = rhs.m_step;
154  m_divisions = rhs.m_divisions;
155  m_subDivisions = rhs.m_subDivisions;
156  m_subDivisionString = rhs.m_subDivisionString;
157  m_subDivisionLabelLength = rhs.m_subDivisionLabelLength;
158  m_labelAbove = rhs.m_labelAbove;
159  m_subTickSize = rhs.m_subTickSize;
160  m_tickCentralized = rhs.m_tickCentralized;
161  m_space = rhs.m_space;
162  m_unit = rhs.m_unit;
163  m_unitAbove = rhs.m_unitAbove;
164  m_offsetOrigin = rhs.m_offsetOrigin;
165 
166  // calcular o tamanho do widget e coloque sobre o map editor
167  adjust();
168 
169  draw();
170  show();
171  createMenu();
172  }
173 
174  return *this;
175 }
176 
178 {
179  m_menu = new QMenu(this);
180  m_setTypeAction = m_menu->addAction("Set Type...");
181  m_setFamilyAction = m_menu->addAction("Set Family...");
182  m_setLabelColorAction = m_menu->addAction("Set Label Color...");
183  m_setBarColorAction = m_menu->addAction("Set Bar Color...");
184  m_setBarHeightAction = m_menu->addAction("Set Bar Height...");
185  m_offsetOriginAction = m_menu->addAction("Offset Origin");
186  m_offsetOriginAction->setCheckable(true);
187  m_offsetOriginAction->setChecked(m_offsetOrigin);
188  m_setLabelAboveAction = m_menu->addAction("Label Above");
189  m_setLabelAboveAction->setCheckable(true);
190  m_setLabelAboveAction->setChecked(m_labelAbove);
191  m_setUnitAboveAction = m_menu->addAction("Unit Above");
192  m_setUnitAboveAction->setCheckable(true);
193  m_setUnitAboveAction->setChecked(m_unitAbove);
194  m_setUnitAction = m_menu->addAction("Set Unit...");
195  m_setDivisionsAction = m_menu->addAction("Set Number Of Divisions...");
196  m_setSubDivisionsAction = m_menu->addAction("Set Number Of Subdivisions...");
197  m_setStepAction = m_menu->addAction("Set Step...");
198  m_showTooTipAction = m_menu->addAction("Show Tooltip");
199  m_showTooTipAction->setCheckable(true);
200  m_showTooTipAction->setChecked(m_showToolTip);
201 }
202 
204 {
205  QPainter painter(this);
206  painter.drawPixmap(0, 0, m_pixmap);
207 }
208 
210 {
211  return &m_pixmap;
212 }
213 
215 {
216  return m_dataFrame;
217 }
218 
220 {
221  m_dataFrame = df;
222 }
223 
225 {
226  m_pixmap.fill(Qt::transparent);
227 
228  drawLabels();
229 
230  if(m_type == 1)
231  drawBar1();
232  else if(m_type == 2)
233  drawBar2();
234  else if(m_type == 3)
235  drawBar3();
236  else if(m_type == 4)
237  drawBar4();
238  update();
239 }
240 
242 {
243  if(m_labelLengths.empty())
244  return;
245 
246  QMatrix m = m_layoutEditor->getMatrixPaperViewToVp();
247  QMatrix matrix(m.m11(), m.m12(), m.m21(), m.m22(), -m_frameRect.left()* m.m11(), -m_frameRect.bottom() * m.m22());
248  QPainter painter(&m_pixmap);
249  painter.setBrush(Qt::NoBrush);
250  painter.setPen(m_labelColor);
251  painter.setFont(m_font);
252 
253  double conv = m_dataFrame->getDataUnitToMilimeter();
254  double toKm = conv / 1000000;
255 
256  // put values
257  double textHeight = m_labelHeight * .9;
258  QPoint p;
259  for(int i = 0; i <= m_divisions; ++i)
260  {
261  QString s = m_labels[i];
262 
263  if(m_labelAbove)
264  p = matrix.map(QPointF(m_barRect.left() - m_labelLengths[i] / 2. + m_stepmm * (double)i, m_barRect.bottom() + m_space)).toPoint();
265  else
266  p = matrix.map(QPointF(m_barRect.left() - m_labelLengths[i] / 2. + m_stepmm * (double)i, m_barRect.top() - m_space - textHeight)).toPoint();
267 
268  painter.drawText(p, s);
269  }
270 
271  // colocar o label da metade da primeira divisao
272  if(m_labelAbove)
273  p = matrix.map(QPointF(m_barRect.left() - m_subDivisionLabelLength / 2. + m_stepmm/2., m_barRect.bottom() + m_space)).toPoint();
274  else
275  p = matrix.map(QPointF(m_barRect.left() - m_subDivisionLabelLength / 2. + m_stepmm/2., m_barRect.top() - m_space - textHeight)).toPoint();
276 
277  painter.drawText(p, m_subDivisionString);
278 
279  // put unit
280  double y;
281  if(m_labelAbove && m_unitAbove)
282  y = m_barRect.bottom() + m_space + textHeight + m_space;
283  else if(m_labelAbove && m_unitAbove == false)
284  y = m_barRect.top() - m_space - textHeight + 1; // somando 1 para nao cortar o unit
285  else if(m_labelAbove == false && m_unitAbove == false)
286  y = m_barRect.top() - m_space - textHeight - m_space - textHeight + 1; // somando 1 para nao cortar o unit
287  else if(m_labelAbove == false && m_unitAbove)
288  y = m_barRect.bottom() + m_space + 1; // somando 1 para o unit não ficar muito proximo aa barra
289 
290  QRectF rt = painter.boundingRect(QRect(0, 0, 100000, 100000), Qt::AlignLeft, m_unit);
291  rt = matrix.inverted().mapRect(rt);
292  double x = m_barRect.center().x() - rt.width() / 2;
293 
294  p = matrix.map(QPointF(x, y)).toPoint();
295  painter.setPen(m_labelColor);
296  painter.drawText(p, m_unit);
297 }
298 
300 {
301  QMatrix m = m_layoutEditor->getMatrixPaperViewToVp();
302  QMatrix matrix(m.m11(), m.m12(), m.m21(), m.m22(), -m_frameRect.left()* m.m11(), -m_frameRect.bottom() * m.m22());
303  QPainter painter(&m_pixmap);
304  painter.setBrush(Qt::NoBrush);
305 
306  double subStep = m_stepmm / (double)m_subDivisions;
307 
308  // draw bar line
309  painter.setPen(m_barColor);
310  QPoint p, p1, p2;
311  double y1, y2;
312  if(m_tickCentralized)
313  {
314  p1 = matrix.map(QPointF(m_barRect.left(), m_barRect.center().y())).toPoint();
315  p2 = matrix.map(QPointF(m_barRect.right(), m_barRect.center().y())).toPoint();
316  y1 = m_barRect.center().y() - m_subTickSize / 2.;
317  y2 = m_barRect.center().y() + m_subTickSize / 2.;
318  }
319  else
320  {
321  if(m_labelAbove)
322  {
323  p1 = matrix.map(QPointF(m_barRect.left(), m_barRect.top())).toPoint();
324  p2 = matrix.map(QPointF(m_barRect.right(), m_barRect.top())).toPoint();
325  y1 = m_barRect.top();
326  y2 = m_barRect.top() + m_subTickSize;
327  }
328  else
329  {
330  p1 = matrix.map(QPointF(m_barRect.left(), m_barRect.bottom())).toPoint();
331  p2 = matrix.map(QPointF(m_barRect.right(), m_barRect.bottom())).toPoint();
332  y1 = m_barRect.bottom() - m_subTickSize;
333  y2 = m_barRect.bottom() + m_subTickSize;
334  }
335  }
336  painter.drawLine(p1, p2);
337 
338  // put subdivision ticks
339  for(int i = 0; i < m_subDivisions; ++i)
340  {
341  p1 = matrix.map(QPointF(m_barRect.left() + subStep * (double)i, y1)).toPoint();
342  p2 = matrix.map(QPointF(m_barRect.left() + subStep * (double)i, y2)).toPoint();
343  painter.drawLine(p1, p2);
344  }
345 
346  // put division ticks
347  painter.setPen(Qt::black);
348  for(int i = 1; i <= m_divisions; ++i)
349  {
350  p1 = matrix.map(QPointF(m_barRect.left() + m_stepmm * (double)i, m_barRect.top())).toPoint();
351  p2 = matrix.map(QPointF(m_barRect.left() + m_stepmm * (double)i, m_barRect.bottom())).toPoint();
352  painter.drawLine(p1, p2);
353  }
354 }
355 
357 {
358  QPoint p1, p2;
359  QMatrix m = m_layoutEditor->getMatrixPaperViewToVp();
360  QMatrix matrix(m.m11(), m.m12(), m.m21(), m.m22(), -m_frameRect.left()* m.m11(), -m_frameRect.bottom() * m.m22());
361  QPainter painter(&m_pixmap);
362  painter.setBrush(Qt::NoBrush);
363  painter.setPen(m_barColor);
364 
365  double subStep = m_stepmm / (double)m_subDivisions;
366 
367  // put subdivision vertical lines
368  for(int i = 0; i < m_subDivisions; ++i)
369  {
370  p1 = matrix.map(QPointF(m_barRect.left() + subStep * (double)i, m_barRect.top())).toPoint();
371  p2 = matrix.map(QPointF(m_barRect.left() + subStep * (double)i, m_barRect.bottom())).toPoint();
372  painter.drawLine(p1, p2);
373  }
374 
375  // put division vertical lines
376  for(int i = 1; i <= m_divisions; ++i)
377  {
378  p1 = matrix.map(QPointF(m_barRect.left() + m_stepmm * (double)i, m_barRect.top())).toPoint();
379  p2 = matrix.map(QPointF(m_barRect.left() + m_stepmm * (double)i, m_barRect.bottom())).toPoint();
380  painter.drawLine(p1, p2);
381  }
382 
383  // put subdivision horizontal lines
384  for(int i = 0; i < m_subDivisions; ++i)
385  {
386  int ii = i + 1;
387  if((i%2) == 0)
388  {
389  p1 = matrix.map(QPointF(m_barRect.left() + subStep * (double)i, m_barRect.bottom())).toPoint();
390  p2 = matrix.map(QPointF(m_barRect.left() + subStep * (double)ii, m_barRect.bottom())).toPoint();
391  }
392  else
393  {
394  p1 = matrix.map(QPointF(m_barRect.left() + subStep * (double)i, m_barRect.top())).toPoint();
395  p2 = matrix.map(QPointF(m_barRect.left() + subStep * (double)ii, m_barRect.top())).toPoint();
396  }
397  painter.drawLine(p1, p2);
398  }
399 
400  // put division horizontal lines
401  for(int i = 1; i < m_divisions; ++i)
402  {
403  int ii = i + 1;
404  if((m_subDivisions % 2) == 0)
405  {
406  if((i%2))
407  {
408  p1 = matrix.map(QPointF(m_barRect.left() + m_stepmm * (double)i, m_barRect.bottom())).toPoint();
409  p2 = matrix.map(QPointF(m_barRect.left() + m_stepmm * (double)ii, m_barRect.bottom())).toPoint();
410  }
411  else
412  {
413  p1 = matrix.map(QPointF(m_barRect.left() + m_stepmm * (double)i, m_barRect.top())).toPoint();
414  p2 = matrix.map(QPointF(m_barRect.left() + m_stepmm * (double)ii, m_barRect.top())).toPoint();
415  }
416  }
417  else
418  {
419  if((i%2) == 0)
420  {
421  p1 = matrix.map(QPointF(m_barRect.left() + m_stepmm * (double)i, m_barRect.bottom())).toPoint();
422  p2 = matrix.map(QPointF(m_barRect.left() + m_stepmm * (double)ii, m_barRect.bottom())).toPoint();
423  }
424  else
425  {
426  p1 = matrix.map(QPointF(m_barRect.left() + m_stepmm * (double)i, m_barRect.top())).toPoint();
427  p2 = matrix.map(QPointF(m_barRect.left() + m_stepmm * (double)ii, m_barRect.top())).toPoint();
428  }
429  }
430  painter.drawLine(p1, p2);
431  }
432 }
433 
435 {
436  QPoint p1, p2;
437  QMatrix m = m_layoutEditor->getMatrixPaperViewToVp();
438  QMatrix matrix(m.m11(), m.m12(), m.m21(), m.m22(), -m_frameRect.left()* m.m11(), -m_frameRect.bottom() * m.m22());
439  QPainter painter(&m_pixmap);
440 
441  double subStep = m_stepmm / (double)m_subDivisions;
442 
443  // put sub bars
444  painter.setBrush(m_barColor);
445  painter.setPen(Qt::NoPen);
446  QRectF raux = m_barRect;
447  QRect r;
448 
449  for(int i = 0; i < m_subDivisions; i+=2)
450  {
451  raux.setLeft(m_barRect.left() + subStep * (double)i);
452  raux.setWidth(subStep);
453  r = matrix.mapRect(raux).toRect();
454  painter.drawRect(r);
455  }
456 
457  // put bars
458  int ii = 1;
459  if((m_subDivisions) % 2)
460  ii = 2;
461  for(int i = ii; i < m_divisions; i+=2)
462  {
463  raux.setLeft(m_barRect.left() + m_stepmm * (double)i);
464  raux.setWidth(m_stepmm);
465  r = matrix.mapRect(raux).toRect();
466  painter.drawRect(r);
467  }
468 
469  // put subdivision vertical lines
470  painter.setBrush(Qt::NoBrush);
471  painter.setPen(Qt::black);
472  for(int i = 1; i < m_subDivisions; ++i)
473  {
474  p1 = matrix.map(QPointF(m_barRect.left() + subStep * (double)i, m_barRect.top())).toPoint();
475  p2 = matrix.map(QPointF(m_barRect.left() + subStep * (double)i, m_barRect.bottom())).toPoint();
476  painter.drawLine(p1, p2);
477  }
478 
479  // put division vertical lines
480  for(int i = 1; i < m_divisions; ++i)
481  {
482  p1 = matrix.map(QPointF(m_barRect.left() + m_stepmm * (double)i, m_barRect.top())).toPoint();
483  p2 = matrix.map(QPointF(m_barRect.left() + m_stepmm * (double)i, m_barRect.bottom())).toPoint();
484  painter.drawLine(p1, p2);
485  }
486 
487  // put horizontall line
488  p1 = matrix.map(QPointF(m_barRect.left(), m_barRect.center().y())).toPoint();
489  p2 = matrix.map(QPointF(m_barRect.right(), m_barRect.center().y())).toPoint();
490  painter.drawLine(p1, p2);
491 
492  // put bar rect
493  r = matrix.mapRect(m_barRect).toRect();
494  painter.drawRect(r);
495 }
496 
498 {
499  QPoint p1, p2;
500  QMatrix m = m_layoutEditor->getMatrixPaperViewToVp();
501  QMatrix matrix(m.m11(), m.m12(), m.m21(), m.m22(), -m_frameRect.left()* m.m11(), -m_frameRect.bottom() * m.m22());
502  QPainter painter(&m_pixmap);
503 
504  double subStep = m_stepmm / (double)m_subDivisions;
505 
506  // put sub bars
507  painter.setBrush(m_barColor);
508  painter.setPen(Qt::NoPen);
509  QRectF raux = m_barRect;
510  QRect r;
511 
512  for(int i = 0; i < m_subDivisions; i++)
513  {
514  raux.setLeft(m_barRect.left() + subStep * (double)i);
515  raux.setWidth(subStep);
516  if((i % 2) == 0)
517  raux.setTop(m_barRect.center().y());
518  else
519  raux.setTop(m_barRect.top());
520  raux.setHeight(m_barRect.height() / 2.);
521 
522  r = matrix.mapRect(raux).toRect();
523  painter.drawRect(r);
524  }
525 
526  // put bars
527  if((m_subDivisions % 2) == 0)
528  {
529  for(int i = 1; i < m_divisions; i++)
530  {
531  raux.setLeft(m_barRect.left() + m_stepmm * (double)i);
532  raux.setWidth(m_stepmm);
533  if((i % 2))
534  raux.setTop(m_barRect.center().y());
535  else
536  raux.setTop(m_barRect.top());
537  raux.setHeight(m_barRect.height() / 2.);
538 
539  r = matrix.mapRect(raux).toRect();
540  painter.drawRect(r);
541  }
542  }
543  else
544  {
545  for(int i = 1; i < m_divisions; i++)
546  {
547  raux.setLeft(m_barRect.left() + m_stepmm * (double)i);
548  raux.setWidth(m_stepmm);
549  if((i % 2) == 0)
550  raux.setTop(m_barRect.center().y());
551  else
552  raux.setTop(m_barRect.top());
553  raux.setHeight(m_barRect.height() / 2.);
554 
555  r = matrix.mapRect(raux).toRect();
556  painter.drawRect(r);
557  }
558  }
559 
560  // put subdivision vertical lines
561  painter.setBrush(Qt::NoBrush);
562  painter.setPen(Qt::black);
563  for(int i = 1; i < m_subDivisions; ++i)
564  {
565  p1 = matrix.map(QPointF(m_barRect.left() + subStep * (double)i, m_barRect.top())).toPoint();
566  p2 = matrix.map(QPointF(m_barRect.left() + subStep * (double)i, m_barRect.bottom())).toPoint();
567  painter.drawLine(p1, p2);
568  }
569 
570  // put division vertical lines
571  for(int i = 1; i < m_divisions; ++i)
572  {
573  p1 = matrix.map(QPointF(m_barRect.left() + m_stepmm * (double)i, m_barRect.top())).toPoint();
574  p2 = matrix.map(QPointF(m_barRect.left() + m_stepmm * (double)i, m_barRect.bottom())).toPoint();
575  painter.drawLine(p1, p2);
576  }
577 
578  // put horizontall line
579  p1 = matrix.map(QPointF(m_barRect.left(), m_barRect.center().y())).toPoint();
580  p2 = matrix.map(QPointF(m_barRect.right(), m_barRect.center().y())).toPoint();
581  painter.drawLine(p1, p2);
582 
583  // put bar rect
584  r = matrix.mapRect(m_barRect).toRect();
585  painter.drawRect(r);
586 }
587 
589 {
590  // calcule o tamanho do widget
591  QPointF center = m_frameRect.center();
592 
593  labelLengthCalculation();
594  if(m_labelLengths.empty())
595  return;
596 
597  double mmFrameHeight = m_labelHeight + m_labelHeight + 2 * m_space + m_barRect.height();
598  double mmFrameWidth = m_labelLengths[0] / 2. + m_stepmm * (double)m_divisions + m_labelLengths[m_divisions-1] / 2.;
599 
600  double x = m_labelLengths[0] / 2.;
601  double bw = mmFrameWidth - m_labelLengths[0] / 2. - m_labelLengths[m_divisions-1] / 2.;
602  double bh = m_barRect.height();
603 
604  double y;
605  if(m_labelAbove == false && m_unitAbove == false)
606  y = m_labelHeight + m_space + m_labelHeight + m_space;
607  else if(m_labelAbove == true && m_unitAbove == false)
608  y = m_labelHeight + m_space;
609  else if(m_labelAbove == false && m_unitAbove == true)
610  y = m_labelHeight + m_space;
611  else if(m_labelAbove == true && m_unitAbove == true)
612  y = 1; // nao coloque zero porque pode falhar na hora de desenhar (devido a erros de transformacao)
613 
614  m_frameRect = QRectF(0, 0, mmFrameWidth + 2, mmFrameHeight); // some 2mm no width para evitar o corte do ultimo label.
615  m_frameRect.moveCenter(center);
616 
617  m_barRect = QRectF(x + m_frameRect.left(), y + m_frameRect.top(), bw, bh);
618 
619  QMatrix matrix = m_layoutEditor->getMatrixPaperViewToVp();
620  QRect widgetRect = matrix.mapRect(m_frameRect).toRect();
621 
622  //colocar o widget sobre o map editor
623  resize(widgetRect.size());
624  move(widgetRect.left(), widgetRect.top());
625 
626  m_pixmap = QPixmap(widgetRect.width(), widgetRect.height());
627 
628  calculateSelectionPoints();
629  draw();
630 }
631 
633 {
634  QRect rec = m_pixmap.rect();
635 
636  double pw = rec.width();
637  double ph = rec.height();
638  int ipw = qRound(pw);
639  int iph = qRound(ph);
640  int ipw2 = qRound(pw/2.);
641  int iph2 = qRound(ph/2.);
642  double w = 9;
643  double h = 9;
644 
645  if(pw < w*5)
646  w = pw / 5.;
647  if(ph < h*5)
648  h = ph / 5.;
649 
650  int iw = qRound(w);
651  int ih = qRound(h);
652  int iw2 = qRound(w/2.);
653  int ih2 = qRound(h/2.);
654  m_recSel1 = QRect(0, 0, iw, ih);
655  m_recSel2 = QRect(ipw2 - iw2, 0, iw, ih);
656  m_recSel3 = QRect(ipw - iw, 0, iw, ih);
657  m_recSel4 = QRect(ipw - iw, iph2 - ih2, iw, ih);
658  m_recSel5 = QRect(ipw - iw, iph - ih, iw, ih);
659  m_recSel6 = QRect(ipw2 - iw2, iph - ih, iw, ih);
660  m_recSel7 = QRect(0, iph - ih, iw, ih);
661  m_recSel8 = QRect(0, iph2 - ih2, iw, ih);
662  //m_recSel9 = QRect(ipw2 - iw2, iph2 - ih2, iw, ih);
663  m_recSel10 = QRect(0, 0, ipw, iph);
664 }
666 {
667  setPointSize(m_pointSize);
668 
669  QPixmap pix(10, 10);
670  QPainter painter(&pix);
671  painter.setFont(m_font);
672 
673  QString s("0");
674  QRectF rt = painter.boundingRect(QRect(0, 0, 100000, 100000), Qt::AlignLeft, s);
675  m_barRect.setX(rt.width() / 2.);
676 
677  getLabels();
678 
679  QMatrix matrix = m_layoutEditor->getMatrixPaperViewToVp();
680  m_labelLengths.clear();
681  std::vector<QString>::iterator it;
682  for(it = m_labels.begin(); it != m_labels.end(); ++it)
683  {
684  QString s = *it;
685  rt = painter.boundingRect(QRect(0, 0, 100000, 100000), Qt::AlignLeft, s);
686  rt = matrix.inverted().mapRect(rt);
687  m_labelLengths.push_back(rt.width());
688  }
689 
690  rt = painter.boundingRect(QRect(0, 0, 100000, 100000), Qt::AlignLeft, m_subDivisionString);
691  rt = matrix.inverted().mapRect(rt);
692  m_subDivisionLabelLength = rt.width();
693  m_labelHeight = rt.height();
694 }
695 
697 {
698  double conv = m_dataFrame->getDataUnitToMilimeter();
699  m_toKm = conv / 1000000;
700  if(conv == 0)
701  {
702  QMessageBox::warning (this, "Projection Error", "Parece que tem algo errado na projeção do dado");
703  return;
704  }
705 
706  // Meters, Kilometers, Miles, Leagues, Inches, Feet, Hand, Fingers, Nautic Miles, Nautic Fathom, Decimal Degrees, Yards, Fourlongs, Chains, Marathons, Unknow
707  if(m_unit == "Kilometers")
708  m_kmToUnit = 1;
709  else if(m_unit == "Meters")
710  m_kmToUnit = 1000;
711  else if(m_unit == "Miles")
712  m_kmToUnit = .6214;
713  else if(m_unit == "Leagues")
714  m_kmToUnit = .2071;
715  else if(m_unit == "Inches")
716  m_kmToUnit = 39370.0787;
717  else if(m_unit == "Feet")
718  m_kmToUnit = 3280.8399;
719  else if(m_unit == "Hand")
720  m_kmToUnit = 9842.5197;
721  else if(m_unit == "Fingers")
722  m_kmToUnit = 44994.3757;
723  else if(m_unit == "Nautic Miles")
724  m_kmToUnit = .5398;
725  else if(m_unit == "Nautic Fathom")
726  m_kmToUnit = 546.8066;
727  else if(m_unit == "Decimal Degrees")
728  m_kmToUnit = .009178;
729  else if(m_unit == "Yards")
730  m_kmToUnit = 1093.6133;
731  else if(m_unit == "Fourlongs")
732  m_kmToUnit = 4.971;
733  else if(m_unit == "Chains")
734  m_kmToUnit = 49.7097;
735  else if(m_unit == "Marathons")
736  m_kmToUnit = 0.0237;
737  else // "Unknow"
738  m_kmToUnit = 1000000/conv;
739 
740  double ww = m_dataFrame->getMapDisplay()->getExtent().getWidth();
741  double widthUnit = ww * m_toKm * m_kmToUnit;
742 
743  if(m_step == 0)
744  findNiceStep(.75 * widthUnit / m_divisions);
745 
746  // calcule step em mm
747  double w = m_dataFrame->getFrameRect().width();
748  m_stepmm = m_step * w / (ww * m_toKm * m_kmToUnit);
749 
750  std::string s;
751  if(m_precision == 0)
752  {
753  if(((int)m_step)%2 == 1)
754  s = te::common::Convert2String(m_step/2, 1);
755  else
756  s = te::common::Convert2String(m_step/2, 0);
757  }
758  else
759  {
760  s = te::common::Convert2String(m_step, m_precision);
761  double v = atof(s.c_str());
762 
763  QString qs(s.c_str());
764  QChar c = qs[qs.length()-1];
765  if(c == '0' || c == '2' || c == '4' || c == '6' || c == '8')
766  s = te::common::Convert2String(v/2, m_precision);
767  else
768  s = te::common::Convert2String(v/2, m_precision+1);
769  }
770 
771  m_subDivisionString = s.c_str();
772 
773  m_labels.clear();
774  if(m_offsetOrigin)
775  {
776  s = te::common::Convert2String(m_step, m_precision);
777  QString qs = s.c_str();
778  m_labels.push_back(qs);
779  m_labels.push_back("0");
780  }
781  else
782  m_labels.push_back("0");
783 
784  for(int i = 1; i <= m_divisions; ++i)
785  {
786  double v = m_step * i;
787  s = te::common::Convert2String(v, m_precision);
788  QString qs = s.c_str();
789 
790  m_labels.push_back(qs);
791  }
792 }
793 
795 {
796  // se m_step == 0 use fineRound false e nao faca increase ou decrease
797  bool fineRound = false;
798  int increase = 0; // 0 nao faz nada; 1 increase; 2 decrease
799  m_precision = 0;
800  double fator;
801 
802  if(m_step != 0)
803  {
804  double fat = newStep / m_step;
805  if(fat > .95 && fat < 1.05)
806  fineRound = true;
807  if(fat > 1)
808  increase = 1;
809  else
810  increase = 2;
811  }
812 
813  double vstep = newStep;
814 
815  // ache o primeiro algarismo entre 1 e 9
816  double mv = vstep;
817  double mult = 1;
818  while(mv <= 1)
819  {
820  m_precision++;
821  mult *= 10;
822  mv = vstep * mult;
823  }
824 
825  double dv = vstep;
826  double div = 1;
827  while(dv >= 10)
828  {
829  div *= 10;
830  dv = vstep / div;
831  }
832 
833  // pegue o número e o fator que depende se o step é maior ou menor que 1
834  double v;
835  if(mult == 1 && dv >= 1)
836  {
837  v = dv;
838  fator = div;
839  }
840  else
841  {
842  v = mv;
843  fator = 1 / mult;
844  }
845 
846  if(fineRound == false) // faça ajuste grosseiro (gera número mais redondo)
847  {
848  vstep = qRound(v) * fator;
849  if(increase == 1)
850  {
851  if(vstep <= m_step)
852  vstep = qRound(v+1) * fator;
853  }
854  else if(increase == 2)
855  {
856  if(vstep >= m_step)
857  vstep = qRound(v-1) * fator;
858  }
859  }
860  else // faça ajuste refinado (gera número menos redondo)
861  {
862  vstep = qRound(v * 10) * fator / 10;
863  double delta = fator / 10;
864  if(increase == 1)
865  {
866  if(vstep <= m_step)
867  vstep += delta;
868  }
869  else if(increase == 2)
870  {
871  if(vstep >= m_step)
872  vstep -= delta;
873  }
874 
875  if(div == 1 && mult == 1)
876  m_precision++;
877 
878  if(mult > 1)
879  m_precision++;
880  }
881 
882  std::string st = te::common::Convert2String(vstep, m_precision);
883  m_step = atof(st.c_str());
884  }
885 
887 {
888  m_pointSize = pointSize;
889 
890  QMatrix matrix = m_layoutEditor->getMatrixPaperViewToVp();
891  double h = m_pointSize * 25.4 / 72.;
892  double vtam = h * matrix.m11();
893  int ps = qRound(vtam);
894  if(ps < 1)
895  ps = 1;
896 
897  m_font.setPixelSize(ps);
898 }
899 
901 {
902  return m_font;
903 }
904 
906 {
907  m_font = f;
908 }
909 
911 {
912  return m_labelColor;
913 }
914 
916 {
917  m_labelColor = c;
918 }
919 
921 {
922  return m_barColor;
923 }
924 
926 {
927  m_barColor = c;
928 }
929 
931 {
932  return m_barRect;
933 }
934 
936 {
937  m_barRect = r;
938 }
939 
941 {
942  return m_type;
943 }
944 
946 {
947  m_type = t;
948 }
949 
951 {
952  return m_labelAbove;
953 }
954 
956 {
957  m_labelAbove = b;
958 }
959 
961 {
962  return m_unitAbove;
963 }
964 
966 {
967  m_unitAbove = b;
968 }
969 
971 {
972  return m_subTickSize;
973 }
974 
976 {
977  m_subTickSize = s;
978 }
979 
981 {
982  return m_tickCentralized;
983 }
984 
986 {
987  m_tickCentralized = b;
988 }
989 
991 {
992  return m_step;
993 }
994 
996 {
997  m_step = s;
998 }
999 
1001 {
1002  return m_divisions;
1003 }
1004 
1006 {
1007  m_divisions = n;
1008 }
1009 
1011 {
1012  return m_subDivisions;
1013 }
1014 
1016 {
1017  m_subDivisions = n;
1018 }
1019 
1021 {
1022  return m_space;
1023 }
1024 
1026 {
1027  m_space = s;
1028 }
1029 
1031 {
1032  return m_unit;
1033 }
1034 
1036 {
1037  m_unit = s;
1038 }
1039 
1041 {
1042  if(mouseEvent->buttons() == Qt::LeftButton)
1043  {
1044  QPoint p = mouseEvent->pos();
1045  m_pressPoint = p;
1046  m_undo = false;
1047  m_copyAuxFrameRect = QRect();
1048  m_layoutEditor->raiseDraftLayoutEditor();
1049  }
1050  else if(mouseEvent->buttons() == Qt::RightButton)
1051  {
1052  QPoint gp = mouseEvent->globalPos();
1053  if(m_selected == 10)
1054  {
1055  QAction* action = m_menu->exec(gp);
1056  if(action == m_setTypeAction)
1057  setTypeAction();
1058  else if(action == m_setFamilyAction)
1059  setFamilyAction();
1060  else if(action == m_setLabelColorAction)
1061  setLabelColorAction();
1062  else if(action == m_setBarColorAction)
1063  setBarColorAction();
1064  else if(action == m_setBarHeightAction)
1065  setBarHeightAction();
1066  else if(action == m_offsetOriginAction)
1067  setOffsetOriginAction();
1068  else if(action == m_setLabelAboveAction)
1069  setLabelAboveAction();
1070  else if(action == m_setUnitAboveAction)
1071  setUnitAboveAction();
1072  else if(action == m_setUnitAction)
1073  setUnitAction();
1074  else if(action == m_setDivisionsAction)
1075  setDivisionsAction();
1076  else if(action == m_setSubDivisionsAction)
1077  setSubDivisionsAction();
1078  else if(action == m_setStepAction)
1079  setStepAction();
1080  else if(action == m_showTooTipAction)
1081  setShowTooTipAction();
1082  }
1083  }
1084 }
1085 
1087 {
1088  QPoint p = mouseEvent->pos();
1089  QPoint gp = mouseEvent->globalPos();
1090 
1091  if(mouseEvent->buttons() == Qt::NoButton)
1092  {
1093  setCursor();
1094 
1095  m_dragging = false;
1096  getSelectionPoint(p);
1097  if(m_selected == 0)
1098  return;
1099  else
1100  {
1101  showSelectionPoints();
1102  toolTip(gp, "Selection");
1103  if(m_selected == 10 && m_layoutEditor->getFrameSelected() != this)
1104  m_layoutEditor->setFrameSelected(this);
1105  }
1106 
1107  setCursor();
1108  }
1109  else if(mouseEvent->buttons() == Qt::LeftButton)
1110  {
1111  m_dragging = true;
1112  QPoint p = mouseEvent->pos();
1113  QPoint d = m_pressPoint - p;
1114  QMatrix matrix = m_layoutEditor->getMatrix();
1115  m_auxFrameRect = matrix.mapRect(m_frameRect).toRect();
1116 
1117  // mouse drag with left buttom
1118  if(m_selected != 0)
1119  {
1120  if(m_undo == false)
1121  {
1122  m_layoutEditor->insertCopy2Undo(m_dataFrame);
1123  m_undo = true;
1124  }
1125 
1126  if(m_selected == 4) // resize right
1127  m_auxFrameRect = QRect(m_auxFrameRect.left(), m_auxFrameRect.top(), m_auxFrameRect.width() - d.x(), m_auxFrameRect.height());
1128  else if(m_selected == 8) // resize left
1129  m_auxFrameRect = QRect(m_auxFrameRect.left() - d.x(), m_auxFrameRect.top(), m_auxFrameRect.width() + d.x(), m_auxFrameRect.height());
1130  else // move data frame
1131  m_auxFrameRect.moveCenter(m_auxFrameRect.center() - d);
1132 
1133  rubberBand();
1134  setCursor();
1135  }
1136  }
1137 }
1138 
1140 {
1141  if(mouseEvent->button() == Qt::LeftButton)
1142  {
1143  QPoint p = mouseEvent->pos();
1144 
1145  if(m_pressPoint != p && m_selected != 0)
1146  {
1147  setCursor();
1148 
1149  QPixmap* pixmap = m_layoutEditor->getDraftPixmap();
1150  pixmap->fill(Qt::transparent);
1151  QMatrix matrix = m_layoutEditor->getMatrix();
1152  QRectF r(m_auxFrameRect.left(), m_auxFrameRect.top(), m_auxFrameRect.width(), m_auxFrameRect.height());
1153  double w = m_frameRect.width();
1154  m_frameRect = matrix.inverted().mapRect(r);
1155  double nw = m_frameRect.width();
1156  m_layoutEditor->lowerDraftLayoutEditor();
1157 
1158  if(m_selected == 4 || m_selected == 8)
1159  {
1160  bool fineRound = false;
1161  double fat = nw / w;
1162  if(fat > .95 && fat < 1.05)
1163  fineRound = true;
1164 
1165  double newStep = m_step * fat;
1166  findNiceStep(newStep);
1167  }
1168 
1169  adjust();
1170  m_layoutEditor->draw();
1171 
1172  if(m_selected != 10)
1173  {
1174  QPoint c = getCenterSelected();
1175  cursor().setPos(mapToGlobal(c));
1176  QMouseEvent e1(QEvent::MouseButtonPress, c, Qt::LeftButton, Qt::LeftButton, Qt::NoModifier);
1177  QApplication::sendEvent(this, &e1);
1178  }
1179  showSelectionPoints();
1180  }
1181  }
1182 }
1183 
1185 {
1186  if(QApplication::overrideCursor() || m_dragging)
1187  return;
1188 
1189  m_layoutEditor->setFrameSelected(this);
1190  raise();
1191  m_selected = 0;
1192 }
1193 
1195 {
1196  if(m_dragging)
1197  {
1198  if(m_selected != 0)
1199  raise();
1200  return;
1201  }
1202 
1203  m_selected = 0;
1204  m_layoutEditor->setFrameSelected(0);
1205  lower();
1206  setCursor();
1207 }
1208 
1210 {
1211  // faz tudo em coordenadas do dispositivo
1212 
1213  QPixmap* pixmap = m_layoutEditor->getDraftPixmap();
1214  QPainter painter(pixmap);
1215  painter.translate(m_layoutEditor->getVerticalRulerWidth(), m_layoutEditor->getHorizontalRulerWidth());
1216  painter.setBrush(Qt::NoBrush);
1217  painter.setPen(Qt::red);
1218 
1219  // erase old
1220  if(m_copyAuxFrameRect.isValid())
1221  {
1222  painter.setCompositionMode(QPainter::CompositionMode_DestinationOut);
1223  painter.drawRect(m_copyAuxFrameRect);
1224  }
1225 
1226  // show new
1227  painter.setCompositionMode(QPainter::CompositionMode_DestinationOver);
1228  painter.drawRect(m_auxFrameRect);
1229  painter.end();
1230 
1231  m_copyAuxFrameRect = m_auxFrameRect;
1232 
1233  m_layoutEditor->update();
1234 }
1235 
1237 {
1238  // faz tudo em coordenadas do dispositivo
1239 
1240  m_pixmap.fill(Qt::transparent);
1241  draw();
1242 
1243  QPainter painter(&m_pixmap);
1244 
1245  painter.setPen(Qt::blue);
1246  painter.setBrush(QColor(0, 0, 255, 24));
1247  painter.drawRect(QRect(m_recSel10.left(), m_recSel10.top(), m_recSel10.width()-1, m_recSel10.height()-1));
1248 
1249  // draw selection points
1250  painter.setBrush(QColor(0, 0, 255, 150));
1251  painter.drawRect(m_recSel4);
1252  painter.drawRect(m_recSel8);
1253  painter.end();
1254  update();
1255 }
1256 
1258 {
1259  m_pixmap.fill(Qt::transparent);
1260  draw();
1261  update();
1262 }
1263 
1265 {
1266  // faz tudo em coordenadas do dispositivo
1267 
1268  m_selected = 0;
1269 
1270  if(m_recSel4.contains(p, Qt::OddEvenFill))
1271  m_selected = 4;
1272  else if(m_recSel8.contains(p, Qt::OddEvenFill))
1273  m_selected = 8;
1274  else if(m_recSel10.contains(p, Qt::OddEvenFill))
1275  m_selected = 10;
1276 }
1277 
1279 {
1280  // faz tudo em coordenadas do dispositivo
1281 
1282  QPoint c;
1283 
1284  if(m_selected == 4)
1285  c = m_recSel4.center();
1286  else if(m_selected == 8)
1287  c = m_recSel8.center();
1288  else if(m_selected == 10)
1289  c = m_recSel10.center();
1290 
1291  return c;
1292 }
1293 
1295 {
1296  QCursor cursor;
1297 
1298  if(m_selected == 10)
1299  cursor.setShape(Qt::SizeAllCursor);
1300  else if(m_selected == 4 || m_selected == 8)
1301  cursor.setShape(Qt::SizeHorCursor);
1302 
1303  if(QApplication::overrideCursor())
1304  {
1305  if(QApplication::overrideCursor()->shape() != cursor.shape())
1306  {
1307  while(QApplication::overrideCursor())
1308  QApplication::restoreOverrideCursor();
1309  if(cursor.shape() != Qt::ArrowCursor)
1310  QApplication::setOverrideCursor(cursor);
1311  }
1312  }
1313  else if(cursor.shape() != Qt::ArrowCursor)
1314  QApplication::setOverrideCursor(cursor);
1315 }
1316 
1317 
1318 void te::qt::widgets::GraphicScaleFrame::toolTip(const QPoint& p, const QString& type)
1319 {
1320  if(m_showToolTip == false)
1321  {
1322  QToolTip::hideText();
1323  return;
1324  }
1325 
1326  if(type == "Selection")
1327  {
1328  if(m_selected == 4 || m_selected == 8)
1329  QToolTip::showText(p, "Drag to Change Step", this);
1330  else if(m_selected == 10)
1331  QToolTip::showText(p, "Drag to Move", this);
1332  else
1333  QToolTip::hideText();
1334  }
1335 }
1336 
1338 {
1339  bool ok;
1340  int i = QInputDialog::getInt(this, tr("Configure Type"),
1341  tr("Graphic Scale Type:"), m_type, 1, 4, 1, &ok);
1342  if(ok)
1343  {
1344  m_type = i;
1345  adjust();
1346  update();
1347  }
1348 }
1349 
1351 {
1352  bool ok;
1353  QFont f = m_font;
1354  f.setPointSize(m_pointSize);
1355 
1356  QFont font = QFontDialog::getFont(&ok, f, this);
1357  if(ok)
1358  {
1359  m_font = font;
1360  m_pointSize = font.pointSize();
1361  setPointSize(m_pointSize);
1362  adjust();
1363  update();
1364  }
1365 }
1366 
1368 {
1369  QColor cor = QColorDialog::getColor(m_labelColor, this, "Label Color");
1370  if(cor.isValid())
1371  {
1372  m_labelColor = cor;
1373  adjust();
1374  update();
1375  }
1376 }
1377 
1379 {
1380  QColor cor = QColorDialog::getColor(m_labelColor, this, "Label Color");
1381  if(cor.isValid())
1382  {
1383  m_barColor = cor;
1384  adjust();
1385  update();
1386  }
1387 }
1388 
1390 {
1391  bool ok;
1392  int i = QInputDialog::getInt(this, tr("Configure Bar Height"),
1393  tr("Bar Height:"), qRound(m_barRect.height()), 2, 20, 1, &ok);
1394  if(ok)
1395  {
1396  m_barRect.setHeight(i);
1397  adjust();
1398  update();
1399  }
1400 }
1401 
1403 {
1404  if(m_offsetOriginAction->isChecked() != m_offsetOrigin)
1405  {
1406  m_offsetOrigin = m_offsetOriginAction->isChecked();
1407  adjust();
1408  update();
1409  }
1410 }
1411 
1413 {
1414  if(m_setLabelAboveAction->isChecked() != m_labelAbove)
1415  {
1416  m_labelAbove = m_setLabelAboveAction->isChecked();
1417  adjust();
1418  update();
1419  }
1420 }
1421 
1423 {
1424  if(m_setUnitAboveAction->isChecked() != m_unitAbove)
1425  {
1426  m_unitAbove = m_setUnitAboveAction->isChecked();
1427  adjust();
1428  update();
1429  }
1430 }
1431 
1433 {
1434  QStringList items;
1435  items << tr("Kilometers") << tr("Meters") << tr("Decimal Degrees") << tr("Miles") << \
1436  tr("Leagues") << tr("Inches") << tr("Feet") << tr("Hand") << tr("Fingers") << \
1437  tr("Nautic Miles") << tr("Nautic Fathom") << tr("Yards") << tr("Fourlongs") << \
1438  tr("Chains") << tr("Marathons") << tr("Unknow");
1439 
1440  int current;
1441  for(current = 0; current < items.size(); current++)
1442  {
1443  if(m_unit == items[current])
1444  break;
1445  }
1446 
1447  bool ok;
1448  QString item = QInputDialog::getItem(this, tr("Set Unit"),
1449  tr("Unit:"), items, current, false, &ok);
1450 
1451  if(ok && item.isEmpty() == false && item != m_unit)
1452  {
1453  setUnit(item);
1454  m_step = 0; // calcula de novo o step
1455  adjust();
1456  update();
1457  }
1458 }
1459 
1461 {
1462  bool ok;
1463  int i = QInputDialog::getInt(this, tr("Set Number Of Divisions"),
1464  tr("Number Of Divisions:"), m_divisions, 2, 10, 1, &ok);
1465  if(ok)
1466  {
1467  m_divisions = i;
1468 
1469  // na interface pode ter uma opção para recalcular o step (isto mantem o tamanho horizontal da escala)
1470  m_step = 0; // para recalcular o step - retirar esta linha caso cntrario
1471  adjust();
1472  update();
1473  }
1474 }
1475 
1477 {
1478  bool ok;
1479  int i = QInputDialog::getInt(this, tr("Set Number Of Subdivisions"),
1480  tr("Number Of Subdivisions:"), m_subDivisions, 2, 10, 1, &ok);
1481  if(ok)
1482  {
1483  m_subDivisions = i;
1484  adjust();
1485  update();
1486  }
1487 }
1488 
1490 {
1491  bool ok;
1492  double v = QInputDialog::getDouble(this, tr("Set Step Distance"),
1493  tr("Step Distance:"), m_step, 0, 2147483647, 1, &ok);
1494  if(ok)
1495  {
1496  m_step = v;
1497  adjust();
1498  update();
1499  }
1500 }
1501 
1503 {
1504  if(m_showTooTipAction->isChecked() != m_showToolTip)
1505  {
1506  m_showToolTip = m_setUnitAboveAction->isChecked();
1507  showToolTip(m_showToolTip);
1508  }
1509 }
1510 
A DataFrame ....
Definition: DataFrame.h:59
A canvas built on top of Qt.
This file contains include headers for TerraLib Spatial Reference System module.
double getDouble(const std::string &value, std::vector< std::string > &sVector)
Definition: Utils.cpp:59
QRectF getFrameRect()
Definition: Frame.cpp:116
void toolTip(const QPoint &, const QString &)
void setDataFrame(te::qt::widgets::DataFrame *df)
This file contains include headers for the TerraLib Common Runtime module.
GraphicScaleFrame(te::qt::widgets::DataFrame *df, Qt::WindowFlags f=Qt::Widget)
GraphicScaleFrame & operator=(const GraphicScaleFrame &rhs)
te::qt::widgets::DataFrame * getDataFrame()
te::qt::widgets::DataFrame * m_dataFrame
std::string Convert2String(boost::int16_t value)
It converts a short integer value to a string.
Definition: StringUtils.h:51
QRectF m_frameRect
Definition: Frame.h:73
Frame & operator=(const Frame &rhs)
Definition: Frame.cpp:70