[QGIS Commit] r9213 - in trunk/qgis: python/core scripts src/app
src/core src/plugins/interpolation
svn_qgis at osgeo.org
svn_qgis at osgeo.org
Sat Aug 30 05:28:54 EDT 2008
Author: timlinux
Date: 2008-08-30 05:28:54 -0400 (Sat, 30 Aug 2008)
New Revision: 9213
Modified:
trunk/qgis/python/core/qgsgeometry.sip
trunk/qgis/python/core/qgsvectordataprovider.sip
trunk/qgis/python/core/qgsvectorlayer.sip
trunk/qgis/scripts/astyle.sh
trunk/qgis/src/app/qgsmaptooladdvertex.cpp
trunk/qgis/src/app/qgsmaptooldeletevertex.cpp
trunk/qgis/src/app/qgsmaptoolmovevertex.cpp
trunk/qgis/src/app/qgsuniquevaluedialog.cpp
trunk/qgis/src/core/qgsgeometry.cpp
trunk/qgis/src/core/qgsgeometry.h
trunk/qgis/src/core/qgsvectordataprovider.cpp
trunk/qgis/src/core/qgsvectordataprovider.h
trunk/qgis/src/core/qgsvectorfilewriter.h
trunk/qgis/src/core/qgsvectorlayer.cpp
trunk/qgis/src/core/qgsvectorlayer.h
trunk/qgis/src/plugins/interpolation/qgsinterpolationdialog.cpp
Log:
Updates to api docs and some api consistency cleanups
Modified: trunk/qgis/python/core/qgsgeometry.sip
===================================================================
--- trunk/qgis/python/core/qgsgeometry.sip 2008-08-30 08:32:34 UTC (rev 9212)
+++ trunk/qgis/python/core/qgsgeometry.sip 2008-08-30 09:28:54 UTC (rev 9213)
@@ -126,7 +126,7 @@
* these error conditions. (Or maybe we add another method to this
* object to help make the distinction?)
*/
- bool insertVertexBefore(double x, double y, int beforeVertex);
+ bool insertVertex(double x, double y, int beforeVertex);
/** Moves the vertex at the given position number,
* ring and item (first number is index 0)
@@ -134,7 +134,7 @@
* Returns FALSE if atVertex does not correspond to a valid vertex
* on this geometry
*/
- bool moveVertexAt(double x, double y, int atVertex);
+ bool moveVertex(double x, double y, int atVertex);
/** Deletes the vertex at the given position number,
* ring and item (first number is index 0)
@@ -146,7 +146,7 @@
* these error conditions. (Or maybe we add another method to this
* object to help make the distinction?)
*/
- bool deleteVertexAt(int atVertex);
+ bool deleteVertex(int atVertex);
/**
* Returns coordinates of a vertex.
Modified: trunk/qgis/python/core/qgsvectordataprovider.sip
===================================================================
--- trunk/qgis/python/core/qgsvectordataprovider.sip 2008-08-30 08:32:34 UTC (rev 9212)
+++ trunk/qgis/python/core/qgsvectordataprovider.sip 2008-08-30 09:28:54 UTC (rev 9213)
@@ -221,7 +221,7 @@
/**
* Returns the index of a field name or -1 if the field does not exist
*/
- int indexFromFieldName(const QString& fieldName) const;
+ int fieldNameIndex(const QString& fieldName) const;
/**
* Return list of indexes to fetch all attributes in getNextFeature()
@@ -235,6 +235,6 @@
* Set whether provider should return also features that don't have
* associated geometry. FALSE by default
*/
- void setFetchFeaturesWithoutGeom(bool fetch);
+ void enableGeometrylessFeatures(bool fetch);
};
Modified: trunk/qgis/python/core/qgsvectorlayer.sip
===================================================================
--- trunk/qgis/python/core/qgsvectorlayer.sip 2008-08-30 08:32:34 UTC (rev 9212)
+++ trunk/qgis/python/core/qgsvectorlayer.sip 2008-08-30 09:28:54 UTC (rev 9213)
@@ -165,18 +165,18 @@
* in the given ring, item (first number is index 0), and feature
* Not meaningful for Point geometries
*/
- bool insertVertexBefore(double x, double y, int atFeatureId, int beforeVertex);
+ bool insertVertex(double x, double y, int atFeatureId, int beforeVertex);
/** Moves the vertex at the given position number,
* ring and item (first number is index 0), and feature
* to the given coordinates
*/
- bool moveVertexAt(double x, double y, int atFeatureId, int atVertex);
+ bool moveVertex(double x, double y, int atFeatureId, int atVertex);
/** Deletes the vertex at the given position number,
* ring and item (first number is index 0), and feature
*/
- bool deleteVertexAt(int atFeatureId, int atVertex);
+ bool deleteVertex(int atFeatureId, int atVertex);
/** Deletes the selected features
* @return true in case of success and false otherwise
Modified: trunk/qgis/scripts/astyle.sh
===================================================================
--- trunk/qgis/scripts/astyle.sh 2008-08-30 08:32:34 UTC (rev 9212)
+++ trunk/qgis/scripts/astyle.sh 2008-08-30 09:28:54 UTC (rev 9213)
@@ -32,7 +32,7 @@
--unpad=paren"
for f in "$@"; do
- flip -ub "$f"
+ #flip -ub "$f"
#qgsloggermig.pl "$f"
astyle $ARTISTIC_STYLE_OPTIONS "$f"
done
Modified: trunk/qgis/src/app/qgsmaptooladdvertex.cpp
===================================================================
--- trunk/qgis/src/app/qgsmaptooladdvertex.cpp 2008-08-30 08:32:34 UTC (rev 9212)
+++ trunk/qgis/src/app/qgsmaptooladdvertex.cpp 2008-08-30 09:28:54 UTC (rev 9213)
@@ -98,7 +98,7 @@
QList<QgsSnappingResult>::iterator sr_it = mRecentSnappingResults.begin();
for ( ; sr_it != mRecentSnappingResults.end(); ++sr_it )
{
- vlayer->insertVertexBefore( snappedPointLayerCoord.x(), snappedPointLayerCoord.y(), sr_it->snappedAtGeometry, sr_it->afterVertexNr );
+ vlayer->insertVertex( snappedPointLayerCoord.x(), snappedPointLayerCoord.y(), sr_it->snappedAtGeometry, sr_it->afterVertexNr );
}
}
}
Modified: trunk/qgis/src/app/qgsmaptooldeletevertex.cpp
===================================================================
--- trunk/qgis/src/app/qgsmaptooldeletevertex.cpp 2008-08-30 08:32:34 UTC (rev 9212)
+++ trunk/qgis/src/app/qgsmaptooldeletevertex.cpp 2008-08-30 09:28:54 UTC (rev 9213)
@@ -81,7 +81,7 @@
QList<QgsSnappingResult>::iterator sr_it = mRecentSnappingResults.begin();
for ( ; sr_it != mRecentSnappingResults.end(); ++sr_it )
{
- vlayer->deleteVertexAt( sr_it->snappedAtGeometry, sr_it->snappedVertexNr );
+ vlayer->deleteVertex( sr_it->snappedAtGeometry, sr_it->snappedVertexNr );
}
}
Modified: trunk/qgis/src/app/qgsmaptoolmovevertex.cpp
===================================================================
--- trunk/qgis/src/app/qgsmaptoolmovevertex.cpp 2008-08-30 08:32:34 UTC (rev 9212)
+++ trunk/qgis/src/app/qgsmaptoolmovevertex.cpp 2008-08-30 09:28:54 UTC (rev 9213)
@@ -168,7 +168,7 @@
QList<QgsSnappingResult>::iterator sr_it = mRecentSnappingResults.begin();
for ( ; sr_it != mRecentSnappingResults.end(); ++sr_it )
{
- if ( !vlayer->moveVertexAt( snappedPointLayerCoord.x(), snappedPointLayerCoord.y(), sr_it->snappedAtGeometry, sr_it->snappedVertexNr ) )
+ if ( !vlayer->moveVertex( snappedPointLayerCoord.x(), snappedPointLayerCoord.y(), sr_it->snappedAtGeometry, sr_it->snappedVertexNr ) )
{
//error
}
Modified: trunk/qgis/src/app/qgsuniquevaluedialog.cpp
===================================================================
--- trunk/qgis/src/app/qgsuniquevaluedialog.cpp 2008-08-30 08:32:34 UTC (rev 9212)
+++ trunk/qgis/src/app/qgsuniquevaluedialog.cpp 2008-08-30 09:28:54 UTC (rev 9213)
@@ -149,7 +149,7 @@
QgsVectorDataProvider *provider = dynamic_cast<QgsVectorDataProvider *>( mVectorLayer->dataProvider() );
if ( provider )
{
- int fieldIndex = provider->indexFromFieldName( mClassificationComboBox->currentText() );
+ int fieldIndex = provider->fieldNameIndex( mClassificationComboBox->currentText() );
if ( fieldIndex != -1 )
{
renderer->setClassificationField( fieldIndex );
@@ -292,7 +292,7 @@
QgsVectorDataProvider *provider = dynamic_cast<QgsVectorDataProvider *>( mVectorLayer->dataProvider() );
if ( provider )
{
- int nr = provider->indexFromFieldName( attributeName );
+ int nr = provider->fieldNameIndex( attributeName );
if ( nr == -1 )
{
return;
Modified: trunk/qgis/src/core/qgsgeometry.cpp
===================================================================
--- trunk/qgis/src/core/qgsgeometry.cpp 2008-08-30 08:32:34 UTC (rev 9212)
+++ trunk/qgis/src/core/qgsgeometry.cpp 2008-08-30 09:28:54 UTC (rev 9213)
@@ -1147,7 +1147,7 @@
-bool QgsGeometry::insertVertexBefore( double x, double y,
+bool QgsGeometry::insertVertex( double x, double y,
int beforeVertex,
const GEOSCoordSequence* old_sequence,
GEOSCoordSequence** new_sequence )
@@ -1199,7 +1199,7 @@
return inserted;
}
-bool QgsGeometry::moveVertexAt( double x, double y, int atVertex )
+bool QgsGeometry::moveVertex( double x, double y, int atVertex )
{
int vertexnr = atVertex;
@@ -1448,7 +1448,7 @@
}
}
-bool QgsGeometry::deleteVertexAt( int atVertex )
+bool QgsGeometry::deleteVertex( int atVertex )
{
int vertexnr = atVertex;
bool success = false;
@@ -1775,7 +1775,7 @@
}
}
-bool QgsGeometry::insertVertexBefore( double x, double y, int beforeVertex )
+bool QgsGeometry::insertVertex( double x, double y, int beforeVertex )
{
int vertexnr = beforeVertex;
bool success = false;
Modified: trunk/qgis/src/core/qgsgeometry.h
===================================================================
--- trunk/qgis/src/core/qgsgeometry.h 2008-08-30 08:32:34 UTC (rev 9212)
+++ trunk/qgis/src/core/qgsgeometry.h 2008-08-30 09:28:54 UTC (rev 9213)
@@ -164,7 +164,7 @@
* these error conditions. (Or maybe we add another method to this
* object to help make the distinction?)
*/
- bool insertVertexBefore( double x, double y, int beforeVertex );
+ bool insertVertex( double x, double y, int beforeVertex );
/** Moves the vertex at the given position number
* and item (first number is index 0)
@@ -172,7 +172,7 @@
* Returns FALSE if atVertex does not correspond to a valid vertex
* on this geometry
*/
- bool moveVertexAt( double x, double y, int atVertex );
+ bool moveVertex( double x, double y, int atVertex );
/** Deletes the vertex at the given position number and item
* (first number is index 0)
@@ -184,7 +184,7 @@
* these error conditions. (Or maybe we add another method to this
* object to help make the distinction?)
*/
- bool deleteVertexAt( int atVertex );
+ bool deleteVertex( int atVertex );
/**
* Returns coordinates of a vertex.
@@ -362,7 +362,7 @@
* Returns FALSE if beforeVertex does not correspond to a valid vertex number
* on the Coordinate Sequence.
*/
- bool insertVertexBefore( double x, double y,
+ bool insertVertex( double x, double y,
int beforeVertex,
const GEOSCoordSequence* old_sequence,
GEOSCoordSequence** new_sequence );
Modified: trunk/qgis/src/core/qgsvectordataprovider.cpp
===================================================================
--- trunk/qgis/src/core/qgsvectordataprovider.cpp 2008-08-30 08:32:34 UTC (rev 9212)
+++ trunk/qgis/src/core/qgsvectordataprovider.cpp 2008-08-30 09:28:54 UTC (rev 9213)
@@ -218,7 +218,7 @@
}
-int QgsVectorDataProvider::indexFromFieldName( const QString& fieldName ) const
+int QgsVectorDataProvider::fieldNameIndex( const QString& fieldName ) const
{
const QgsFieldMap &theFields = fields();
@@ -243,7 +243,7 @@
return list;
}
-void QgsVectorDataProvider::setFetchFeaturesWithoutGeom( bool fetch )
+void QgsVectorDataProvider::enableGeometrylessFeatures( bool fetch )
{
mFetchFeaturesWithoutGeom = fetch;
}
Modified: trunk/qgis/src/core/qgsvectordataprovider.h
===================================================================
--- trunk/qgis/src/core/qgsvectordataprovider.h 2008-08-30 08:32:34 UTC (rev 9212)
+++ trunk/qgis/src/core/qgsvectordataprovider.h 2008-08-30 09:28:54 UTC (rev 9213)
@@ -32,7 +32,13 @@
typedef QMap<QString, QString> QgsNewAttributesMap;
typedef QMap<QString, QVariant::Type> QgsNativeTypeMap;
-/** Base class for vector data providers
+/** \ingroup core
+ * This is the base class for vector data providers.
+ *
+ * Data providers abstract the retrieval and writing (where supported)
+ * of feature and attrubute information from a spatial datasource.
+ *
+ *
*/
class CORE_EXPORT QgsVectorDataProvider : public QgsDataProvider
{
@@ -95,9 +101,9 @@
/**
* Gets the feature at the given feature ID.
- * @param featureId id of the feature
- * @param feature feature which will receive the data
- * @param fetchGeoemtry if true, geometry will be fetched from the provider
+ * @param featureId of the feature to be returned
+ * @param feature which will receive the data
+ * @param fetchGeometry flag which if true, will cause the geometry to be fetched from the provider
* @param fetchAttributes a list containing the indexes of the attribute fields to copy
* @return True when feature was found, otherwise false
*
@@ -138,6 +144,7 @@
/**
* Return a map of indexes with field names for this layer
* @return map of fields
+ * @see QgsFieldMap
*/
virtual const QgsFieldMap &fields() const = 0;
@@ -151,7 +158,7 @@
virtual void reset() = 0;
/**
- * Returns the minimum value of an attributs
+ * Returns the minimum value of an attribute
* @param index the index of the attribute
*
* Default implementation walks all numeric attributes and caches minimal
@@ -161,7 +168,7 @@
virtual QVariant minimumValue( int index );
/**
- * Returns the maximum value of an attributs
+ * Returns the maximum value of an attribute
* @param index the index of the attribute
*
* Default implementation walks all numeric attributes and caches minimal
@@ -186,7 +193,7 @@
virtual bool addFeatures( QgsFeatureList &flist );
/**
- * Deletes a feature
+ * Deletes one or more features
* @param id list containing feature ids to delete
* @return true in case of success and false in case of failure
*/
@@ -220,9 +227,10 @@
/**
* Changes geometries of existing features
- * @param geometry_map A std::map containing the feature IDs to change the geometries of.
- * the second map parameter being the new geometries themselves
- * @return true in case of success and false in case of failure
+ * @param geometry_map A QgsGeometryMap whose index contains the feature IDs
+ * that will have their geometries changed.
+ * The second map parameter being the new geometries themselves
+ * @return True in case of success and false in case of failure
*/
virtual bool changeGeometryValues( QgsGeometryMap & geometry_map );
@@ -257,7 +265,7 @@
/**
* Returns the index of a field name or -1 if the field does not exist
*/
- int indexFromFieldName( const QString& fieldName ) const;
+ int fieldNameIndex( const QString& fieldName ) const;
/**
* Return list of indexes to fetch all attributes in getNextFeature()
@@ -268,10 +276,10 @@
const QgsNativeTypeMap &supportedNativeTypes() const;
/**
- * Set whether provider should return also features that don't have
+ * Set whether provider should also return features that don't have
* associated geometry. FALSE by default
*/
- void setFetchFeaturesWithoutGeom( bool fetch );
+ void enableGeometrylessFeatures( bool fetch );
protected:
QVariant convertValue( QVariant::Type type, QString value );
Modified: trunk/qgis/src/core/qgsvectorfilewriter.h
===================================================================
--- trunk/qgis/src/core/qgsvectorfilewriter.h 2008-08-30 08:32:34 UTC (rev 9212)
+++ trunk/qgis/src/core/qgsvectorfilewriter.h 2008-08-30 09:28:54 UTC (rev 9213)
@@ -29,7 +29,8 @@
class QTextCodec;
-/**
+/** \ingroup core
+ * A convenience class for writing vector files to disk.
There are two possibilities how to use this class:
1. static call to QgsVectorFileWriter::writeAsShapefile(...) which saves the whole vector layer
2. create an instance of the class and issue calls to addFeature(...)
Modified: trunk/qgis/src/core/qgsvectorlayer.cpp
===================================================================
--- trunk/qgis/src/core/qgsvectorlayer.cpp 2008-08-30 08:32:34 UTC (rev 9212)
+++ trunk/qgis/src/core/qgsvectorlayer.cpp 2008-08-30 09:28:54 UTC (rev 9213)
@@ -1433,7 +1433,7 @@
}
-bool QgsVectorLayer::insertVertexBefore( double x, double y, int atFeatureId, int beforeVertex )
+bool QgsVectorLayer::insertVertex( double x, double y, int atFeatureId, int beforeVertex )
{
if ( !mEditable )
{
@@ -1453,7 +1453,7 @@
mChangedGeometries[atFeatureId] = mCachedGeometries[atFeatureId];
}
- mChangedGeometries[atFeatureId].insertVertexBefore( x, y, beforeVertex );
+ mChangedGeometries[atFeatureId].insertVertex( x, y, beforeVertex );
setModified( true, true ); // only geometry was changed
@@ -1463,7 +1463,7 @@
}
-bool QgsVectorLayer::moveVertexAt( double x, double y, int atFeatureId, int atVertex )
+bool QgsVectorLayer::moveVertex( double x, double y, int atFeatureId, int atVertex )
{
if ( !mEditable )
{
@@ -1482,7 +1482,7 @@
mChangedGeometries[atFeatureId] = mCachedGeometries[atFeatureId];
}
- mChangedGeometries[atFeatureId].moveVertexAt( x, y, atVertex );
+ mChangedGeometries[atFeatureId].moveVertex( x, y, atVertex );
setModified( true, true ); // only geometry was changed
@@ -1492,7 +1492,7 @@
}
-bool QgsVectorLayer::deleteVertexAt( int atFeatureId, int atVertex )
+bool QgsVectorLayer::deleteVertex( int atFeatureId, int atVertex )
{
if ( !mEditable )
{
@@ -1511,7 +1511,7 @@
mChangedGeometries[atFeatureId] = mCachedGeometries[atFeatureId];
}
- mChangedGeometries[atFeatureId].deleteVertexAt( atVertex );
+ mChangedGeometries[atFeatureId].deleteVertex( atVertex );
setModified( true, true ); // only geometry was changed
@@ -3167,7 +3167,7 @@
if ( it->snappedVertexNr == -1 ) // segment snap
{
layerPoint = it->snappedVertex;
- if ( !insertVertexBefore( layerPoint.x(), layerPoint.y(), it->snappedAtGeometry, it->afterVertexNr ) )
+ if ( !insertVertex( layerPoint.x(), layerPoint.y(), it->snappedAtGeometry, it->afterVertexNr ) )
{
returnval = 3;
}
Modified: trunk/qgis/src/core/qgsvectorlayer.h
===================================================================
--- trunk/qgis/src/core/qgsvectorlayer.h 2008-08-30 08:32:34 UTC (rev 9212)
+++ trunk/qgis/src/core/qgsvectorlayer.h 2008-08-30 09:28:54 UTC (rev 9213)
@@ -51,8 +51,8 @@
typedef QSet<int> QgsFeatureIds;
typedef QSet<int> QgsAttributeIds;
-/*! \class QgsVectorLayer
- * \brief Vector layer backed by a data source provider
+/** \ingroup core
+ * Vector layer backed by a data source provider.
*/
class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
{
@@ -115,6 +115,7 @@
/** Setup the coordinate system tranformation for the layer */
void setCoordinateSystem();
+ /** Get the label object associated with this layer */
QgsLabel *label();
QgsAttributeAction* actions() { return mActions; }
@@ -222,17 +223,17 @@
* in the given ring, item (first number is index 0), and feature
* Not meaningful for Point geometries
*/
- bool insertVertexBefore( double x, double y, int atFeatureId, int beforeVertex );
+ bool insertVertex( double x, double y, int atFeatureId, int beforeVertex );
/** Moves the vertex at the given position number,
* ring and item (first number is index 0), and feature
* to the given coordinates
*/
- bool moveVertexAt( double x, double y, int atFeatureId, int atVertex );
+ bool moveVertex( double x, double y, int atFeatureId, int atVertex );
/** Deletes a vertex from a feature
*/
- bool deleteVertexAt( int atFeatureId, int atVertex );
+ bool deleteVertex( int atFeatureId, int atVertex );
/** Deletes the selected features
* @return true in case of success and false otherwise
@@ -295,7 +296,7 @@
int addTopologicalPoints( const QgsPoint& p );
/**Inserts vertices to the snapped segments.
- This is usefull for topological editing if snap to segment is enabled.
+ This is useful for topological editing if snap to segment is enabled.
@param snapResults results collected from the snapping operation
@return 0 in case of success*/
int insertSegmentVerticesForSnap( const QList<QgsSnappingResult>& snapResults );
@@ -326,8 +327,11 @@
@param snap_to to segment / to vertex
@return 0 in case of success
*/
- int snapWithContext( const QgsPoint& startPoint, double snappingTolerance, QMultiMap<double, QgsSnappingResult>& snappingResults,
- QgsSnapper::SNAP_TO snap_to );
+ int snapWithContext( const QgsPoint& startPoint,
+ double snappingTolerance,
+ QMultiMap<double,
+ QgsSnappingResult>& snappingResults,
+ QgsSnapper::SNAP_TO snap_to );
/** Draws the layer
* @return FALSE if an error occurred during drawing
@@ -340,7 +344,10 @@
/** \brief Draws the layer labels using coordinate transformation
* \param scale size scale, applied to all values in pixels
*/
- void drawLabels( QPainter * p, const QgsRect& viewExtent, const QgsMapToPixel* cXf, const QgsCoordinateTransform* ct, double scale );
+ void drawLabels( QPainter * p, const QgsRect& viewExtent,
+ const QgsMapToPixel* cXf,
+ const QgsCoordinateTransform* ct,
+ double scale );
/** returns field list in the to-be-committed state */
const QgsFieldMap &pendingFields();
@@ -382,7 +389,8 @@
again.
The commits occur in distinct stages,
- (add attributes, add features, change attribute values, change geometries, delete features, delete attributes)
+ (add attributes, add features, change attribute values, change
+ geometries, delete features, delete attributes)
so if a stage fails, it's difficult to roll back cleanly.
Therefore any error message also includes which stage failed so
that the user has some chance of repairing the damage cleanly.
@@ -457,7 +465,7 @@
bool setDataProvider( QString const & provider );
/** Draws features. May cause projections exceptions to be generated
- * (i.e., code that calls this function needs to catch them
+ * (i.e., code that calls this function needs to catch them)
*/
void drawFeature( QPainter* p,
QgsFeature& fet,
Modified: trunk/qgis/src/plugins/interpolation/qgsinterpolationdialog.cpp
===================================================================
--- trunk/qgis/src/plugins/interpolation/qgsinterpolationdialog.cpp 2008-08-30 08:32:34 UTC (rev 9212)
+++ trunk/qgis/src/plugins/interpolation/qgsinterpolationdialog.cpp 2008-08-30 09:28:54 UTC (rev 9213)
@@ -106,7 +106,7 @@
}
else
{
- int attributeIndex = theProvider->indexFromFieldName( mInterpolationAttributeComboBox->currentText() );
+ int attributeIndex = theProvider->fieldNameIndex( mInterpolationAttributeComboBox->currentText() );
theInterpolator->enableAttributeValueInterpolation( attributeIndex );
}
More information about the QGIS-commit
mailing list