Logo Search packages:      
Sourcecode: qgis version File versions

QgsVectorLayer Class Reference

#include <qgsvectorlayer.h>

Inheritance diagram for QgsVectorLayer:

QgsMapLayer

List of all members.


Detailed Description

Vector layer backed by a data source provider.

Definition at line 49 of file qgsvectorlayer.h.


Public Types

enum  LAYERS { VECTOR, RASTER, DATABASE }
 Layers enum defining the types of layers that can be added to a map.
enum  SHAPETYPE { Point, Line, Polygon }

Public Slots

bool addFeature (QgsFeature *f)
virtual QgsRect bBoxOfSelected ()
QPopupMenu * contextMenu ()
bool deleteSelectedFeatures ()
virtual long featureCount () const
virtual int fieldCount () const
virtual std::vector< QgsField >
const & 
fields () const
QString getDefaultValue (const QString &attr, QgsFeature *f)
virtual QgsFeaturegetFirstFeature (bool fetchAttributes=false) const
virtual bool getNextFeature (QgsFeature &feature, bool fetchAttributes=false) const
virtual QgsFeaturegetNextFeature (bool fetchAttributes=false) const
void inOverview (bool)
void invalidateTableDisplay ()
virtual bool isEditable () const
virtual bool isModified () const
bool isValid ()
 Return the validity of the layer.
void keyPressed (QKeyEvent *e)
 keyPress event so we can check if cancel was pressed
bool labelOn (void)
int maximumScale ()
float maxScale ()
int minimumScale ()
float minScale ()
QgsDlgVectorLayerProperties * propertiesDialog ()
QString providerType ()
 Return the provider type for this layer.
bool readXML_ (QDomNode &layer_node)
void removeSelection ()
QgsRendererrenderer ()
QDialog * rendererDialog ()
virtual void saveAsShapefile ()
 Save as shapefile.
bool scaleBasedVisibility ()
bool scaleDependentRender ()
void select (int number)
void setLabelOn (bool on)
void setLayerProperties (QgsDlgVectorLayerProperties *properties)
void setMaxScale (float theMaxScale)
void setMinScale (float theMinScale)
void setRenderer (QgsRenderer *r)
void setRendererDialog (QDialog *dialog)
void setScaleBasedVisibility (bool theVisibilityFlag)
virtual void setSubsetString (QString subset)
void setVisible (bool vis)
 set visibility
virtual void showLayerProperties ()
virtual QString subsetString ()
void triggerRepaint ()
virtual void updateExtents ()
virtual long updateFeatureCount () const
void updateItemPixmap ()
void updateOverviewPopupItem ()
QGis::VectorType vectorType ()
bool writeXML_ (QDomNode &layer_node, QDomDocument &doc)

Signals

void recalculateExtents ()
virtual void repaintRequested ()
void setProgress (int theProgress, int theTotalSteps)
 emit a signal to notify of a progress event
void setStatus (QString theStatusQString)
 emit a signal to be caught by gisapp and display a msg on status bar
void visibilityChanged (void)
void showInOverview (QgsMapLayer *maplayer, bool)

Public Member Functions

QgsAttributeActionactions ()
virtual QgsRect calculateExtent ()
const QString displayField () const
 Returns the primary display field name used in the identify results dialog.
virtual void draw (QPainter *, QgsRect *, int)
const QgsRect extent ()
virtual const int & featureType ()
QgsVectorDataProvidergetDataProvider ()
QString const & getLayerID () const
void identify (QgsRect *)
 Identify feature found within the search rectangle.
void initContextMenu (QgisApp *app)
 Initialize the context menu.
QgsLabellabel ()
virtual const QString & labelField ()
QgsLegendItemlegendItem ()
virtual QPixmap * legendPixmap ()
QString const & name () const
 QgsVectorLayer (QString baseName=0, QString path=0, QString providerLib=0)
 Constructor.
bool readXML (QDomNode &layer_node)
void select (QgsRect *rect, bool lock)
 Select features found within the search rectangle.
void setDataProvider (QString const &provider)
void setDisplayField (QString fldName=0)
 Set the primary display field to be used in the identify results dialog.
virtual void setFeatureType (const int &_newVal)
virtual void setLabelField (const QString &_newVal)
void setLayerName (const QString &name)
void setLegendItem (QgsLegendItem *li)
bool showInOverviewStatus ()
QString const & source () const
 Returns the source for the layer.
QString const & sourceName () const
void table ()
 Display the attribute table.
const int type ()
bool visible ()
 Visibility of the layer.
bool writeXML (QDomNode &layer_node, QDomDocument &document)
virtual ~QgsVectorLayer ()
 Destructor.

Public Attributes

QString m_labelField

Protected Slots

void drawFeature (QPainter *p, QgsFeature *fet, QgsCoordinateTransform *cXf, QPicture *marker, double markerScaleFactor)
void startEditing ()
void stopEditing ()

Protected Member Functions

bool commitChanges ()
int findFreeId ()
bool rollBack ()

Protected Attributes

QString dataSource
 data source description string, varies by layer type
int geometryType
 Geometry type as defined in enum WKBTYPE (qgis.h).
QString internalName
QgsRect layerExtent
 Extent of the layer.
QString layerName
QgsLegendItemm_legendItem
QPixmap m_legendPixmap
QgsDlgVectorLayerProperties * m_propertiesDialog
QgsRendererm_renderer
QDialog * m_rendererDialog
std::list< QgsFeature * > mAddedFeatures
std::set< int > mDeleted
bool mDrawingCancelled
QPixmap mEditablePixmap
QPixmap mInOverviewPixmap
 A little pixmap to show if this layer is represented in overview or now.
QgsLabelmLabel
bool mLabelOn
std::set< int > mSelected
bool mShowInOverview
int mShowInOverviewItemId
 checkable item id in popmenu that sets overview status
QLabel * myPopupLabel
 label for popMenu
QPopupMenu * popMenu
 context menu
QColor selectionColor
QgsAttributeTableDisplaytabledisplay

Private Types

enum  ENDIAN { NDR = 1, XDR = 0 }
enum  WKBTYPE {
  WKBPoint = 1, WKBLineString, WKBPolygon, WKBMultiPoint,
  WKBMultiLineString, WKBMultiPolygon
}

Private Member Functions

void draw (QPainter *p, QgsRect *viewExtent, QgsCoordinateTransform *cXf, QPaintDevice *dst)
 Draws the layer using coordinate transformation.
void drawLabels (QPainter *p, QgsRect *viewExtent, QgsCoordinateTransform *cXf, QPaintDevice *dst)
 Draws the layer labels using coordinate transformation.
int endian ()
void initContextMenu_ (QgisApp *)
QgsVectorLayeroperator= (QgsVectorLayer const &rhs)
 vector layers are not copyable
 QgsVectorLayer (QgsVectorLayer const &rhs)
 vector layers are not copyable

Private Attributes

QgsVectorDataProviderdataProvider
 Pointer to data provider derived from the abastract base class QgsDataProvider.
QString fieldIndex
 index of the primary label field
QgsIdentifyResultsir
 Pointer to the identify results dialog.
QgsAttributeAction mActions
bool mEditable
int mMaximumScale
 Maximum scale factor at which the layer is displayed.
int mMinimumScale
 Minimum scale factor at which the layer is displayed.
bool mModified
bool mScaleDependentRender
 Flag to indicate if scale dependent rendering is in effect.
QLibrary * myLib
QString providerKey
 Data provider key.
bool registered
int updateThreshold
 Update threshold for drawing features as they are read. A value of zero indicates.
bool valid
 Flag to indicate if this is a valid layer.

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index