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

OmgAlgorithm Class Reference
[Library]

#include <omgalgorithm.h>

Inheritance diagram for OmgAlgorithm:

Inheritance graph
[legend]
Collaboration diagram for OmgAlgorithm:

Collaboration graph
[legend]
List of all members.

Detailed Description

A representation of an algorithm, including its state and user selected parameter values. An algorithm is (de)serialisable to xml and each algorithm instance gets a unique guid.

Definition at line 35 of file omgalgorithm.h.

Public Types

enum  Origin { ADAPTERPROFILE = 100, USERPROFILE = 200, UNDEFINED = 300 }

Public Member Functions

 OmgAlgorithm ()
 ~OmgAlgorithm ()
QString toHtml () const
int parameterCount ()
QString toXml () const
bool fromXml (const QString theXml)
QString toModelCreationXml () const
QString toModelProjectionXml (QString theModel, QString theNormalization="") const
QString toString () const
void setId (QString theId)
void setName (QString theName)
void setAuthor (QString theAuthor)
void setCodeAuthor (QString theCodeAuthor)
void setContact (QString theContact)
void setVersion (QString theVersion)
void setCategorical (int theCategorical)
void setAbsence (int theAbsence)
void setOverview (QString theOverview)
void setDescription (QString theDescription)
void setBibliography (QString theBibliography)
void setParameters (QVector< OmgAlgorithmParameter > theParameters)
void addParameter (OmgAlgorithmParameter theParameter)
void setOrigin (Origin theOrigin)
QString id ()
QString name () const
QString author ()
QString contact ()
QString codeAuthor ()
QString version ()
int categorical ()
int absence ()
QString overview ()
QString description ()
QString bibliography ()
QVector< OmgAlgorithmParameterparameters ()
OmgAlgorithmParameter parameter (QString theId)
Origin origin ()

Private Attributes

QString mId
QString mName
QString mAuthor
QString mCodeAuthor
QString mContact
QString mVersion
int mCategorical
int mAbsence
QString mOverview
QString mDescription
QString mBibliography
QVector< OmgAlgorithmParametermParameters
Origin mOrigin


Member Enumeration Documentation

enum OmgAlgorithm::Origin
 

An enumerated type defining possible origins for the algorithm profile

Enumeration values:
ADAPTERPROFILE 
USERPROFILE 
UNDEFINED 

Definition at line 41 of file omgalgorithm.h.


Constructor & Destructor Documentation

OmgAlgorithm::OmgAlgorithm  ) 
 

Definition at line 25 of file omgalgorithm.cpp.

References mParameters.

OmgAlgorithm::~OmgAlgorithm  ) 
 

Definition at line 42 of file omgalgorithm.cpp.


Member Function Documentation

int OmgAlgorithm::absence  ) 
 

Definition at line 133 of file omgalgorithm.cpp.

References mAbsence.

void OmgAlgorithm::addParameter OmgAlgorithmParameter  theParameter  ) 
 

Definition at line 179 of file omgalgorithm.cpp.

References mParameters.

Referenced by fromXml(), and OmgModellerLocalPlugin::getAlgorithm().

QString OmgAlgorithm::author  ) 
 

Definition at line 113 of file omgalgorithm.cpp.

References mAuthor.

Referenced by OmgAlgorithmManager::selectAlgorithm().

QString OmgAlgorithm::bibliography  ) 
 

Definition at line 145 of file omgalgorithm.cpp.

References mBibliography.

Referenced by OmgAlgorithmManager::selectAlgorithm().

int OmgAlgorithm::categorical  ) 
 

Definition at line 129 of file omgalgorithm.cpp.

References mCategorical.

QString OmgAlgorithm::codeAuthor  ) 
 

Definition at line 117 of file omgalgorithm.cpp.

References mCodeAuthor.

Referenced by OmgAlgorithmManager::selectAlgorithm().

QString OmgAlgorithm::contact  ) 
 

Definition at line 121 of file omgalgorithm.cpp.

References mContact.

QString OmgAlgorithm::description  ) 
 

Definition at line 141 of file omgalgorithm.cpp.

References mDescription.

Referenced by OmgAlgorithmManager::selectAlgorithm().

bool OmgAlgorithm::fromXml const QString  theXml  )  [virtual]
 

Implments the serialisable interface method to reinstate an algorithm. It will try to populate all members of this class and fail gracefully when they are not available (typically by leaving the member tagged as [Not Set]

Implements OmgSerialisable.

Definition at line 261 of file omgalgorithm.cpp.

References ADAPTERPROFILE, addParameter(), OmgAlgorithmParameter::fromXml(), mAbsence, mAuthor, mBibliography, mCategorical, mCodeAuthor, mContact, mDescription, mId, mName, mOverview, mVersion, OmgGuid::setGuid(), setOrigin(), and Omgui::xmlDecode().

Referenced by OmgModel::fromXml(), and OmgAlgorithmSet::fromXml().

Here is the call graph for this function:

QString OmgAlgorithm::id  ) 
 

This is the id assigned by the algorithm writer e.g. Bioclim

Definition at line 105 of file omgalgorithm.cpp.

References mId.

Referenced by OmgAlgorithmManager::selectAlgorithm().

QString OmgAlgorithm::name  )  const
 

Definition at line 109 of file omgalgorithm.cpp.

References mName.

Referenced by OmgAlgorithmSet::addAlgorithm(), OmgModel::createThumbnail(), OmgAlgorithmSet::loadAlgorithms(), OmgAlgorithmSet::nameList(), OmgExperimentDesigner::OmgExperimentDesigner(), OmgAlgorithmManager::on_pbnApply_clicked(), OmgAlgorithmManager::on_pbnClone_clicked(), OmgAlgorithmManager::refreshAlgorithmTable(), OmgAlgorithmSet::removeAlgorithm(), OmgExperiment::run(), OmgAlgorithmManager::selectAlgorithm(), OmgModel::toHtml(), and OmgModel::toPrintHtml().

OmgAlgorithm::Origin OmgAlgorithm::origin  ) 
 

Definition at line 171 of file omgalgorithm.cpp.

References mOrigin.

Referenced by OmgExperimentDesigner::OmgExperimentDesigner(), OmgAlgorithmManager::refreshAlgorithmTable(), OmgAlgorithmSet::saveAlgorithms(), and OmgAlgorithmManager::selectAlgorithm().

QString OmgAlgorithm::overview  ) 
 

Definition at line 137 of file omgalgorithm.cpp.

References mOverview.

Referenced by OmgAlgorithmManager::selectAlgorithm().

OmgAlgorithmParameter OmgAlgorithm::parameter QString  theId  ) 
 

Get a parameter from the algorithm given its id. Note a copy is returned. If no match could be found the returned parameter will have an id of 'invalid'

Definition at line 153 of file omgalgorithm.cpp.

References OmgAlgorithmParameter::id(), mParameters, and OmgAlgorithmParameter::setId().

Referenced by OmgAlgorithmManager::on_pbnApply_clicked().

Here is the call graph for this function:

int OmgAlgorithm::parameterCount  ) 
 

Definition at line 184 of file omgalgorithm.cpp.

References mParameters.

Referenced by OmgAlgorithmManager::selectAlgorithm().

QVector< OmgAlgorithmParameter > OmgAlgorithm::parameters  ) 
 

Definition at line 149 of file omgalgorithm.cpp.

References mParameters.

void OmgAlgorithm::setAbsence int  theAbsence  ) 
 

Definition at line 77 of file omgalgorithm.cpp.

References mAbsence.

Referenced by OmgModellerLocalPlugin::getAlgorithm().

void OmgAlgorithm::setAuthor QString  theAuthor  ) 
 

Definition at line 57 of file omgalgorithm.cpp.

References mAuthor.

Referenced by OmgModellerLocalPlugin::getAlgorithm().

void OmgAlgorithm::setBibliography QString  theBibliography  ) 
 

Definition at line 90 of file omgalgorithm.cpp.

References mBibliography.

Referenced by OmgModellerLocalPlugin::getAlgorithm().

void OmgAlgorithm::setCategorical int  theCategorical  ) 
 

Definition at line 73 of file omgalgorithm.cpp.

References mCategorical.

Referenced by OmgModellerLocalPlugin::getAlgorithm().

void OmgAlgorithm::setCodeAuthor QString  theCodeAuthor  ) 
 

Definition at line 61 of file omgalgorithm.cpp.

References mCodeAuthor.

Referenced by OmgModellerLocalPlugin::getAlgorithm().

void OmgAlgorithm::setContact QString  theContact  ) 
 

Definition at line 65 of file omgalgorithm.cpp.

References mContact.

Referenced by OmgModellerLocalPlugin::getAlgorithm().

void OmgAlgorithm::setDescription QString  theDescription  ) 
 

Definition at line 86 of file omgalgorithm.cpp.

References mDescription.

Referenced by OmgModellerLocalPlugin::getAlgorithm().

void OmgAlgorithm::setId QString  theId  ) 
 

Definition at line 49 of file omgalgorithm.cpp.

References mId.

Referenced by OmgModellerLocalPlugin::getAlgorithm().

void OmgAlgorithm::setName QString  theName  ) 
 

Definition at line 53 of file omgalgorithm.cpp.

References mName.

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

void OmgAlgorithm::setOrigin Origin  theOrigin  ) 
 

Definition at line 98 of file omgalgorithm.cpp.

References mOrigin.

Referenced by fromXml(), OmgModellerLocalPlugin::getAlgorithm(), OmgAlgorithmSet::loadAlgorithms(), and OmgAlgorithmManager::on_pbnClone_clicked().

void OmgAlgorithm::setOverview QString  theOverview  ) 
 

Definition at line 81 of file omgalgorithm.cpp.

References mOverview.

Referenced by OmgModellerLocalPlugin::getAlgorithm().

void OmgAlgorithm::setParameters QVector< OmgAlgorithmParameter theParameters  ) 
 

Definition at line 94 of file omgalgorithm.cpp.

References mParameters.

Referenced by OmgAlgorithmManager::on_pbnApply_clicked().

void OmgAlgorithm::setVersion QString  theVersion  ) 
 

Definition at line 69 of file omgalgorithm.cpp.

References mVersion.

Referenced by OmgModellerLocalPlugin::getAlgorithm().

QString OmgAlgorithm::toHtml  )  const
 

Definition at line 376 of file omgalgorithm.cpp.

References OmgAlgorithmParameter::defaultValue(), OmgAlgorithmParameter::description(), OmgGuid::guid(), OmgAlgorithmParameter::id(), mAbsence, mAuthor, OmgAlgorithmParameter::maximum(), mCategorical, mCodeAuthor, mContact, mDescription, mId, OmgAlgorithmParameter::minimum(), mName, mOverview, mParameters, mVersion, OmgAlgorithmParameter::name(), OmgAlgorithmParameter::type(), and OmgAlgorithmParameter::value().

Referenced by OmgExperimentPrinter::run(), OmgModel::toHtml(), OmgAlgorithmSet::toHtml(), and OmgModel::toPrintHtml().

Here is the call graph for this function:

QString OmgAlgorithm::toModelCreationXml  )  const
 

This is a special case serialiser needed for when preparing an xml representation of an algorithm to send to the openmodeller library (or openmodeller web service interface). The xml produced will include no ancilliary meta information - only the essentials needed for the algorithm.

Returns:
a string containing the algorithm xml representation or if something went wrong and empty string.

Definition at line 224 of file omgalgorithm.cpp.

References mId, mParameters, mVersion, and OmgAlgorithmParameter::toModelCreationXml().

Referenced by OmgModel::toModelCreationXml().

Here is the call graph for this function:

QString OmgAlgorithm::toModelProjectionXml QString  theModel,
QString  theNormalization = ""
const
 

This is a special case serialiser needed for when preparing an xml representation of an algorithm to send to the openmodeller library (or openmodeller web service interface). The xml produced will include no ancilliary meta information - only the essentials needed for the algorithm.

Parameters:
a string containing the serialised model definition as returned by an algorithm
an (optional) string with the normalization xml for the model in libopenmodeller
Returns:
a string containing the algorithm xml representation or if something went wrong and empty string.

Definition at line 239 of file omgalgorithm.cpp.

References mId, mParameters, mVersion, and OmgAlgorithmParameter::toModelCreationXml().

Referenced by OmgModel::toModelProjectionXml().

Here is the call graph for this function:

QString OmgAlgorithm::toString  )  const
 

Definition at line 353 of file omgalgorithm.cpp.

References OmgGuid::guid(), OmgAlgorithmParameter::id(), mAbsence, mAuthor, mCategorical, mCodeAuthor, mContact, mDescription, mId, mName, mOverview, mParameters, mVersion, and OmgAlgorithmParameter::value().

Referenced by OmgModel::toString().

Here is the call graph for this function:

QString OmgAlgorithm::toXml  )  const [virtual]
 

This method is required for the serialiseable interface. It will encapsulate *all* algorithm properties so that its complete state can be serialised and later deserialised.

See also:
toModelCreationXml()

Implements OmgSerialisable.

Definition at line 189 of file omgalgorithm.cpp.

References OmgGuid::guid(), mAbsence, mAuthor, mBibliography, mCategorical, mCodeAuthor, mContact, mDescription, mId, mName, mOverview, mParameters, mVersion, and OmgAlgorithmParameter::toXml().

Referenced by OmgAlgorithmSet::saveAlgorithms(), OmgModel::toXml(), and OmgAlgorithmSet::toXml().

Here is the call graph for this function:

QString OmgAlgorithm::version  ) 
 

Definition at line 125 of file omgalgorithm.cpp.

References mVersion.

Referenced by OmgAlgorithmManager::selectAlgorithm().


Member Data Documentation

int OmgAlgorithm::mAbsence [private]
 

Definition at line 132 of file omgalgorithm.h.

Referenced by absence(), fromXml(), setAbsence(), toHtml(), toString(), and toXml().

QString OmgAlgorithm::mAuthor [private]
 

Definition at line 127 of file omgalgorithm.h.

Referenced by author(), fromXml(), setAuthor(), toHtml(), toString(), and toXml().

QString OmgAlgorithm::mBibliography [private]
 

Definition at line 135 of file omgalgorithm.h.

Referenced by bibliography(), fromXml(), setBibliography(), and toXml().

int OmgAlgorithm::mCategorical [private]
 

Definition at line 131 of file omgalgorithm.h.

Referenced by categorical(), fromXml(), setCategorical(), toHtml(), toString(), and toXml().

QString OmgAlgorithm::mCodeAuthor [private]
 

Definition at line 128 of file omgalgorithm.h.

Referenced by codeAuthor(), fromXml(), setCodeAuthor(), toHtml(), toString(), and toXml().

QString OmgAlgorithm::mContact [private]
 

Definition at line 129 of file omgalgorithm.h.

Referenced by contact(), fromXml(), setContact(), toHtml(), toString(), and toXml().

QString OmgAlgorithm::mDescription [private]
 

Definition at line 134 of file omgalgorithm.h.

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

QString OmgAlgorithm::mId [private]
 

Definition at line 125 of file omgalgorithm.h.

Referenced by fromXml(), id(), setId(), toHtml(), toModelCreationXml(), toModelProjectionXml(), toString(), and toXml().

QString OmgAlgorithm::mName [private]
 

Definition at line 126 of file omgalgorithm.h.

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

Origin OmgAlgorithm::mOrigin [private]
 

A property to indicate the origin of this algorithm profile. this is NOT serialised/deserialised

Definition at line 140 of file omgalgorithm.h.

Referenced by origin(), and setOrigin().

QString OmgAlgorithm::mOverview [private]
 

Definition at line 133 of file omgalgorithm.h.

Referenced by fromXml(), overview(), setOverview(), toHtml(), toString(), and toXml().

QVector<OmgAlgorithmParameter> OmgAlgorithm::mParameters [private]
 

Definition at line 136 of file omgalgorithm.h.

Referenced by addParameter(), OmgAlgorithm(), parameter(), parameterCount(), parameters(), setParameters(), toHtml(), toModelCreationXml(), toModelProjectionXml(), toString(), and toXml().

QString OmgAlgorithm::mVersion [private]
 

Definition at line 130 of file omgalgorithm.h.

Referenced by fromXml(), setVersion(), toHtml(), toModelCreationXml(), toModelProjectionXml(), toString(), toXml(), and version().


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