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:
mhugent 2004-01-21 07:57:15 +00:00
parent 7bde026346
commit ad78d37c9e
5 changed files with 13 additions and 10 deletions

View File

@ -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();

View File

@ -71,11 +71,6 @@ const QgsRect QgsMapLayer::extent()
return layerExtent;
}
QgsRect QgsMapLayer::bBoxOfSelected()
{
}
QgsRect QgsMapLayer::calculateExtent()
{
//just to prevent any crashes

View File

@ -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

View File

@ -707,3 +707,9 @@ void QgsVectorLayer::initContextMenu(QgisApp *app){
QPopupMenu *QgsVectorLayer::contextMenu(){
return popMenu;
}
QgsRect QgsVectorLayer::bBoxOfSelected()
{
QgsRect myrect;//soon
return myrect;
}

View File

@ -85,8 +85,10 @@ class QgsVectorLayer:public QgsMapLayer
QGis::VectorType vectorType();
/**Returns a pointer to the properties dialog*/
QgsVectorLayerProperties* propertiesDialog();
/** Return the context menu for the layer */
QPopupMenu *contextMenu();
/** 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;