Struct PaintVolume

Source
pub struct PaintVolume(/* private fields */);

Implementations§

Source§

impl PaintVolume

Source

pub fn get_depth(&self) -> f32

Retrieves the depth of the volume’s, axis aligned, bounding box.

In other words; this takes into account what actor’s coordinate space self belongs too and conceptually fits an axis aligned box around the volume. It returns the size of that bounding box as measured along the z-axis.

If, for example, ActorExt::get_transformed_paint_volume is used to transform a 2D child actor that is 100px wide, 100px high and 0px deep into container coordinates then the depth might not simply be 0px if the child actor has a 3D rotation applied to it.

Remember: if ActorExt::get_transformed_paint_volume is used then the transformed volume will be defined relative to the container actor and in container coordinates a 2D child actor can have a 3D bounding volume.

There are no accuracy guarantees for the reported depth, except that it must always be greater than, or equal to, the actor’s depth. This is because actors may report simple, loose fitting paint volumes for efficiency.

§Returns

the depth, in units of self’s local coordinate system.

Source

pub fn get_height(&self) -> f32

Retrieves the height of the volume’s, axis aligned, bounding box.

In other words; this takes into account what actor’s coordinate space self belongs too and conceptually fits an axis aligned box around the volume. It returns the size of that bounding box as measured along the y-axis.

If, for example, ActorExt::get_transformed_paint_volume is used to transform a 2D child actor that is 100px wide, 100px high and 0px deep into container coordinates then the height might not simply be 100px if the child actor has a 3D rotation applied to it.

Remember: if ActorExt::get_transformed_paint_volume is used then a transformed child volume will be defined relative to the ancestor container actor and so a 2D child actor can have a 3D bounding volume.

There are no accuracy guarantees for the reported height, except that it must always be greater than, or equal to, the actor’s height. This is because actors may report simple, loose fitting paint volumes for efficiency.

§Returns

the height, in units of self’s local coordinate system.

Source

pub fn get_origin(&self) -> Vertex

Retrieves the origin of the PaintVolume.

§vertex

the return location for a Vertex

Source

pub fn get_width(&self) -> f32

Retrieves the width of the volume’s, axis aligned, bounding box.

In other words; this takes into account what actor’s coordinate space self belongs too and conceptually fits an axis aligned box around the volume. It returns the size of that bounding box as measured along the x-axis.

If, for example, ActorExt::get_transformed_paint_volume is used to transform a 2D child actor that is 100px wide, 100px high and 0px deep into container coordinates then the width might not simply be 100px if the child actor has a 3D rotation applied to it.

Remember: if ActorExt::get_transformed_paint_volume is used then a transformed child volume will be defined relative to the ancestor container actor and so a 2D child actor can have a 3D bounding volume.

There are no accuracy guarantees for the reported width, except that it must always be greater than, or equal to, the actor’s width. This is because actors may report simple, loose fitting paint volumes for efficiency.

§Returns

the width, in units of self’s local coordinate system.

Source

pub fn set_depth(&mut self, depth: f32)

Sets the depth of the paint volume. The depth is measured along the z axis in the actor coordinates that self is associated with.

§depth

the depth of the paint volume, in pixels

Source

pub fn set_from_allocation<P: IsA<Actor>>(&mut self, actor: &P) -> bool

Sets the PaintVolume from the allocation of actor.

This function should be used when overriding the ActorClass.get_paint_volume() by Actor sub-classes that do not paint outside their allocation.

A typical example is:

static gboolean
my_actor_get_paint_volume (ClutterActor       *self,
                           ClutterPaintVolume *volume)
{
  return clutter_paint_volume_set_from_allocation (volume, self);
}
§actor

a Actor

§Returns

true if the paint volume was successfully set, and false otherwise

Source

pub fn set_height(&mut self, height: f32)

Sets the height of the paint volume. The height is measured along the y axis in the actor coordinates that self is associated with.

§height

the height of the paint volume, in pixels

Source

pub fn set_origin(&mut self, origin: &Vertex)

Sets the origin of the paint volume.

The origin is defined as the X, Y and Z coordinates of the top-left corner of an actor’s paint volume, in actor coordinates.

The default is origin is assumed at: (0, 0, 0)

§origin

a Vertex

Source

pub fn set_width(&mut self, width: f32)

Sets the width of the paint volume. The width is measured along the x axis in the actor coordinates that self is associated with.

§width

the width of the paint volume, in pixels

Source

pub fn union(&mut self, another_pv: &PaintVolume)

Updates the geometry of self to encompass self and another_pv.

There are no guarantees about how precisely the two volumes will be unioned.

§another_pv

A second PaintVolume to union with self

Source

pub fn union_box(&mut self, box_: &ActorBox)

Unions the 2D region represented by box_ to a PaintVolume.

This function is similar to PaintVolume::union, but it is specific for 2D regions.

§box_

a ActorBox to union to self

Trait Implementations§

Source§

impl Clone for PaintVolume

Source§

fn clone(&self) -> PaintVolume

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PaintVolume

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Hash for PaintVolume

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for PaintVolume

Source§

fn cmp(&self, other: &PaintVolume) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for PaintVolume

Source§

fn eq(&self, other: &PaintVolume) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for PaintVolume

Source§

fn partial_cmp(&self, other: &PaintVolume) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl StaticType for PaintVolume

Source§

fn static_type() -> Type

Returns the type identifier of Self.
Source§

impl Eq for PaintVolume

Source§

impl StructuralPartialEq for PaintVolume

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for T

Source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for T

Source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for T

Source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for T

Source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for T

Source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for T

Source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for T

Source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for T

Source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for T

Source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for T

Source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for T

Source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for T

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToValue for T
where T: SetValue + ?Sized,

Source§

fn to_value(&self) -> Value

Returns a Value clone of self.
Source§

fn to_value_type(&self) -> Type

Returns the type identifer of self. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.