[QGIS Commit] r9493 - in trunk/qgis: python/core src/app src/core src/core/renderer

svn_qgis at osgeo.org svn_qgis at osgeo.org
Sat Oct 18 18:24:15 EDT 2008


Author: timlinux
Date: 2008-10-18 18:24:15 -0400 (Sat, 18 Oct 2008)
New Revision: 9493

Modified:
   trunk/qgis/python/core/qgsvectorlayer.sip
   trunk/qgis/src/app/qgisapp.cpp
   trunk/qgis/src/app/qgscontinuouscolordialog.cpp
   trunk/qgis/src/app/qgsgraduatedsymboldialog.cpp
   trunk/qgis/src/app/qgsmapserverexport.cpp
   trunk/qgis/src/app/qgsmaptooladdfeature.cpp
   trunk/qgis/src/app/qgsmaptoolidentify.cpp
   trunk/qgis/src/app/qgsmaptoolselect.cpp
   trunk/qgis/src/app/qgssinglesymboldialog.cpp
   trunk/qgis/src/app/qgsuniquevaluedialog.cpp
   trunk/qgis/src/app/qgsvectorlayerproperties.cpp
   trunk/qgis/src/core/qgsvectorlayer.cpp
   trunk/qgis/src/core/qgsvectorlayer.h
   trunk/qgis/src/core/renderer/qgscontinuouscolorrenderer.cpp
   trunk/qgis/src/core/renderer/qgsgraduatedsymbolrenderer.cpp
   trunk/qgis/src/core/renderer/qgssinglesymbolrenderer.cpp
   trunk/qgis/src/core/renderer/qgsuniquevaluerenderer.cpp
Log:
Cleanup for type accessors on maplayer and subclasses

Modified: trunk/qgis/python/core/qgsvectorlayer.sip
===================================================================
--- trunk/qgis/python/core/qgsvectorlayer.sip	2008-10-18 19:50:18 UTC (rev 9492)
+++ trunk/qgis/python/core/qgsvectorlayer.sip	2008-10-18 22:24:15 UTC (rev 9493)
@@ -95,10 +95,10 @@
   void setRenderer(QgsRenderer * r /Transfer/);
 
   /** Returns point, line or polygon */
-  QGis::GeometryType type() const;
+  QGis::GeometryType geometryType() const;
 
   /**Returns the WKBType or WKBUnknown in case of error*/
-  QGis::WkbType geometryType() const;
+  QGis::WkbType wkbType() const;
 
   /** Return the provider type for this layer */
   QString providerType() const;

Modified: trunk/qgis/src/app/qgisapp.cpp
===================================================================
--- trunk/qgis/src/app/qgisapp.cpp	2008-10-18 19:50:18 UTC (rev 9492)
+++ trunk/qgis/src/app/qgisapp.cpp	2008-10-18 22:24:15 UTC (rev 9493)
@@ -5100,7 +5100,7 @@
       }
 
 
-      if ( vlayer->type() == QGis::Point )
+      if ( vlayer->geometryType() == QGis::Point )
       {
         if ( vlayer->isEditable() && dprovider->capabilities() & QgsVectorDataProvider::AddFeatures )
         {
@@ -5123,7 +5123,7 @@
         if ( vlayer->isEditable() && dprovider->capabilities() & QgsVectorDataProvider::ChangeGeometries )
         {
           //don't enable vertex move for single point
-          if ( vlayer->geometryType() != QGis::WKBPoint && vlayer->geometryType() != QGis::WKBPoint25D )
+          if ( vlayer->wkbType() != QGis::WKBPoint && vlayer->wkbType() != QGis::WKBPoint25D )
           {
             mActionMoveVertex->setEnabled( true );
           }
@@ -5131,7 +5131,7 @@
         }
         return;
       }
-      else if ( vlayer->type() == QGis::Line )
+      else if ( vlayer->geometryType() == QGis::Line )
       {
         if ( vlayer->isEditable() && dprovider->capabilities() & QgsVectorDataProvider::AddFeatures )
         {
@@ -5150,7 +5150,7 @@
         mActionAddRing->setEnabled( false );
         mActionAddIsland->setEnabled( false );
       }
-      else if ( vlayer->type() == QGis::Polygon )
+      else if ( vlayer->geometryType() == QGis::Polygon )
       {
         if ( vlayer->isEditable() && dprovider->capabilities() & QgsVectorDataProvider::AddFeatures )
         {
@@ -5179,7 +5179,7 @@
         mActionMoveVertex->setEnabled( true );
         mActionDeleteVertex->setEnabled( true );
         mActionMoveFeature->setEnabled( true );
-        if ( vlayer->type() == QGis::Polygon )
+        if ( vlayer->geometryType() == QGis::Polygon )
         {
           mActionAddRing->setEnabled( true );
           //some polygon layers contain also multipolygon features.

Modified: trunk/qgis/src/app/qgscontinuouscolordialog.cpp
===================================================================
--- trunk/qgis/src/app/qgscontinuouscolordialog.cpp	2008-10-18 19:50:18 UTC (rev 9492)
+++ trunk/qgis/src/app/qgscontinuouscolordialog.cpp	2008-10-18 22:24:15 UTC (rev 9493)
@@ -91,7 +91,7 @@
     const QgsSymbol* minsymbol = renderer->minimumSymbol();
     const QgsSymbol* maxsymbol = renderer->maximumSymbol();
 
-    if ( mVectorLayer->type() == QGis::Line || mVectorLayer->type() == QGis::Point )
+    if ( mVectorLayer->geometryType() == QGis::Line || mVectorLayer->geometryType() == QGis::Point )
     {
       btnMinValue->setColor( minsymbol->pen().color() );
       btnMaxValue->setColor( maxsymbol->pen().color() );
@@ -114,7 +114,7 @@
       cb_polygonOutline->setCheckState( Qt::Unchecked );
     }
 
-    if ( mVectorLayer->type() != QGis::Polygon )
+    if ( mVectorLayer->geometryType() != QGis::Polygon )
     {
       cb_polygonOutline->setVisible( false );
     }
@@ -123,7 +123,7 @@
   {
     cb_polygonOutline->setCheckState( Qt::Checked );
     outlinewidthspinbox->setValue( 0.4 );
-    if ( mVectorLayer->type() != QGis::Polygon )
+    if ( mVectorLayer->geometryType() != QGis::Polygon )
       cb_polygonOutline->setVisible( false );
 
     btnMinValue->setColor( Qt::black );
@@ -179,11 +179,11 @@
 
 
   //create the render items for minimum and maximum value
-  QgsSymbol* minsymbol = new QgsSymbol( mVectorLayer->type(), QString::number( minimum, 'f' ), "", "" );
+  QgsSymbol* minsymbol = new QgsSymbol( mVectorLayer->geometryType(), QString::number( minimum, 'f' ), "", "" );
   QPen minPen;
   minPen.setColor( btnMinValue->color() );
   minPen.setWidthF( outlinewidthspinbox->value() );
-  if ( mVectorLayer->type() == QGis::Line || mVectorLayer->type() == QGis::Point )
+  if ( mVectorLayer->geometryType() == QGis::Line || mVectorLayer->geometryType() == QGis::Point )
   {
     minsymbol->setPen( minPen );
   }
@@ -193,11 +193,11 @@
     minsymbol->setPen( minPen );
   }
 
-  QgsSymbol* maxsymbol = new QgsSymbol( mVectorLayer->type(), QString::number( maximum, 'f' ), "", "" );
+  QgsSymbol* maxsymbol = new QgsSymbol( mVectorLayer->geometryType(), QString::number( maximum, 'f' ), "", "" );
   QPen maxPen;
   maxPen.setColor( btnMaxValue->color() );
   maxPen.setWidthF( outlinewidthspinbox->value() );
-  if ( mVectorLayer->type() == QGis::Line || mVectorLayer->type() == QGis::Point )
+  if ( mVectorLayer->geometryType() == QGis::Line || mVectorLayer->geometryType() == QGis::Point )
   {
     maxsymbol->setPen( maxPen );
   }
@@ -207,7 +207,7 @@
     maxsymbol->setPen( maxPen );
   }
 
-  QgsContinuousColorRenderer* renderer = new QgsContinuousColorRenderer( mVectorLayer->type() );
+  QgsContinuousColorRenderer* renderer = new QgsContinuousColorRenderer( mVectorLayer->geometryType() );
   mVectorLayer->setRenderer( renderer );
 
   renderer->setMinimumSymbol( minsymbol );

Modified: trunk/qgis/src/app/qgsgraduatedsymboldialog.cpp
===================================================================
--- trunk/qgis/src/app/qgsgraduatedsymboldialog.cpp	2008-10-18 19:50:18 UTC (rev 9492)
+++ trunk/qgis/src/app/qgsgraduatedsymboldialog.cpp	2008-10-18 22:24:15 UTC (rev 9493)
@@ -114,7 +114,7 @@
     {
       //todo: make an assignment operator and a copy constructor for QgsSymbol
       QString classbreak = ( *it )->lowerValue() + " - " + ( *it )->upperValue();
-      QgsSymbol* sym = new QgsSymbol( mVectorLayer->type(), ( *it )->lowerValue(), ( *it )->upperValue(), ( *it )->label() );
+      QgsSymbol* sym = new QgsSymbol( mVectorLayer->geometryType(), ( *it )->lowerValue(), ( *it )->upperValue(), ( *it )->label() );
       sym->setPen(( *it )->pen() );
       sym->setCustomTexture(( *it )->customTexture() );
       sym->setBrush(( *it )->brush() );
@@ -175,7 +175,7 @@
     return;
   }
 
-  QgsGraduatedSymbolRenderer* renderer = new QgsGraduatedSymbolRenderer( mVectorLayer->type() );
+  QgsGraduatedSymbolRenderer* renderer = new QgsGraduatedSymbolRenderer( mVectorLayer->geometryType() );
 
   //
   // First the mode
@@ -208,13 +208,13 @@
     QString upper_bound = it->second->upperValue();
     QString label = it->second->label();
 
-    QgsSymbol* sy = new QgsSymbol( mVectorLayer->type(), lower_bound, upper_bound, label );
+    QgsSymbol* sy = new QgsSymbol( mVectorLayer->geometryType(), lower_bound, upper_bound, label );
 
     sy->setColor( it->second->pen().color() );
     sy->setLineStyle( it->second->pen().style() );
     sy->setLineWidth( it->second->pen().widthF() );
 
-    if ( mVectorLayer->type() == QGis::Point )
+    if ( mVectorLayer->geometryType() == QGis::Point )
     {
       sy->setNamedPointSymbol( it->second->pointSymbolName() );
       sy->setPointSize( it->second->pointSize() );
@@ -222,7 +222,7 @@
       sy->setRotationClassificationField( it->second->rotationClassificationField() );
     }
 
-    if ( mVectorLayer->type() != QGis::Line )
+    if ( mVectorLayer->geometryType() != QGis::Line )
     {
       sy->setFillColor( it->second->brush().color() );
       sy->setCustomTexture( it->second->customTexture() );//necessary?
@@ -270,7 +270,7 @@
 void QgsGraduatedSymbolDialog::adjustClassification()
 {
   mClassListWidget->clear();
-  QGis::GeometryType m_type = mVectorLayer->type();
+  QGis::GeometryType m_type = mVectorLayer->geometryType();
   QgsVectorDataProvider *provider = dynamic_cast<QgsVectorDataProvider *>( mVectorLayer->dataProvider() );
   double minimum = 0;
   double maximum = 0;
@@ -586,7 +586,7 @@
 void QgsGraduatedSymbolDialog::updateEntryIcon( QgsSymbol * thepSymbol,
     QListWidgetItem * thepItem )
 {
-  QGis::GeometryType myType = mVectorLayer->type();
+  QGis::GeometryType myType = mVectorLayer->geometryType();
   switch ( myType )
   {
     case QGis::Point:

Modified: trunk/qgis/src/app/qgsmapserverexport.cpp
===================================================================
--- trunk/qgis/src/app/qgsmapserverexport.cpp	2008-10-18 19:50:18 UTC (rev 9492)
+++ trunk/qgis/src/app/qgsmapserverexport.cpp	2008-10-18 22:24:15 UTC (rev 9493)
@@ -208,7 +208,7 @@
       if ( lyr->type() == QgsMapLayer::VectorLayer )
       {
         QgsVectorLayer* vlayer = dynamic_cast<QgsVectorLayer*>( lyr );
-        switch ( vlayer->geometryType() )
+        switch ( vlayer->wkbType() )
         {
           case QGis::WKBPoint:
           case QGis::WKBMultiPoint:

Modified: trunk/qgis/src/app/qgsmaptooladdfeature.cpp
===================================================================
--- trunk/qgis/src/app/qgsmaptooladdfeature.cpp	2008-10-18 19:50:18 UTC (rev 9492)
+++ trunk/qgis/src/app/qgsmaptooladdfeature.cpp	2008-10-18 22:24:15 UTC (rev 9493)
@@ -50,7 +50,7 @@
     return;
   }
 
-  QGis::WkbType layerWKBType = vlayer->geometryType();
+  QGis::WkbType layerWKBType = vlayer->wkbType();
 
   //no support for adding features to 2.5D types yet
   if ( layerWKBType == QGis::WKBLineString25D || layerWKBType == QGis::WKBPolygon25D ||
@@ -86,7 +86,7 @@
   if ( mTool == CapturePoint )
   {
     //check we only use this tool for point/multipoint layers
-    if ( vlayer->type() != QGis::Point )
+    if ( vlayer->geometryType() != QGis::Point )
     {
       QMessageBox::information( 0, QObject::tr( "Wrong editing tool" ),
                                 QObject::tr( "Cannot apply the 'capture point' tool on this vector layer" ) );
@@ -194,7 +194,7 @@
   else if ( mTool == CaptureLine || mTool == CapturePolygon )
   {
     //check we only use the line tool for line/multiline layers
-    if ( mTool == CaptureLine && vlayer->type() != QGis::Line )
+    if ( mTool == CaptureLine && vlayer->geometryType() != QGis::Line )
     {
       QMessageBox::information( 0, QObject::tr( "Wrong editing tool" ),
                                 QObject::tr( "Cannot apply the 'capture line' tool on this vector layer" ) );
@@ -202,7 +202,7 @@
     }
 
     //check we only use the polygon tool for polygon/multipolygon layers
-    if ( mTool == CapturePolygon && vlayer->type() != QGis::Polygon )
+    if ( mTool == CapturePolygon && vlayer->geometryType() != QGis::Polygon )
     {
       QMessageBox::information( 0, QObject::tr( "Wrong editing tool" ),
                                 QObject::tr( "Cannot apply the 'capture polygon' tool on this vector layer" ) );

Modified: trunk/qgis/src/app/qgsmaptoolidentify.cpp
===================================================================
--- trunk/qgis/src/app/qgsmaptoolidentify.cpp	2008-10-18 19:50:18 UTC (rev 9492)
+++ trunk/qgis/src/app/qgsmaptoolidentify.cpp	2008-10-18 22:24:15 UTC (rev 9493)
@@ -339,7 +339,7 @@
 
     // Calculate derived attributes and insert:
     // measure distance or area depending on geometry type
-    if ( layer->type() == QGis::Line )
+    if ( layer->geometryType() == QGis::Line )
     {
       double dist = calc.measure( f_it->geometry() );
       QString str = calc.textUnit( dist, 3, mCanvas->mapUnits(), false );
@@ -357,13 +357,13 @@
         mResults->addDerivedAttribute( featureNode, "endY", str );
       }
     }
-    else if ( layer->type() == QGis::Polygon )
+    else if ( layer->geometryType() == QGis::Polygon )
     {
       double area = calc.measure( f_it->geometry() );
       QString str = calc.textUnit( area, 3, mCanvas->mapUnits(), true );
       mResults->addDerivedAttribute( featureNode, QObject::tr( "Area" ), str );
     }
-    else if ( layer->type() == QGis::Point )
+    else if ( layer->geometryType() == QGis::Point )
     {
       // Include the x and y coordinates of the point as a derived attribute
       QString str;

Modified: trunk/qgis/src/app/qgsmaptoolselect.cpp
===================================================================
--- trunk/qgis/src/app/qgsmaptoolselect.cpp	2008-10-18 19:50:18 UTC (rev 9492)
+++ trunk/qgis/src/app/qgsmaptoolselect.cpp	2008-10-18 22:24:15 UTC (rev 9493)
@@ -81,7 +81,7 @@
   if ( !mDragging )
   {
     int boxSize = 0;
-    if ( vlayer->type() != QGis::Polygon )
+    if ( vlayer->geometryType() != QGis::Polygon )
     {
       //if point or line use an artificial bounding box of 10x10 pixels
       //to aid the user to click on a feature accurately

Modified: trunk/qgis/src/app/qgssinglesymboldialog.cpp
===================================================================
--- trunk/qgis/src/app/qgssinglesymboldialog.cpp	2008-10-18 19:50:18 UTC (rev 9492)
+++ trunk/qgis/src/app/qgssinglesymboldialog.cpp	2008-10-18 22:24:15 UTC (rev 9493)
@@ -75,7 +75,7 @@
     mypItem->setText( "" );
     //store the symbol offset in the UserData role for later retrieval
     mypItem->setData( Qt::UserRole, *it );
-    if ( layer->type() != QGis::Point )
+    if ( layer->geometryType() != QGis::Point )
     {
       break;
     }
@@ -138,7 +138,7 @@
   cboFillStyle->addItem( QIcon( QgsSymbologyUtils::char2PatternPixmap( "NoBrush" ) ), tr( "No Brush" ), "NoBrush" );
   cboFillStyle->addItem( QIcon( QgsSymbologyUtils::char2PatternPixmap( "TexturePattern" ) ), tr( "Texture" ), "TexturePattern" );
 
-  if ( mVectorLayer && mVectorLayer->type() != QGis::Point )
+  if ( mVectorLayer && layer->geometryType() != QGis::Point )
   {
     mGroupPoint->setVisible( false );
     mGroupPoint->setEnabled( false );
@@ -162,7 +162,7 @@
       else
       {
         // Take values from an example instance
-        QgsSingleSymbolRenderer exampleRenderer = QgsSingleSymbolRenderer( mVectorLayer->type() );
+        QgsSingleSymbolRenderer exampleRenderer = QgsSingleSymbolRenderer( mVectorLayer->geometryType() );
         set( exampleRenderer.symbols().first() );
       }
     }
@@ -307,10 +307,10 @@
 
 void QgsSingleSymbolDialog::apply()
 {
-  QgsSymbol* sy = new QgsSymbol( mVectorLayer->type() );
+  QgsSymbol* sy = new QgsSymbol( mVectorLayer->geometryType() );
   apply( sy );
 
-  QgsSingleSymbolRenderer *renderer = new QgsSingleSymbolRenderer( mVectorLayer->type() );
+  QgsSingleSymbolRenderer *renderer = new QgsSingleSymbolRenderer( mVectorLayer->geometryType() );
   renderer->addSymbol( sy );
   renderer->updateSymbolAttributes();
 
@@ -423,7 +423,7 @@
   btnOutlineColor->setEnabled( true );
   cboOutlineStyle->setEnabled( true );
 
-  if ( mVectorLayer && mVectorLayer->type() != QGis::Line )
+  if ( mVectorLayer && mVectorLayer->geometryType() != QGis::Line )
   {
     btnFillColor->setEnabled( true );
     cboFillStyle->setEnabled( true );

Modified: trunk/qgis/src/app/qgsuniquevaluedialog.cpp
===================================================================
--- trunk/qgis/src/app/qgsuniquevaluedialog.cpp	2008-10-18 19:50:18 UTC (rev 9492)
+++ trunk/qgis/src/app/qgsuniquevaluedialog.cpp	2008-10-18 22:24:15 UTC (rev 9493)
@@ -76,7 +76,7 @@
     {
       QgsSymbol* symbol = ( *iter );
       QString symbolvalue = symbol->lowerValue();
-      QgsSymbol* sym = new QgsSymbol( mVectorLayer->type(), symbol->lowerValue(), symbol->upperValue(), symbol->label() );
+      QgsSymbol* sym = new QgsSymbol( mVectorLayer->geometryType(), symbol->lowerValue(), symbol->upperValue(), symbol->label() );
       sym->setPen( symbol->pen() );
       sym->setCustomTexture( symbol->customTexture() );
       sym->setBrush( symbol->brush() );
@@ -128,13 +128,13 @@
 void QgsUniqueValueDialog::apply()
 {
   QgsDebugMsg( "called." );
-  QgsUniqueValueRenderer *renderer = new QgsUniqueValueRenderer( mVectorLayer->type() );
+  QgsUniqueValueRenderer *renderer = new QgsUniqueValueRenderer( mVectorLayer->geometryType() );
 
   //go through mValues and add the entries to the renderer
   for ( QMap<QString, QgsSymbol*>::iterator it = mValues.begin();it != mValues.end();++it )
   {
     QgsSymbol* symbol = it.value();
-    QgsSymbol* newsymbol = new QgsSymbol( mVectorLayer->type(), symbol->lowerValue(), symbol->upperValue(), symbol->label() );
+    QgsSymbol* newsymbol = new QgsSymbol( mVectorLayer->geometryType(), symbol->lowerValue(), symbol->upperValue(), symbol->label() );
     newsymbol->setPen( symbol->pen() );
     newsymbol->setCustomTexture( symbol->customTexture() );
     newsymbol->setBrush( symbol->brush() );
@@ -179,7 +179,7 @@
 {
   QPen pen;
   QBrush brush;
-  if ( mVectorLayer->type() == QGis::Line )
+  if ( mVectorLayer->geometryType() == QGis::Line )
   {
     pen.setColor( thecolor );
     pen.setStyle( Qt::SolidLine );
@@ -208,7 +208,7 @@
     value += QString::number( i );
   }
 
-  QgsSymbol *symbol = new QgsSymbol( mVectorLayer->type(), value );
+  QgsSymbol *symbol = new QgsSymbol( mVectorLayer->geometryType(), value );
   mValues.insert( value, symbol );
 
   QListWidgetItem *item = new QListWidgetItem( value );
@@ -434,7 +434,7 @@
 void QgsUniqueValueDialog::updateEntryIcon( QgsSymbol * thepSymbol,
     QListWidgetItem * thepItem )
 {
-  QGis::GeometryType myType = mVectorLayer->type();
+  QGis::GeometryType myType = mVectorLayer->geometryType();
   switch ( myType )
   {
     case QGis::Point:

Modified: trunk/qgis/src/app/qgsvectorlayerproperties.cpp
===================================================================
--- trunk/qgis/src/app/qgsvectorlayerproperties.cpp	2008-10-18 19:50:18 UTC (rev 9492)
+++ trunk/qgis/src/app/qgsvectorlayerproperties.cpp	2008-10-18 22:24:15 UTC (rev 9493)
@@ -689,7 +689,7 @@
 
   //geom type
 
-  QGis::GeometryType type = layer->type();
+  QGis::GeometryType type = layer->geometryType();
 
   if ( type < 0 || type > QGis::Polygon )
   {
@@ -697,7 +697,7 @@
   }
   else
   {
-    QString typeString( QGis::qgisVectorGeometryType[layer->type()] );
+    QString typeString( QGis::qgisVectorGeometryType[layer->geometryType()] );
 
     myMetadata += "<tr><td>";
     myMetadata += tr( "Geometry type of the features in this layer : " ) +

Modified: trunk/qgis/src/core/qgsvectorlayer.cpp
===================================================================
--- trunk/qgis/src/core/qgsvectorlayer.cpp	2008-10-18 19:50:18 UTC (rev 9492)
+++ trunk/qgis/src/core/qgsvectorlayer.cpp	2008-10-18 22:24:15 UTC (rev 9493)
@@ -121,7 +121,7 @@
       {
         setCoordinateSystem();
         // add single symbol renderer as default
-        QgsSingleSymbolRenderer *renderer = new QgsSingleSymbolRenderer( type() );
+        QgsSingleSymbolRenderer *renderer = new QgsSingleSymbolRenderer( geometryType() );
         setRenderer( renderer );
       }
     }
@@ -129,7 +129,7 @@
     {
       setCoordinateSystem();
       // add single symbol renderer as default
-      QgsSingleSymbolRenderer *renderer = new QgsSingleSymbolRenderer( type() );
+      QgsSingleSymbolRenderer *renderer = new QgsSingleSymbolRenderer( geometryType() );
       setRenderer( renderer );
     }
     // Get the update threshold from user settings. We
@@ -918,7 +918,7 @@
   }
 }
 
-QGis::GeometryType QgsVectorLayer::type() const
+QGis::GeometryType QgsVectorLayer::geometryType() const
 {
   if ( mDataProvider )
   {
@@ -972,9 +972,9 @@
   return QGis::UnknownGeometry;
 }
 
-QGis::WkbType QgsVectorLayer::geometryType() const
+QGis::WkbType QgsVectorLayer::wkbType() const
 {
-  return ( QGis::WkbType )( mGeometryType );
+  return ( QGis::WkbType )( mWkbType );
 }
 
 QgsRect QgsVectorLayer::boundingBoxOfSelected()
@@ -2177,7 +2177,7 @@
       mLayerExtent.setYMinimum( mbr.yMin() );
 
       // get and store the feature type
-      mGeometryType = mDataProvider->geometryType();
+      mWkbType = mDataProvider->geometryType();
 
       // look at the fields in the layer and set the primary
       // display field using some real fuzzy logic
@@ -2430,22 +2430,22 @@
 
   if ( !singlenode.isNull() )
   {
-    renderer = new QgsSingleSymbolRenderer( type() );
+    renderer = new QgsSingleSymbolRenderer( geometryType() );
     returnCode = renderer->readXML( singlenode, *this );
   }
   else if ( !graduatednode.isNull() )
   {
-    renderer = new QgsGraduatedSymbolRenderer( type() );
+    renderer = new QgsGraduatedSymbolRenderer( geometryType() );
     returnCode = renderer->readXML( graduatednode, *this );
   }
   else if ( !continuousnode.isNull() )
   {
-    renderer = new QgsContinuousColorRenderer( type() );
+    renderer = new QgsContinuousColorRenderer( geometryType() );
     returnCode = renderer->readXML( continuousnode, *this );
   }
   else if ( !uniquevaluenode.isNull() )
   {
-    renderer = new QgsUniqueValueRenderer( type() );
+    renderer = new QgsUniqueValueRenderer( geometryType() );
     returnCode = renderer->readXML( uniquevaluenode, *this );
   }
 
@@ -3192,7 +3192,7 @@
   }
   if ( snap_to == QgsSnapper::SNAP_TO_SEGMENT || snap_to == QgsSnapper::SNAP_TO_VERTEX_AND_SEGMENT ) // snap to segment
   {
-    if ( type() != QGis::Point ) // cannot snap to segment for points/multipoints
+    if ( geometryType() != QGis::Point ) // cannot snap to segment for points/multipoints
     {
       sqrDistSegmentSnap = geom->closestSegmentWithContext( startPoint, snappedPoint, afterVertex );
 

Modified: trunk/qgis/src/core/qgsvectorlayer.h
===================================================================
--- trunk/qgis/src/core/qgsvectorlayer.h	2008-10-18 19:50:18 UTC (rev 9492)
+++ trunk/qgis/src/core/qgsvectorlayer.h	2008-10-18 22:24:15 UTC (rev 9493)
@@ -155,10 +155,10 @@
     void setRenderer( QgsRenderer * r );
 
     /** Returns point, line or polygon */
-    QGis::GeometryType type() const;
+    QGis::GeometryType geometryType() const;
 
     /**Returns the WKBType or WKBUnknown in case of error*/
-    QGis::WkbType geometryType() const;
+    QGis::WkbType wkbType() const;
 
     /** Return the provider type for this layer */
     QString providerType() const;
@@ -613,7 +613,7 @@
     int mMaxUpdatedIndex;
 
     /** Geometry type as defined in enum WkbType (qgis.h) */
-    int mGeometryType;
+    int mWkbType;
 
     /** Renderer object which holds the information about how to display the features */
     QgsRenderer *mRenderer;

Modified: trunk/qgis/src/core/renderer/qgscontinuouscolorrenderer.cpp
===================================================================
--- trunk/qgis/src/core/renderer/qgscontinuouscolorrenderer.cpp	2008-10-18 19:50:18 UTC (rev 9492)
+++ trunk/qgis/src/core/renderer/qgscontinuouscolorrenderer.cpp	2008-10-18 22:24:15 UTC (rev 9493)
@@ -189,7 +189,7 @@
 
 int QgsContinuousColorRenderer::readXML( const QDomNode& rnode, QgsVectorLayer& vl )
 {
-  mGeometryType = vl.type();
+  mGeometryType = vl.geometryType();
   QDomNode classnode = rnode.namedItem( "classificationfield" );
   QString classificationField = classnode.toElement().text();
 

Modified: trunk/qgis/src/core/renderer/qgsgraduatedsymbolrenderer.cpp
===================================================================
--- trunk/qgis/src/core/renderer/qgsgraduatedsymbolrenderer.cpp	2008-10-18 19:50:18 UTC (rev 9492)
+++ trunk/qgis/src/core/renderer/qgsgraduatedsymbolrenderer.cpp	2008-10-18 22:24:15 UTC (rev 9493)
@@ -217,7 +217,7 @@
 
 int QgsGraduatedSymbolRenderer::readXML( const QDomNode& rnode, QgsVectorLayer& vl )
 {
-  mGeometryType = vl.type();
+  mGeometryType = vl.geometryType();
   QDomNode modeNode = rnode.namedItem( "mode" );
   QString modeValue = modeNode.toElement().text();
   QDomNode classnode = rnode.namedItem( "classificationfield" );

Modified: trunk/qgis/src/core/renderer/qgssinglesymbolrenderer.cpp
===================================================================
--- trunk/qgis/src/core/renderer/qgssinglesymbolrenderer.cpp	2008-10-18 19:50:18 UTC (rev 9492)
+++ trunk/qgis/src/core/renderer/qgssinglesymbolrenderer.cpp	2008-10-18 22:24:15 UTC (rev 9493)
@@ -157,7 +157,7 @@
 
 int QgsSingleSymbolRenderer::readXML( const QDomNode& rnode, QgsVectorLayer& vl )
 {
-  mGeometryType = vl.type();
+  mGeometryType = vl.geometryType();
   QgsSymbol* sy = new QgsSymbol( mGeometryType );
 
   QDomNode synode = rnode.namedItem( "symbol" );

Modified: trunk/qgis/src/core/renderer/qgsuniquevaluerenderer.cpp
===================================================================
--- trunk/qgis/src/core/renderer/qgsuniquevaluerenderer.cpp	2008-10-18 19:50:18 UTC (rev 9492)
+++ trunk/qgis/src/core/renderer/qgsuniquevaluerenderer.cpp	2008-10-18 22:24:15 UTC (rev 9493)
@@ -197,7 +197,7 @@
 
 int QgsUniqueValueRenderer::readXML( const QDomNode& rnode, QgsVectorLayer& vl )
 {
-  mGeometryType = vl.type();
+  mGeometryType = vl.geometryType();
   QDomNode classnode = rnode.namedItem( "classificationfield" );
   QString classificationField = classnode.toElement().text();
 



More information about the QGIS-commit mailing list