|
Isis 3 Programmer Reference
|
13 #include <QScopedPointer>
14 #include <QSharedPointer>
19 #include "PvlObject.h"
134 const QString &
name)
const;
137 const int &index = 0,
138 const QString &defValue =
"")
const;
140 const QString &delimiter =
"::")
const;
141 QString
scanAndReplace(
const QString &input,
const QString &target,
142 const QString &replacement)
const;
145 const QString &defValue =
"")
const;
148 const QString &defValue =
"")
const;
161 const bool &withAssets =
false)
const;
168 bool initProgress(
const int &nsteps = 0,
const QString &text =
"");
174 template <
class STRATEGYLIST,
class STRATEGYFACTORY>
175 STRATEGYLIST LoadMinerStrategies(
const QString &minerName,
177 STRATEGYFACTORY *factory = STRATEGYFACTORY::instance();
181 if ( !config.isEmpty() ) {
182 miner = factory->buildRun(config, globals);
184 else if ( getDefinition().hasObject(minerName+
"Miner") ) {
185 miner = factory->buildRun(getDefinition().findObject(minerName+
"Miner"),
Contains Pvl Groups and Pvl Objects.
QString processArgs(const QString &value, const QStringList &argKeys, const ResourceList &globals, const QString &defValue="") const
Processes the given string value using the given argument list, resource and default resource.
bool initProgress(const int &nsteps=0, const QString &text="")
Initializes strategy progress monitor if requested by user.
ResourceList activeList(ResourceList &resources) const
Get list of all active Resources only - no discarded Resources.
void deactivateList(ResourceList &resources) const
Deactivate all resources contained in the resource list.
Provides a flat map of PvlKeywords.
ResourceList cloneList(const ResourceList &resources, const bool &withAssets=false) const
Create a clone of a Resource list.
ResourceList copyList(const ResourceList &resources) const
Make a copy of the resource list that is independently managed.
void propagateKeys(SharedResource &source, SharedResource &target) const
Adds the PVL definition keywords from the source to the target.
ResourceList getGlobals(SharedResource &myGlobals, const ResourceList &globals) const
ResourceList getGlobalDefaults() const
Accessor method to get the global defaults.
int applyToIntersectedGeometry(ResourceList &resources, GisGeometry &geom, const ResourceList &globals)
Identify and apply Strategy to Resources that intersect a geometry.
Strategy()
Constructs default Strategy object of name "Strategy" and type "Counter".
SharedPvlObject m_definition
A shared pointer to the PvlObject that defines the strategy.
void setDoNotApplyToDiscarded()
Disables the general application of Strategy algorithm for all Resources regardless of state.
unsigned int processed()
Increments the total number of resources processed and returns the incremented value.
QSharedPointer< PvlObject > SharedPvlObject
Definition for a SharedPvlObject, a shared pointer to a PvlObject.
void resetProcessed()
Resets the total number of processed resources to zero.
Strategy - Supports algorithm development.
bool importGeometry(SharedResource &resource, const ResourceList &globals) const
Imports a geometry from the given resource.
void activateList(ResourceList &resources) const
Activate all resources contained in the resource list.
SharedResource composite(SharedResource &resourceA, SharedResource &resourceB, const QPair< QString, QString > &keySuffix=qMakePair(QString("A"), QString("B"))) const
Create a composite Resource from a pair by merging keywords.
Encapsulation class provides support for GEOS-C API.
QScopedPointer< Progress > m_progress
Progress percentage monitor.
QString m_name
A string containing the name of the strategy.
ResourceList m_globals
A shared pointer to the global Resource of keywords.
int applyToResources(ResourceList &resources, const ResourceList &globals)
Applies the strategy algorithms to the resources in the given list.
bool isDebug() const
An accessor method so that inherited classes can determine whether to print debug messages for this o...
QList< SharedStrategy > StrategyList
Definition for a StrategyList, a list of SharedStrategy types.
bool m_applyDiscarded
Indicates whether to apply strategy to discarded resources.
int countActive(const ResourceList &resources) const
Counts the number of active (i.e.
QStringList qualifiers(const QString &keyspec, const QString &delimiter="::") const
Splits the given keyspec string into a list using the given delimiter string.
int countDiscarded(const ResourceList &resources) const
Counts the number of non-active (i.e.
bool doShowProgress() const
bool m_debug
Indicates whether to print debug messages.
QString findReplacement(const QString &target, const ResourceList &globals, const int &index=0, const QString &defValue="") const
Find keyword replacement value in globals list.
int apply(ResourceList &resources)
Apply algorithm to resource list.
QSharedPointer< Strategy > SharedStrategy
Definition for a SharedStrategy, a shared pointer to a Strategy.
static void queryCallback(void *item, void *userdata)
Important GEOS query callback for class and overlap geometry.
QString scanAndReplace(const QString &input, const QString &target, const QString &replacement) const
Performs a case insensitive scan of the input string for a substring matching the target string and r...
QString m_type
A string containing the type of strategy.
This is free and unencumbered software released into the public domain.
PvlFlatMap getDefinitionMap() const
Returns the keyword definitions found in the Strategy object.
unsigned int m_total
The total number of resources processed.
virtual ~Strategy()
Destroys the Strategy object.
QString name() const
Accessor method to get the name of the strategy.
QString type() const
Accessor method to get the type of strategy.
QString description() const
Return description for the strategy.
void setName(const QString &name)
Allow derived strategies to reset name (mostly for default constructors)
bool isApplyToDiscarded() const
Accessor for the apply discarded variable.
void setApplyToDiscarded()
Sets Resource as discarded.
void setType(const QString &type)
Allow derived strategies to reset type (mostly for default constructors)
ResourceList assetResourceList(const SharedResource &resource, const QString &name) const
Searches the given resource for an asset with the given name and converts it to a ResourceList,...
This is free and unencumbered software released into the public domain.
Q_DECLARE_METATYPE(Isis::PlotWindow *)
We have plot windows as QVariant data types, so here it's enabled.
unsigned int totalProcessed() const
Accessor for the total number of resources processed.
QString translateKeywordArgs(const QString &value, const ResourceList &globals, const QString &defValue="") const
Translates the arguments of the PVL keyword in the PVL definition object.