QGIS API Documentation  2.4.0-Chugiak
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
QgsRasterPipe Class Reference

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. More...
 
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. More...
 
bool set (QgsRasterInterface *theInterface)
 Insert a new known interface in default place or replace interface of the same role if it already exists. More...
 
bool remove (int idx)
 Remove and delete interface at given index if possible. More...
 
bool remove (QgsRasterInterface *theInterface)
 Remove and delete interface from pipe if possible. More...
 
int size () const
 
QgsRasterInterfaceat (int idx) const
 
QgsRasterInterfacelast () const
 
bool setOn (int idx, bool on)
 Set interface at index on/off Returns true on success. More...
 
bool canSetOn (int idx, bool on)
 Test if interface at index may be swithed on/off. More...
 
QgsRasterDataProviderprovider () const
 
QgsRasterRendererrenderer () const
 
QgsRasterResampleFilterresampleFilter () const
 
QgsBrightnessContrastFilterbrightnessFilter () const
 
QgsHueSaturationFilterhueSaturationFilter () const
 
QgsRasterProjectorprojector () const
 
QgsRasterNullernuller () const
 

Private Member Functions

Role interfaceRole (QgsRasterInterface *iface) const
 Get known parent type_info of interface parent. More...
 
void setRole (QgsRasterInterface *theInterface, int idx)
 
void unsetRole (QgsRasterInterface *theInterface)
 
bool checkBounds (int idx) const
 
QgsRasterInterfaceinterface (Role role) const
 Get known interface by role. More...
 
bool connect (QVector< QgsRasterInterface * > theInterfaces)
 Try to connect interfaces in pipe and to the provider at beginning. More...
 

Private Attributes

QVector< QgsRasterInterface * > mInterfaces
 
QMap< Role, int > mRoleMap
 

Detailed Description

Base class for processing modules.

Definition at line 41 of file qgsrasterpipe.h.

Member Enumeration Documentation

Enumerator
UnknownRole 
ProviderRole 
RendererRole 
BrightnessRole 
ResamplerRole 
ProjectorRole 
NullerRole 
HueSaturationRole 

Definition at line 45 of file qgsrasterpipe.h.

Constructor & Destructor Documentation

QgsRasterPipe::QgsRasterPipe ( )

Definition at line 25 of file qgsrasterpipe.cpp.

QgsRasterPipe::QgsRasterPipe ( const QgsRasterPipe thePipe)
QgsRasterPipe::~QgsRasterPipe ( )

Definition at line 50 of file qgsrasterpipe.cpp.

References interface(), and mInterfaces.

Member Function Documentation

QgsRasterInterface* QgsRasterPipe::at ( int  idx) const
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.

bool QgsRasterPipe::checkBounds ( int  idx) const
private

Definition at line 331 of file qgsrasterpipe.cpp.

References mInterfaces.

Referenced by canSetOn(), remove(), replace(), and setOn().

bool QgsRasterPipe::connect ( QVector< QgsRasterInterface * >  theInterfaces)
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().

QgsRasterInterface * QgsRasterPipe::interface ( Role  role) const
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().

QgsRasterPipe::Role QgsRasterPipe::interfaceRole ( QgsRasterInterface iface) const
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().

QgsRasterInterface* QgsRasterPipe::last ( ) const
inline
QgsRasterNuller * QgsRasterPipe::nuller ( ) const

Definition at line 254 of file qgsrasterpipe.cpp.

References interface(), and NullerRole.

Referenced by QgsRasterFileWriter::writeDataRaster().

QgsRasterProjector * QgsRasterPipe::projector ( ) const
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
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.

void QgsRasterPipe::setRole ( QgsRasterInterface theInterface,
int  idx 
)
private

Definition at line 139 of file qgsrasterpipe.cpp.

References interfaceRole(), mRoleMap, and UnknownRole.

Referenced by insert(), and replace().

int QgsRasterPipe::size ( void  ) const
inline

Definition at line 84 of file qgsrasterpipe.h.

Referenced by QgsRasterPipe(), and QgsRasterLayer::writeSymbology().

void QgsRasterPipe::unsetRole ( QgsRasterInterface theInterface)
private

Definition at line 146 of file qgsrasterpipe.cpp.

References interfaceRole(), mRoleMap, and UnknownRole.

Referenced by remove().

Member Data Documentation

QVector<QgsRasterInterface*> QgsRasterPipe::mInterfaces
private
QMap<Role, int> QgsRasterPipe::mRoleMap
private

Definition at line 111 of file qgsrasterpipe.h.

Referenced by interface(), QgsRasterPipe(), set(), setRole(), and unsetRole().


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