mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-17 00:04:02 -04: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 "qgslinesymbol.h"
|
||||||
#include "qgsmapcanvas.h"
|
#include "qgsmapcanvas.h"
|
||||||
#include "qgsmaplayerinterface.h"
|
#include "qgsmaplayerinterface.h"
|
||||||
|
#include "qgsvectorlayer.h"
|
||||||
|
|
||||||
QgsMapCanvas::QgsMapCanvas(QWidget * parent, const char *name)
|
QgsMapCanvas::QgsMapCanvas(QWidget * parent, const char *name)
|
||||||
:QWidget(parent, name)
|
:QWidget(parent, name)
|
||||||
@ -326,7 +327,8 @@ void QgsMapCanvas::zoomPreviousExtent()
|
|||||||
|
|
||||||
void QgsMapCanvas::zoomToSelected()
|
void QgsMapCanvas::zoomToSelected()
|
||||||
{
|
{
|
||||||
QgsMapLayer * lyr = mapLegend->currentLayer();
|
QgsVectorLayer* lyr = dynamic_cast<QgsVectorLayer*>(mapLegend->currentLayer());
|
||||||
|
|
||||||
if(lyr)
|
if(lyr)
|
||||||
{
|
{
|
||||||
QgsRect rect=lyr->bBoxOfSelected();
|
QgsRect rect=lyr->bBoxOfSelected();
|
||||||
|
@ -71,11 +71,6 @@ const QgsRect QgsMapLayer::extent()
|
|||||||
return layerExtent;
|
return layerExtent;
|
||||||
}
|
}
|
||||||
|
|
||||||
QgsRect QgsMapLayer::bBoxOfSelected()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
QgsRect QgsMapLayer::calculateExtent()
|
QgsRect QgsMapLayer::calculateExtent()
|
||||||
{
|
{
|
||||||
//just to prevent any crashes
|
//just to prevent any crashes
|
||||||
|
@ -65,8 +65,6 @@ class QgsMapLayer:public QObject
|
|||||||
* based on the layer type
|
* based on the layer type
|
||||||
*/
|
*/
|
||||||
virtual QgsRect calculateExtent();
|
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 *, int);
|
||||||
virtual void draw(QPainter *, QgsRect *, QgsCoordinateTransform * cXf);
|
virtual void draw(QPainter *, QgsRect *, QgsCoordinateTransform * cXf);
|
||||||
/*! Identify the feature(s) in this layer that are contained in the search rectangle
|
/*! 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(){
|
QPopupMenu *QgsVectorLayer::contextMenu(){
|
||||||
return popMenu;
|
return popMenu;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QgsRect QgsVectorLayer::bBoxOfSelected()
|
||||||
|
{
|
||||||
|
QgsRect myrect;//soon
|
||||||
|
return myrect;
|
||||||
|
}
|
||||||
|
@ -87,6 +87,8 @@ class QgsVectorLayer:public QgsMapLayer
|
|||||||
QgsVectorLayerProperties* propertiesDialog();
|
QgsVectorLayerProperties* propertiesDialog();
|
||||||
/** Return the context menu for the layer */
|
/** Return the context menu for the layer */
|
||||||
QPopupMenu *contextMenu();
|
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:
|
protected:
|
||||||
/**Pointer to the table display object if there is one, else a pointer to 0*/
|
/**Pointer to the table display object if there is one, else a pointer to 0*/
|
||||||
QgsAttributeTableDisplay* tabledisplay;
|
QgsAttributeTableDisplay* tabledisplay;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user