Struct FloatValueAccumulator
pub struct FloatValueAccumulator(/* private fields */);Expand description
Use a FloatValueAccumulator to increase the value of a float property type or a property field over time.
To use a FloatValueAccumulator, set:
-
The property type on the node whose value you want to increment. You set this in the TargetPropertyTypeProperty. If the target property type is a compound property type, to set the property field that you want to increment, use the TargetPropertyFieldProperty.
-
The size of the increment:
- To set increments of fixed size, set the IncrementSizeProperty.
- To define the size of increments with a property, set the IncrementSizeSourceProperty. For example, this way you can change the size of increments during application runtime.
-
The frequency of increments in milliseconds. You set this in the IncrementTimeIntervalProperty.
-
The range for the total sum of the increments:
- Set the lowest value with the MinimumAccumulatedValueProperty.
- Set the highest value with the MaximumAccumulatedValueProperty.
Keep in mind that the final value of the target property is the base value of the property plus the total sum of the increments added by a Value Accumulator.
-
How you want the Value Accumulator to handle the increments when it reaches the limits of the range of increments. You set this in the BoundTypeProperty. When the value of the target property reaches the limits of the range:
- BoundType::Clamp clamps the value
- BoundType::Loop wraps the value
§Examples
To use a Float Value Accumulator to accumulate values of a property into a field of another property over time:
See: IntValueAccumulator
§Since
Kanzi 3.9.2
Implementations§
§impl FloatValueAccumulator
impl FloatValueAccumulator
pub fn get_increment_size_source(&self) -> Result<KanziString, Error>
pub fn get_increment_size_source(&self) -> Result<KanziString, Error>
pub fn get_increment_size(&self) -> Result<f32, Error>
pub fn get_increment_size(&self) -> Result<f32, Error>
pub fn set_increment_size(&self, value: f32) -> Result<(), Error>
pub fn set_increment_size(&self, value: f32) -> Result<(), Error>
pub fn get_target_property_type(&self) -> Result<KanziString, Error>
pub fn get_target_property_type(&self) -> Result<KanziString, Error>
pub fn get_target_property_field(&self) -> Result<PropertyField, Error>
pub fn get_target_property_field(&self) -> Result<PropertyField, Error>
pub fn set_target_property_field(
&self,
value: PropertyField,
) -> Result<(), Error>
pub fn set_target_property_field( &self, value: PropertyField, ) -> Result<(), Error>
pub fn get_minimum_accumulated_value(&self) -> Result<f32, Error>
pub fn get_minimum_accumulated_value(&self) -> Result<f32, Error>
pub fn set_minimum_accumulated_value(&self, value: f32) -> Result<(), Error>
pub fn set_minimum_accumulated_value(&self, value: f32) -> Result<(), Error>
pub fn get_maximum_accumulated_value(&self) -> Result<f32, Error>
pub fn get_maximum_accumulated_value(&self) -> Result<f32, Error>
pub fn set_maximum_accumulated_value(&self, value: f32) -> Result<(), Error>
pub fn set_maximum_accumulated_value(&self, value: f32) -> Result<(), Error>
Methods from Deref<Target = ValueAccumulatorBase>§
pub fn get_autoplay(&self) -> Result<bool, Error>
pub fn get_autoplay(&self) -> Result<bool, Error>
See: AUTOPLAY_PROPERTY
pub fn set_autoplay(&self, value: bool) -> Result<(), Error>
pub fn set_autoplay(&self, value: bool) -> Result<(), Error>
See: AUTOPLAY_PROPERTY
pub fn get_bound_type(&self) -> Result<BoundType, Error>
pub fn get_bound_type(&self) -> Result<BoundType, Error>
See: BOUND_TYPE_PROPERTY
pub fn set_bound_type(&self, value: BoundType) -> Result<(), Error>
pub fn set_bound_type(&self, value: BoundType) -> Result<(), Error>
See: BOUND_TYPE_PROPERTY
pub fn get_increment_time_interval(&self) -> Result<i32, Error>
pub fn get_increment_time_interval(&self) -> Result<i32, Error>
pub fn set_increment_time_interval(&self, value: i32) -> Result<(), Error>
pub fn set_increment_time_interval(&self, value: i32) -> Result<(), Error>
Methods from Deref<Target = NodeComponent>§
pub fn get_name(&self) -> Result<KanziString, Error>
pub fn get_name(&self) -> Result<KanziString, Error>
See: NAME_PROPERTY
pub fn get_node(&self) -> Result<Option<Weak<Node>>, Error>
pub fn get_node(&self) -> Result<Option<Weak<Node>>, Error>
Returns the node the node component is attached to
or None if node component is not attached to a node.
pub fn get_state(&self) -> Result<NodeComponentState, Error>
pub fn get_state(&self) -> Result<NodeComponentState, Error>
Gets the state of node component indicating if component is attached to a node, detached from any node or in process of attaching/detaching.
Methods from Deref<Target = Object>§
pub fn as_ptr(&self) -> *mut ObjectWrapper
pub fn as_wrapper(&self) -> &ObjectWrapper
pub fn as_object(&self) -> &Object
pub fn as_object(&self) -> &Object
Represents any type inheriting from Object as &Object.
This is useful for comparisions when PartialEq traits failed to compare objects of
different types.
let child = screen.get_child(0)?;
let parent = child.get_parent()?.into_error(ErrorKind::ObjectNotFound)?;
// assert_eq!(screen, parent); // <- Fails to compile!
assert_eq!(screen.as_object(), parent.as_object());pub fn get_native(&self) -> Result<NonNull<c_void>, Error>
pub fn get_native(&self) -> Result<NonNull<c_void>, Error>
Gets a pointer to the backing C++ instance.
pub fn get_property<T>(
&self,
property_type: &PropertyType<T>,
) -> Result<<T as VariantConstraint>::RetArg, Error>where
T: PropertyTypeConstraint,
pub fn get_property<T>(
&self,
property_type: &PropertyType<T>,
) -> Result<<T as VariantConstraint>::RetArg, Error>where
T: PropertyTypeConstraint,
Returns the current value of a property disregarding modifiers.
Base value is affected by the following inputs where the highest entry in the list determines the base value:
- Local value set with setProperty or loaded from kzb
- Value set by a style affecting the property.
- Value defined by class metadata.
Modifiers are not applied, the highest-priority base value is returned.
If no inputs to the property value can be established the system returns the value default value from property type metadata.
§Arguments
property_type- The property type identifying the property to retrieve.
§Returns
The evaluated property value.
pub fn get_optional_property<T>(
&self,
property_type: &PropertyType<T>,
) -> Result<Option<<T as VariantConstraint>::RetArg>, Error>where
T: PropertyTypeConstraint,
pub fn get_optional_property<T>(
&self,
property_type: &PropertyType<T>,
) -> Result<Option<<T as VariantConstraint>::RetArg>, Error>where
T: PropertyTypeConstraint,
Returns the current value of a property disregarding modifiers, but does not default to the value in property metadata if there are no inputs to the property value.
If there is no value sources, None is returned.
If no inputs to the property value can be established the system returns the value default value from property type metadata.
§Arguments
property_type- The property type identifying the property to retrieve.
§Returns
The evaluated property value.
pub fn set_property<T>(
&self,
property_type: &PropertyType<T>,
value: <T as VariantConstraint>::DataArg<'_>,
) -> Result<(), Error>where
T: PropertyTypeConstraint,
pub fn set_property<T>(
&self,
property_type: &PropertyType<T>,
value: <T as VariantConstraint>::DataArg<'_>,
) -> Result<(), Error>where
T: PropertyTypeConstraint,
Sets the local value of a property type.
pub fn has_value<T>(
&self,
property_type: &PropertyType<T>,
) -> Result<bool, Error>where
T: PropertyTypeConstraint,
pub fn has_value<T>(
&self,
property_type: &PropertyType<T>,
) -> Result<bool, Error>where
T: PropertyTypeConstraint,
Evaluates whether there are any inputs into the property value. Both value sources and modifiers are taken into account.
§Returns
Returns true if there are inputs into the property value, false otherwise.
pub fn remove_local_value<T>(
&self,
property_type: &PropertyType<T>,
) -> Result<(), Error>where
T: PropertyTypeConstraint,
pub fn remove_local_value<T>(
&self,
property_type: &PropertyType<T>,
) -> Result<(), Error>where
T: PropertyTypeConstraint,
Removes the local value associated with the property.
pub fn get_metaclass(&self) -> Result<Metaclass, Error>
pub fn get_metaclass(&self) -> Result<Metaclass, Error>
Returns the metaclass of the dynamic type of the object.
pub fn get_domain(&self) -> Result<Domain, Error>
pub fn get_domain(&self) -> Result<Domain, Error>
Returns the domain the object belongs to.
pub fn set_flag_keep_during_patching<T>(
&self,
property_type: &PropertyType<T>,
) -> Result<(), Error>where
T: PropertyTypeConstraint,
pub fn set_flag_keep_during_patching<T>(
&self,
property_type: &PropertyType<T>,
) -> Result<(), Error>where
T: PropertyTypeConstraint,
Sets the flag to indicate that the property was loaded from KZB.
pub fn debug_string(&self) -> Result<String, Error>
pub fn debug_string(&self) -> Result<String, Error>
Builds a string representation of the object intended for debugging purposes.
Trait Implementations§
§impl Clone for FloatValueAccumulator
impl Clone for FloatValueAccumulator
§fn clone(&self) -> FloatValueAccumulator
fn clone(&self) -> FloatValueAccumulator
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more