45 #include <QtGui/QApplication> 
   46 #include <QtGui/QAction> 
   47 #include <QtGui/QMenu> 
   48 #include <QtGui/QToolTip> 
   49 #include <QtGui/QPainter> 
   50 #include <QtGui/QColor> 
   51 #include <QtGui/QWidget> 
   52 #include <QtGui/QFontDatabase> 
   53 #include <QtGui/QResizeEvent> 
   54 #include <QtGui/QBoxLayout> 
   55 #include <QtGui/QMessageBox> 
   56 #include <QtGui/QInputDialog> 
   58 #include <QtCore/QRect> 
   59 #include <QtCore/QCoreApplication> 
   60 #include <QtCore/QEvent> 
   63   te::qt::widgets::
Frame(me, f),
 
   66   m_dataUnitToMilimeter(-1),
 
   69   m_graphicScaleFrame(0)
 
   71   setWindowTitle(
"DataFrame");
 
   72   setMouseTracking(
true);
 
   83   QBoxLayout* layout = 
new QBoxLayout(QBoxLayout::LeftToRight, 
this);
 
  104   te::qt::widgets::
Frame(rhs.m_layoutEditor, rhs.windowFlags()),
 
  105   m_dataUnitToMilimeter(rhs.m_dataUnitToMilimeter)
 
  108   setWindowTitle(
"DataFrame");
 
  109   setMouseTracking(
true);
 
  131   QBoxLayout* layout = 
new QBoxLayout(QBoxLayout::LeftToRight, 
this);
 
  182     setWindowTitle(
"DataFrame");
 
  183     setMouseTracking(
true);
 
  191     m_graphicScaleFrame = 0;
 
  200     m_mapDisplay->setAcceptDrops(
true);
 
  203     m_mapDisplay->setResizeInterval(0);
 
  204     m_mapDisplay->setMouseTracking(
true);
 
  205     m_mapDisplay->installEventFilter(
this);
 
  206     QBoxLayout* layout = 
new QBoxLayout(QBoxLayout::LeftToRight, 
this);
 
  207     layout->addWidget(m_mapDisplay);
 
  210     m_mapDisplay->show();
 
  211     connect(m_mapDisplay, SIGNAL(drawLayersFinished(
const QMap<QString, QString>&)), 
this, SLOT(onDrawLayersFinished(
const QMap<QString, QString>&)));
 
  214     m_mapDisplay->setExtent(env, 
false);
 
  219       m_UTMGridFrame->setDataFrame(
this);
 
  225       m_geoGridFrame->setDataFrame(
this);
 
  231       m_graphicScaleFrame->setDataFrame(
this);
 
  235     m_menu = 
new QMenu(
this);
 
  236     m_createUTMGridAction = m_menu->addAction(
"Create UTM Grid");
 
  237     m_removeUTMGridAction = m_menu->addAction(
"Remove UTM Grid");
 
  238     m_createGeographicGridAction = m_menu->addAction(
"Create Geographic Grid");
 
  239     m_removeGeographicGridAction = m_menu->addAction(
"Remove Geographic Grid");
 
  240     m_createGraphicScaleAction = m_menu->addAction(
"Create Graphic Scale");
 
  241     m_removeGraphicScaleAction = m_menu->addAction(
"Remove Graphic Scale");
 
  242     m_magneticDeclinationAction = m_menu->addAction(
"Magnetic Declination...");
 
  257   removeEventFilter(
this);
 
  259   delete m_UTMGridFrame;
 
  260   delete m_geoGridFrame;
 
  261   delete m_graphicScaleFrame;
 
  275     m_mapDisplay->setExtent(e);
 
  288   adjustWidgetToFrameRect(m_frameRect);
 
  290     m_UTMGridFrame->adjust();
 
  292     m_geoGridFrame->adjust();
 
  293   if(m_graphicScaleFrame)
 
  294     m_graphicScaleFrame->adjust();
 
  304   if(m_layoutEditor->getPaperViewRect().intersects(m_frameRect) == 
false)
 
  311   QMatrix matrix = m_layoutEditor->getMatrixPaperViewToVp();
 
  312   QRect rec = matrix.mapRect(m_frameRect).toRect();
 
  314   QWidget::resize(rec.width()+19, rec.height()+19);
 
  315   QWidget::move(rec.left()-9, rec.top()-9);
 
  319   double pw = rec.width();
 
  320   double ph = rec.height();
 
  321   int ipw = qRound(pw);
 
  322   int iph = qRound(ph);
 
  323   int ipw2 = qRound(pw/2.);
 
  324   int iph2 = qRound(ph/2.);
 
  335   int iw2 = qRound(w/2.);
 
  336   int ih2 = qRound(h/2.);
 
  338   m_recSel1 = QRect(0, 0, iw, ih);
 
  339   m_recSel2 = QRect(ipw2 - iw2, 0, iw, ih);
 
  340   m_recSel3 = QRect(ipw - iw, 0, iw, ih);
 
  341   m_recSel4 = QRect(ipw - iw, iph2 - ih2, iw, ih);
 
  342   m_recSel5 = QRect(ipw - iw, iph - ih, iw, ih);
 
  343   m_recSel6 = QRect(ipw2 - iw2, iph - ih, iw, ih);
 
  344   m_recSel7 = QRect(0, iph - ih, iw, ih);
 
  345   m_recSel8 = QRect(0, iph2 - ih2, iw, ih);
 
  347   m_recSel10 = QRect(0, 0, ipw, iph);
 
  361   double toMeter = m_dataUnitToMilimeter / 1000;
 
  363   double w = m_frameRect.width();
 
  364   double h = m_frameRect.height();
 
  365   double ew = env.
getWidth() * toMeter;
 
  369   double ww = w * m_scale / 1000;
 
  370   double wh = h * m_scale / 1000;
 
  371   double exi = (ecx - ww / 2.) / toMeter;
 
  372   double eyi = (ecy - wh / 2.) / toMeter;
 
  374   m_dataRect = QRectF(QPointF(exi, eyi), QPointF(exi + ww/toMeter, eyi + wh/toMeter));
 
  375   m_mapDisplay->setExtent(env2);
 
  376   if(m_graphicScaleFrame)
 
  377     m_graphicScaleFrame->setStep(0);
 
  390     if(al->getType() == 
"DATASETLAYER" || 
 
  391       al->getType() == 
"QUERYLAYER" ||
 
  392       al->getType() == 
"RASTERLAYER")
 
  395         layerList.push_back(al);
 
  400     for(it = al.get()->begin(); it != al.get()->end(); ++it)
 
  406       getLayerList(t, layerList);
 
  420     QPixmap* pix = m_mapDisplay->getDisplayPixmap();
 
  421     m_mapDisplay->setBackgroundColor(Qt::gray);
 
  422     m_mapDisplay->update();
 
  426   m_dataChanged = 
true;
 
  427   m_mapDisplay->changeData(al, nsrid);
 
  428   m_visibleLayers.clear();
 
  429   getLayerList(al, m_visibleLayers);
 
  430   if(m_visibleLayers.size() == 0)
 
  432     QPixmap* pix = m_mapDisplay->getDisplayPixmap();
 
  433     m_mapDisplay->setBackgroundColor(Qt::gray);
 
  434     m_mapDisplay->update();
 
  438   m_mapDisplay->setBackgroundColor(Qt::white);
 
  442     m_mapDisplay->refresh();
 
  445     m_dataRect = QRectF();
 
  450   findDataUnitToMilimeter(e, m_mapDisplay->getSRID());
 
  452   double w = m_frameRect.width();
 
  453   double ww = m_dataUnitToMilimeter * e.
getWidth();
 
  465   if(oldsrid == newsrid)
 
  472     double x, y, xmin, xmax, ymin, ymax;
 
  476     converter->setSourceSRID(oldsrid);
 
  477     converter->setTargetSRID(newsrid);
 
  481     converter->convert(x, y);
 
  489     converter->convert(x, y);
 
  501     converter->convert(x, y);
 
  513     converter->convert(x, y);
 
  527     converter->convert(cx, cy);
 
  529     if(std::numeric_limits<double>::has_infinity)
 
  531       if(xmin == std::numeric_limits<double>::infinity() || ymin == std::numeric_limits<double>::infinity() ||
 
  532          xmax == std::numeric_limits<double>::infinity() || ymax == std::numeric_limits<double>::infinity())
 
  536     double w = xmax - xmin;
 
  537     double h = ymax - ymin;
 
  540     double xScale = w / oldEnv.
getWidth();
 
  544       h *= (xScale / yScale);
 
  546       w *= (yScale / xScale);
 
  553     e.
init(xmin, ymin, xmax, ymax);
 
  557     findDataUnitToMilimeter(e, newsrid);
 
  560   catch(std::exception&)
 
  578   converter->setSourceSRID(srid);
 
  579   converter->setTargetSRID(29101); 
 
  585   converter->convert(a1, b1);
 
  590   converter->convert(a2, b2);
 
  594   double dx = (x2 - x1);
 
  595   double dy = (y2 - y1);
 
  596   double da = (a2 - a1);
 
  597   double db = (b2 - b1);
 
  599   double d = sqrt(dx * dx + dy * dy);
 
  600   double dd = sqrt(da * da + db * db);
 
  602   m_dataUnitToMilimeter = 1000 * dd / d;
 
  609   return m_dataUnitToMilimeter;
 
  618   m_dataChanged = 
false;
 
  619   std::list<te::map::AbstractLayerPtr>::iterator it, mit;
 
  620   std::list<te::map::AbstractLayerPtr> visibleLayers;
 
  622   getLayerList(al, visibleLayers);
 
  623   if(m_visibleLayers.size())
 
  625     if(visibleLayers.size() == 0)
 
  627       m_dataChanged = 
true;     
 
  628       m_visibleLayers.clear();
 
  632       if(visibleLayers.size() == m_visibleLayers.size())
 
  634         for(it = visibleLayers.begin(), mit = m_visibleLayers.begin(); it != visibleLayers.end(); ++it, ++mit)
 
  640             m_dataChanged = 
true; 
 
  644         if(it == visibleLayers.end()) 
 
  651     if(visibleLayers.size())
 
  653       m_dataChanged = 
true; 
 
  654       m_visibleLayers = visibleLayers;
 
  661   m_dataChanged = 
true;
 
  664     setData(0, m_mapDisplay->getSRID(), m_dataRect);
 
  665     setData(al, m_mapDisplay->getSRID(), m_dataRect);
 
  674     m_mapDisplay->refresh();
 
  676     m_mapDisplay->update();
 
  680     m_UTMGridFrame->draw();
 
  681     m_UTMGridFrame->update();
 
  686     m_geoGridFrame->draw();
 
  687     m_geoGridFrame->update();
 
  690   if(m_graphicScaleFrame)
 
  692     m_graphicScaleFrame->draw();
 
  693     m_graphicScaleFrame->update();
 
  696   setDataChanged(
false);
 
  703   QPixmap* pixmap = m_mapDisplay->getDraftPixmap();
 
  704   pixmap->fill(Qt::transparent);
 
  707     m_UTMGridFrame->copyToDraftMapDisplay();
 
  709     m_geoGridFrame->copyToDraftMapDisplay();
 
  713   QPainter painter(pixmap);
 
  715   painter.setBrush(Qt::NoBrush);
 
  716   painter.setPen(Qt::blue);
 
  717   painter.setBrush(QColor(0, 0, 255, 120));
 
  718   painter.drawRect(m_recSel1);
 
  719   painter.drawRect(m_recSel2);
 
  720   painter.drawRect(m_recSel3);
 
  721   painter.drawRect(m_recSel4);
 
  722   painter.drawRect(m_recSel5);
 
  723   painter.drawRect(m_recSel6);
 
  724   painter.drawRect(m_recSel7);
 
  725   painter.drawRect(m_recSel8);
 
  727   painter.setBrush(QColor(0, 0, 255, 20));
 
  728   painter.drawRect(m_recSel10);  
 
  730   m_mapDisplay->repaint();
 
  735   QPixmap* pixmap = m_mapDisplay->getDraftPixmap();
 
  736   pixmap->fill(Qt::transparent);
 
  739     m_UTMGridFrame->copyToDraftMapDisplay();
 
  741     m_geoGridFrame->copyToDraftMapDisplay();
 
  745   m_mapDisplay->repaint();
 
  752   if(m_recSel1.contains(p))
 
  754   else if(m_recSel2.contains(p))
 
  756   else if(m_recSel3.contains(p))
 
  758   else if(m_recSel4.contains(p))
 
  760   else if(m_recSel5.contains(p))
 
  762   else if(m_recSel6.contains(p))
 
  764   else if(m_recSel7.contains(p))
 
  766   else if(m_recSel8.contains(p))
 
  770   else if(m_recSel10.contains(p))
 
  817     c = m_recSel1.center();
 
  818   else if(m_selected == 2)
 
  819     c = m_recSel2.center();
 
  820   else if(m_selected == 3)
 
  821     c = m_recSel3.center();
 
  822   else if(m_selected == 4)
 
  823     c = m_recSel4.center();
 
  824   else if(m_selected == 5)
 
  825     c = m_recSel5.center();
 
  826   else if(m_selected == 6)
 
  827     c = m_recSel6.center();
 
  828   else if(m_selected == 7)
 
  829     c = m_recSel7.center();
 
  830   else if(m_selected == 8)
 
  831     c = m_recSel8.center();
 
  832   else if(m_selected == 10)
 
  833     c = m_recSel10.center();
 
  842   QPixmap* pixmap = m_layoutEditor->getDraftPixmap();
 
  843   QPainter painter(pixmap);
 
  844   painter.translate(m_layoutEditor->getVerticalRulerWidth(), m_layoutEditor->getHorizontalRulerWidth());
 
  846   painter.setBrush(Qt::NoBrush);
 
  847   painter.setPen(Qt::red);
 
  848   if(m_copyAuxFrameRect.isValid())
 
  850     painter.setCompositionMode(QPainter::CompositionMode_DestinationOut);
 
  851     painter.drawRect(m_copyAuxFrameRect);
 
  853   painter.setCompositionMode(QPainter::CompositionMode_DestinationOver);
 
  854   painter.drawRect(m_auxFrameRect);
 
  856   m_copyAuxFrameRect = m_auxFrameRect;
 
  858   m_layoutEditor->update();
 
  865     m_mapDisplay->installEventFilter(
this);
 
  869     m_mapDisplay->removeEventFilter(
this);
 
  872     m_UTMGridFrame->sendEventToChildren(b);
 
  874     m_geoGridFrame->sendEventToChildren(b);
 
  875   if(m_graphicScaleFrame)
 
  876     m_graphicScaleFrame->sendEventToChildren(b);
 
  883   int type = e->type();
 
  885   if(obj == m_mapDisplay) 
 
  887     if(type == QEvent::DragEnter)
 
  893     else if(type == QEvent::Drop)
 
  895       QDropEvent* dropEvent = (QDropEvent*)e;
 
  896       const QMimeData* mime = dropEvent->mimeData();
 
  897       QString s = mime->data(
"application/x-terralib;value=\"DraggedItems\"").constData();
 
  898       if(s.isEmpty() == 
false)
 
  901         removeGeographicGrid();
 
  902         removeGraphicScale(); 
 
  904         unsigned long v = s.toULongLong();
 
  905         std::vector<te::qt::widgets::AbstractTreeItem*>* draggedItems = 
reinterpret_cast<std::vector<AbstractTreeItem*>*
>(v);
 
  912     else if(type == QEvent::MouseButtonPress)
 
  914       QMouseEvent *mouseEvent = 
static_cast<QMouseEvent*
>(e);
 
  916       if(mouseEvent->buttons() == Qt::LeftButton)
 
  918         QPoint p = mouseEvent->pos();
 
  921         m_copyAuxFrameRect = QRect();
 
  922         m_layoutEditor->raiseDraftLayoutEditor();
 
  924       else if(mouseEvent->buttons() == Qt::RightButton)
 
  926         QPoint gp = mouseEvent->globalPos();
 
  929           QAction* action = m_menu->exec(gp);
 
  930           if(action == m_createUTMGridAction)
 
  932           else if(action == m_removeUTMGridAction)
 
  934           else if(action == m_createGeographicGridAction)
 
  935             createGeographicGrid();
 
  936           else if(action == m_removeGeographicGridAction)
 
  937             removeGeographicGrid();
 
  938           else if(action == m_createGraphicScaleAction)
 
  939             createGraphicScale();
 
  940           else if(action == m_removeGraphicScaleAction)
 
  941             removeGraphicScale();
 
  942           else if(action == m_magneticDeclinationAction)
 
  943             magneticDeclination();
 
  948     else if (type == QEvent::MouseMove)
 
  950       QMouseEvent *mouseEvent = 
static_cast<QMouseEvent*
>(e);
 
  951       QPoint p = mouseEvent->pos();
 
  952       QPoint gp = mouseEvent->globalPos();
 
  954       if(mouseEvent->buttons() == Qt::NoButton)
 
  959         getSelectionPoint(p);
 
  964           showSelectionPoints();
 
  965           toolTip(gp, 
"Selection");
 
  966           if(m_selected == 10 && m_layoutEditor->getFrameSelected() != 
this)
 
  967             m_layoutEditor->setFrameSelected(
this);
 
  972       else if(mouseEvent->buttons() == Qt::LeftButton)
 
  975         QMouseEvent *mouseEvent = 
static_cast<QMouseEvent*
>(e);
 
  976         QPoint p = mouseEvent->pos();
 
  977         QPoint d = m_pressPoint - p;
 
  978         QMatrix matrix = m_layoutEditor->getMatrix();
 
  979         m_auxFrameRect = matrix.mapRect(m_frameRect).toRect();
 
  986             m_layoutEditor->insertCopy2Undo(
this);
 
  991             m_auxFrameRect = QRect(m_auxFrameRect.left() - d.x(), m_auxFrameRect.top() - d.y(), m_auxFrameRect.width() + d.x(), m_auxFrameRect.height() + d.y());
 
  992           else if(m_selected == 2) 
 
  993             m_auxFrameRect = QRect(m_auxFrameRect.left(), m_auxFrameRect.top() - d.y(), m_auxFrameRect.width(), m_auxFrameRect.height() + d.y());
 
  994           else if(m_selected == 3) 
 
  995             m_auxFrameRect = QRect(m_auxFrameRect.left(), m_auxFrameRect.top() - d.y(), m_auxFrameRect.width() - d.x(), m_auxFrameRect.height() + d.y());
 
  996           else if(m_selected == 4) 
 
  997             m_auxFrameRect = QRect(m_auxFrameRect.left(), m_auxFrameRect.top(), m_auxFrameRect.width() - d.x(), m_auxFrameRect.height());
 
  998           else if(m_selected == 5) 
 
  999             m_auxFrameRect = QRect(m_auxFrameRect.left(), m_auxFrameRect.top(), m_auxFrameRect.width() - d.x(), m_auxFrameRect.height() - d.y());
 
 1000           else if(m_selected == 6) 
 
 1001             m_auxFrameRect = QRect(m_auxFrameRect.left(), m_auxFrameRect.top(), m_auxFrameRect.width(), m_auxFrameRect.height() - d.y());
 
 1002           else if(m_selected == 7) 
 
 1003             m_auxFrameRect = QRect(m_auxFrameRect.left() - d.x(), m_auxFrameRect.top(), m_auxFrameRect.width() + d.x(), m_auxFrameRect.height() - d.y());
 
 1004           else if(m_selected == 8) 
 
 1005             m_auxFrameRect = QRect(m_auxFrameRect.left() - d.x(), m_auxFrameRect.top(), m_auxFrameRect.width() + d.x(), m_auxFrameRect.height());
 
 1006           else if(m_selected == 9) 
 
 1010             m_auxFrameRect.moveCenter(m_auxFrameRect.center() - d);
 
 1018     else if(type == QEvent::MouseButtonRelease)
 
 1020       QMouseEvent *mouseEvent = 
static_cast<QMouseEvent*
>(e);
 
 1021       if(mouseEvent->button() == Qt::LeftButton)
 
 1023         QPoint p = mouseEvent->pos();
 
 1025         if(m_pressPoint != p && m_selected != 0)
 
 1027           if(m_UTMGridFrame || m_geoGridFrame)
 
 1029             QPixmap* pix = m_mapDisplay->getDraftPixmap();
 
 1030             pix->fill(Qt::transparent);
 
 1034           QPixmap* pixmap = m_layoutEditor->getDraftPixmap();
 
 1035           pixmap->fill(Qt::transparent);
 
 1036           verifyConstraints();
 
 1037           QMatrix matrix = m_layoutEditor->getMatrix();
 
 1038           QRectF r(m_auxFrameRect.left(), m_auxFrameRect.top(), m_auxFrameRect.width(), m_auxFrameRect.height());
 
 1039           adjustWidgetToFrameRect(matrix.inverted().mapRect(r));
 
 1040           m_layoutEditor->lowerDraftLayoutEditor();
 
 1043             m_UTMGridFrame->adjust();
 
 1045             m_geoGridFrame->adjust();
 
 1046           if(m_graphicScaleFrame)
 
 1047             m_graphicScaleFrame->adjust();
 
 1049           m_layoutEditor->draw();
 
 1058           showSelectionPoints();
 
 1063     else if(type == QEvent::Enter)
 
 1065       if(QApplication::overrideCursor() || m_dragging)
 
 1068       m_layoutEditor->setFrameSelected(
this);
 
 1073     else if(type == QEvent::Leave)
 
 1075       m_mapDisplay->update();
 
 1080           if(m_UTMGridFrame || m_geoGridFrame)
 
 1087       m_layoutEditor->setFrameSelected(0);
 
 1096   return QWidget::eventFilter(obj, e);
 
 1103   if(m_selected == 1 || m_selected == 5)
 
 1104     cursor.setShape(Qt::SizeFDiagCursor);
 
 1105   else if(m_selected == 2 || m_selected == 6)
 
 1106     cursor.setShape(Qt::SizeVerCursor);
 
 1107   else if(m_selected == 3 || m_selected == 7)
 
 1108     cursor.setShape(Qt::SizeBDiagCursor);
 
 1109   else if(m_selected == 4 || m_selected == 8)
 
 1110     cursor.setShape(Qt::SizeHorCursor);
 
 1111   else if(m_selected == 10)
 
 1112     cursor.setShape(Qt::SizeAllCursor);
 
 1114   if(QApplication::overrideCursor())
 
 1116     if(QApplication::overrideCursor()->shape() != cursor.shape())
 
 1118       while(QApplication::overrideCursor())
 
 1119         QApplication::restoreOverrideCursor();
 
 1120       if(cursor.shape() != Qt::ArrowCursor)
 
 1121         QApplication::setOverrideCursor(cursor);
 
 1124   else if(cursor.shape() != Qt::ArrowCursor)
 
 1125     QApplication::setOverrideCursor(cursor);
 
 1130   if(m_showToolTip == 
false)
 
 1132     QToolTip::hideText();
 
 1136   if(type == 
"Selection")
 
 1138     if(m_selected >= 1 && m_selected <= 8)
 
 1139       QToolTip::showText(p, 
"Drag To Resize", 
this);
 
 1140     else if(m_selected == 10)
 
 1141       QToolTip::showText(p, 
"Drag to Move", 
this);
 
 1143       QToolTip::hideText();
 
 1150     delete m_UTMGridFrame;
 
 1153   m_createUTMGridAction->setEnabled(
false);
 
 1154   m_removeUTMGridAction->setEnabled(
true);
 
 1162     delete m_UTMGridFrame;
 
 1165   m_createUTMGridAction->setEnabled(
true);
 
 1166   m_removeUTMGridAction->setEnabled(
false);
 
 1172     delete m_geoGridFrame;
 
 1175   m_createGeographicGridAction->setEnabled(
false);
 
 1176   m_removeGeographicGridAction->setEnabled(
true);
 
 1184     delete m_geoGridFrame;
 
 1187   m_createGeographicGridAction->setEnabled(
true);
 
 1188   m_removeGeographicGridAction->setEnabled(
false);
 
 1193   if(m_graphicScaleFrame)
 
 1194     delete m_graphicScaleFrame;
 
 1198   m_createGraphicScaleAction->setEnabled(
false);
 
 1199   m_removeGraphicScaleAction->setEnabled(
true);
 
 1206   if(m_graphicScaleFrame)
 
 1207     delete m_graphicScaleFrame;
 
 1208   m_graphicScaleFrame = 0;
 
 1210   m_createGraphicScaleAction->setEnabled(
true);
 
 1211   m_removeGraphicScaleAction->setEnabled(
false);
 
 1232     m_UTMGridFrame->hide();
 
 1234     m_geoGridFrame->hide();
 
 1235   if(m_graphicScaleFrame)
 
 1236     m_graphicScaleFrame->hide();
 
 1238     m_mapDisplay->hide();
 
 1245     m_UTMGridFrame->show();
 
 1247     m_geoGridFrame->show();
 
 1248   if(m_graphicScaleFrame)
 
 1249     m_graphicScaleFrame->show();
 
 1251     m_mapDisplay->show();
 
 1257   te::qt::widgets::Frame::lower();
 
 1259     m_mapDisplay->lower();
 
 1262     m_UTMGridFrame->lower();
 
 1264     m_geoGridFrame->lower();
 
 1269   return &m_lastDisplayContent;
 
 1274   return &m_lastDisplayContent;
 
 1280   m_lastDisplayContent = QPixmap(*m_mapDisplay->getDisplayPixmap());
 
 1284     drawLayerSelection();
 
 1289   m_selectionColor = selColor;
 
 1296   std::list<te::map::AbstractLayerPtr>::iterator it;
 
 1297   std::list<te::map::AbstractLayerPtr> layers;
 
 1299   getLayerList(al, layers);
 
 1301   for(it = layers.begin(); it != layers.end(); ++it)
 
 1309       if(oids == 0 || oids->
size() == 0)
 
 1311         m_mapDisplay->repaint();
 
 1315       bool needRemap = 
false;
 
 1321       std::auto_ptr<te::da::DataSet> selected;
 
 1324         selected = layer->
getData(oids);
 
 1326       catch(std::exception& e)
 
 1328         QMessageBox::critical(m_mapDisplay, tr(
"Error"), QString(tr(
"The layer selection cannot be drawn. Details:") + 
" %1.").arg(e.what()));
 
 1334       QPixmap* content = m_mapDisplay->getDisplayPixmap();
 
 1343       while(selected->moveNext())
 
 1345         std::auto_ptr<te::gm::Geometry> g(selected->getGeometry(gpos));
 
 1350           g->transform(m_mapDisplay->getSRID());
 
 1353         if(currentGeomType != g->getGeomTypeId())
 
 1355           currentGeomType = g->getGeomTypeId();
 
 1359         canvas.
draw(g.get());
 
 1363   m_mapDisplay->repaint();
 
 1368   return m_geoGridFrame;
 
 1373   return m_UTMGridFrame;
 
 1378   return m_graphicScaleFrame;
 
void setDataChanged(bool)
 
void removeGraphicScale()
 
virtual te::map::AbstractLayerPtr getLayer() const =0
 
QAction * m_removeGraphicScaleAction
 
void createGraphicScale()
 
This class is designed to declare objects to be thrown as exceptions by TerraLib. ...
 
te::qt::widgets::GraphicScaleFrame * getGraphicScaleFrame()
 
This class represents a set of unique ids created in the same context. i.e. from the same data set...
 
void toolTip(const QPoint &, const QString &)
 
double getDataUnitToMilimeter()
 
void getSelectionPoint(const QPoint &p)
 
QPixmap * getLastDisplayContent()
 
double getWidth() const 
It returns the envelope width. 
 
This file contains include headers for the Vector Geometry model of TerraLib. 
 
virtual te::map::AlignType getVAlign() const 
It returns the MapDisplay current vertical align. 
 
This abstract class describes a basic item to be organized in a tree-oriented way. 
 
This is the base class for layers. 
 
virtual const te::da::ObjectIdSet * getSelected() const 
It returns the selected group of this Layer. 
 
void setDataFrame(te::qt::widgets::DataFrame *df)
 
const double & getLowerLeftY() const 
It returns a constant refernce to the y coordinate of the lower left corner. 
 
virtual void setBackgroundColor(const QColor &color)
Sets the map display background color. 
 
void setSelectionColor(QColor selColor)
 
void onDrawLayersFinished(const QMap< QString, QString > &errors)
 
void setMagneticDeclination(double angle)
 
void getLayerList(te::map::AbstractLayerPtr, std::list< te::map::AbstractLayerPtr > &)
 
te::map::AbstractLayer * m_data
 
DataFrame(const QRectF &frameRect, te::qt::widgets::LayoutEditor *me, Qt::WindowFlags f=Qt::Window)
 
void setDataRect(QRectF &r)
 
te::map::AbstractLayer * getData()
 
te::qt::widgets::UTMGridFrame * m_UTMGridFrame
 
void sendEventToChildren(bool)
 
#define TE_UNKNOWN_SRS
A numeric value to represent a unknown SRS identification in TerraLib. 
 
virtual const char * what() const 
It outputs the exception message. 
 
void setDataFrame(te::qt::widgets::DataFrame *df)
 
double getHeight() const 
It returns the envelope height. 
 
virtual te::map::AlignType getHAlign() const 
It returns the MapDisplay current horizontal align. 
 
te::qt::widgets::MultiThreadMapDisplay * m_mapDisplay
 
This file contains the support to convert coordinates from a SRS to another. 
 
void createGeographicGrid()
 
const double & getLowerLeftX() const 
It returns a constant reference to the x coordinate of the lower left corner. 
 
void showSelectionPoints()
 
void draw(const te::gm::Geometry *geom)
It draws the geometry on canvas. 
 
virtual int getSRID() const 
It return the Spatial Reference System used by the Map Display. 
 
A canvas built on top of Qt. 
 
double m_lly
Lower left corner y-coordinate. 
 
bool transformEnvelope(te::gm::Envelope &e, int oldsrid, int newsrid)
 
std::size_t size() const 
It returns the object id set size. 
 
Utility functions for the data access module. 
 
QAction * m_createGraphicScaleAction
 
te::qt::widgets::UTMGridFrame * getUTMGridFrame()
 
void adjustWidgetToFrameRect(const QRectF &r)
 
double m_ury
Upper right corner y-coordinate. 
 
void init(const double &llx, const double &lly, const double &urx, const double &ury)
It initializes (sets) the envelope bounds. 
 
A canvas built on top of Qt. 
 
double m_dataUnitToMilimeter
 
TEDATAACCESSEXPORT std::size_t GetFirstPropertyPos(const te::da::DataSet *dataset, int datatype)
 
GeomType
Each enumerated type is compatible with a Well-known Binary (WKB) type code. 
 
virtual void setResizeInterval(int msec)
Sets the timeout interval in milliseconds to redraw on resize event. 
 
double m_urx
Upper right corner x-coordinate. 
 
QPoint getCenterSelected()
 
void drawLayerSelection()
 
void hideSelectionPoints()
 
void findDataUnitToMilimeter(const te::gm::Envelope &e, int srid)
 
The class that represents an item in a LayerTreeModel. 
 
A multi thread Qt4 widget to control the display of a set of layers. 
 
QAction * m_removeGeographicGridAction
 
virtual void setSRID(const int &srid, bool doRefresh=true)
It sets a new Spatial Reference System to be used by the Map Display. 
 
QAction * m_removeUTMGridAction
 
Frame & operator=(const Frame &rhs)
 
boost::intrusive_ptr< TreeItem > TreeItemPtr
 
A multi thread Qt4 widget to control the display of a set of layers. 
 
A Converter is responsible for the conversion of coordinates between different Coordinate Systems (CS...
 
DataFrame & operator=(const DataFrame &rhs)
 
void setExtent(te::gm::Envelope &e, bool doRefresh=true)
It sets the world visible area and refreshes the contents in the map display. 
 
double m_llx
Lower left corner x-coordinate. 
 
std::list< te::map::AbstractLayerPtr > m_visibleLayers
 
TEQTWIDGETSEXPORT void Config2DrawLayerSelection(te::map::Canvas *canvas, const QColor &selectionColor, const te::gm::GeomType &type)
It configs (i.e. prepares) the given canvas to draw a layer selection. 
 
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
 
virtual Visibility getVisibility() const 
It returns the layer visibility. 
 
te::qt::widgets::GraphicScaleFrame * m_graphicScaleFrame
 
double getMagneticDeclination()
 
std::list< TreeItemPtr >::iterator iterator
 
virtual const te::gm::Envelope & getExtent() const 
It returns the world extent showned by the MapDisplay. 
 
QAction * m_createGeographicGridAction
 
An Envelope defines a 2D rectangular region. 
 
void setWindow(const double &llx, const double &lly, const double &urx, const double &ury)
It sets the world (or window) coordinates area (supposing a cartesian reference system). 
 
QAction * m_magneticDeclinationAction
 
virtual int getSRID() const 
It returns the Spatial Reference System ID associated to the Layer. 
 
This class represents a set of unique ids created in the same context. i.e. from the same data set...
 
virtual void setAlign(te::map::AlignType h, te::map::AlignType v)
It will set the align rendering of objects into the map display. Just successive drawings will be aff...
 
void removeGeographicGrid()
 
te::qt::widgets::GeographicGridFrame * m_geoGridFrame
 
te::qt::widgets::GeographicGridFrame * getGeoGridFrame()
 
bool eventFilter(QObject *, QEvent *)
 
void magneticDeclination()
 
virtual std::auto_ptr< te::da::DataSet > getData(te::common::TraverseType travType=te::common::FORWARDONLY, const te::common::AccessPolicy accessPolicy=te::common::RAccess) const =0
It gets the dataset identified by the layer name. 
 
QAction * m_createUTMGridAction
 
void setData(te::map::AbstractLayerPtr d, int nsrid=TE_UNKNOWN_SRS, QRectF r=QRectF())
 
te::qt::widgets::MultiThreadMapDisplay * getMapDisplay()
 
The class that represents an item in a LayerTreeModel.