Gromacs
2025.0-dev-20241011-013a99c
|
#include <gromacs/selection/selectionoption.h>
Specifies an option that provides selection(s).
Public methods in this class do not throw.
To use options of this type, SelectionOptionManager must first be added to the Options collection. For trajectory analysis tools, the framework takes care of this.
Public Types | |
typedef SelectionOptionInfo | InfoType |
OptionInfo subclass corresponding to this option type. | |
Public Types inherited from gmx::OptionTemplate< Selection, SelectionOption > | |
typedef Selection | ValueType |
Type that stores a single option value. | |
typedef SelectionOption | MyClass |
Alias for the derived class type. | |
Public Member Functions | |
SelectionOption (const char *name) | |
Initializes an option with the given name. | |
MyClass & | evaluateVelocities () |
Request velocity evaluation for output positions. More... | |
MyClass & | evaluateForces () |
Request force evaluation for output positions. More... | |
MyClass & | onlyAtoms () |
Only accept selections that evaluate to atom positions. | |
MyClass & | onlySortedAtoms () |
Only accept selections that evaluate to atom positions in sorted order. | |
MyClass & | onlyStatic () |
Only accept static selections for this option. | |
MyClass & | dynamicMask () |
Handle dynamic selections for this option with position masks. More... | |
MyClass & | allowEmpty () |
Allow specifying an unconditionally empty selection for this option. More... | |
MyClass & | defaultSelectionText (const char *text) |
Sets default selection text for the option. More... | |
Public Member Functions inherited from gmx::OptionTemplate< Selection, SelectionOption > | |
MyClass & | description (const char *descr) |
Sets a description for the option. More... | |
MyClass & | hidden (bool bHidden=true) |
Hides the option from normal help output. | |
MyClass & | required (bool bRequired=true) |
Requires the option to be specified explicitly. More... | |
MyClass & | allowMultiple (bool bMulti=true) |
Allows the option to be specified multiple times. | |
MyClass & | valueCount (int count) |
Requires exactly count values for the option. | |
MyClass & | multiValue (bool bMulti=true) |
Allows any number of values for the option. | |
MyClass & | defaultValue (const Selection &defaultValue) |
Sets a default value for the option. More... | |
MyClass & | defaultValueIfSet (const Selection &defaultValue) |
Sets a default value for the option when it is set. More... | |
MyClass & | store (Selection *store) |
Stores value(s) in memory pointed by store . More... | |
MyClass & | storeCount (int *countptr) |
Stores number of values in the value pointed by countptr . More... | |
MyClass & | storeVector (std::vector< Selection > *store) |
Stores option values in the provided vector. More... | |
MyClass & | storeIsSet (bool *store) |
Stores whether the option was explicitly set. More... | |
Friends | |
class | SelectionOptionStorage |
Needed to initialize SelectionOptionStorage from this class without otherwise unnecessary accessors. | |
Additional Inherited Members | |
Protected Types inherited from gmx::OptionTemplate< Selection, SelectionOption > | |
typedef OptionTemplate < Selection, SelectionOption > | MyBase |
Alias for the template class for use in base classes. | |
Protected Member Functions inherited from gmx::OptionTemplate< Selection, SelectionOption > | |
const Selection * | defaultValue () const |
Returns a pointer to user-specified default value, or NULL if there is none. | |
const Selection * | defaultValueIfSet () const |
Returns a pointer to user-specified default value, or NULL if there is none. | |
Selection * | store () const |
Returns a pointer to the storage location, or NULL if none specified. | |
std::vector< Selection > * | storeVector () const |
Returns a pointer to the storage vector, or NULL if none specified. | |
OptionTemplate (const char *name) | |
Initializes the name and default values for an option. | |
MyClass & | me () |
Returns *this casted into MyClass to reduce typing. | |
Protected Member Functions inherited from gmx::AbstractOption | |
AbstractOption (const char *name) | |
Initializes the name and default values for an option. | |
void | setDescription (const char *descr) |
Sets the description for the option. | |
void | setStoreIsSet (bool *store) |
Sets the storage location for whether the option is set. | |
void | setFlag (OptionFlag flag) |
Sets a flag for the option. | |
void | clearFlag (OptionFlag flag) |
Clears a flag for the option. | |
void | setFlag (OptionFlag flag, bool bSet) |
Sets or clears a flag for the option. | |
bool | isVector () const |
Returns true if the option is vector-valued. | |
void | setVector () |
Sets the option to be vector-valued. More... | |
void | setValueCount (int count) |
Sets the required number of values for the option. | |
Protected Attributes inherited from gmx::AbstractOption | |
int | minValueCount_ |
Minimum number of values required for the option. | |
int | maxValueCount_ |
Maximum number of values allowed for the option. | |
|
inline |
Allow specifying an unconditionally empty selection for this option.
If this option is not set, selections that are unconditionally empty (i.e., can never match any atoms) result in errors. Note that even without this option, it is still possible that a dynamic selection evaluates to zero atoms for some frames.
|
inline |
Sets default selection text for the option.
If the option is not set by the user, the provided text is parsed as the value of the selection.
|
inline |
Handle dynamic selections for this option with position masks.
|
inline |
Request force evaluation for output positions.
|
inline |
Request velocity evaluation for output positions.