OEOptions
class OEOptions
The OEOptions is an abstract base class. The Options represent a collection of OEParameter class that defines the set of parameters associated with settings of various objects or calculations.
See also
OESimpleAppOptions class
Code Examples
Define parameters example
- The OEOptions class defines the following public methods:
AddDetail
AddDetail(detail: str) -> bool
Adds a line to the detailed description of the options.
AddOption
AddOption(opts: OEOptions) -> OEOptions
Adds a copy of the specified options as sub-options to this options.
AddParameter
AddParameter(param: OEParameter) -> OEParameter
Adds a copy of the specified parameter to the options.
AddParameterPrefix
AddParameterPrefix(prefix: str, underScore: bool = True) -> bool
Add the specified prefix to the name of all the parameters.
AddParameterSuffix
AddParameterSuffix(suffix: str) -> bool
Add the specified suffix to the name of all the parameters.
Clear
Clear() -> None
Removes all parameters and sub-options.
DeleteOptions
DeleteOptions(arg2: OEOptions) -> bool
Deletes the specified sub-options, if it belongs to this options.
DeleteParameter
DeleteParameter(param: OEParameter) -> bool
Deletes the specified parameter, if it belongs to this options.
FindDupParameters
FindDupParameters(const: bool) -> OEParameterIter
FindDupParameters(const: bool) -> Iterable[OEParameter]
Returns duplicate parameters. Two parameters are considered duplicates if they have
a common name. If visibleOnly is set to True, parameters with visibility
OEParamVisibility_Hidden are ignored from this list. This operation
is always recursive to the associated sub-options.
GetBrief
GetBrief() -> str
See SetBrief method.
GetDetail
GetDetail() -> Iterable[str]
See AddDetail method.
GetName
GetName() -> str
See SetName method.
GetOption
GetOption(name: str) -> OEOptions
Get the sub-options with the specified name. Returns a NULL pointer if a sub-options with specified name does not exist.
GetOptions
GetOptions(const: bool) -> Iterable[OEOptions]
Get the sub-options of this options. A value of true for recursive compiles all
the sub-options from the subsequent sub-options.
GetOrderPriority
GetOrderPriority() -> int
See SetOrderPriority method.
GetParameter
GetParameter(name: str) -> OEParameter
Get the parameter with the specified name. Returns a NULL pointer if a parameter with specified name does not exist.
GetParameters
GetParameters(const: bool) -> Iterable[OEParameter]
GetParameters(const: bool) -> OEParameterIter
GetParameters(arg1: str, recursive: bool = True) -> Iterable[OEParameter]
GetParameters(arg1: str, recursive: bool = True) -> OEParameterIter
Get the parameters from this options. If a name is specified only parameters with the specified
name are provided. A value of true for recursive compiles all the parameters from the
subsequent sub-options.
HasDupParameters
HasDupParameters(visibleOnly: bool = True) -> bool
Check if a there are duplicate parameters in this options. Two parameters are considered
duplicates if they have a common name. If visibleOnly is set to True, parameters with
visibility OEParamVisibility_Hidden are ignored from this check. This
operation is always recursive to the associated sub-options.
HasOption
HasOption(name: str) -> bool
Check if a sub-options with the specified name exists in the options.
HasParameter
HasParameter(name: str) -> bool
Check if a parameter with the specified name (or alias) exists in the options.
SetBrief
SetBrief(brief: str) -> bool
Sets the brief description of the Options.
SetName
SetName(name: str) -> bool
Sets the name of the Options.
SetOrderPriority
SetOrderPriority(priority: int) -> bool
Sets the order priority of the Options, which is used to control the order Options appear in help lists. Default: 0
SetParameterVisibility
SetParameterVisibility(visibility: int) -> bool
SetParameterVisibility(name: str, visibility: int) -> bool
Sets the visibility of the parameters to the specified value. This operation is
always recursive to the associated sub-options. Valid settings are defined in the OEParamVisibility namespace.
UpdateValues
UpdateValues(opts: OEOptions) -> bool
Update parameters values of this options, from the parameter values of the soecified options. Two parameters are considered same if they have a common name and data type. This operation is always recursive to the associated sub-options.