21 #ifndef QGSRASTERLAYER_H
22 #define QGSRASTERLAYER_H
200 const QString & baseName = QString::null,
201 bool loadDefaultStyleFlag =
true );
205 const QString & baseName,
206 const QString & providerKey,
207 bool loadDefaultStyleFlag =
true );
236 static bool isValidRasterFileName(
const QString & theFileNameQString, QString &retError );
237 static bool isValidRasterFileName(
const QString & theFileNameQString );
240 static QDateTime lastModified(
const QString & name );
243 void setDataProvider(
const QString & provider );
268 int bandCount()
const;
271 const QString bandName(
int theBandNoInt );
289 void draw( QPainter * theQPainter,
301 QList< QPair< QString, QColor > > legendSymbologyItems()
const;
307 QPixmap paletteAsPixmap(
int theBandNumber = 1 );
312 QString providerType()
const;
315 double rasterUnitsPerPixelX();
316 double rasterUnitsPerPixelY();
329 int theSampleSize = SAMPLE_SIZE,
330 bool theGenerateLookupTableFlag =
true );
333 void setDefaultContrastEnhancement();
336 void setDrawingStyle(
const QString & theDrawingStyleQString );
339 void showProgress(
int theValue );
345 QPixmap previewAsPixmap( QSize
size, QColor bgColor = Qt::white );
348 void triggerRepaint();
364 virtual QDateTime
timestamp()
const {
return mDataProvider->timestamp() ; }
367 void showStatusMessage(
const QString & theMessage );
370 void updateProgress(
int,
int );
373 void onProgress(
int,
double, QString );
377 void progressUpdate(
int theValue );
386 void rendererChanged();
390 bool readSymbology(
const QDomNode& node, QString& errorMessage );
393 bool readXml(
const QDomNode& layer_node );
396 bool writeSymbology( QDomNode&, QDomDocument& doc, QString& errorMessage )
const;
399 bool writeXml( QDomNode & layer_node, QDomDocument & doc );
406 void closeDataProvider();
virtual QStringList subLayers() const
Returns the sublayers of this layer (Useful for providers that manage their own layers, such as WMS)
A rectangle specified with double values.
Base class for all map layer types.
Base class for processing modules.
virtual QString metadata()
Obtain Metadata for this layer.
DrawingStyle
This enumerator describes the different kinds of drawing we can do.
This class provides qgis with the ability to render raster datasets onto the mapcanvas.
virtual QString lastError()
If an operation returns 0 (e.g.
QgsRasterPipe * pipe()
Get raster pipe.
virtual bool readSymbology(const QDomNode &node, QString &errorMessage)=0
Read the symbology for the current layer from the Dom node supplied.
virtual void reload()
Synchronises with changes in the datasource.
Resample filter pipe for rasters.
static const double SAMPLE_SIZE
Default sample size (number of pixels) for estimated statistics/histogram calculation.
QString mError
[ data provider interface ]The error message associated with the last error
virtual bool writeSymbology(QDomNode &node, QDomDocument &doc, QString &errorMessage) const =0
Write the symbology for the layer into the docment provided.
virtual bool draw(QgsRenderContext &rendererContext)
This is the method that does the actual work of drawing the layer onto a paint device.
ColorShadingAlgorithm
This enumerator describes the types of shading that can be used.
Perform transforms between map coordinates and device coordinates.
virtual bool writeXml(QDomNode &layer_node, QDomDocument &document)
called by writeLayerXML(), used by children to write state specific to them to project files...
QgsRasterRenderer * renderer() const
QgsRasterViewPort mLastViewPort
static const double CUMULATIVE_CUT_UPPER
Default cumulative cut upper limit.
ContrastEnhancementLimits
Contrast enhancement limits.
virtual void setSubLayerVisibility(QString name, bool vis)
Set the visibility of the given sublayer name.
virtual QString lastErrorTitle()
If an operation returns 0 (e.g.
QgsRasterResampleFilter * resampleFilter() const
Set raster resample filter.
LayerType rasterType()
Accessor for raster layer type (which is a read only property)
QgsRasterDataProvider * mDataProvider
Pointer to data provider.
ContrastEnhancementAlgorithm
This enumerator describes the types of contrast enhancement algorithms that can be used...
QString mProviderKey
[ data provider interface ] Data provider key
Contains information about the context of a rendering operation.
QDateTime mLastModified
[ data provider interface ] Timestamp, the last modified time of the data source when the layer was c...
virtual QDateTime timestamp() const
Time stamp of data source in the moment when data/metadata were loaded by provider.
virtual bool readXml(const QDomNode &layer_node)
called by readLayerXML(), used by children to read state specific to them from project files...
Brightness/contrast filter pipe for rasters.
Color and saturation filter pipe for rasters.
static const double CUMULATIVE_CUT_LOWER
Default cumulative cut lower limit.
QgsHueSaturationFilter * hueSaturationFilter() const
const QString QSTRING_NOT_SET
Constant defining flag for XML and a constant that signals property not used.
void dataChanged()
data of layer changed added in 1.5
This class provides details of the viewable area that a raster will be rendered into.
LayerType
This enumerator describes the type of raster layer.
QString mErrorCaption
[ data provider interface ] The error caption associated with the last error
virtual void setLayerOrder(const QStringList &layers)
Reorders the previously selected sublayers of this layer from bottom to top (Useful for providers tha...
Raster renderer pipe that applies colors to a raster.
const QString TRSTRING_NOT_SET
QgsBrightnessContrastFilter * brightnessFilter() const
Base class for raster data providers.