pub struct PaintVolume(/* private fields */);
Implementations§
Source§impl PaintVolume
impl PaintVolume
Sourcepub fn get_depth(&self) -> f32
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.
Sourcepub fn get_height(&self) -> f32
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.
Sourcepub fn get_origin(&self) -> Vertex
pub fn get_origin(&self) -> Vertex
Sourcepub fn get_width(&self) -> f32
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.
Sourcepub fn set_depth(&mut self, depth: f32)
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
Sourcepub fn set_from_allocation<P: IsA<Actor>>(&mut self, actor: &P) -> bool
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
Sourcepub fn set_height(&mut self, height: f32)
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
Sourcepub fn set_origin(&mut self, origin: &Vertex)
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
Sourcepub fn set_width(&mut self, width: f32)
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
Sourcepub fn union(&mut self, another_pv: &PaintVolume)
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
Trait Implementations§
Source§impl Clone for PaintVolume
impl Clone for PaintVolume
Source§fn clone(&self) -> PaintVolume
fn clone(&self) -> PaintVolume
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for PaintVolume
impl Debug for PaintVolume
Source§impl Hash for PaintVolume
impl Hash for PaintVolume
Source§impl Ord for PaintVolume
impl Ord for PaintVolume
Source§fn cmp(&self, other: &PaintVolume) -> Ordering
fn cmp(&self, other: &PaintVolume) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for PaintVolume
impl PartialEq for PaintVolume
Source§impl PartialOrd for PaintVolume
impl PartialOrd for PaintVolume
Source§impl StaticType for PaintVolume
impl StaticType for PaintVolume
Source§fn static_type() -> Type
fn static_type() -> Type
Self
.