Quantum GIS API Documentation  master-ce49b66
QgsRasterPipe Class Reference

Base class for processing modules. More...

#include <qgsrasterpipe.h>

List of all members.

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

Private Member Functions

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

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

Definition at line 25 of file qgsrasterpipe.cpp.

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.

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().

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().

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().

Definition at line 254 of file qgsrasterpipe.cpp.

References interface(), and NullerRole.

Referenced by QgsRasterFileWriter::writeDataRaster().

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.

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().

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

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:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines