[QGIS Commit] r13122 - trunk/qgis/src/app
svn_qgis at osgeo.org
svn_qgis at osgeo.org
Sat Mar 20 19:22:09 EDT 2010
Author: mhugent
Date: 2010-03-20 19:22:09 -0400 (Sat, 20 Mar 2010)
New Revision: 13122
Modified:
trunk/qgis/src/app/qgsmaptooladdfeature.cpp
Log:
Remove the error dialog if using the add feature tool on 25d shapefiles
Modified: trunk/qgis/src/app/qgsmaptooladdfeature.cpp
===================================================================
--- trunk/qgis/src/app/qgsmaptooladdfeature.cpp 2010-03-20 23:16:53 UTC (rev 13121)
+++ trunk/qgis/src/app/qgsmaptooladdfeature.cpp 2010-03-20 23:22:09 UTC (rev 13122)
@@ -54,15 +54,6 @@
QGis::WkbType layerWKBType = vlayer->wkbType();
- //no support for adding features to 2.5D types yet
- if ( layerWKBType == QGis::WKBLineString25D || layerWKBType == QGis::WKBPolygon25D ||
- layerWKBType == QGis::WKBMultiLineString25D || layerWKBType == QGis::WKBPoint25D || layerWKBType == QGis::WKBMultiPoint25D )
- {
- QMessageBox::critical( 0, tr( "2.5D shape type not supported" ), tr( "Adding features to 2.5D shapetypes is not supported yet" ) );
- stopCapturing();
- return;
- }
-
QgsVectorDataProvider* provider = vlayer->dataProvider();
if ( !( provider->capabilities() & QgsVectorDataProvider::AddFeatures ) )
@@ -131,7 +122,7 @@
double x = savePoint.x();
double y = savePoint.y();
- if ( layerWKBType == QGis::WKBPoint )
+ if ( layerWKBType == QGis::WKBPoint || layerWKBType == QGis::WKBPoint25D )
{
size = 1 + sizeof( int ) + 2 * sizeof( double );
wkb = new unsigned char[size];
@@ -141,7 +132,7 @@
memcpy( &wkb[5], &x, sizeof( double ) );
memcpy( &wkb[5] + sizeof( double ), &y, sizeof( double ) );
}
- else if ( layerWKBType == QGis::WKBMultiPoint )
+ else if ( layerWKBType == QGis::WKBMultiPoint || layerWKBType == QGis::WKBMultiPoint25D )
{
size = 2 + 3 * sizeof( int ) + 2 * sizeof( double );
wkb = new unsigned char[size];
@@ -268,7 +259,7 @@
if ( mode() == CaptureLine )
{
- if ( layerWKBType == QGis::WKBLineString )
+ if ( layerWKBType == QGis::WKBLineString || layerWKBType == QGis::WKBLineString25D )
{
wkbsize = 1 + 2 * sizeof( int ) + 2 * size() * sizeof( double );
wkb = new unsigned char[wkbsize];
@@ -292,7 +283,7 @@
position += sizeof( double );
}
}
- else if ( layerWKBType == QGis::WKBMultiLineString )
+ else if ( layerWKBType == QGis::WKBMultiLineString || layerWKBType == QGis::WKBMultiLineString25D )
{
wkbsize = 1 + 2 * sizeof( int ) + 1 + 2 * sizeof( int ) + 2 * size() * sizeof( double );
wkb = new unsigned char[wkbsize];
@@ -337,7 +328,7 @@
}
else // polygon
{
- if ( layerWKBType == QGis::WKBPolygon )
+ if ( layerWKBType == QGis::WKBPolygon || layerWKBType == QGis::WKBPolygon25D )
{
wkbsize = 1 + 3 * sizeof( int ) + 2 * ( size() + 1 ) * sizeof( double );
wkb = new unsigned char[wkbsize];
@@ -374,7 +365,7 @@
memcpy( &wkb[position], &y, sizeof( double ) );
}
- else if ( layerWKBType == QGis::WKBMultiPolygon )
+ else if ( layerWKBType == QGis::WKBMultiPolygon || layerWKBType == QGis::WKBMultiPolygon25D )
{
wkbsize = 2 + 5 * sizeof( int ) + 2 * ( size() + 1 ) * sizeof( double );
wkb = new unsigned char[wkbsize];
More information about the QGIS-commit
mailing list