Wrapper class for accessing and modifying selection option information.
Allows changes to a selection option after creation.
This class provides the necessary interface for changing, e.g., the number of allowed selections for a selection option after the option has been created with Options::addOption(). This is needed if the number or other flags are only known after other options have been parsed. The main advantage of this class over custom checks is that if used before interactive selection prompt, the interactive prompt is updated accordingly.
When using this class, the option should be initially created with the most permissive flags, and this class should be used to place restrictions where appropriate. Otherwise, values that are provided before adjustments will need to follow the more strict checks. In most cases in trajectory analysis (which is the main use case for selection options), the adjustments should be done in TrajectoryAnalysisModule::optionsFinished() for them to take place before interactive selection prompts.
An instance of this class for a selection option can be obtained with SelectionOption::getAdjuster() when the option is created.
Example use:
Options options("example", "Example options");
info = options.
addOption(SelectionOption(
"sel").storeVector(&sel)
.multiValue());
if ( condition )
{
info->setValueCount(2);
info->setOnlyStatic(true);
}
*
|
| SelectionOptionInfo (SelectionOptionStorage *option) |
| Creates option info object for given storage object. More...
|
|
void | setValueCount (int count) |
| Sets the number of selections allowed for the option. More...
|
|
void | setEvaluateVelocities (bool bEnabled) |
| Sets whether this option evaluates velocities for positions. More...
|
|
void | setEvaluateForces (bool bEnabled) |
| Sets whether this option evaluates forces for positions. More...
|
|
void | setOnlyAtoms (bool bEnabled) |
| Sets whether this option accepts positions that come from multiple atoms. More...
|
|
void | setOnlyStatic (bool bEnabled) |
| Sets whether this option accepts dynamic selections. More...
|
|
void | setDynamicMask (bool bEnabled) |
| Sets whether this option uses position masks for dynamic selections. More...
|
|
template<class InfoType > |
bool | isType () const |
| Test whether the option is of a particular type. More...
|
|
template<class InfoType > |
InfoType * | toType () |
| Convert the info object to a particular type if the type is correct. More...
|
|
template<class InfoType > |
const InfoType * | toType () const |
| Convert the info object to a particular type if the type is correct. More...
|
|
bool | isSet () const |
| Returns true if the option has been set.
|
|
bool | isHidden () const |
| Returns true if the option is a hidden option.
|
|
bool | isRequired () const |
| Returns true if the option is required.
|
|
int | minValueCount () const |
| Returns the minimum number of values that this option accepts.
|
|
int | maxValueCount () const |
| Returns the maximum number of values that this option accepts.
|
|
const std::string & | name () const |
| Returns the name of the option.
|
|
std::string | type () const |
| Returns the type of the option as a string.
|
|
std::string | formatDescription () const |
| Returns the description of the option.
|
|
std::vector< Any > | defaultValues () const |
| Returns the default value(s) of the option. More...
|
|
std::vector< std::string > | defaultValuesAsStrings () const |
| Returns the default value(s) of the option as strings. More...
|
|
std::vector< Any > | normalizeValues (const std::vector< Any > &values) const |
| Converts given values to native representation for this option. More...
|
|