mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
moved bBoxOfSelected() from QgsMapLayer to QgsVectorLayer to restore 'zoom to selected' soon
git-svn-id: http://svn.osgeo.org/qgis/trunk@545 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
7bde026346
commit
ad78d37c9e
@ -39,6 +39,7 @@
|
||||
#include "qgslinesymbol.h"
|
||||
#include "qgsmapcanvas.h"
|
||||
#include "qgsmaplayerinterface.h"
|
||||
#include "qgsvectorlayer.h"
|
||||
|
||||
QgsMapCanvas::QgsMapCanvas(QWidget * parent, const char *name)
|
||||
:QWidget(parent, name)
|
||||
@ -326,7 +327,8 @@ void QgsMapCanvas::zoomPreviousExtent()
|
||||
|
||||
void QgsMapCanvas::zoomToSelected()
|
||||
{
|
||||
QgsMapLayer * lyr = mapLegend->currentLayer();
|
||||
QgsVectorLayer* lyr = dynamic_cast<QgsVectorLayer*>(mapLegend->currentLayer());
|
||||
|
||||
if(lyr)
|
||||
{
|
||||
QgsRect rect=lyr->bBoxOfSelected();
|
||||
|
@ -71,11 +71,6 @@ const QgsRect QgsMapLayer::extent()
|
||||
return layerExtent;
|
||||
}
|
||||
|
||||
QgsRect QgsMapLayer::bBoxOfSelected()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
QgsRect QgsMapLayer::calculateExtent()
|
||||
{
|
||||
//just to prevent any crashes
|
||||
|
@ -65,8 +65,6 @@ class QgsMapLayer:public QObject
|
||||
* based on the layer type
|
||||
*/
|
||||
virtual QgsRect calculateExtent();
|
||||
/**Returns the bounding box of the selected features. If there is no selection, the lower bounds are DBL_MAX and the upper bounds DBL_MIN*/
|
||||
virtual QgsRect bBoxOfSelected();
|
||||
virtual void draw(QPainter *, QgsRect *, int);
|
||||
virtual void draw(QPainter *, QgsRect *, QgsCoordinateTransform * cXf);
|
||||
/*! Identify the feature(s) in this layer that are contained in the search rectangle
|
||||
|
@ -707,3 +707,9 @@ void QgsVectorLayer::initContextMenu(QgisApp *app){
|
||||
QPopupMenu *QgsVectorLayer::contextMenu(){
|
||||
return popMenu;
|
||||
}
|
||||
|
||||
QgsRect QgsVectorLayer::bBoxOfSelected()
|
||||
{
|
||||
QgsRect myrect;//soon
|
||||
return myrect;
|
||||
}
|
||||
|
@ -87,6 +87,8 @@ class QgsVectorLayer:public QgsMapLayer
|
||||
QgsVectorLayerProperties* propertiesDialog();
|
||||
/** Return the context menu for the layer */
|
||||
QPopupMenu *contextMenu();
|
||||
/**Returns the bounding box of the selected features. If there is no selection, the lower bounds are DBL_MAX and the upper bounds DBL_MIN*/
|
||||
virtual QgsRect bBoxOfSelected();
|
||||
protected:
|
||||
/**Pointer to the table display object if there is one, else a pointer to 0*/
|
||||
QgsAttributeTableDisplay* tabledisplay;
|
||||
|
Loading…
x
Reference in New Issue
Block a user