Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

OmgAlgorithmSet Class Reference
[Library]

#include <omgalgorithmset.h>

Inheritance diagram for OmgAlgorithmSet:

Inheritance graph
[legend]
Collaboration diagram for OmgAlgorithmSet:

Collaboration graph
[legend]
List of all members.

Detailed Description

An container class for algorithm definitions. It also has ability to self initialise using the active openModeller plugin (and by looking for algorithms profiles stored as xml in the filesystem.

Author:
Tim Sutton

Definition at line 32 of file omgalgorithmset.h.

Public Member Functions

 OmgAlgorithmSet ()
 ~OmgAlgorithmSet ()
bool addAlgorithm (OmgAlgorithm theAlgorithm, bool theOverwriteFlag=false)
bool removeAlgorithm (OmgAlgorithm theAlgorithm)
bool removeAlgorithm (QString theAlgorithm)
QString name () const
QString description () const
QStringList nameList ()
void setName (QString theName)
void setDescription (QString theDescription)
void clear ()
int count () const
QString toString ()
QString toXml () const
bool fromXml (const QString)
QString toHtml ()
void loadAlgorithms (QString theSearchDir)
void saveAlgorithms (QString theSaveDir, bool theUserProfilesFlag=true)
OmgAlgorithm getAlgorithm (QString theGuid)
bool contains (QString theName)
OmgAlgorithm operator[] (int)

Static Public Member Functions

static OmgAlgorithmSet getFromActivePlugin ()

Private Types

typedef QMap< QString, OmgAlgorithmAlgorithmsMap

Private Attributes

QString mName
QString mDescription
AlgorithmsMap mAlgorithmsMap


Member Typedef Documentation

typedef QMap<QString,OmgAlgorithm> OmgAlgorithmSet::AlgorithmsMap [private]
 

Definition at line 158 of file omgalgorithmset.h.


Constructor & Destructor Documentation

OmgAlgorithmSet::OmgAlgorithmSet  ) 
 

Constructor .

Definition at line 30 of file omgalgorithmset.cpp.

OmgAlgorithmSet::~OmgAlgorithmSet  ) 
 

Desctructor .

Definition at line 34 of file omgalgorithmset.cpp.


Member Function Documentation

bool OmgAlgorithmSet::addAlgorithm OmgAlgorithm  theAlgorithm,
bool  theOverwriteFlag = false
 

Add a algorithm to the algorithmset

Parameters:
theAlgorithm the alg to add to the set
theOverwriteFlag - whether to write any preexisting alg with the same name (default is false)
See also:
OmgAlgorithm

Definition at line 38 of file omgalgorithmset.cpp.

References mAlgorithmsMap, and OmgAlgorithm::name().

Referenced by fromXml(), OmgModellerLocalPlugin::getAlgorithmSet(), loadAlgorithms(), OmgAlgorithmManager::on_pbnApply_clicked(), and OmgAlgorithmManager::on_pbnClone_clicked().

Here is the call graph for this function:

void OmgAlgorithmSet::clear  ) 
 

Clear all entries from the alg set

Definition at line 98 of file omgalgorithmset.cpp.

References mAlgorithmsMap.

Referenced by OmgAlgorithmManager::refreshAlgorithmTable().

bool OmgAlgorithmSet::contains QString  theName  ) 
 

Find out if an algorithm of a given name exists in the alg set

Definition at line 139 of file omgalgorithmset.cpp.

References mAlgorithmsMap.

Referenced by OmgAlgorithmManager::on_pbnApply_clicked(), and OmgAlgorithmManager::on_pbnClone_clicked().

int OmgAlgorithmSet::count  )  const
 

Retrun the count of algorithms in the algorithmset - excluding the mask

Definition at line 102 of file omgalgorithmset.cpp.

References mAlgorithmsMap.

Referenced by OmgExperimentDesigner::OmgExperimentDesigner(), OmgAlgorithmManager::refreshAlgorithmTable(), and toXml().

QString OmgAlgorithmSet::description  )  const
 

A description for the layerset e.g. including details like hostname etc for remote services

Definition at line 74 of file omgalgorithmset.cpp.

References mDescription.

bool OmgAlgorithmSet::fromXml const   QString  ) 
 

Initialise this algorithmset from an xml representation of this AlgorithmSet

See also:
OmgSerialisable

Definition at line 195 of file omgalgorithmset.cpp.

References addAlgorithm(), OmgAlgorithm::fromXml(), mDescription, and mName.

Referenced by OmgModellerWebServicesPlugin::getAlgorithmSet().

Here is the call graph for this function:

OmgAlgorithm OmgAlgorithmSet::getAlgorithm QString  theGuid  ) 
 

Get an algorithm from the set given its guid return OmgAlgorithm or 0 if not found

Definition at line 124 of file omgalgorithmset.cpp.

References OmgGuid::guid(), and mAlgorithmsMap.

Referenced by OmgExperimentDesigner::getExperiment(), OmgAlgorithmManager::on_pbnApply_clicked(), OmgAlgorithmManager::on_pbnClone_clicked(), and OmgAlgorithmManager::selectAlgorithm().

Here is the call graph for this function:

OmgAlgorithmSet OmgAlgorithmSet::getFromActivePlugin  )  [static]
 

Retirieve an algorithmset using the currently active plugin in qsettings.

Definition at line 244 of file omgalgorithmset.cpp.

References OmgModellerPluginInterface::getAlgorithmSet(), and OmgModellerPluginRegistry::instance().

Referenced by OmgExperimentDesigner::OmgExperimentDesigner(), OmgMainWindow::printAlgorithmProfilesReport(), and OmgAlgorithmManager::refreshAlgorithmTable().

Here is the call graph for this function:

void OmgAlgorithmSet::loadAlgorithms QString  theSearchDir  ) 
 

Append any algoirthms that can be deserialised from the data directory onto this algorithm set.

Parameters:
theSearchDir - the directory where xml parameters should be searched for.

Definition at line 274 of file omgalgorithmset.cpp.

References addAlgorithm(), OmgSerialisable::fromXmlFile(), OmgAlgorithm::name(), and OmgAlgorithm::setOrigin().

Referenced by OmgExperimentDesigner::OmgExperimentDesigner(), OmgMainWindow::printAlgorithmProfilesReport(), and OmgAlgorithmManager::refreshAlgorithmTable().

Here is the call graph for this function:

QString OmgAlgorithmSet::name  )  const
 

The name of this algorithmset - in plain english

Definition at line 70 of file omgalgorithmset.cpp.

References mName.

QStringList OmgAlgorithmSet::nameList  ) 
 

Helper method to return a list of all the algorithm names.

Definition at line 112 of file omgalgorithmset.cpp.

References mAlgorithmsMap, and OmgAlgorithm::name().

Referenced by OmgModellerWebServicesPlugin::getAlgorithmList().

Here is the call graph for this function:

OmgAlgorithm OmgAlgorithmSet::operator[] int   ) 
 

Overloaded [] operator so that OmgAlgorithmSet can be treated like an array.

Parameters:
int thePosition - position of element to retrieve from the collection
Returns:
OmgAlgorithm - the algorithm at this position

Definition at line 147 of file omgalgorithmset.cpp.

References mAlgorithmsMap.

bool OmgAlgorithmSet::removeAlgorithm QString  theAlgorithm  ) 
 

Overloaded method to remove a algorithm from the algorithmset given only its algorithm Name.

Definition at line 60 of file omgalgorithmset.cpp.

References mAlgorithmsMap.

bool OmgAlgorithmSet::removeAlgorithm OmgAlgorithm  theAlgorithm  ) 
 

Remove a algorithm from the algorithmset

See also:
OmgAlgorithm

Definition at line 55 of file omgalgorithmset.cpp.

References mAlgorithmsMap, and OmgAlgorithm::name().

Here is the call graph for this function:

void OmgAlgorithmSet::saveAlgorithms QString  theSaveDir,
bool  theUserProfilesFlag = true
 

Save the algorithms in this set as individiual xml files rather than as a single file representing the set

Parameters:
theSearchDir - the directory where xml parameters should
theUserProfilesFlag - whether to save only algs whose origin is OmgAlgorithm::USERPROFILE. Default is true! be saved to.

Definition at line 315 of file omgalgorithmset.cpp.

References OmgGuid::guid(), mAlgorithmsMap, OmgAlgorithm::origin(), and OmgAlgorithm::toXml().

Here is the call graph for this function:

void OmgAlgorithmSet::setDescription QString  theDescription  ) 
 

Set a description for the algorithmset

See also:
description()

Definition at line 87 of file omgalgorithmset.cpp.

References mDescription.

Referenced by OmgModellerWebServicesPlugin::getAlgorithmSet(), and OmgModellerLocalPlugin::getAlgorithmSet().

void OmgAlgorithmSet::setName QString  theName  ) 
 

Set the algorithmSet Name

See also:
name()

Definition at line 83 of file omgalgorithmset.cpp.

References mName.

Referenced by OmgModellerWebServicesPlugin::getAlgorithmSet(), and OmgModellerLocalPlugin::getAlgorithmSet().

QString OmgAlgorithmSet::toHtml  ) 
 

Return an html representation of this AlgorithmSet e.g.

Definition at line 181 of file omgalgorithmset.cpp.

References mAlgorithmsMap, and OmgAlgorithm::toHtml().

Referenced by OmgMainWindow::printAlgorithmProfilesReport().

Here is the call graph for this function:

QString OmgAlgorithmSet::toString  ) 
 

Return a string representation of this AlgorithmSet

Definition at line 107 of file omgalgorithmset.cpp.

QString OmgAlgorithmSet::toXml  )  const [virtual]
 

Return an xml representation of this AlgorithmSet

See also:
OmgSerialisable

Implements OmgSerialisable.

Definition at line 163 of file omgalgorithmset.cpp.

References count(), mAlgorithmsMap, mDescription, mName, and OmgAlgorithm::toXml().

Here is the call graph for this function:


Member Data Documentation

AlgorithmsMap OmgAlgorithmSet::mAlgorithmsMap [private]
 

Definition at line 159 of file omgalgorithmset.h.

Referenced by addAlgorithm(), clear(), contains(), count(), getAlgorithm(), nameList(), operator[](), removeAlgorithm(), saveAlgorithms(), toHtml(), and toXml().

QString OmgAlgorithmSet::mDescription [private]
 

Definition at line 157 of file omgalgorithmset.h.

Referenced by description(), fromXml(), setDescription(), and toXml().

QString OmgAlgorithmSet::mName [private]
 

Definition at line 156 of file omgalgorithmset.h.

Referenced by fromXml(), name(), setName(), and toXml().


The documentation for this class was generated from the following files:
Generated on Mon Apr 28 15:12:33 2008 for openModellerDesktop by  doxygen 1.4.1-20050210