gtkmm: Gsk::PathMeasure Class Reference

gtkmm 4.23.2

Public Member Functions | Static Public Member Functions | Protected Member Functions | Related Symbols | List of all members
Gsk::PathMeasure Class Referencefinal

Performs measurements on paths such as determining the length of the path. More...

`#include <gskmm/pathmeasure.h>`

## Public Member Functions
void | reference () const
| Increment the reference count for this object.
void | unreference () const
| Decrement the reference count for this object.
GskPathMeasure * | gobj ()
| Provides access to the underlying C instance.
const GskPathMeasure * | gobj () const
| Provides access to the underlying C instance.
GskPathMeasure * | gobj_copy () const
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
| PathMeasure ()=delete
| PathMeasure (const PathMeasure &)=delete
PathMeasure & | operator= (const PathMeasure &)=delete
Glib::RefPtr< Path > | get_path () const
| Returns the path that the measure was created for.
float | get_tolerance () const
| Returns the tolerance that the measure was created with.
float | get_length () const
| Gets the length of the path being measured.
std::optional< PathPoint > | get_point (float distance)
| Gets the point at the given distance into the path.

## Static Public Member Functions
static Glib::RefPtr< PathMeasure > | create (const Glib::RefPtr< const Path > & path)
| Creates a measure object for the given path with the default tolerance.
static Glib::RefPtr< PathMeasure > | create (const Glib::RefPtr< const Path > & path, float tolerance)
| Creates a measure object for the given path and tolerance.

## Protected Member Functions
void | operator delete (void *, std::size_t)

## Related Symbols
(Note that these are not member symbols.)
Glib::RefPtr< Gsk::PathMeasure > | wrap (GskPathMeasure * object, bool take_copy=false)
| A Glib::wrap() method for this object.

## Detailed Description

Performs measurements on paths such as determining the length of the path.

Many measuring operations require sampling the path length at intermediate points. Therefore, a Gsk::PathMeasure has a tolerance that determines what precision is required for such approximations.

Since gtkmm 4.24

## Constructor & Destructor Documentation

## ◆ PathMeasure() [1/2]

Gsk::PathMeasure::PathMeasure | ( |  | ) |
| delete

## ◆ PathMeasure() [2/2]

Gsk::PathMeasure::PathMeasure | ( | const PathMeasure & |  | ) |
| delete

## Member Function Documentation

## ◆ create() [1/2]

Glib::RefPtr< PathMeasure > Gsk::PathMeasure::create | ( | const Glib::RefPtr< const Path > & | path | ) |
| static

Creates a measure object for the given path with the default tolerance.

Since gtkmm 4.24

Parameters

  path | The path to measure.

Returns
  A new Gsk::PathMeasure representing path.

## ◆ create() [2/2]

Glib::RefPtr< PathMeasure > Gsk::PathMeasure::create | ( | const Glib::RefPtr< const Path > & | path,
|  | float | tolerance )
| static

Creates a measure object for the given path and tolerance.

Since gtkmm 4.24

Parameters

  path | The path to measure.
  tolerance | The tolerance for measuring operations.

Returns
  A new Gsk::PathMeasure representing path.

## ◆ get_length()

float Gsk::PathMeasure::get_length | ( |  | ) | const

Gets the length of the path being measured.

The length is cached, so this function does not do any work.

Since gtkmm 4.24

Returns
  The length of the path measured by self.

## ◆ get_path()

Glib::RefPtr< Path > Gsk::PathMeasure::get_path | ( |  | ) | const

Returns the path that the measure was created for.

Since gtkmm 4.24

Returns
  The path of self.

## ◆ get_point()

std::optional< PathPoint > Gsk::PathMeasure::get_point | ( | float | distance | ) |

Gets the point at the given distance into the path.

An empty path has no points, so no value is returned in that case.

Since gtkmm 4.24

Parameters

  distance | The distance.

Returns
  The point, if it was set.

## ◆ get_tolerance()

float Gsk::PathMeasure::get_tolerance | ( |  | ) | const

Returns the tolerance that the measure was created with.

Since gtkmm 4.24

Returns
  The tolerance of self.

## ◆ gobj() [1/2]

GskPathMeasure * Gsk::PathMeasure::gobj | ( |  | ) |

Provides access to the underlying C instance.

## ◆ gobj() [2/2]

const GskPathMeasure * Gsk::PathMeasure::gobj | ( |  | ) | const

Provides access to the underlying C instance.

## ◆ gobj_copy()

GskPathMeasure * Gsk::PathMeasure::gobj_copy | ( |  | ) | const

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

## ◆ operator delete()

void Gsk::PathMeasure::operator delete | ( | void * | ,
|  | std::size_t | )
| protected

## ◆ operator=()

PathMeasure & Gsk::PathMeasure::operator= | ( | const PathMeasure & |  | ) |
| delete

## ◆ reference()

void Gsk::PathMeasure::reference | ( |  | ) | const

Increment the reference count for this object.

You should never need to do this manually - use the object via a RefPtr instead.

## ◆ unreference()

void Gsk::PathMeasure::unreference | ( |  | ) | const

Decrement the reference count for this object.

You should never need to do this manually - use the object via a RefPtr instead.

## Friends And Related Symbol Documentation

## ◆ wrap()

Glib::RefPtr< Gsk::PathMeasure > wrap | ( | GskPathMeasure * | object,
|  | bool | take_copy = false )
| related

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.