Clutter.PaintVolume

Fields

None

Methods

copy ()

free ()

get_depth ()

get_height ()

get_origin ()

get_width ()

set_depth (depth)

set_from_allocation (actor)

set_height (height)

set_origin (origin)

set_width (width)

union (another_pv)

union_box (box)

Details

class Clutter.PaintVolume

Clutter.PaintVolume is an opaque structure whose members cannot be directly accessed.

A Clutter.PaintVolume represents an a bounding volume whose internal representation isn’t defined but can be set and queried in terms of an axis aligned bounding box.

A Clutter.PaintVolume for a Clutter.Actor is defined to be relative from the current actor modelview matrix.

Other internal representation and methods for describing the bounding volume may be added in the future.

New in version 1.4.

copy()
Returns:

a newly allocated copy of a Clutter.PaintVolume

Return type:

Clutter.PaintVolume

Copies self into a new Clutter.PaintVolume

New in version 1.6.

free()

Frees the resources allocated by self

New in version 1.6.

get_depth()
Returns:

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

Return type:

float

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, Clutter.Actor.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 Clutter.Actor.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.

New in version 1.6.

get_height()
Returns:

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

Return type:

float

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, Clutter.Actor.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 Clutter.Actor.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.

New in version 1.6.

get_origin()
Returns:

the return location for a Clutter.Vertex

Return type:

vertex: Clutter.Vertex

Retrieves the origin of the Clutter.PaintVolume.

New in version 1.6.

get_width()
Returns:

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

Return type:

float

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, Clutter.Actor.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 Clutter.Actor.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.

New in version 1.6.

set_depth(depth)
Parameters:

depth (float) – the depth of the paint volume, in pixels

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

New in version 1.6.

set_from_allocation(actor)
Parameters:

actor (Clutter.Actor) – a Clutter.Actor

Returns:

True if the paint volume was successfully set, and False otherwise

Return type:

bool

Sets the Clutter.PaintVolume from the allocation of actor.

This function should be used when overriding the Clutter.Actor.do_get_paint_volume() by Clutter.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);
}

New in version 1.6.

set_height(height)
Parameters:

height (float) – the height of the paint volume, in pixels

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

New in version 1.6.

set_origin(origin)
Parameters:

origin (Clutter.Vertex) – a Clutter.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)

New in version 1.6.

set_width(width)
Parameters:

width (float) – the width of the paint volume, in pixels

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

New in version 1.6.

union(another_pv)
Parameters:

another_pv (Clutter.PaintVolume) – A second Clutter.PaintVolume to union with self

Updates the geometry of self to encompass self and another_pv.

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

New in version 1.6.

union_box(box)
Parameters:

box (Clutter.ActorBox) – a Clutter.ActorBox to union to self

Unions the 2D region represented by box to a Clutter.PaintVolume.

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

New in version 1.10.