sample_patch.diff

sunilkcube -, 2011-04-07 03:08 AM

Download (2.42 KB)

View differences:

src/gui/qgsmapcanvas.cpp (working copy)
231 231
    return;
232 232
  }
233 233

  
234
  mMapRenderer->setAllLayerSet(layers); 
234 235
  // create layer set
235 236
  QStringList layerSet, layerSetOverview;
236 237

  
src/core/qgsmaprenderer.h (working copy)
24 24
#include "qgis.h"
25 25
#include "qgsrectangle.h"
26 26
#include "qgsrendercontext.h"
27
#include "../gui/qgsmapcanvas.h"
27 28

  
28 29
class QDomDocument;
29 30
class QDomNode;
......
206 207

  
207 208
    //! change current layer set
208 209
    void setLayerSet( const QStringList& layers );
210
    
211
    // set all layerset  including both visible and invisible layers 
212
    void setAllLayerSet( QList<QgsMapCanvasLayer> &allLayers );
209 213

  
210 214
    //! updates extent of the layer set
211 215
    void updateFullExtent();
......
303 307
    //! stores array of layers to be rendered (identified by string)
304 308
    QStringList mLayerSet;
305 309

  
310
    // stores array of layers both visible and invisible layers for calculating full extent 
311
    QStringList mAllLayerSet; 
312
    
306 313
    //! full extent of the layer set
307 314
    QgsRectangle mFullExtent;
308 315

  
src/core/qgsmaprenderer.cpp (working copy)
840 840

  
841 841
  // iterate through the map layers and test each layers extent
842 842
  // against the current min and max values
843
  QStringList::iterator it = mLayerSet.begin();
844
  while ( it != mLayerSet.end() )
843
  QStringList::iterator it = mAllLayerSet.begin();
844
  while ( it != mAllLayerSet.end() )
845 845
  {
846 846
    QgsMapLayer * lyr = registry->mapLayer( *it );
847 847
    if ( lyr == NULL )
......
908 908
  return mLayerSet;
909 909
}
910 910

  
911
void QgsMapRenderer::setAllLayerSet( QList<QgsMapCanvasLayer> &allLayers )
912
{
913
  int i;
914
  for ( i = 0; i < allLayers.size(); i++ )
915
  {
916
    QgsMapCanvasLayer &lyr = allLayers[i];
917
    if ( !lyr.layer() )
918
    {
919
      continue;
920
    }
921

  
922
    mAllLayerSet.push_back( lyr.layer()->id() );
923
  }
924
  QgsDebugMsg ( " total layers present are " + QString :: number (mAllLayerSet.size()));
925
}
926

  
911 927
QgsOverlayObjectPositionManager* QgsMapRenderer::overlayManagerFromSettings()
912 928
{
913 929
  QSettings settings;