Skip to content
Permalink
Browse files
More api cleanups mainly affecting gui
git-svn-id: http://svn.osgeo.org/qgis/trunk@9233 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Aug 31, 2008
1 parent 21a5d72 commit 8f60bc5095d86505595bd053b1c8e57d2f7f1a43
Showing with 134 additions and 134 deletions.
  1. +1 −1 python/gui/qgisinterface.sip
  2. +8 −8 python/gui/qgsmapcanvas.sip
  3. +2 −2 python/gui/qgsmapcanvasitem.sip
  4. +1 −1 python/gui/qgsmapcanvasmap.sip
  5. +1 −1 python/gui/qgsmapoverviewcanvas.sip
  6. +6 −6 python/gui/qgsmaptool.sip
  7. +1 −1 python/gui/qgsmaptoolpan.sip
  8. +1 −1 python/gui/qgsmaptoolzoom.sip
  9. +5 −5 src/app/legend/qgslegend.cpp
  10. +1 −1 src/app/legend/qgslegend.h
  11. +7 −7 src/app/legend/qgslegendlayerfile.cpp
  12. +2 −2 src/app/legend/qgslegendlayerfile.h
  13. +9 −9 src/app/qgisapp.cpp
  14. +2 −2 src/app/qgisapp.h
  15. +2 −2 src/app/qgisappinterface.cpp
  16. +1 −1 src/app/qgisappinterface.h
  17. +1 −1 src/app/qgsmaptooladdfeature.cpp
  18. +1 −1 src/app/qgsmaptooladdvertex.cpp
  19. +2 −2 src/app/qgsmaptoolcapture.cpp
  20. +2 −2 src/app/qgsmaptooledit.cpp
  21. +1 −1 src/app/qgsmaptoolidentify.cpp
  22. +5 −5 src/app/qgsmaptoolmovefeature.cpp
  23. +1 −1 src/app/qgsmaptoolmovevertex.cpp
  24. +1 −1 src/app/qgsmaptoolselect.cpp
  25. +1 −1 src/core/qgsprojectfiletransform.cpp
  26. +1 −1 src/gui/qgisinterface.h
  27. +16 −16 src/gui/qgsmapcanvas.cpp
  28. +9 −9 src/gui/qgsmapcanvas.h
  29. +4 −4 src/gui/qgsmapcanvasitem.cpp
  30. +2 −2 src/gui/qgsmapcanvasitem.h
  31. +1 −1 src/gui/qgsmapcanvasmap.h
  32. +2 −2 src/gui/qgsmapoverviewcanvas.cpp
  33. +1 −1 src/gui/qgsmapoverviewcanvas.h
  34. +9 −9 src/gui/qgsmaptool.cpp
  35. +7 −7 src/gui/qgsmaptool.h
  36. +1 −1 src/gui/qgsmaptoolemitpoint.cpp
  37. +1 −1 src/gui/qgsmaptoolpan.h
  38. +1 −1 src/gui/qgsmaptoolzoom.h
  39. +1 −1 src/gui/qgsrubberband.cpp
  40. +1 −1 src/gui/qgsvertexmarker.cpp
  41. +1 −1 src/plugins/georeferencer/qgsgeorefdatapoint.cpp
  42. +1 −1 src/plugins/georeferencer/qgspointdialog.cpp
  43. +4 −4 src/plugins/grass/qgsgrassedittools.cpp
  44. +4 −4 src/plugins/grass/qgsgrassregion.cpp
  45. +2 −2 src/plugins/maplayer/maplayertest.cpp
@@ -31,7 +31,7 @@ class QgisInterface : QObject
//! Zoom to full extent of map layers
virtual void zoomFull()=0;
//! Zoom to previous view extent
virtual void zoomPrevious()=0;
virtual void zoomToPrevious()=0;
//! Zoome to extent of the active layer
virtual void zoomActiveLayer()=0;

@@ -11,13 +11,13 @@ class QgsMapCanvasLayer
%End

public:
QgsMapCanvasLayer(QgsMapLayer* layer, bool visible = TRUE, bool inOverview = FALSE);
QgsMapCanvasLayer(QgsMapLayer* layer, bool visible = TRUE, bool isInOverview = FALSE);

void setVisible(bool visible);
void setInOverview(bool inOverview);
void setInOverview(bool isInOverview);

bool isVisible() const;
bool inOverview() const;
bool isInOverview() const;

QgsMapLayer* layer();
//const QgsMapLayer* layer() const;
@@ -68,7 +68,7 @@ class QgsMapCanvas : QGraphicsView
QPixmap& canvasPixmap();

//! Get the last reported scale of the canvas
double getScale();
double scale();

//! Clear the map canvas
void clear();
@@ -85,10 +85,10 @@ class QgsMapCanvas : QGraphicsView
void setExtent(const QgsRect & r);

//! Zoom to the full extent of all layers
void zoomFullExtent();
void zoomToFullExtent();

//! Zoom to the previous extent (view)
void zoomPreviousExtent();
void zoomToPreviousExtent();

/**Zooms to the extend of the selected features*/
void zoomToSelected();
@@ -165,7 +165,7 @@ class QgsMapCanvas : QGraphicsView
void enableAntiAliasing(bool theFlag);

//! Select which Qt class to render with
void useQImageToRender(bool theFlag);
void useImageToRender(bool theFlag);

// following 2 methods should be moved elsewhere or changed to private
// currently used by pan map tool
@@ -272,7 +272,7 @@ class QgsMapCanvas : QGraphicsView
void moveCanvasContents(bool reset = FALSE);

//! called on resize or changed extent to notify canvas items to change their rectangle
void updateCanvasItemsPositions();
void updateCanvasItemPositions();


}; // class QgsMapCanvas
@@ -42,10 +42,10 @@ class QgsMapCanvasItem : QGraphicsItem
void setRect(const QgsRect& r);

//! transformation from screen coordinates to map coordinates
QgsPoint toMapCoords(const QPoint& point);
QgsPoint toMapCoordinates(const QPoint& point);

//! transformation from map coordinates to screen coordinates
QPointF toCanvasCoords(const QgsPoint& point);
QPointF toCanvasCoordinates(const QgsPoint& point);

};

@@ -33,7 +33,7 @@ class QgsMapCanvasMap : QGraphicsRectItem

void enableAntiAliasing(bool flag);

void useQImageToRender(bool flag);
void useImageToRender(bool flag);

//! renders map using QgsMapRender to mPixmap
void render();
@@ -17,7 +17,7 @@ class QgsMapOverviewCanvas : QWidget
void refresh();

//! changes background color
void setbgColor(const QColor& color);
void setBackgroundColor(const QColor& color);

//! updates layer set for overview
void setLayerSet(const QStringList& layerSet);
@@ -57,7 +57,7 @@ class QgsMapTool : QObject
/** Check whether this MapTool performs a zoom or pan operation.
* If it does, we will be able to perform the zoom and then
* resume operations with the original / previously used tool.*/
virtual bool isZoomTool();
virtual bool isTransient();

/** Check whether this MapTool performs an edit operation.
* If it does, we will deactivate it when editing is turned off
@@ -76,19 +76,19 @@ class QgsMapTool : QObject
QgsMapTool(QgsMapCanvas* canvas /TransferThis/);

//! transformation from screen coordinates to map coordinates
QgsPoint toMapCoords(const QPoint& point);
QgsPoint toMapCoordinates(const QPoint& point);

//! transformation from screen coordinates to layer's coordinates
QgsPoint toLayerCoords(QgsMapLayer* layer, const QPoint& point);
QgsPoint toLayerCoordinates(QgsMapLayer* layer, const QPoint& point);

//! trnasformation from map coordinates to layer's coordinates
QgsPoint toLayerCoords(QgsMapLayer* layer, const QgsPoint& point);
QgsPoint toLayerCoordinates(QgsMapLayer* layer, const QgsPoint& point);

//! trnasformation of the rect from map coordinates to layer's coordinates
QgsRect toLayerCoords(QgsMapLayer* layer, const QgsRect& rect);
QgsRect toLayerCoordinates(QgsMapLayer* layer, const QgsRect& rect);

//! transformation from map coordinates to screen coordinates
QPoint toCanvasCoords(const QgsPoint& point);
QPoint toCanvasCoordinates(const QgsPoint& point);


};
@@ -18,7 +18,7 @@ class QgsMapToolPan : QgsMapTool
//! Overridden mouse release event
virtual void canvasReleaseEvent(QMouseEvent * e);

virtual bool isZoomTool();
virtual bool isTransient();

};

@@ -18,7 +18,7 @@ class QgsMapToolZoom : QgsMapTool
//! Overridden mouse release event
virtual void canvasReleaseEvent(QMouseEvent * e);

virtual bool isZoomTool();
virtual bool isTransient();

};

@@ -511,7 +511,7 @@ void QgsLegend::addLayer( QgsMapLayer * layer )

// first layer?
if ( mMapCanvas->layerCount() == 1 )
mMapCanvas->zoomFullExtent();
mMapCanvas->zoomToFullExtent();
setCurrentItem( llayer );
//make the QTreeWidget item up-to-date
doItemsLayout();
@@ -910,7 +910,7 @@ bool QgsLegend::writeXML( QDomNode & legendnode, QDomDocument & document )
legendlayerfilenode.setAttribute( "visible", llf->isVisible() );

// show in overview flag
legendlayerfilenode.setAttribute( "inOverview", llf->isInOverview() );
legendlayerfilenode.setAttribute( "isInOverview", llf->isInOverview() );
}
break;

@@ -1035,7 +1035,7 @@ bool QgsLegend::readXML( QDomNode& legendnode )

// load layer's visibility and 'show in overview' flag
theLegendLayerFile->setVisible( atoi( childelem.attribute( "visible", "1" ).toUtf8() ) ); //Default is visible
theLegendLayerFile->setInOverview( atoi( childelem.attribute( "inOverview" ).toUtf8() ) );
theLegendLayerFile->setInOverview( atoi( childelem.attribute( "isInOverview" ).toUtf8() ) );

// set the check state
blockSignals( true );
@@ -1399,15 +1399,15 @@ void QgsLegend::updateOverview()
mMapCanvas->updateOverview();
}

void QgsLegend::setOverviewAllLayers( bool inOverview )
void QgsLegend::setOverviewAllLayers( bool isInOverview )
{
QTreeWidgetItem* theItem = firstItem();
while ( theItem )
{
QgsLegendLayerFile* llf = dynamic_cast<QgsLegendLayerFile*>( theItem );
if ( llf )
{
llf->setInOverview( inOverview );
llf->setInOverview( isInOverview );
}
theItem = nextItem( theItem );
}
@@ -154,7 +154,7 @@ class QgsLegend : public QTreeWidget
void updateOverview();

/**Show/remove all layer in/from overview*/
void setOverviewAllLayers( bool inOverview );
void setOverviewAllLayers( bool isInOverview );

/**Adds an entry to mPixmapWidthValues*/
void addPixmapWidthValue( int width );
@@ -102,7 +102,7 @@ void QgsLegendLayerFile::updateLegendItem()
{
QPixmap pix = legend()->pixmaps().mOriginalPixmap;

if ( mLyr.inOverview() )
if ( mLyr.isInOverview() )
{
//add overview glasses to the pixmap
QPainter p( &pix );
@@ -130,12 +130,12 @@ void QgsLegendLayerFile::updateLegendItem()

}

void QgsLegendLayerFile::setIconAppearance( bool inOverview,
void QgsLegendLayerFile::setIconAppearance( bool isInOverview,
bool editable )
{
QPixmap newIcon( getOriginalPixmap() );

if ( inOverview )
if ( isInOverview )
{
// Overlay the overview icon on the default icon
QPixmap myPixmap = QgisApp::getThemePixmap( "mIconOverview.png" );
@@ -189,14 +189,14 @@ bool QgsLegendLayerFile::isVisible()
return mLyr.isVisible();
}

void QgsLegendLayerFile::setInOverview( bool inOverview )
void QgsLegendLayerFile::setInOverview( bool isInOverview )
{
mLyr.setInOverview( inOverview );
mLyr.setInOverview( isInOverview );
}

bool QgsLegendLayerFile::isInOverview()
{
return mLyr.inOverview();
return mLyr.isInOverview();
}

void QgsLegendLayerFile::showInOverview()
@@ -333,7 +333,7 @@ void QgsLegendLayerFile::addToPopupMenu( QMenu& theMenu, QAction* toggleEditingA
QAction* showInOverviewAction = theMenu.addAction( tr( "&Show in overview" ), this, SLOT( showInOverview() ) );
showInOverviewAction->setCheckable( true );
showInOverviewAction->blockSignals( true );
showInOverviewAction->setChecked( mLyr.inOverview() );
showInOverviewAction->setChecked( mLyr.isInOverview() );
showInOverviewAction->blockSignals( false );

// remove from canvas
@@ -46,7 +46,7 @@ class QgsLegendLayerFile : public QgsLegendItem

QPixmap getOriginalPixmap() const;

void setIconAppearance( bool inOverview, bool editable );
void setIconAppearance( bool isInOverview, bool editable );

/**Returns a label for a layer. Is static such that
the name can be passed to the constructor of QgsLegendLayerFile*/
@@ -55,7 +55,7 @@ class QgsLegendLayerFile : public QgsLegendItem
void setVisible( bool visible = TRUE );
bool isVisible();

void setInOverview( bool inOverview = TRUE );
void setInOverview( bool isInOverview = TRUE );
bool isInOverview();

/** called to add appropriate menu items to legend's popup menu */
@@ -728,7 +728,7 @@ void QgisApp::createActions()
mActionZoomLast = new QAction( getThemeIcon( "mActionZoomLast.png" ), tr( "Zoom Last" ), this );
//mActionZoomLast->setShortcut(tr("Ctrl+O","Zoom to Last Extent"));
mActionZoomLast->setStatusTip( tr( "Zoom to Last Extent" ) );
connect( mActionZoomLast, SIGNAL( triggered() ), this, SLOT( zoomPrevious() ) );
connect( mActionZoomLast, SIGNAL( triggered() ), this, SLOT( zoomToPrevious() ) );

mActionZoomActualSize = new QAction( tr( "Zoom Actual Size" ), this );
mActionZoomActualSize->setStatusTip( tr( "Zoom to Actual Size" ) );
@@ -825,7 +825,7 @@ void QgisApp::createActions()
mActionAddToOverview = new QAction( getThemeIcon( "mActionInOverview.png" ), tr( "Add to Overview" ), this );
mActionAddToOverview->setShortcut( tr( "O", "Add current layer to overview map" ) );
mActionAddToOverview->setStatusTip( tr( "Add current layer to overview map" ) );
connect( mActionAddToOverview, SIGNAL( triggered() ), this, SLOT( inOverview() ) );
connect( mActionAddToOverview, SIGNAL( triggered() ), this, SLOT( isInOverview() ) );
mActionAddToOverview->setEnabled( false );

mActionAddAllToOverview = new QAction( getThemeIcon( "mActionAddAllToOverview.png" ), tr( "Add All to Overview" ), this );
@@ -1596,7 +1596,7 @@ void QgisApp::createOverview()
// moved here to set anti aliasing to both map canvas and overview
QSettings mySettings;
mMapCanvas->enableAntiAliasing( mySettings.value( "/qgis/enable_anti_aliasing", false ).toBool() );
mMapCanvas->useQImageToRender( mySettings.value( "/qgis/use_qimage_to_render", false ).toBool() );
mMapCanvas->useImageToRender( mySettings.value( "/qgis/use_qimage_to_render", false ).toBool() );

int action = mySettings.value( "/qgis/wheel_action", 0 ).toInt();
double zoomFactor = mySettings.value( "/qgis/zoom_factor", 2 ).toDouble();
@@ -3650,15 +3650,15 @@ void QgisApp::pan()

void QgisApp::zoomFull()
{
mMapCanvas->zoomFullExtent();
mMapCanvas->zoomToFullExtent();
// notify the project we've made a change
QgsProject::instance()->dirty( true );

}

void QgisApp::zoomPrevious()
void QgisApp::zoomToPrevious()
{
mMapCanvas->zoomPreviousExtent();
mMapCanvas->zoomToPreviousExtent();
// notify the project we've made a change
QgsProject::instance()->dirty( true );

@@ -4078,7 +4078,7 @@ void QgisApp::showScale( double theScale )

void QgisApp::userScale()
{
double currentScale = mMapCanvas->getScale();
double currentScale = mMapCanvas->scale();

QStringList parts = mScaleEdit->text().split( ':' );
if ( parts.size() == 2 )
@@ -4096,7 +4096,7 @@ void QgisApp::userScale()


// toggle overview status
void QgisApp::inOverview()
void QgisApp::isInOverview()
{
mMapLegend->legendLayerShowInOverview();
}
@@ -4477,7 +4477,7 @@ void QgisApp::options()

QSettings mySettings;
mMapCanvas->enableAntiAliasing( mySettings.value( "/qgis/enable_anti_aliasing" ).toBool() );
mMapCanvas->useQImageToRender( mySettings.value( "/qgis/use_qimage_to_render" ).toBool() );
mMapCanvas->useImageToRender( mySettings.value( "/qgis/use_qimage_to_render" ).toBool() );

int action = mySettings.value( "/qgis/wheel_action", 0 ).toInt();
double zoomFactor = mySettings.value( "/qgis/zoom_factor", 2 ).toDouble();
@@ -312,7 +312,7 @@ class QgisApp : public QMainWindow
//! Zoom to full extent
void zoomFull();
//! Zoom to the previous extent
void zoomPrevious();
void zoomToPrevious();
//! Zoom to selected features
void zoomToSelected();

@@ -358,7 +358,7 @@ class QgisApp : public QMainWindow
void addDatabaseLayer();
//#endif
/** toggles whether the current selected layer is in overview or not */
void inOverview();
void isInOverview();
//! Slot to show the map coordinate position of the mouse cursor
void showMouseCoordinate( QgsPoint & );
//! Slot to show current map scale;
@@ -47,9 +47,9 @@ void QgisAppInterface::zoomFull()
qgis->zoomFull();
}

void QgisAppInterface::zoomPrevious()
void QgisAppInterface::zoomToPrevious()
{
qgis->zoomPrevious();
qgis->zoomToPrevious();
}

void QgisAppInterface::zoomActiveLayer()
@@ -46,7 +46,7 @@ class QgisAppInterface : public QgisInterface
//! Zoom map to full extent
void zoomFull();
//! Zoom map to previous extent
void zoomPrevious();
void zoomToPrevious();
//! Zoom to active layer
void zoomActiveLayer();

@@ -103,7 +103,7 @@ void QgsMapToolAddFeature::canvasReleaseEvent( QMouseEvent * e )
idPoint = snapPointFromResults( snapResults, e->pos() );
try
{
savePoint = toLayerCoords( vlayer, idPoint );
savePoint = toLayerCoordinates( vlayer, idPoint );
QgsDebugMsg( "savePoint = " + savePoint.toString() );
}
catch ( QgsCsException &cse )

0 comments on commit 8f60bc5

Please sign in to comment.