QGIS API Documentation  2.4.0-Chugiak
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
qgsvectorlayer.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsvectorlayer.h - description
3  -------------------
4  begin : Oct 29, 2003
5  copyright : (C) 2003 by Gary E.Sherman
6  email : sherman at mrcc.com
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef QGSVECTORLAYER_H
19 #define QGSVECTORLAYER_H
20 
21 #include <QMap>
22 #include <QSet>
23 #include <QList>
24 #include <QStringList>
25 
26 #include "qgis.h"
27 #include "qgsmaplayer.h"
28 #include "qgsfeature.h"
29 #include "qgsfeatureiterator.h"
30 #include "qgseditorwidgetconfig.h"
31 #include "qgsfield.h"
32 #include "qgssnapper.h"
33 #include "qgsfield.h"
34 #include "qgsrelation.h"
36 
37 class QPainter;
38 class QImage;
39 
40 class QgsAttributeAction;
42 class QgsEditorWidgetWrapper;
43 class QgsFeatureRequest;
44 class QgsGeometry;
45 class QgsGeometryVertexIndex;
46 class QgsLabel;
47 class QgsMapToPixel;
48 class QgsRectangle;
49 class QgsRelation;
50 class QgsRelationManager;
53 class QgsRectangle;
58 class QgsGeometryCache;
60 class QgsSymbolV2;
62 
63 typedef QList<int> QgsAttributeList;
64 typedef QSet<int> QgsAttributeIds;
65 
67 class CORE_EXPORT QgsAttributeEditorElement : public QObject
68 {
69  Q_OBJECT
70  public:
71 
73  {
77  AeTypeInvalid
78  };
79 
80  QgsAttributeEditorElement( AttributeEditorType type, QString name, QObject *parent = NULL )
81  : QObject( parent ), mType( type ), mName( name ) {}
82 
84 
85  QString name() const { return mName; }
86  AttributeEditorType type() const { return mType; }
87 
88  virtual QDomElement toDomElement( QDomDocument& doc ) const = 0;
89 
90  protected:
92  QString mName;
93 };
94 
97 {
98  public:
99  QgsAttributeEditorContainer( QString name, QObject *parent )
100  : QgsAttributeEditorElement( AeTypeContainer, name, parent )
101  , mIsGroupBox( true )
102  {}
103 
105 
106  virtual QDomElement toDomElement( QDomDocument& doc ) const;
107  virtual void addChildElement( QgsAttributeEditorElement *widget );
108  virtual void setIsGroupBox( bool isGroupBox ) { mIsGroupBox = isGroupBox; }
109  virtual bool isGroupBox() const { return mIsGroupBox; }
110  QList<QgsAttributeEditorElement*> children() const { return mChildren; }
111  virtual QList<QgsAttributeEditorElement*> findElements( AttributeEditorType type ) const;
112 
113  private:
115  QList<QgsAttributeEditorElement*> mChildren;
116 };
117 
120 {
121  public:
122  QgsAttributeEditorField( QString name , int idx, QObject *parent )
123  : QgsAttributeEditorElement( AeTypeField, name, parent ), mIdx( idx ) {}
124 
126 
127  virtual QDomElement toDomElement( QDomDocument& doc ) const;
128  int idx() const { return mIdx; }
129 
130  private:
131  int mIdx;
132 };
133 
136 {
137  public:
138  QgsAttributeEditorRelation( QString name, const QString &relationId, QObject *parent )
139  : QgsAttributeEditorElement( AeTypeRelation, name, parent )
140  , mRelationId( relationId ) {}
141 
142  QgsAttributeEditorRelation( QString name, const QgsRelation& relation, QObject *parent )
143  : QgsAttributeEditorElement( AeTypeRelation, name, parent )
144  , mRelationId( relation.id() )
145  , mRelation( relation ) {}
146 
148 
149  virtual QDomElement toDomElement( QDomDocument& doc ) const;
150  const QgsRelation& relation() const { return mRelation; }
151 
158  bool init( QgsRelationManager *relManager );
159 
160  private:
161  QString mRelationId;
163 };
164 
166 struct CORE_EXPORT QgsVectorJoinInfo
167 {
171  QString joinLayerId;
173  QString joinFieldName;
179  QHash< QString, QgsAttributes> cachedAttributes;
180 
185 };
186 
455 class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
456 {
457  Q_OBJECT
458 
459  public:
462  {
463  GeneratedLayout = 0,
464  TabLayout = 1,
465  UiFileLayout = 2
466  };
467 
471  enum EditType
472  {
494  };
495 
499  {
500  SuppressDefault = 0, // use the application-wide setting
501  SuppressOn = 1,
502  SuppressOff = 2
503  };
504 
505  struct RangeData
506  {
507  RangeData() { mMin = QVariant( 0 ); mMax = QVariant( 5 ); mStep = QVariant( 1 );}
508  RangeData( QVariant theMin, QVariant theMax, QVariant theStep )
509  : mMin( theMin ), mMax( theMax ), mStep( theStep ) {}
510 
511  QVariant mMin;
512  QVariant mMax;
513  QVariant mStep;
514  };
515 
517  {
519  ValueRelationData( QString layer, QString key, QString value, bool allowNull, bool orderByValue,
520  bool allowMulti = false,
521  QString filterExpression = QString::null )
522  : mLayer( layer )
523  , mKey( key )
524  , mValue( value )
525  , mFilterExpression( filterExpression )
526  , mAllowNull( allowNull )
527  , mOrderByValue( orderByValue )
528  , mAllowMulti( allowMulti )
529  {}
530 
531  QString mLayer;
532  QString mKey;
533  QString mValue;
537  bool mAllowMulti; /* allow selection of multiple keys @added in 1.9 */
538  };
539 
540  struct GroupData
541  {
543  GroupData( QString name , QList<QString> fields )
544  : mName( name ), mFields( fields ) {}
545  QString mName;
546  QList<QString> mFields;
547  };
548 
549  struct TabData
550  {
551  TabData() {}
552  TabData( QString name , QList<QString> fields , QList<GroupData> groups )
553  : mName( name ), mFields( fields ), mGroups( groups ) {}
554  QString mName;
555  QList<QString> mFields;
556  QList<GroupData> mGroups;
557  };
558 
572  QgsVectorLayer( QString path = QString::null, QString baseName = QString::null,
573  QString providerLib = QString::null, bool loadDefaultStyleFlag = true );
574 
576  virtual ~QgsVectorLayer();
577 
579  QString storageType() const;
580 
582  QString capabilitiesString() const;
583 
585  QString dataComment() const;
586 
588  void setDisplayField( QString fldName = "" );
589 
591  const QString displayField() const;
592 
600  void setDisplayExpression( const QString &displayExpression );
601 
610  const QString displayExpression();
611 
613  QgsVectorDataProvider* dataProvider();
614 
618  const QgsVectorDataProvider* dataProvider() const;
619 
621  void setProviderEncoding( const QString& encoding );
622 
624  void setCoordinateSystem();
625 
629  void addJoin( const QgsVectorJoinInfo& joinInfo );
630 
633  void removeJoin( const QString& joinLayerId );
634 
636  const QList< QgsVectorJoinInfo >& vectorJoins() const;
637 
639  QgsLabel *label();
640 
641  const QgsLabel *label() const;
642 
643  QgsAttributeAction *actions() { return mActions; }
644 
650  int selectedFeatureCount();
651 
660  void select( QgsRectangle & rect, bool addToSelection );
661 
673  void modifySelection( QgsFeatureIds selectIds, QgsFeatureIds deselectIds );
674 
676  void invertSelection();
677 
679  void selectAll();
680 
682  QgsFeatureIds allFeatureIds();
683 
691  void invertSelectionInRectangle( QgsRectangle & rect );
692 
700  QgsFeatureList selectedFeatures();
701 
708  const QgsFeatureIds &selectedFeaturesIds() const;
709 
717  void setSelectedFeatures( const QgsFeatureIds &ids );
718 
720  QgsRectangle boundingBoxOfSelected();
721 
723  void setDiagramRenderer( QgsDiagramRendererV2* r );
724  const QgsDiagramRendererV2* diagramRenderer() const { return mDiagramRenderer; }
725 
726  void setDiagramLayerSettings( const QgsDiagramLayerSettings& s );
727  const QgsDiagramLayerSettings *diagramLayerSettings() const { return mDiagramLayerSettings; }
728 
731  QgsFeatureRendererV2* rendererV2();
735  void setRendererV2( QgsFeatureRendererV2* r );
736 
738  QGis::GeometryType geometryType() const;
739 
743  bool hasGeometryType() const;
744 
746  QGis::WkbType wkbType() const;
747 
749  QString providerType() const;
750 
754  virtual bool readXml( const QDomNode& layer_node );
755 
759  virtual bool writeXml( QDomNode & layer_node, QDomDocument & doc );
760 
769  virtual void saveStyleToDatabase( QString name, QString description,
770  bool useAsDefault, QString uiFileContent,
771  QString &msgError );
772 
781  virtual int listStylesInDatabase( QStringList &ids, QStringList &names,
782  QStringList &descriptions, QString &msgError );
783 
787  virtual QString getStyleFromDatabase( QString styleId, QString &msgError );
788 
795  virtual QString loadNamedStyle( const QString &theURI, bool &theResultFlag, bool loadFromLocalDb );
796 
801  virtual QString loadNamedStyle( const QString &theURI, bool &theResultFlag );
802 
803  virtual bool applyNamedStyle( QString namedStyle , QString errorMsg );
804 
809  QgsAttributeEditorElement* attributeEditorElementFromDomElement( QDomElement &elem, QObject* parent );
810 
816  bool readSymbology( const QDomNode& node, QString& errorMessage );
817 
824  bool writeSymbology( QDomNode& node, QDomDocument& doc, QString& errorMessage ) const;
825 
826  bool writeSld( QDomNode& node, QDomDocument& doc, QString& errorMessage ) const;
827  bool readSld( const QDomNode& node, QString& errorMessage );
828 
836  virtual long featureCount() const;
837 
844  long featureCount( QgsSymbolV2* symbol );
845 
851  bool countSymbolFeatures( bool showProgress = true );
852 
860  virtual bool setSubsetString( QString subset );
861 
866  virtual QString subsetString();
867 
871  QgsFeatureIterator getFeatures( const QgsFeatureRequest& request = QgsFeatureRequest() );
872 
878  bool addFeature( QgsFeature& f, bool alsoUpdateExtent = true );
879 
887  bool updateFeature( QgsFeature &f );
888 
893  bool insertVertex( double x, double y, QgsFeatureId atFeatureId, int beforeVertex );
894 
899  bool moveVertex( double x, double y, QgsFeatureId atFeatureId, int atVertex );
900 
903  bool deleteVertex( QgsFeatureId atFeatureId, int atVertex );
904 
908  bool deleteSelectedFeatures();
909 
919  int addRing( const QList<QgsPoint>& ring );
920 
931  int addPart( const QList<QgsPoint>& ring );
932 
938  int translateFeature( QgsFeatureId featureId, double dx, double dy );
939 
947  int splitParts( const QList<QgsPoint>& splitLine, bool topologicalEditing = false );
948 
956  int splitFeatures( const QList<QgsPoint>& splitLine, bool topologicalEditing = false );
957 
966  Q_DECL_DEPRECATED int removePolygonIntersections( QgsGeometry* geom, QgsFeatureIds ignoreFeatures = QgsFeatureIds() );
967 
973  int addTopologicalPoints( QgsGeometry* geom );
974 
982  int addTopologicalPoints( const QgsPoint& p );
983 
989  int insertSegmentVerticesForSnap( const QList<QgsSnappingResult>& snapResults );
990 
992  void enableLabels( bool on );
993 
995  bool hasLabelsEnabled() const;
996 
998  virtual bool isEditable() const;
999 
1003  virtual bool isReadOnly() const;
1004 
1006  virtual bool isModified() const;
1007 
1014  bool snapPoint( QgsPoint& point, double tolerance );
1015 
1023  int snapWithContext( const QgsPoint& startPoint,
1024  double snappingTolerance,
1025  QMultiMap < double, QgsSnappingResult > &snappingResults,
1026  QgsSnapper::SnappingType snap_to );
1027 
1030  virtual void reload();
1031 
1035  virtual QgsMapLayerRenderer* createMapRenderer( QgsRenderContext& rendererContext );
1036 
1040  bool draw( QgsRenderContext& rendererContext );
1041 
1043  void drawLabels( QgsRenderContext& rendererContext );
1044 
1046  QgsRectangle extent();
1047 
1049  const QgsFields &pendingFields() const;
1050 
1052  QgsAttributeList pendingAllAttributesList();
1053 
1057  QgsAttributeList pendingPkAttributesList();
1058 
1060  int pendingFeatureCount();
1061 
1066  bool setReadOnly( bool readonly = true );
1067 
1069  bool startEditing();
1070 
1073  bool changeGeometry( QgsFeatureId fid, QgsGeometry* geom );
1074 
1081  Q_DECL_DEPRECATED bool changeAttributeValue( QgsFeatureId fid, int field, QVariant value, bool emitSignal );
1082 
1093  bool changeAttributeValue( QgsFeatureId fid, int field, const QVariant &newValue, const QVariant &oldValue = QVariant() );
1094 
1098  bool addAttribute( const QgsField &field );
1099 
1104  void addAttributeAlias( int attIndex, QString aliasString );
1105 
1110  void addAttributeEditorWidget( QgsAttributeEditorElement* data );
1111 
1119  const QString editorWidgetV2( int fieldIdx ) const;
1120 
1130  const QString editorWidgetV2( const QString& fieldName ) const;
1131 
1139  const QgsEditorWidgetConfig editorWidgetV2Config( int fieldIdx ) const;
1140 
1150  const QgsEditorWidgetConfig editorWidgetV2Config( const QString& fieldName ) const;
1151 
1156  QList< QgsAttributeEditorElement* > &attributeEditorElements();
1161  void clearAttributeEditorWidgets();
1162 
1167  QString attributeAlias( int attributeIndex ) const;
1168 
1173  QString attributeDisplayName( int attributeIndex ) const;
1174 
1175  const QMap< QString, QString >& attributeAliases() const { return mAttributeAliasMap; }
1176 
1177  const QSet<QString>& excludeAttributesWMS() const { return mExcludeAttributesWMS; }
1178  void setExcludeAttributesWMS( const QSet<QString>& att ) { mExcludeAttributesWMS = att; }
1179 
1180  const QSet<QString>& excludeAttributesWFS() const { return mExcludeAttributesWFS; }
1181  void setExcludeAttributesWFS( const QSet<QString>& att ) { mExcludeAttributesWFS = att; }
1182 
1184  bool deleteAttribute( int attr );
1185 
1193  bool deleteAttributes( QList<int> attrs );
1194 
1196  bool addFeatures( QgsFeatureList features, bool makeSelected = true );
1197 
1199  bool deleteFeature( QgsFeatureId fid );
1200 
1216  bool commitChanges();
1217  const QStringList &commitErrors();
1218 
1222  bool rollBack( bool deleteBuffer = true );
1223 
1229  Q_DECL_DEPRECATED EditType editType( int idx );
1230 
1236  Q_DECL_DEPRECATED void setEditType( int idx, EditType edit );
1237 
1239  EditorLayout editorLayout();
1240 
1242  void setEditorLayout( EditorLayout editorLayout );
1243 
1250  void setEditorWidgetV2( int attrIdx, const QString& widgetType );
1251 
1258  void setEditorWidgetV2Config( int attrIdx, const QgsEditorWidgetConfig& config );
1259 
1265  Q_DECL_DEPRECATED void setCheckedState( int idx, QString checked, QString notChecked );
1266 
1268  QString editForm();
1269 
1271  void setEditForm( QString ui );
1272 
1275  QgsVectorLayer::FeatureFormSuppress featureFormSuppress() const { return mFeatureFormSuppress; }
1276 
1279  void setFeatureFormSuppress( QgsVectorLayer::FeatureFormSuppress s ) { mFeatureFormSuppress = s; }
1280 
1282  QString annotationForm() const { return mAnnotationForm; }
1283 
1285  void setAnnotationForm( const QString& ui );
1286 
1288  QString editFormInit();
1289 
1291  void setEditFormInit( QString function );
1292 
1297  Q_DECL_DEPRECATED QMap<QString, QVariant> valueMap( int idx );
1298 
1304  Q_DECL_DEPRECATED RangeData range( int idx );
1305 
1311  ValueRelationData valueRelation( int idx );
1312 
1319  QList<QgsRelation> referencingRelations( int idx );
1320 
1328  Q_DECL_DEPRECATED QString dateFormat( int idx );
1329 
1337  Q_DECL_DEPRECATED QSize widgetSize( int idx );
1338 
1342  bool fieldEditable( int idx );
1343 
1347  bool labelOnTop( int idx );
1348 
1352  void setFieldEditable( int idx, bool editable );
1353 
1357  void setLabelOnTop( int idx, bool onTop );
1358 
1360  QgsVectorLayerEditBuffer* editBuffer() { return mEditBuffer; }
1361 
1366  void beginEditCommand( QString text );
1367 
1369  void endEditCommand();
1370 
1372  void destroyEditCommand();
1373 
1377  int fieldNameIndex( const QString& fieldName ) const;
1378 
1382  {
1385  NoMarker /* added in version 1.1 */
1386  };
1387 
1390  static void drawVertexMarker( double x, double y, QPainter& p, QgsVectorLayer::VertexMarkerType type, int vertexSize );
1391 
1394  void updateFields();
1395 
1398  void createJoinCaches();
1399 
1405  void uniqueValues( int index, QList<QVariant> &uniqueValues, int limit = -1 );
1406 
1409  QVariant minimumValue( int index );
1410 
1413  QVariant maximumValue( int index );
1414 
1415  /* Set the blending mode used for rendering each feature
1416  * @note added in 2.0
1417  */
1418  void setFeatureBlendMode( const QPainter::CompositionMode &blendMode );
1419  /* Returns the current blending mode for features
1420  * @note added in 2.0
1421  */
1422  QPainter::CompositionMode featureBlendMode() const;
1423 
1424  /* Set the transparency for the vector layer
1425  * @note added in 2.0
1426  */
1427  void setLayerTransparency( int layerTransparency );
1428  /* Returns the current transparency for the vector layer
1429  * @note added in 2.0
1430  */
1431  int layerTransparency() const;
1432 
1433  QString metadata();
1434 
1436  inline QgsGeometryCache* cache() { return mCache; }
1437 
1441  void setSimplifyMethod( const QgsVectorSimplifyMethod& simplifyMethod ) { mSimplifyMethod = simplifyMethod; }
1445  inline const QgsVectorSimplifyMethod& simplifyMethod() const { return mSimplifyMethod; }
1446 
1451  bool simplifyDrawingCanbeApplied( const QgsRenderContext& renderContext, QgsVectorSimplifyMethod::SimplifyHint simplifyHint ) const;
1452 
1453  public slots:
1461  void select( const QgsFeatureId &featureId );
1462 
1470  void select( const QgsFeatureIds& featureIds );
1471 
1479  void deselect( const QgsFeatureId featureId );
1480 
1488  void deselect( const QgsFeatureIds& featureIds );
1489 
1495  void removeSelection();
1496 
1497  void triggerRepaint();
1498 
1502  virtual void updateExtents();
1503 
1506  void checkJoinLayerRemove( QString theLayerId );
1507 
1508  protected slots:
1509  void invalidateSymbolCountedFlag();
1510 
1511  signals:
1512 
1520  void selectionChanged( const QgsFeatureIds selected, const QgsFeatureIds deselected, const bool clearAndSelect );
1521 
1523  void selectionChanged();
1524 
1526  void layerModified();
1527 
1529  void beforeModifiedCheck() const;
1530 
1532  void editingStarted();
1533 
1535  void editingStopped();
1536 
1538  void beforeCommitChanges();
1539 
1541  void beforeRollBack();
1542 
1551  void attributeAdded( int idx );
1560  void attributeDeleted( int idx );
1561  void featureAdded( QgsFeatureId fid ); // added in 1.7
1562  void featureDeleted( QgsFeatureId fid );
1569  void updatedFields();
1570  void layerDeleted();
1571 
1572  void attributeValueChanged( QgsFeatureId fid, int idx, const QVariant & );
1573  void geometryChanged( QgsFeatureId fid, QgsGeometry &geom ); // added in 1.9
1574 
1577  void committedAttributesDeleted( const QString& layerId, const QgsAttributeList& deletedAttributes );
1578  void committedAttributesAdded( const QString& layerId, const QList<QgsField>& addedAttributes );
1579  void committedFeaturesAdded( const QString& layerId, const QgsFeatureList& addedFeatures );
1580  void committedFeaturesRemoved( const QString& layerId, const QgsFeatureIds& deletedFeatureIds );
1581  void committedAttributeValuesChanges( const QString& layerId, const QgsChangedAttributesMap& changedAttributesValues );
1582  void committedGeometriesChanges( const QString& layerId, const QgsGeometryMap& changedGeometries );
1583 
1584  void saveLayerToProject();
1585 
1589  void labelingFontNotFound( QgsVectorLayer* layer, const QString& fontfamily );
1590 
1592  void featureBlendModeChanged( const QPainter::CompositionMode &blendMode );
1593 
1595  void layerTransparencyChanged( int layerTransparency );
1596 
1602  void editCommandStarted( const QString& text );
1603 
1609  void editCommandEnded();
1610 
1616  void editCommandDestroyed();
1617 
1618  private slots:
1619  void onRelationsLoaded();
1620 
1621  protected:
1623  void setExtent( const QgsRectangle &rect );
1624 
1625  private: // Private methods
1626 
1628  QgsVectorLayer( const QgsVectorLayer & rhs );
1629 
1631  QgsVectorLayer & operator=( QgsVectorLayer const & rhs );
1632 
1637  bool setDataProvider( QString const & provider );
1638 
1640  QgsFeatureId findFreeId();
1641 
1650  void snapToGeometry( const QgsPoint& startPoint,
1651  QgsFeatureId featureId,
1652  QgsGeometry* geom,
1653  double sqrSnappingTolerance,
1654  QMultiMap<double, QgsSnappingResult>& snappingResults,
1655  QgsSnapper::SnappingType snap_to ) const;
1656 
1658  //void addJoinedAttributes( QgsFeature& f, bool all = false );
1659 
1661  void readSldLabeling( const QDomNode& node );
1662 
1663  private: // Private attributes
1664 
1667 
1669  QString mDisplayField;
1670 
1673 
1675  QString mProviderKey;
1676 
1679 
1682 
1688 
1691 
1693  QMap< QString, QString > mAttributeAliasMap;
1694 
1696  QList< QgsAttributeEditorElement* > mAttributeEditorElements;
1697 
1699  QSet<QString> mExcludeAttributesWMS;
1701  QSet<QString> mExcludeAttributesWFS;
1702 
1704  QList< TabData > mTabs;
1705 
1708 
1711 
1714 
1717 
1719  bool mLabelOn;
1720 
1723 
1725  QPainter::CompositionMode mFeatureBlendMode;
1726 
1729 
1732 
1735 
1738 
1739  QStringList mCommitErrors;
1740 
1741  QMap< QString, bool> mFieldEditables;
1742  QMap< QString, bool> mLabelOnTop;
1743 
1744  QMap<QString, QString> mEditorWidgetV2Types;
1745  QMap<QString, QgsEditorWidgetConfig > mEditorWidgetV2Configs;
1746 
1749 
1750  QString mEditForm, mEditFormInit;
1751 
1755 
1756  //annotation form for this layer
1758 
1761 
1765 
1766  //stores information about joined layers
1768 
1769  //diagram rendering object. 0 if diagram drawing is disabled
1771 
1772  //stores infos about diagram placement (placement type, priority, position distance)
1774 
1777 
1778  // Features in renderer classes counted
1780 
1781  // Feature counts for each renderer symbol
1782  QMap<QgsSymbolV2*, long> mSymbolFeatureCountMap;
1783 
1785 };
1786 
1787 #endif
virtual bool isEditable() const
True if the layer can be edited.
EditorLayout mEditorLayout
Defines the default layout to use for the attribute editor (Drag and drop, UI File, Generated)
int mWkbType
Geometry type as defined in enum WkbType (qgis.h)
Wrapper for iterator of features from vector data provider or vector layer.
QString annotationForm() const
get annotation form (added in 1.5)
QMap< QgsFeatureId, QgsGeometry > QgsGeometryMap
Definition: qgsfeature.h:323
static unsigned index
int mCurrentVertexMarkerSize
The current size of editing marker.
A rectangle specified with double values.
Definition: qgsrectangle.h:35
Base class for all map layer types.
Definition: qgsmaplayer.h:47
QSet< QString > mExcludeAttributesWFS
Attributes which are not published in WFS.
QgsVectorLayer::FeatureFormSuppress mFeatureFormSuppress
Type of feature form suppression after feature creation.
QString joinFieldName
Join field in the source layer.
const QSet< QString > & excludeAttributesWMS() const
QgsVectorDataProvider * mDataProvider
Pointer to data provider derived from the abastract base class QgsDataProvider.
QgsVectorLayer::VertexMarkerType mCurrentVertexMarkerType
The current type of editing marker.
void setExcludeAttributesWFS(const QSet< QString > &att)
virtual QString metadata()
Obtain Metadata for this layer.
QString targetFieldName
Join field in the target layer.
virtual void drawLabels(QgsRenderContext &rendererContext)
Draw labels.
GeometryType
Definition: qgis.h:155
virtual bool isGroupBox() const
RangeData(QVariant theMin, QVariant theMax, QVariant theStep)
QgsAttributeAction * actions()
EditorLayout
The different types to layout the attribute editor.
QMap< QString, QgsEditorWidgetConfig > mEditorWidgetV2Configs
The attribute value should not be changed in the attribute form.
QSet< QgsFeatureId > QgsFeatureIds
Definition: qgsfeature.h:325
QList< QgsFeature > QgsFeatureList
Definition: qgsfeature.h:330
QList< QgsAttributeEditorElement * > mAttributeEditorElements
Stores a list of attribute editor elements (Each holding a tree structure for a tab in the attribute ...
void setExcludeAttributesWMS(const QSet< QString > &att)
QgsFeatureRendererV2 * mRendererV2
Renderer object which holds the information about how to display the features.
int joinFieldIndex
Join field index in the source layer.
virtual bool readSymbology(const QDomNode &node, QString &errorMessage)=0
Read the symbology for the current layer from the Dom node supplied.
Storage and management of actions associated with Qgis layer attributes.
const QgsVectorSimplifyMethod & simplifyMethod() const
Returns the simplification settings for fast rendering of features.
virtual void reload()
Synchronises with changes in the datasource.
Definition: qgsmaplayer.h:131
VertexMarkerType
Editing vertex markers.
QgsVectorLayer::FeatureFormSuppress featureFormSuppress() const
Type of feature form pop-up suppression after feature creation (overrides app setting) ...
SimplifyHint
Simplification flags for fast rendering of features.
QString mDisplayExpression
the preview expression used to generate a human readable preview string for features ...
Container of fields for a vector layer.
Definition: qgsfield.h:161
WkbType
Used for symbology operations.
Definition: qgis.h:53
QMap< QString, bool > mFieldEditables
virtual ~QgsAttributeEditorElement()
virtual QgsMapLayerRenderer * createMapRenderer(QgsRenderContext &rendererContext)
Return new instance of QgsMapLayerRenderer that will be used for rendering of given context...
Definition: qgsmaplayer.h:136
const QgsRelation & relation() const
bool memoryCache
True if the join is cached in virtual memory.
int targetFieldIndex
Join field index in the target layer.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
Definition: qgsfeature.h:113
const QgsDiagramLayerSettings * diagramLayerSettings() const
QStringList mCommitErrors
QgsAttributeEditorField(QString name, int idx, QObject *parent)
TabData(QString name, QList< QString > fields, QList< GroupData > groups)
bool mVertexMarkerOnlyForSelection
Flag if the vertex markers should be drawn only for selection (true) or for all features (false) ...
virtual bool writeSymbology(QDomNode &node, QDomDocument &doc, QString &errorMessage) const =0
Write the symbology for the layer into the docment provided.
QgsGeometryCache * cache()
QgsAttributeEditorRelation(QString name, const QString &relationId, QObject *parent)
Returns diagram settings for a feature.
Manages joined fields for a vector layer.
virtual bool draw(QgsRenderContext &rendererContext)
This is the method that does the actual work of drawing the layer onto a paint device.
QString mAnnotationForm
Perform transforms between map coordinates and device coordinates.
Definition: qgsmaptopixel.h:33
SnappingType
Snap to vertex, to segment or both.
Definition: qgssnapper.h:66
QList< QgsAttributeEditorElement * > mChildren
QgsVectorLayerEditBuffer * editBuffer()
Buffer with uncommitted editing operations. Only valid after editing has been turned on...
bool mLabelFontNotFoundNotified
Whether 'labeling font not found' has be shown for this layer (only show once in QgsMessageBar, on first rendering)
QgsGeometryCache * mCache
cache for some vector layer data - currently only geometries for faster editing
virtual bool writeXml(QDomNode &layer_node, QDomDocument &document)
called by writeLayerXML(), used by children to write state specific to them to project files...
The attribute value should not be shown in the attribute form.
const QSet< QString > & excludeAttributesWFS() const
virtual void setExtent(const QgsRectangle &rect)
Set the extent.
This class wraps a request for features to a vector layer (or directly its vector data provider)...
QList< int > QgsAttributeList
AttributeEditorType type() const
QgsVectorSimplifyMethod mSimplifyMethod
Simplification object which holds the information about how to simplify the features for fast renderi...
QgsDiagramLayerSettings * mDiagramLayerSettings
Encapsulate a field in an attribute table or data source.
Definition: qgsfield.h:31
QMap< QgsSymbolV2 *, long > mSymbolFeatureCountMap
const QMap< QString, QString > & attributeAliases() const
const QgsDiagramRendererV2 * diagramRenderer() const
A class to represent a point geometry.
Definition: qgspoint.h:63
virtual bool readSld(const QDomNode &node, QString &errorMessage)
Definition: qgsmaplayer.h:350
QMap< QString, QString > mAttributeAliasMap
Map that stores the aliases for attributes.
QList< TabData > mTabs
Map that stores the tab for attributes in the edit form.
QList< QgsAttributeEditorElement * > children() const
QgsVectorLayerEditBuffer * mEditBuffer
stores information about uncommitted changes to layer
Partial snapshot of vector layer's state (only the members necessary for access to features) ...
QgsMapLayer & operator=(QgsMapLayer const &)
private assign operator - QgsMapLayer not copyable
QList< QString > mFields
A class to render labels.
Definition: qgslabel.h:51
uuid generator - readonly and automatically intialized
QgsDiagramRendererV2 * mDiagramRenderer
This class contains information how to simplify geometries fetched from a vector layer.
Contains information about the context of a rendering operation.
ValueRelationData(QString layer, QString key, QString value, bool allowNull, bool orderByValue, bool allowMulti=false, QString filterExpression=QString::null)
QString mDisplayField
index of the primary label field
virtual QDomElement toDomElement(QDomDocument &doc) const =0
QSet< QString > mExcludeAttributesWMS
Attributes which are not published in WMS.
QHash< QString, QgsAttributes > cachedAttributes
Cache for joined attributes to provide fast lookup (size is 0 if no memory caching) ...
QMap< QgsFeatureId, QgsAttributeMap > QgsChangedAttributesMap
Definition: qgsfeature.h:320
QMap< QString, QString > mEditorWidgetV2Types
bool mLabelOn
Display labels.
QgsVectorLayerJoinBuffer * mJoinBuffer
GroupData(QString name, QList< QString > fields)
virtual void setIsGroupBox(bool isGroupBox)
This class manages a set of relations between layers.
virtual bool readXml(const QDomNode &layer_node)
called by readLayerXML(), used by children to read state specific to them from project files...
QgsAttributeEditorRelation(QString name, const QgsRelation &relation, QObject *parent)
Class for doing transforms between two map coordinate systems.
QMap< QString, bool > mLabelOnTop
void setSimplifyMethod(const QgsVectorSimplifyMethod &simplifyMethod)
Set the simplification settings for fast rendering of features.
QMap< QString, QVariant > QgsEditorWidgetConfig
Holds a set of configuration parameters for a editor widget wrapper.
qint64 QgsFeatureId
Definition: qgsfeature.h:30
Base class for utility classes that encapsulate information necessary for rendering of map layers...
void setFeatureFormSuppress(QgsVectorLayer::FeatureFormSuppress s)
Set type of feature form pop-up suppression after feature creation (overrides app setting) ...
int mLayerTransparency
Layer transparency.
virtual QString loadNamedStyle(const QString &theURI, bool &theResultFlag)
Retrieve a named style for this layer if one exists (either as a .qml file on disk or as a record in ...
QList< QString > mFields
QgsAttributeEditorElement(AttributeEditorType type, QString name, QObject *parent=NULL)
QgsLabel * mLabel
Label.
QSet< int > QgsAttributeIds
QgsAttributeEditorContainer(QString name, QObject *parent)
FeatureFormSuppress
Types of feature form suppression after feature creation.
This is the base class for vector data providers.
QList< int > QgsAttributeList
QgsFields mUpdatedFields
field map to commit
QPainter::CompositionMode mFeatureBlendMode
Blend mode for features.
virtual QgsRectangle extent()
Return the extent of the layer.
Represents a vector layer which manages a vector based data sets.
modularized edit widgets
bool mReadOnly
Flag indicating whether the layer is in read-only mode (editing disabled) or not. ...
QgsFeatureIds mSelectedFeatureIds
Set holding the feature IDs that are activated.
QString joinLayerId
Source layer.
value map from an table
AttributeEditorType mType
Abstract base class for simplify geometries using a specific algorithm.
QString mProviderKey
Data provider key.
QgsAttributeAction * mActions
The user-defined actions that are accessed from the Identify Results dialog box.
QList< GroupData > mGroups