A point with 2 coordinates.
More...
#include <gdkmm/graphene_point.h>
|
| | Point () |
| | Constructs an invalid object.
|
| |
| | Point (graphene_point_t * castitem, bool make_a_copy=false) |
| |
| | Point (const Point & src) |
| |
| Point & | operator= (const Point & src) |
| |
| | Point (Point && other) noexcept |
| |
| Point & | operator= (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.
|
| |
| | Point (float x, float y) |
| |
| | operator bool () const |
| | Checks if this instance is valid.
|
| |
| 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.
|
| |
| bool | near (const Point & b, float epsilon) const |
| | Checks whether the two points a and b are within the threshold of epsilon.
|
| |
A point with 2 coordinates.
Gdk::Graphene::Point is a data structure capable of describing a point with two coordinates.
- Since gtkmm 4.12:
◆ 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 |
|
) |
| |
◆ 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
-
- 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
-
| b | A #graphene_point_t. |
| epsilon | Threshold 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 |
◆ swap()
- Parameters
-
| lhs | The left-hand side |
| rhs | The right-hand side |
◆ wrap()
A Glib::wrap() method for this object.
- Parameters
-
| object | The C instance. |
| take_copy | False 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.
◆ gobject_
| graphene_point_t* Gdk::Graphene::Point::gobject_ |
|
protected |