Point

A point with two coordinates.

Constructors

this
this(graphene_point_t* graphene_point, bool ownedRef)

Sets our main struct and passes it to the parent class.

this
this()

Allocates a new #graphene_point_t structure.

Destructor

~this
~this()
Undocumented in source.

Members

Functions

distance
float distance(Point b, float dX, float dY)

Computes the distance between @a and @b.

equal
bool equal(Point b)

Checks if the two points @a and @b point to the same coordinates.

free
void free()

Frees the resources allocated by graphene_point_alloc().

getPointStruct
graphene_point_t* getPointStruct(bool transferOwnership)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

init
Point init(float x, float y)

Initializes @p to the given @x and @y coordinates.

initFromPoint
Point initFromPoint(Point src)

Initializes @p with the same coordinates of @src.

initFromVec2
Point initFromVec2(Vec2 src)

Initializes @p with the coordinates inside the given #graphene_vec2_t.

interpolate
void interpolate(Point b, double factor, Point res)

Linearly interpolates the coordinates of @a and @b using the given @factor.

near
bool near(Point b, float epsilon)

Checks whether the two points @a and @b are within the threshold of @epsilon.

toVec2
void toVec2(Vec2 v)

Stores the coordinates of the given #graphene_point_t into a #graphene_vec2_t.

Properties

x
float x [@property getter]
float x [@property setter]

the X coordinate of the point

y
float y [@property getter]
float y [@property setter]

the Y coordinate of the point

Static functions

getType
GType getType()
zero
Point zero()

Returns a point fixed at (0, 0).

Variables

graphene_point
graphene_point_t* graphene_point;

the main Gtk struct

ownedRef
bool ownedRef;
Undocumented in source.

Meta