Constraint¶
Bases: object
Constraint class defines limits and valid values for a parameter.
Notes: This class is non-copyable and non-movable.
This abstract base class defines constraints on a parameter, such as minimum/maximum values, step size, and valid value lists.
isReadOnly()
¶
Check if read-only
Determines if the parameter is read-only.
Returns:
| Type | Description |
|---|---|
boolean
|
True if the parameter is read-only, false otherwise |
getType()
¶
Get parameter type
Retrieves the data type of the parameter.
Returns:
| Type | Description |
|---|---|
int
|
The parameter type (EParamType) |
hasMin()
¶
Check if minimum exists
Returns:
| Type | Description |
|---|---|
boolean
|
True if a minimum value is defined, false otherwise |
getMin()
¶
Get minimum value
Returns:
| Type | Description |
|---|---|
float
|
The minimum valid value |
hasMax()
¶
Check if maximum exists
Returns:
| Type | Description |
|---|---|
boolean
|
True if a maximum value is defined, false otherwise |
getMax()
¶
Get maximum value
Returns:
| Type | Description |
|---|---|
float
|
The maximum valid value |
hasStep()
¶
Check if step exists
Returns:
| Type | Description |
|---|---|
boolean
|
True if a step value is defined, false otherwise |
getStep()
¶
Get step value
Returns:
| Type | Description |
|---|---|
float
|
The step size |
hasKeyList()
¶
Check if key list exists
Returns:
| Type | Description |
|---|---|
boolean
|
True if a list of valid keys is available, false otherwise |
hasValueList()
¶
Check if value list exists
Returns:
| Type | Description |
|---|---|
boolean
|
True if a list of valid values is available, false otherwise |
getValueList()
¶
Get value list
Returns:
| Type | Description |
|---|---|
list[string]
|
A vector of valid value strings |
getKeyList()
¶
Get key list
Returns:
| Type | Description |
|---|---|
list[string]
|
A vector of valid key strings |
getKeyType()
¶
Get key type
Returns:
| Type | Description |
|---|---|
int
|
The type of the keys |
getValue(key)
¶
Retrieves the value associated with a key.
Retrieves the value corresponding to a specific key.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
string
|
The key to look up |
required |
Returns:
| Type | Description |
|---|---|
str
|
The corresponding value |
hasSubConstraint(property)
¶
Check if sub-constraint exists
Checks if a sub-constraint exists. Sub-constraints are constraints on existing properties.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
property
|
string
|
The property name to check |
required |
Returns:
| Type | Description |
|---|---|
boolean
|
True if a sub-constraint exists for the property, false otherwise |
getSubConstraint(property)
¶
Get sub-constraint
Retrieves a sub-constraint. Sub-constraints are constraints on existing properties.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
property
|
string
|
The property name |
required |
Returns:
| Type | Description |
|---|---|
Constraint
|
A shared pointer to the sub-constraint, or null if not found |
cloneConstraint()
¶
Clone constraint
Creates a deep copy of the constraint.
Returns:
| Type | Description |
|---|---|
Constraint
|
A shared pointer to the cloned constraint |