QGIS API Documentation  2.5.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules 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 
41 class QgsAttributeAction;
48 class QgsFeatureRequest;
49 class QgsGeometry;
50 class QgsGeometryCache;
51 class QgsGeometryVertexIndex;
52 class QgsLabel;
53 class QgsMapToPixel;
54 class QgsRectangle;
55 class QgsRectangle;
56 class QgsRelation;
57 class QgsRelationManager;
59 class QgsSymbolV2;
63 
64 typedef QList<int> QgsAttributeList;
65 typedef QSet<int> QgsAttributeIds;
66 
68 class CORE_EXPORT QgsAttributeEditorElement : public QObject
69 {
70  Q_OBJECT
71  public:
72 
74  {
78  AeTypeInvalid
79  };
80 
81  QgsAttributeEditorElement( AttributeEditorType type, QString name, QObject *parent = NULL )
82  : QObject( parent ), mType( type ), mName( name ) {}
83 
85 
86  QString name() const { return mName; }
87  AttributeEditorType type() const { return mType; }
88 
89  virtual QDomElement toDomElement( QDomDocument& doc ) const = 0;
90 
91  protected:
93  QString mName;
94 };
95 
98 {
99  public:
100  QgsAttributeEditorContainer( QString name, QObject *parent )
101  : QgsAttributeEditorElement( AeTypeContainer, name, parent )
102  , mIsGroupBox( true )
103  {}
104 
106 
107  virtual QDomElement toDomElement( QDomDocument& doc ) const;
108  virtual void addChildElement( QgsAttributeEditorElement *widget );
109  virtual void setIsGroupBox( bool isGroupBox ) { mIsGroupBox = isGroupBox; }
110  virtual bool isGroupBox() const { return mIsGroupBox; }
111  QList<QgsAttributeEditorElement*> children() const { return mChildren; }
112  virtual QList<QgsAttributeEditorElement*> findElements( AttributeEditorType type ) const;
113 
114  private:
115  bool mIsGroupBox;
116  QList<QgsAttributeEditorElement*> mChildren;
117 };
118 
121 {
122  public:
123  QgsAttributeEditorField( QString name, int idx, QObject *parent )
124  : QgsAttributeEditorElement( AeTypeField, name, parent ), mIdx( idx ) {}
125 
127 
128  virtual QDomElement toDomElement( QDomDocument& doc ) const;
129  int idx() const { return mIdx; }
130 
131  private:
132  int mIdx;
133 };
134 
137 {
138  public:
139  QgsAttributeEditorRelation( QString name, const QString &relationId, QObject *parent )
140  : QgsAttributeEditorElement( AeTypeRelation, name, parent )
141  , mRelationId( relationId ) {}
142 
143  QgsAttributeEditorRelation( QString name, const QgsRelation& relation, QObject *parent )
144  : QgsAttributeEditorElement( AeTypeRelation, name, parent )
145  , mRelationId( relation.id() )
146  , mRelation( relation ) {}
147 
149 
150  virtual QDomElement toDomElement( QDomDocument& doc ) const;
151  const QgsRelation& relation() const { return mRelation; }
152 
159  bool init( QgsRelationManager *relManager );
160 
161  private:
162  QString mRelationId;
163  QgsRelation mRelation;
164 };
165 
167 struct CORE_EXPORT QgsVectorJoinInfo
168 {
172  QString joinLayerId;
174  QString joinFieldName;
180  QHash< QString, QgsAttributes> cachedAttributes;
181 
186 
187  bool operator==( const QgsVectorJoinInfo& other ) const
188  {
189  return targetFieldName == other.targetFieldName &&
190  joinLayerId == other.joinLayerId &&
191  joinFieldName == other.joinFieldName &&
192  joinFieldsSubset == other.joinFieldsSubset &&
193  memoryCache == other.memoryCache;
194  }
195 
198  void setJoinFieldNamesSubset( QStringList* fieldNamesSubset ) { joinFieldsSubset = QSharedPointer<QStringList>( fieldNamesSubset ); }
201  QStringList* joinFieldNamesSubset() const { return joinFieldsSubset.data(); }
202 
203 protected:
205  QSharedPointer<QStringList> joinFieldsSubset;
206 };
207 
470 class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
471 {
472  Q_OBJECT
473 
474  public:
477  {
478  GeneratedLayout = 0,
479  TabLayout = 1,
480  UiFileLayout = 2
481  };
482 
486  enum EditType
487  {
509  };
510 
514  {
515  SuppressDefault = 0, // use the application-wide setting
516  SuppressOn = 1,
517  SuppressOff = 2
518  };
519 
520  struct RangeData
521  {
522  RangeData() { mMin = QVariant( 0 ); mMax = QVariant( 5 ); mStep = QVariant( 1 );}
523  RangeData( QVariant theMin, QVariant theMax, QVariant theStep )
524  : mMin( theMin ), mMax( theMax ), mStep( theStep ) {}
525 
526  QVariant mMin;
527  QVariant mMax;
528  QVariant mStep;
529  };
530 
532  {
534  ValueRelationData( QString layer, QString key, QString value, bool allowNull, bool orderByValue,
535  bool allowMulti = false,
536  QString filterExpression = QString::null )
537  : mLayer( layer )
538  , mKey( key )
539  , mValue( value )
540  , mFilterExpression( filterExpression )
541  , mAllowNull( allowNull )
542  , mOrderByValue( orderByValue )
543  , mAllowMulti( allowMulti )
544  {}
545 
546  QString mLayer;
547  QString mKey;
548  QString mValue;
552  bool mAllowMulti; /* allow selection of multiple keys @added in 1.9 */
553  };
554 
555  struct GroupData
556  {
558  GroupData( QString name, QList<QString> fields )
559  : mName( name ), mFields( fields ) {}
560  QString mName;
561  QList<QString> mFields;
562  };
563 
564  struct TabData
565  {
566  TabData() {}
567  TabData( QString name, QList<QString> fields, QList<GroupData> groups )
568  : mName( name ), mFields( fields ), mGroups( groups ) {}
569  QString mName;
570  QList<QString> mFields;
571  QList<GroupData> mGroups;
572  };
573 
587  QgsVectorLayer( QString path = QString::null, QString baseName = QString::null,
588  QString providerLib = QString::null, bool loadDefaultStyleFlag = true );
589 
591  virtual ~QgsVectorLayer();
592 
594  QString storageType() const;
595 
597  QString capabilitiesString() const;
598 
600  QString dataComment() const;
601 
603  void setDisplayField( QString fldName = "" );
604 
606  const QString displayField() const;
607 
615  void setDisplayExpression( const QString &displayExpression );
616 
625  const QString displayExpression();
626 
628  QgsVectorDataProvider* dataProvider();
629 
633  const QgsVectorDataProvider* dataProvider() const;
634 
636  void setProviderEncoding( const QString& encoding );
637 
639  void setCoordinateSystem();
640 
645  bool addJoin( const QgsVectorJoinInfo& joinInfo );
646 
649  void removeJoin( const QString& joinLayerId );
650 
652  const QList< QgsVectorJoinInfo >& vectorJoins() const;
653 
662  void addExpressionField( const QString& exp, const QgsField& fld );
663 
671  void removeExpressionField( int index );
672 
674  QgsLabel *label();
675 
676  const QgsLabel *label() const;
677 
678  QgsAttributeAction *actions() { return mActions; }
679 
685  int selectedFeatureCount();
686 
695  void select( QgsRectangle & rect, bool addToSelection );
696 
708  void modifySelection( QgsFeatureIds selectIds, QgsFeatureIds deselectIds );
709 
711  void invertSelection();
712 
714  void selectAll();
715 
717  QgsFeatureIds allFeatureIds();
718 
726  void invertSelectionInRectangle( QgsRectangle & rect );
727 
736  QgsFeatureList selectedFeatures();
737 
749  QgsFeatureIterator selectedFeaturesIterator( QgsFeatureRequest request = QgsFeatureRequest() );
750 
757  const QgsFeatureIds &selectedFeaturesIds() const;
758 
766  void setSelectedFeatures( const QgsFeatureIds &ids );
767 
769  QgsRectangle boundingBoxOfSelected();
770 
772  void setDiagramRenderer( QgsDiagramRendererV2* r );
773  const QgsDiagramRendererV2* diagramRenderer() const { return mDiagramRenderer; }
774 
775  void setDiagramLayerSettings( const QgsDiagramLayerSettings& s );
776  const QgsDiagramLayerSettings *diagramLayerSettings() const { return mDiagramLayerSettings; }
777 
780  QgsFeatureRendererV2* rendererV2();
784  void setRendererV2( QgsFeatureRendererV2* r );
785 
787  QGis::GeometryType geometryType() const;
788 
792  bool hasGeometryType() const;
793 
795  QGis::WkbType wkbType() const;
796 
798  QString providerType() const;
799 
803  virtual bool readXml( const QDomNode& layer_node );
804 
808  virtual bool writeXml( QDomNode & layer_node, QDomDocument & doc );
809 
818  virtual void saveStyleToDatabase( QString name, QString description,
819  bool useAsDefault, QString uiFileContent,
820  QString &msgError );
821 
830  virtual int listStylesInDatabase( QStringList &ids, QStringList &names,
831  QStringList &descriptions, QString &msgError );
832 
836  virtual QString getStyleFromDatabase( QString styleId, QString &msgError );
837 
844  virtual QString loadNamedStyle( const QString &theURI, bool &theResultFlag, bool loadFromLocalDb );
845 
850  virtual QString loadNamedStyle( const QString &theURI, bool &theResultFlag );
851 
852  virtual bool applyNamedStyle( QString namedStyle, QString errorMsg );
853 
858  QgsAttributeEditorElement* attributeEditorElementFromDomElement( QDomElement &elem, QObject* parent );
859 
865  bool readSymbology( const QDomNode& node, QString& errorMessage );
866 
873  bool writeSymbology( QDomNode& node, QDomDocument& doc, QString& errorMessage ) const;
874 
875  bool writeSld( QDomNode& node, QDomDocument& doc, QString& errorMessage ) const;
876  bool readSld( const QDomNode& node, QString& errorMessage );
877 
885  virtual long featureCount() const;
886 
893  long featureCount( QgsSymbolV2* symbol );
894 
900  bool countSymbolFeatures( bool showProgress = true );
901 
909  virtual bool setSubsetString( QString subset );
910 
915  virtual QString subsetString();
916 
920  QgsFeatureIterator getFeatures( const QgsFeatureRequest& request = QgsFeatureRequest() );
921 
927  bool addFeature( QgsFeature& f, bool alsoUpdateExtent = true );
928 
936  bool updateFeature( QgsFeature &f );
937 
942  bool insertVertex( double x, double y, QgsFeatureId atFeatureId, int beforeVertex );
943 
948  bool moveVertex( double x, double y, QgsFeatureId atFeatureId, int atVertex );
949 
952  bool deleteVertex( QgsFeatureId atFeatureId, int atVertex );
953 
957  bool deleteSelectedFeatures();
958 
968  int addRing( const QList<QgsPoint>& ring );
969 
980  int addPart( const QList<QgsPoint>& ring );
981 
987  int translateFeature( QgsFeatureId featureId, double dx, double dy );
988 
996  int splitParts( const QList<QgsPoint>& splitLine, bool topologicalEditing = false );
997 
1005  int splitFeatures( const QList<QgsPoint>& splitLine, bool topologicalEditing = false );
1006 
1015  Q_DECL_DEPRECATED int removePolygonIntersections( QgsGeometry* geom, QgsFeatureIds ignoreFeatures = QgsFeatureIds() );
1016 
1022  int addTopologicalPoints( QgsGeometry* geom );
1023 
1031  int addTopologicalPoints( const QgsPoint& p );
1032 
1038  int insertSegmentVerticesForSnap( const QList<QgsSnappingResult>& snapResults );
1039 
1041  void enableLabels( bool on );
1042 
1044  bool hasLabelsEnabled() const;
1045 
1047  virtual bool isEditable() const;
1048 
1052  virtual bool isReadOnly() const;
1053 
1055  virtual bool isModified() const;
1056 
1063  bool snapPoint( QgsPoint& point, double tolerance );
1064 
1072  int snapWithContext( const QgsPoint& startPoint,
1073  double snappingTolerance,
1074  QMultiMap < double, QgsSnappingResult > &snappingResults,
1075  QgsSnapper::SnappingType snap_to );
1076 
1079  virtual void reload();
1080 
1084  virtual QgsMapLayerRenderer* createMapRenderer( QgsRenderContext& rendererContext );
1085 
1089  bool draw( QgsRenderContext& rendererContext );
1090 
1092  void drawLabels( QgsRenderContext& rendererContext );
1093 
1095  QgsRectangle extent();
1096 
1098  const QgsFields &pendingFields() const;
1099 
1101  QgsAttributeList pendingAllAttributesList();
1102 
1106  QgsAttributeList pendingPkAttributesList();
1107 
1109  int pendingFeatureCount();
1110 
1115  bool setReadOnly( bool readonly = true );
1116 
1118  bool startEditing();
1119 
1122  bool changeGeometry( QgsFeatureId fid, QgsGeometry* geom );
1123 
1130  Q_DECL_DEPRECATED bool changeAttributeValue( QgsFeatureId fid, int field, QVariant value, bool emitSignal );
1131 
1142  bool changeAttributeValue( QgsFeatureId fid, int field, const QVariant &newValue, const QVariant &oldValue = QVariant() );
1143 
1147  bool addAttribute( const QgsField &field );
1148 
1153  void addAttributeAlias( int attIndex, QString aliasString );
1154 
1159  void remAttributeAlias( int attIndex );
1160 
1165  void addAttributeEditorWidget( QgsAttributeEditorElement* data );
1166 
1174  const QString editorWidgetV2( int fieldIdx ) const;
1175 
1185  const QString editorWidgetV2( const QString& fieldName ) const;
1186 
1194  const QgsEditorWidgetConfig editorWidgetV2Config( int fieldIdx ) const;
1195 
1205  const QgsEditorWidgetConfig editorWidgetV2Config( const QString& fieldName ) const;
1206 
1211  QList< QgsAttributeEditorElement* > &attributeEditorElements();
1216  void clearAttributeEditorWidgets();
1217 
1222  QString attributeAlias( int attributeIndex ) const;
1223 
1228  QString attributeDisplayName( int attributeIndex ) const;
1229 
1230  const QMap< QString, QString >& attributeAliases() const { return mAttributeAliasMap; }
1231 
1232  const QSet<QString>& excludeAttributesWMS() const { return mExcludeAttributesWMS; }
1233  void setExcludeAttributesWMS( const QSet<QString>& att ) { mExcludeAttributesWMS = att; }
1234 
1235  const QSet<QString>& excludeAttributesWFS() const { return mExcludeAttributesWFS; }
1236  void setExcludeAttributesWFS( const QSet<QString>& att ) { mExcludeAttributesWFS = att; }
1237 
1239  bool deleteAttribute( int attr );
1240 
1248  bool deleteAttributes( QList<int> attrs );
1249 
1251  bool addFeatures( QgsFeatureList features, bool makeSelected = true );
1252 
1254  bool deleteFeature( QgsFeatureId fid );
1255 
1271  bool commitChanges();
1272  const QStringList &commitErrors();
1273 
1277  bool rollBack( bool deleteBuffer = true );
1278 
1284  Q_DECL_DEPRECATED EditType editType( int idx );
1285 
1291  Q_DECL_DEPRECATED void setEditType( int idx, EditType edit );
1292 
1294  EditorLayout editorLayout();
1295 
1297  void setEditorLayout( EditorLayout editorLayout );
1298 
1327  void setEditorWidgetV2( int attrIdx, const QString& widgetType );
1328 
1344  void setEditorWidgetV2Config( int attrIdx, const QgsEditorWidgetConfig& config );
1345 
1351  Q_DECL_DEPRECATED void setCheckedState( int idx, QString checked, QString notChecked );
1352 
1354  QString editForm();
1355 
1357  void setEditForm( QString ui );
1358 
1361  QgsVectorLayer::FeatureFormSuppress featureFormSuppress() const { return mFeatureFormSuppress; }
1362 
1365  void setFeatureFormSuppress( QgsVectorLayer::FeatureFormSuppress s ) { mFeatureFormSuppress = s; }
1366 
1368  QString annotationForm() const { return mAnnotationForm; }
1369 
1371  void setAnnotationForm( const QString& ui );
1372 
1374  QString editFormInit();
1375 
1377  void setEditFormInit( QString function );
1378 
1383  Q_DECL_DEPRECATED QMap<QString, QVariant> valueMap( int idx );
1384 
1390  Q_DECL_DEPRECATED RangeData range( int idx );
1391 
1397  ValueRelationData valueRelation( int idx );
1398 
1405  QList<QgsRelation> referencingRelations( int idx );
1406 
1414  Q_DECL_DEPRECATED QString dateFormat( int idx );
1415 
1423  Q_DECL_DEPRECATED QSize widgetSize( int idx );
1424 
1428  bool fieldEditable( int idx );
1429 
1433  bool labelOnTop( int idx );
1434 
1438  void setFieldEditable( int idx, bool editable );
1439 
1443  void setLabelOnTop( int idx, bool onTop );
1444 
1446  QgsVectorLayerEditBuffer* editBuffer() { return mEditBuffer; }
1447 
1452  void beginEditCommand( QString text );
1453 
1455  void endEditCommand();
1456 
1458  void destroyEditCommand();
1459 
1463  int fieldNameIndex( const QString& fieldName ) const;
1464 
1468  {
1471  NoMarker /* added in version 1.1 */
1472  };
1473 
1476  static void drawVertexMarker( double x, double y, QPainter& p, QgsVectorLayer::VertexMarkerType type, int vertexSize );
1477 
1480  void updateFields();
1481 
1484  void createJoinCaches();
1485 
1491  void uniqueValues( int index, QList<QVariant> &uniqueValues, int limit = -1 );
1492 
1495  QVariant minimumValue( int index );
1496 
1499  QVariant maximumValue( int index );
1500 
1501  /* Set the blending mode used for rendering each feature
1502  * @note added in 2.0
1503  */
1504  void setFeatureBlendMode( const QPainter::CompositionMode &blendMode );
1505  /* Returns the current blending mode for features
1506  * @note added in 2.0
1507  */
1508  QPainter::CompositionMode featureBlendMode() const;
1509 
1510  /* Set the transparency for the vector layer
1511  * @note added in 2.0
1512  */
1513  void setLayerTransparency( int layerTransparency );
1514  /* Returns the current transparency for the vector layer
1515  * @note added in 2.0
1516  */
1517  int layerTransparency() const;
1518 
1519  QString metadata();
1520 
1522  inline QgsGeometryCache* cache() { return mCache; }
1523 
1527  void setSimplifyMethod( const QgsVectorSimplifyMethod& simplifyMethod ) { mSimplifyMethod = simplifyMethod; }
1531  inline const QgsVectorSimplifyMethod& simplifyMethod() const { return mSimplifyMethod; }
1532 
1537  bool simplifyDrawingCanbeApplied( const QgsRenderContext& renderContext, QgsVectorSimplifyMethod::SimplifyHint simplifyHint ) const;
1538 
1539  public slots:
1547  void select( const QgsFeatureId &featureId );
1548 
1556  void select( const QgsFeatureIds& featureIds );
1557 
1565  void deselect( const QgsFeatureId featureId );
1566 
1574  void deselect( const QgsFeatureIds& featureIds );
1575 
1581  void removeSelection();
1582 
1586  virtual void updateExtents();
1587 
1590  void checkJoinLayerRemove( QString theLayerId );
1591 
1592  protected slots:
1593  void invalidateSymbolCountedFlag();
1594 
1595  signals:
1596 
1604  void selectionChanged( const QgsFeatureIds selected, const QgsFeatureIds deselected, const bool clearAndSelect );
1605 
1607  void selectionChanged();
1608 
1610  void layerModified();
1611 
1613  void beforeModifiedCheck() const;
1614 
1616  void editingStarted();
1617 
1619  void editingStopped();
1620 
1622  void beforeCommitChanges();
1623 
1625  void beforeRollBack();
1626 
1635  void attributeAdded( int idx );
1644  void attributeDeleted( int idx );
1645  void featureAdded( QgsFeatureId fid ); // added in 1.7
1646  void featureDeleted( QgsFeatureId fid );
1653  void updatedFields();
1654  void layerDeleted();
1655 
1656  void attributeValueChanged( QgsFeatureId fid, int idx, const QVariant & );
1657  void geometryChanged( QgsFeatureId fid, QgsGeometry &geom ); // added in 1.9
1658 
1661  void committedAttributesDeleted( const QString& layerId, const QgsAttributeList& deletedAttributes );
1662  void committedAttributesAdded( const QString& layerId, const QList<QgsField>& addedAttributes );
1663  void committedFeaturesAdded( const QString& layerId, const QgsFeatureList& addedFeatures );
1664  void committedFeaturesRemoved( const QString& layerId, const QgsFeatureIds& deletedFeatureIds );
1665  void committedAttributeValuesChanges( const QString& layerId, const QgsChangedAttributesMap& changedAttributesValues );
1666  void committedGeometriesChanges( const QString& layerId, const QgsGeometryMap& changedGeometries );
1667 
1668  void saveLayerToProject();
1669 
1673  void labelingFontNotFound( QgsVectorLayer* layer, const QString& fontfamily );
1674 
1676  void featureBlendModeChanged( const QPainter::CompositionMode &blendMode );
1677 
1679  void layerTransparencyChanged( int layerTransparency );
1680 
1686  void editCommandStarted( const QString& text );
1687 
1693  void editCommandEnded();
1694 
1700  void editCommandDestroyed();
1701 
1711  void readCustomSymbology( const QDomElement& element, QString& errorMessage );
1712 
1722  void writeCustomSymbology( QDomElement& element, QDomDocument& doc, QString& errorMessage ) const;
1723 
1724  private slots:
1725  void onRelationsLoaded();
1726  void onJoinedFieldsChanged();
1727 
1728  protected:
1730  void setExtent( const QgsRectangle &rect );
1731 
1732  private: // Private methods
1733 
1735  QgsVectorLayer( const QgsVectorLayer & rhs );
1736 
1738  QgsVectorLayer & operator=( QgsVectorLayer const & rhs );
1739 
1744  bool setDataProvider( QString const & provider );
1745 
1747  QgsFeatureId findFreeId();
1748 
1757  void snapToGeometry( const QgsPoint& startPoint,
1758  QgsFeatureId featureId,
1759  QgsGeometry* geom,
1760  double sqrSnappingTolerance,
1761  QMultiMap<double, QgsSnappingResult>& snappingResults,
1762  QgsSnapper::SnappingType snap_to ) const;
1763 
1765  //void addJoinedAttributes( QgsFeature& f, bool all = false );
1766 
1768  void readSldLabeling( const QDomNode& node );
1769 
1770  private: // Private attributes
1771 
1773  QgsVectorDataProvider *mDataProvider;
1774 
1776  QString mDisplayField;
1777 
1779  QString mDisplayExpression;
1780 
1782  QString mProviderKey;
1783 
1785  QgsAttributeAction* mActions;
1786 
1788  bool mReadOnly;
1789 
1794  QgsFeatureIds mSelectedFeatureIds;
1795 
1797  QgsFields mUpdatedFields;
1798 
1800  QMap< QString, QString > mAttributeAliasMap;
1801 
1803  QList< QgsAttributeEditorElement* > mAttributeEditorElements;
1804 
1806  QSet<QString> mExcludeAttributesWMS;
1808  QSet<QString> mExcludeAttributesWFS;
1809 
1811  QList< TabData > mTabs;
1812 
1814  int mWkbType;
1815 
1817  QgsFeatureRendererV2 *mRendererV2;
1818 
1820  QgsVectorSimplifyMethod mSimplifyMethod;
1821 
1823  QgsLabel *mLabel;
1824 
1826  bool mLabelOn;
1827 
1829  bool mLabelFontNotFoundNotified;
1830 
1832  QPainter::CompositionMode mFeatureBlendMode;
1833 
1835  int mLayerTransparency;
1836 
1838  QgsVectorLayer::VertexMarkerType mCurrentVertexMarkerType;
1839 
1841  int mCurrentVertexMarkerSize;
1842 
1844  bool mVertexMarkerOnlyForSelection;
1845 
1846  QStringList mCommitErrors;
1847 
1848  QMap< QString, bool> mFieldEditables;
1849  QMap< QString, bool> mLabelOnTop;
1850 
1851  QMap<QString, QString> mEditorWidgetV2Types;
1852  QMap<QString, QgsEditorWidgetConfig > mEditorWidgetV2Configs;
1853 
1855  EditorLayout mEditorLayout;
1856 
1857  QString mEditForm, mEditFormInit;
1858 
1861  QgsVectorLayer::FeatureFormSuppress mFeatureFormSuppress;
1862 
1863  //annotation form for this layer
1864  QString mAnnotationForm;
1865 
1867  QgsGeometryCache* mCache;
1868 
1870  QgsVectorLayerEditBuffer* mEditBuffer;
1872 
1873  //stores information about joined layers
1874  QgsVectorLayerJoinBuffer* mJoinBuffer;
1875 
1877  QgsExpressionFieldBuffer* mExpressionFieldBuffer;
1878 
1879  //diagram rendering object. 0 if diagram drawing is disabled
1880  QgsDiagramRendererV2* mDiagramRenderer;
1881 
1882  //stores infos about diagram placement (placement type, priority, position distance)
1883  QgsDiagramLayerSettings *mDiagramLayerSettings;
1884 
1885  bool mValidExtent;
1886  bool mLazyExtent;
1887 
1888  // Features in renderer classes counted
1889  bool mSymbolFeatureCounted;
1890 
1891  // Feature counts for each renderer symbol
1892  QMap<QgsSymbolV2*, long> mSymbolFeatureCountMap;
1893 
1895 };
1896 
1897 #endif
QString mName
Definition: qgsvectorlayer.h:93
Definition: qgsvectorlayer.h:531
virtual bool isEditable() const
True if the layer can be edited.
Definition: qgsmaplayer.cpp:1391
Wrapper for iterator of features from vector data provider or vector layer.
Definition: qgsfeatureiterator.h:139
QString annotationForm() const
get annotation form (added in 1.5)
Definition: qgsvectorlayer.h:1368
QMap< QgsFeatureId, QgsGeometry > QgsGeometryMap
Definition: qgsfeature.h:323
static unsigned index
Definition: mersenne-twister.cpp:36
Definition: qgsvectorlayer.h:496
A rectangle specified with double values.
Definition: qgsrectangle.h:35
Base class for all map layer types.
Definition: qgsmaplayer.h:48
QString mName
Definition: qgsvectorlayer.h:569
Definition: qgsvectorlayer.h:75
QString joinFieldName
Join field in the source layer.
Definition: qgsvectorlayer.h:174
const QSet< QString > & excludeAttributesWMS() const
Definition: qgsvectorlayer.h:1232
void setExcludeAttributesWFS(const QSet< QString > &att)
Definition: qgsvectorlayer.h:1236
Definition: qgsvectorlayer.h:68
virtual QString metadata()
Obtain Metadata for this layer.
Definition: qgsmaplayer.cpp:1435
QString targetFieldName
Join field in the target layer.
Definition: qgsvectorlayer.h:170
virtual void drawLabels(QgsRenderContext &rendererContext)
Draw labels.
Definition: qgsmaplayer.cpp:156
Definition: qgsvectorlayer.h:564
phote widget
Definition: qgsvectorlayer.h:505
virtual bool isGroupBox() const
Definition: qgsvectorlayer.h:110
RangeData(QVariant theMin, QVariant theMax, QVariant theStep)
Definition: qgsvectorlayer.h:523
QgsAttributeAction * actions()
Definition: qgsvectorlayer.h:678
ValueRelationData()
Definition: qgsvectorlayer.h:533
QSet< QgsFeatureId > QgsFeatureIds
Definition: qgsfeature.h:325
QList< QgsFeature > QgsFeatureList
Definition: qgsfeature.h:330
EditorLayout
The different types to layout the attribute editor.
Definition: qgsvectorlayer.h:476
Manages an editor widget Widget and wrapper share the same parent.
Definition: qgseditorwidgetwrapper.h:41
Definition: qgsvectorlayer.h:1469
void setExcludeAttributesWMS(const QSet< QString > &att)
Definition: qgsvectorlayer.h:1233
int joinFieldIndex
Join field index in the source layer.
Definition: qgsvectorlayer.h:185
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.
Definition: qgsattributeaction.h:106
const QgsVectorSimplifyMethod & simplifyMethod() const
Returns the simplification settings for fast rendering of features.
Definition: qgsvectorlayer.h:1531
bool mOrderByValue
Definition: qgsvectorlayer.h:551
virtual void reload()
Synchronises with changes in the datasource.
Definition: qgsmaplayer.h:132
webview widget
Definition: qgsvectorlayer.h:506
QgsVectorLayer::FeatureFormSuppress featureFormSuppress() const
Type of feature form pop-up suppression after feature creation (overrides app setting) ...
Definition: qgsvectorlayer.h:1361
TabData()
Definition: qgsvectorlayer.h:566
FeatureFormSuppress
Types of feature form suppression after feature creation.
Definition: qgsvectorlayer.h:513
QVariant mStep
Definition: qgsvectorlayer.h:528
SimplifyHint
Simplification flags for fast rendering of features.
Definition: qgsvectorsimplifymethod.h:35
multiline edit
Definition: qgsvectorlayer.h:500
Definition: qgsvectorlayer.h:76
QVariant mMax
Definition: qgsvectorlayer.h:527
Container of fields for a vector layer.
Definition: qgsfield.h:172
Definition: qgsgeometry.h:69
Definition: qgsvectorlayer.h:120
GeometryType
Definition: qgis.h:155
virtual ~QgsAttributeEditorElement()
Definition: qgsvectorlayer.h:84
bool mAllowMulti
Definition: qgsvectorlayer.h:552
Definition: qgsvectorlayer.h:136
virtual QgsMapLayerRenderer * createMapRenderer(QgsRenderContext &rendererContext)
Return new instance of QgsMapLayerRenderer that will be used for rendering of given context...
Definition: qgsmaplayer.h:137
WkbType
Used for symbology operations.
Definition: qgis.h:53
const QgsRelation & relation() const
Definition: qgsvectorlayer.h:151
Definition: qgssinglesymbolrendererv2.h:24
bool memoryCache
True if the join is cached in virtual memory.
Definition: qgsvectorlayer.h:176
int targetFieldIndex
Join field index in the target layer.
Definition: qgsvectorlayer.h:183
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
Definition: qgsfeature.h:113
Definition: qgsvectorlayer.h:520
const QgsDiagramLayerSettings * diagramLayerSettings() const
Definition: qgsvectorlayer.h:776
Definition: qgsvectorlayer.h:493
QString mValue
Definition: qgsvectorlayer.h:548
EditType
Definition: qgsvectorlayer.h:486
QgsAttributeEditorField(QString name, int idx, QObject *parent)
Definition: qgsvectorlayer.h:123
int idx() const
Definition: qgsvectorlayer.h:129
TabData(QString name, QList< QString > fields, QList< GroupData > groups)
Definition: qgsvectorlayer.h:567
color
Definition: qgsvectorlayer.h:507
virtual bool writeSymbology(QDomNode &node, QDomDocument &doc, QString &errorMessage) const =0
Write the symbology for the layer into the docment provided.
QgsGeometryCache * cache()
Definition: qgsvectorlayer.h:1522
QgsAttributeEditorRelation(QString name, const QString &relationId, QObject *parent)
Definition: qgsvectorlayer.h:139
Returns diagram settings for a feature.
Definition: qgsdiagramrendererv2.h:155
QString name() const
Definition: qgsvectorlayer.h:86
Manages joined fields for a vector layer.
Definition: qgsvectorlayerjoinbuffer.h:32
Definition: qgsvectorlayer.h:555
virtual bool draw(QgsRenderContext &rendererContext)
This is the method that does the actual work of drawing the layer onto a paint device.
Definition: qgsmaplayer.cpp:150
Perform transforms between map coordinates and device coordinates.
Definition: qgsmaptopixel.h:33
SnappingType
Snap to vertex, to segment or both.
Definition: qgssnapper.h:66
QgsVectorLayerEditBuffer * editBuffer()
Buffer with uncommitted editing operations. Only valid after editing has been turned on...
Definition: qgsvectorlayer.h:1446
Definition: qgsvectorlayer.h:494
void setJoinFieldNamesSubset(QStringList *fieldNamesSubset)
Set subset of fields to be used from joined layer.
Definition: qgsvectorlayer.h:198
bool operator==(const QgsVectorJoinInfo &other) const
Definition: qgsvectorlayer.h:187
value map from an table
Definition: qgsvectorlayer.h:503
QVariant mMin
Definition: qgsvectorlayer.h:526
virtual bool writeXml(QDomNode &layer_node, QDomDocument &document)
called by writeLayerXML(), used by children to write state specific to them to project files...
Definition: qgsmaplayer.cpp:685
bool mAllowNull
Definition: qgsvectorlayer.h:550
const QSet< QString > & excludeAttributesWFS() const
Definition: qgsvectorlayer.h:1235
VertexMarkerType
Editing vertex markers.
Definition: qgsvectorlayer.h:1467
GroupData()
Definition: qgsvectorlayer.h:557
virtual void setExtent(const QgsRectangle &rect)
Set the extent.
Definition: qgsmaplayer.cpp:1440
The attribute value should not be changed in the attribute form.
Definition: qgsvectorlayer.h:498
~QgsAttributeEditorRelation()
Definition: qgsvectorlayer.h:148
This class wraps a request for features to a vector layer (or directly its vector data provider)...
Definition: qgsfeaturerequest.h:58
Definition: qgsvectorlayer.h:495
QList< int > QgsAttributeList
Definition: qgsfeaturerequest.h:26
AttributeEditorType type() const
Definition: qgsvectorlayer.h:87
QSharedPointer< QStringList > joinFieldsSubset
Subset of fields to use from joined layer.
Definition: qgsvectorlayer.h:205
QString mLayer
Definition: qgsvectorlayer.h:546
~QgsAttributeEditorField()
Definition: qgsvectorlayer.h:126
Encapsulate a field in an attribute table or data source.
Definition: qgsfield.h:33
const QMap< QString, QString > & attributeAliases() const
Definition: qgsvectorlayer.h:1230
Definition: qgssymbolv2.h:43
const QgsDiagramRendererV2 * diagramRenderer() const
Definition: qgsvectorlayer.h:773
A class to represent a point geometry.
Definition: qgspoint.h:63
virtual bool readSld(const QDomNode &node, QString &errorMessage)
Definition: qgsmaplayer.h:352
QList< QgsAttributeEditorElement * > children() const
Definition: qgsvectorlayer.h:111
QString mName
Definition: qgsvectorlayer.h:560
Partial snapshot of vector layer's state (only the members necessary for access to features) ...
Definition: qgsvectorlayerfeatureiterator.h:33
QList< QString > mFields
Definition: qgsvectorlayer.h:561
A class to render labels.
Definition: qgslabel.h:51
dial range
Definition: qgsvectorlayer.h:502
Definition: qgsdiagramrendererv2.h:39
Definition: qgsvectorlayer.h:497
Definition: qgsvectorlayer.h:492
QString mKey
Definition: qgsvectorlayer.h:547
~QgsAttributeEditorContainer()
Definition: qgsvectorlayer.h:105
Definition: qgsgeometrycache.h:10
modularized edit widgets
Definition: qgsvectorlayer.h:508
Definition: qgsrelation.h:28
This class contains information how to simplify geometries fetched from a vector layer.
Definition: qgsvectorsimplifymethod.h:24
Contains information about the context of a rendering operation.
Definition: qgsrendercontext.h:39
ValueRelationData(QString layer, QString key, QString value, bool allowNull, bool orderByValue, bool allowMulti=false, QString filterExpression=QString::null)
Definition: qgsvectorlayer.h:534
Buffers information about expression fields for a vector layer.
Definition: qgsexpressionfieldbuffer.h:32
virtual QDomElement toDomElement(QDomDocument &doc) const =0
QHash< QString, QgsAttributes > cachedAttributes
Cache for joined attributes to provide fast lookup (size is 0 if no memory caching) ...
Definition: qgsvectorlayer.h:180
Definition: qgsvectorlayereditbuffer.h:33
QMap< QgsFeatureId, QgsAttributeMap > QgsChangedAttributesMap
Definition: qgsfeature.h:320
Definition: qgsvectorlayer.h:77
Definition: qgsvectorlayer.h:488
The attribute value should not be shown in the attribute form.
Definition: qgsvectorlayer.h:499
GroupData(QString name, QList< QString > fields)
Definition: qgsvectorlayer.h:558
Definition: qgsvectorlayer.h:167
virtual void setIsGroupBox(bool isGroupBox)
Definition: qgsvectorlayer.h:109
This class manages a set of relations between layers.
Definition: qgsrelationmanager.h:32
virtual bool readXml(const QDomNode &layer_node)
called by readLayerXML(), used by children to read state specific to them from project files...
Definition: qgsmaplayer.cpp:431
QString mFilterExpression
Definition: qgsvectorlayer.h:549
uuid generator - readonly and automatically intialized
Definition: qgsvectorlayer.h:504
QgsAttributeEditorRelation(QString name, const QgsRelation &relation, QObject *parent)
Definition: qgsvectorlayer.h:143
Definition: qgsvectorlayer.h:97
Class for doing transforms between two map coordinate systems.
Definition: qgscoordinatetransform.h:52
void setSimplifyMethod(const QgsVectorSimplifyMethod &simplifyMethod)
Set the simplification settings for fast rendering of features.
Definition: qgsvectorlayer.h:1527
Definition: qgsvectorlayer.h:490
QMap< QString, QVariant > QgsEditorWidgetConfig
Holds a set of configuration parameters for a editor widget wrapper.
Definition: qgseditorwidgetconfig.h:19
Definition: qgsvectorlayer.h:1470
qint64 QgsFeatureId
Definition: qgsfeature.h:30
Base class for utility classes that encapsulate information necessary for rendering of map layers...
Definition: qgsmaplayerrenderer.h:43
void setFeatureFormSuppress(QgsVectorLayer::FeatureFormSuppress s)
Set type of feature form pop-up suppression after feature creation (overrides app setting) ...
Definition: qgsvectorlayer.h:1365
QStringList * joinFieldNamesSubset() const
Get subset of fields to be used from joined layer.
Definition: qgsvectorlayer.h:201
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 ...
Definition: qgsmaplayer.cpp:926
QList< QString > mFields
Definition: qgsvectorlayer.h:570
Definition: qgsrendererv2.h:72
QgsAttributeEditorElement(AttributeEditorType type, QString name, QObject *parent=NULL)
Definition: qgsvectorlayer.h:81
QSet< int > QgsAttributeIds
Definition: qgsvectorlayer.h:65
QgsAttributeEditorContainer(QString name, QObject *parent)
Definition: qgsvectorlayer.h:100
AttributeEditorType
Definition: qgsvectorlayer.h:73
This is the base class for vector data providers.
Definition: qgsvectordataprovider.h:48
QList< int > QgsAttributeList
Definition: qgsvectorlayer.h:62
virtual QgsRectangle extent()
Return the extent of the layer.
Definition: qgsmaplayer.cpp:132
Represents a vector layer which manages a vector based data sets.
Definition: qgsvectorlayer.h:470
RangeData()
Definition: qgsvectorlayer.h:522
QString joinLayerId
Source layer.
Definition: qgsvectorlayer.h:172
calendar widget
Definition: qgsvectorlayer.h:501
Definition: qgsvectorlayer.h:489
AttributeEditorType mType
Definition: qgsvectorlayer.h:92
Abstract base class for simplify geometries using a specific algorithm.
Definition: qgsgeometrysimplifier.h:25
Definition: qgsvectorlayer.h:491
QList< GroupData > mGroups
Definition: qgsvectorlayer.h:571