gtkmm 4.14.0
Public Member Functions | Protected Attributes | Related Functions | List of all members
Gdk::Graphene::Point Class Reference

A point with 2 coordinates. More...

#include <gdkmm/graphene_point.h>

Public Member Functions

 Point ()
 Constructs an invalid object. More...
 
 Point (graphene_point_t * castitem, bool make_a_copy=false)
 
 Point (const Point & src)
 
Pointoperator= (const Point & src)
 
 Point (Point && other) noexcept
 
Pointoperator= (Point && other) noexcept
 
 ~Point () noexcept
 
void swap (Point & other) noexcept
 
graphene_point_t * gobj ()
 
const graphene_point_t * gobj () const
 
graphene_point_t * gobj_copy () const
 Provides access to the underlying C instance. The caller is responsible for freeing it. Use when directly setting fields in structs. More...
 
 Point (float x, float y)
 
 operator bool () const
 Checks if this instance is valid. More...
 
float get_x () const
 
void set_x (const float & value)
 
float get_y () const
 
void set_y (const float & value)
 
bool equal (const Point & b) const
 Checks if the two points a and b point to the same coordinates. More...
 
bool near (const Point & b, float epsilon) const
 Checks whether the two points a and b are within the threshold of epsilon. More...
 

Protected Attributes

graphene_point_t * gobject_
 

Related Functions

(Note that these are not member functions.)

void swap (Point & lhs, Point & rhs) noexcept
 
Gdk::Graphene::Point wrap (graphene_point_t * object, bool take_copy=false)
 A Glib::wrap() method for this object. More...
 

Detailed Description

A point with 2 coordinates.

Gdk::Graphene::Point is a data structure capable of describing a point with two coordinates.

Since gtkmm 4.12:

Constructor & Destructor Documentation

◆ Point() [1/5]

Gdk::Graphene::Point::Point ( )

Constructs an invalid object.

E.g. for output arguments to methods. There is not much you can do with the object before it has been assigned a valid value.

◆ Point() [2/5]

Gdk::Graphene::Point::Point ( graphene_point_t *  castitem,
bool  make_a_copy = false 
)
explicit

◆ Point() [3/5]

Gdk::Graphene::Point::Point ( const Point src)

◆ Point() [4/5]

Gdk::Graphene::Point::Point ( Point &&  other)
noexcept

◆ ~Point()

Gdk::Graphene::Point::~Point ( )
noexcept

◆ Point() [5/5]

Gdk::Graphene::Point::Point ( float  x,
float  y 
)

Member Function Documentation

◆ equal()

bool Gdk::Graphene::Point::equal ( const Point b) const

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

This function accounts for floating point fluctuations; if you want to control the fuzziness of the match, you can use graphene_point_near() instead.

Since gtkmm 4.12:
Parameters
bA #graphene_point_t.
Returns
true if the points have the same coordinates.

◆ get_x()

float Gdk::Graphene::Point::get_x ( ) const

◆ get_y()

float Gdk::Graphene::Point::get_y ( ) const

◆ gobj() [1/2]

graphene_point_t * Gdk::Graphene::Point::gobj ( )
inline

◆ gobj() [2/2]

const graphene_point_t * Gdk::Graphene::Point::gobj ( ) const
inline

◆ gobj_copy()

graphene_point_t * Gdk::Graphene::Point::gobj_copy ( ) const

Provides access to the underlying C instance. The caller is responsible for freeing it. Use when directly setting fields in structs.

◆ near()

bool Gdk::Graphene::Point::near ( const Point b,
float  epsilon 
) const

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

Since gtkmm 4.12:
Parameters
bA #graphene_point_t.
epsilonThreshold between the two points.
Returns
true if the distance is within epsilon.

◆ operator bool()

Gdk::Graphene::Point::operator bool ( ) const
explicit

Checks if this instance is valid.

It is valid if and only if it contains a value. For instance,

if (point)
do_something()

◆ operator=() [1/2]

Point & Gdk::Graphene::Point::operator= ( const Point src)

◆ operator=() [2/2]

Point & Gdk::Graphene::Point::operator= ( Point &&  other)
noexcept

◆ set_x()

void Gdk::Graphene::Point::set_x ( const float &  value)

◆ set_y()

void Gdk::Graphene::Point::set_y ( const float &  value)

◆ swap()

void Gdk::Graphene::Point::swap ( Point other)
noexcept

Friends And Related Function Documentation

◆ swap()

void swap ( Point lhs,
Point rhs 
)
related
Parameters
lhsThe left-hand side
rhsThe right-hand side

◆ wrap()

Gdk::Graphene::Point wrap ( graphene_point_t *  object,
bool  take_copy = false 
)
related

A Glib::wrap() method for this object.

Parameters
objectThe C instance.
take_copyFalse if the result should take ownership of the C instance. True if it should take a new copy or ref.
Returns
A C++ instance that wraps this C instance.

Member Data Documentation

◆ gobject_

graphene_point_t* Gdk::Graphene::Point::gobject_
protected