QGIS API Documentation
2.2.0-Valmiera
|
Base class for processing modules. More...
#include <qgsrasterpipe.h>
Public Types | |
enum | Role { UnknownRole = 0, ProviderRole = 1, RendererRole = 2, BrightnessRole = 3, ResamplerRole = 4, ProjectorRole = 5, NullerRole = 6, HueSaturationRole = 7 } |
Public Member Functions | |
QgsRasterPipe () | |
QgsRasterPipe (const QgsRasterPipe &thePipe) | |
~QgsRasterPipe () | |
bool | insert (int idx, QgsRasterInterface *theInterface) |
Try to insert interface at specified index and connect if connection would fail, the interface is not inserted and false is returned. | |
bool | replace (int idx, QgsRasterInterface *theInterface) |
Try to replace interface at specified index and connect if connection would fail, the interface is not inserted and false is returned. | |
bool | set (QgsRasterInterface *theInterface) |
Insert a new known interface in default place or replace interface of the same role if it already exists. | |
bool | remove (int idx) |
Remove and delete interface at given index if possible. | |
bool | remove (QgsRasterInterface *theInterface) |
Remove and delete interface from pipe if possible. | |
int | size () const |
QgsRasterInterface * | at (int idx) const |
QgsRasterInterface * | last () const |
bool | setOn (int idx, bool on) |
Set interface at index on/off Returns true on success. | |
bool | canSetOn (int idx, bool on) |
Test if interface at index may be swithed on/off. | |
QgsRasterDataProvider * | provider () const |
QgsRasterRenderer * | renderer () const |
QgsRasterResampleFilter * | resampleFilter () const |
QgsBrightnessContrastFilter * | brightnessFilter () const |
QgsHueSaturationFilter * | hueSaturationFilter () const |
QgsRasterProjector * | projector () const |
QgsRasterNuller * | nuller () const |
Private Member Functions | |
Role | interfaceRole (QgsRasterInterface *iface) const |
Get known parent type_info of interface parent. | |
void | setRole (QgsRasterInterface *theInterface, int idx) |
void | unsetRole (QgsRasterInterface *theInterface) |
bool | checkBounds (int idx) const |
QgsRasterInterface * | interface (Role role) const |
Get known interface by role. | |
bool | connect (QVector< QgsRasterInterface * > theInterfaces) |
Try to connect interfaces in pipe and to the provider at beginning. |
Private Attributes | |
QVector< QgsRasterInterface * > | mInterfaces |
QMap< Role, int > | mRoleMap |
Base class for processing modules.
Definition at line 41 of file qgsrasterpipe.h.
enum QgsRasterPipe::Role |
UnknownRole | |
ProviderRole | |
RendererRole | |
BrightnessRole | |
ResamplerRole | |
ProjectorRole | |
NullerRole | |
HueSaturationRole |
Definition at line 45 of file qgsrasterpipe.h.
QgsRasterPipe::QgsRasterPipe | ( | ) |
Definition at line 25 of file qgsrasterpipe.cpp.
QgsRasterPipe::QgsRasterPipe | ( | const QgsRasterPipe & | thePipe | ) |
Definition at line 29 of file qgsrasterpipe.cpp.
References QgsRasterInterface::clone(), interface(), interfaceRole(), mInterfaces, mRoleMap, QgsDebugMsg, size(), and UnknownRole.
QgsRasterPipe::~QgsRasterPipe | ( | ) |
Definition at line 50 of file qgsrasterpipe.cpp.
References interface(), and mInterfaces.
|
inline |
Definition at line 85 of file qgsrasterpipe.h.
QgsBrightnessContrastFilter * QgsRasterPipe::brightnessFilter | ( | ) | const |
Definition at line 239 of file qgsrasterpipe.cpp.
References BrightnessRole, and interface().
bool QgsRasterPipe::canSetOn | ( | int | idx, |
bool | on | ||
) |
Test if interface at index may be swithed on/off.
Definition at line 292 of file qgsrasterpipe.cpp.
References checkBounds(), connect(), mInterfaces, and QgsDebugMsg.
|
private |
Definition at line 331 of file qgsrasterpipe.cpp.
References mInterfaces.
Referenced by canSetOn(), remove(), replace(), and setOn().
|
private |
Try to connect interfaces in pipe and to the provider at beginning.
Returns true if connected or false if connection failed
Definition at line 58 of file qgsrasterpipe.cpp.
References QgsDebugMsg.
Referenced by canSetOn(), insert(), remove(), replace(), and setOn().
QgsHueSaturationFilter * QgsRasterPipe::hueSaturationFilter | ( | ) | const |
Definition at line 244 of file qgsrasterpipe.cpp.
References HueSaturationRole, and interface().
bool QgsRasterPipe::insert | ( | int | idx, |
QgsRasterInterface * | theInterface | ||
) |
Try to insert interface at specified index and connect if connection would fail, the interface is not inserted and false is returned.
Definition at line 72 of file qgsrasterpipe.cpp.
References connect(), mInterfaces, QgsDebugMsg, and setRole().
Referenced by set().
|
private |
Get known interface by role.
Definition at line 214 of file qgsrasterpipe.cpp.
References mInterfaces, mRoleMap, and QgsDebugMsg.
Referenced by brightnessFilter(), hueSaturationFilter(), nuller(), projector(), provider(), QgsRasterPipe(), renderer(), resampleFilter(), and ~QgsRasterPipe().
|
private |
Get known parent type_info of interface parent.
Definition at line 124 of file qgsrasterpipe.cpp.
References BrightnessRole, HueSaturationRole, NullerRole, ProjectorRole, ProviderRole, QgsDebugMsg, RendererRole, ResamplerRole, and UnknownRole.
Referenced by QgsRasterPipe(), set(), setRole(), and unsetRole().
|
inline |
Definition at line 86 of file qgsrasterpipe.h.
Referenced by QgsRasterLayer::draw(), QgsRasterFileWriter::writeDataRaster(), and QgsRasterFileWriter::writeRaster().
QgsRasterNuller * QgsRasterPipe::nuller | ( | ) | const |
Definition at line 254 of file qgsrasterpipe.cpp.
References interface(), and NullerRole.
Referenced by QgsRasterFileWriter::writeDataRaster().
QgsRasterProjector * QgsRasterPipe::projector | ( | ) | const |
Definition at line 249 of file qgsrasterpipe.cpp.
References interface(), and ProjectorRole.
Referenced by QgsRasterLayer::draw(), and QgsRasterFileWriter::writeDataRaster().
QgsRasterDataProvider * QgsRasterPipe::provider | ( | ) | const |
Definition at line 224 of file qgsrasterpipe.cpp.
References interface(), and ProviderRole.
bool QgsRasterPipe::remove | ( | int | idx | ) |
Remove and delete interface at given index if possible.
Definition at line 259 of file qgsrasterpipe.cpp.
References checkBounds(), connect(), mInterfaces, QgsDebugMsg, and unsetRole().
Referenced by QgsRasterLayer::closeDataProvider(), and QgsRasterLayer::setDataProvider().
bool QgsRasterPipe::remove | ( | QgsRasterInterface * | theInterface | ) |
Remove and delete interface from pipe if possible.
Definition at line 285 of file qgsrasterpipe.cpp.
References mInterfaces.
QgsRasterRenderer * QgsRasterPipe::renderer | ( | ) | const |
Definition at line 229 of file qgsrasterpipe.cpp.
References interface(), and RendererRole.
Referenced by QgsRasterLayer::legendSymbologyItems(), QgsRasterLayer::setContrastEnhancement(), and QgsRasterLayer::setDataProvider().
bool QgsRasterPipe::replace | ( | int | idx, |
QgsRasterInterface * | theInterface | ||
) |
Try to replace interface at specified index and connect if connection would fail, the interface is not inserted and false is returned.
Definition at line 98 of file qgsrasterpipe.cpp.
References checkBounds(), connect(), mInterfaces, QgsDebugMsg, and setRole().
Referenced by set().
QgsRasterResampleFilter * QgsRasterPipe::resampleFilter | ( | ) | const |
Definition at line 234 of file qgsrasterpipe.cpp.
References interface(), and ResamplerRole.
bool QgsRasterPipe::set | ( | QgsRasterInterface * | theInterface | ) |
Insert a new known interface in default place or replace interface of the same role if it already exists.
Known interfaces are: QgsRasterDataProvider, QgsRasterRenderer, QgsRasterResampleFilter, QgsRasterProjector and their subclasses. For unknown interfaces it mus be explicitly specified position where it should be inserted using insert() method.
Definition at line 153 of file qgsrasterpipe.cpp.
References BrightnessRole, HueSaturationRole, insert(), interfaceRole(), mRoleMap, ProjectorRole, ProviderRole, QgsDebugMsg, RendererRole, replace(), ResamplerRole, and UnknownRole.
Referenced by QgsRasterLayer::readSymbology(), QgsRasterLayer::setDataProvider(), and QgsRasterLayer::setRenderer().
bool QgsRasterPipe::setOn | ( | int | idx, |
bool | on | ||
) |
Set interface at index on/off Returns true on success.
Definition at line 312 of file qgsrasterpipe.cpp.
References checkBounds(), connect(), mInterfaces, and QgsDebugMsg.
|
private |
Definition at line 139 of file qgsrasterpipe.cpp.
References interfaceRole(), mRoleMap, and UnknownRole.
|
inline |
Definition at line 84 of file qgsrasterpipe.h.
Referenced by QgsRasterPipe(), and QgsRasterLayer::writeSymbology().
|
private |
Definition at line 146 of file qgsrasterpipe.cpp.
References interfaceRole(), mRoleMap, and UnknownRole.
Referenced by remove().
|
private |
Definition at line 109 of file qgsrasterpipe.h.
Referenced by canSetOn(), checkBounds(), insert(), interface(), QgsRasterPipe(), remove(), replace(), setOn(), and ~QgsRasterPipe().
|
private |
Definition at line 111 of file qgsrasterpipe.h.
Referenced by interface(), QgsRasterPipe(), set(), setRole(), and unsetRole().