mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
190 lines
4.6 KiB
Plaintext
190 lines
4.6 KiB
Plaintext
/************************************************************************
|
|
* This file has been generated automatically from *
|
|
* *
|
|
* src/core/qgsfeaturestore.h *
|
|
* *
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
************************************************************************/
|
|
|
|
|
|
class QgsFeatureStore : QgsFeatureSink
|
|
{
|
|
%Docstring(signature="appended")
|
|
A container for features with the same fields and crs.
|
|
%End
|
|
|
|
%TypeHeaderCode
|
|
#include "qgsfeaturestore.h"
|
|
%End
|
|
public:
|
|
QgsFeatureStore();
|
|
%Docstring
|
|
Constructor
|
|
%End
|
|
|
|
QgsFeatureStore( const QgsFields &fields, const QgsCoordinateReferenceSystem &crs );
|
|
%Docstring
|
|
Constructor
|
|
%End
|
|
|
|
QgsFields fields() const;
|
|
%Docstring
|
|
Returns the store's field list.
|
|
|
|
.. seealso:: :py:func:`setFields`
|
|
%End
|
|
|
|
void setFields( const QgsFields &fields );
|
|
%Docstring
|
|
Sets the store's ``fields``. Every contained feature's fields will be reset to match ``fields``.
|
|
|
|
.. seealso:: :py:func:`fields`
|
|
%End
|
|
|
|
QgsCoordinateReferenceSystem crs() const;
|
|
%Docstring
|
|
Returns the store's coordinate reference system.
|
|
|
|
.. seealso:: :py:func:`setCrs`
|
|
%End
|
|
|
|
void setCrs( const QgsCoordinateReferenceSystem &crs );
|
|
%Docstring
|
|
Sets the store's ``crs``.
|
|
|
|
.. seealso:: :py:func:`crs`
|
|
%End
|
|
|
|
virtual bool addFeature( QgsFeature &feature, QgsFeatureSink::Flags flags = QgsFeatureSink::Flags() );
|
|
|
|
virtual bool addFeatures( QgsFeatureList &features, QgsFeatureSink::Flags flags = QgsFeatureSink::Flags() );
|
|
|
|
|
|
int count() const;
|
|
%Docstring
|
|
Returns the number of features contained in the store.
|
|
%End
|
|
|
|
|
|
int __len__() const;
|
|
%Docstring
|
|
Returns the number of features contained in the store.
|
|
%End
|
|
%MethodCode
|
|
sipRes = sipCpp->count();
|
|
%End
|
|
|
|
//! Ensures that bool(obj) returns ``True`` (otherwise __len__() would be used)
|
|
int __bool__() const;
|
|
%MethodCode
|
|
sipRes = true;
|
|
%End
|
|
|
|
QgsFeatureList features() const;
|
|
%Docstring
|
|
Returns the list of features contained in the store.
|
|
%End
|
|
|
|
void setParams( const QMap<QString, QVariant> ¶meters );
|
|
%Docstring
|
|
Sets a map of optional ``parameters`` for the store.
|
|
|
|
.. seealso:: :py:func:`params`
|
|
%End
|
|
|
|
QMap<QString, QVariant> params() const;
|
|
%Docstring
|
|
Returns the map of optional parameters.
|
|
|
|
.. seealso:: :py:func:`setParams`
|
|
%End
|
|
|
|
};
|
|
|
|
typedef QVector<QgsFeatureStore> QgsFeatureStoreList;
|
|
|
|
%MappedType QgsFeatureStoreList
|
|
{
|
|
%TypeHeaderCode
|
|
#include "qgsfeaturestore.h"
|
|
%End
|
|
|
|
%ConvertFromTypeCode
|
|
// Create the list.
|
|
PyObject *l;
|
|
|
|
if ( ( l = PyList_New( sipCpp->size() ) ) == NULL )
|
|
return NULL;
|
|
|
|
// Set the list elements.
|
|
for ( int i = 0; i < sipCpp->size(); ++i )
|
|
{
|
|
QgsFeatureStore *v = new QgsFeatureStore( sipCpp->at( i ) );
|
|
PyObject *tobj;
|
|
|
|
if ( ( tobj = sipConvertFromNewType( v, sipType_QgsFeatureStore, Py_None ) ) == NULL )
|
|
{
|
|
Py_DECREF( l );
|
|
delete v;
|
|
|
|
return NULL;
|
|
}
|
|
|
|
PyList_SET_ITEM( l, i, tobj );
|
|
}
|
|
|
|
return l;
|
|
%End
|
|
|
|
%ConvertToTypeCode
|
|
// Check the type if that is all that is required.
|
|
if ( sipIsErr == NULL )
|
|
{
|
|
if ( !PyList_Check( sipPy ) )
|
|
return 0;
|
|
|
|
for ( SIP_SSIZE_T i = 0; i < PyList_GET_SIZE( sipPy ); ++i )
|
|
if ( !sipCanConvertToType( PyList_GET_ITEM( sipPy, i ), sipType_QgsFeatureStore, SIP_NOT_NONE ) )
|
|
return 0;
|
|
|
|
return 1;
|
|
}
|
|
|
|
QgsFeatureStoreList *qv = new QgsFeatureStoreList;
|
|
SIP_SSIZE_T listSize = PyList_GET_SIZE( sipPy );
|
|
qv->reserve( listSize );
|
|
|
|
for ( SIP_SSIZE_T i = 0; i < listSize; ++i )
|
|
{
|
|
PyObject *obj = PyList_GET_ITEM( sipPy, i );
|
|
int state;
|
|
QgsFeatureStore *t = reinterpret_cast<QgsFeatureStore *>( sipConvertToType( obj, sipType_QgsFeatureStore, sipTransferObj, SIP_NOT_NONE, &state, sipIsErr ) );
|
|
|
|
if ( *sipIsErr )
|
|
{
|
|
sipReleaseType( t, sipType_QgsFeatureStore, state );
|
|
|
|
delete qv;
|
|
return 0;
|
|
}
|
|
|
|
qv->append( *t );
|
|
sipReleaseType( t, sipType_QgsFeatureStore, state );
|
|
}
|
|
|
|
*sipCppPtr = qv;
|
|
|
|
return sipGetState( sipTransferObj );
|
|
%End
|
|
};
|
|
|
|
|
|
|
|
/************************************************************************
|
|
* This file has been generated automatically from *
|
|
* *
|
|
* src/core/qgsfeaturestore.h *
|
|
* *
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
************************************************************************/
|