AeonGUI
A portable video game graphic user interface library.
Loading...
Searching...
No Matches
AeonGUI::CairoPath Class Reference

Cairo-backend path implementation. More...

#include </d/a/AeonGUI/AeonGUI/include/aeongui/CairoPath.hpp>

Inheritance diagram for AeonGUI::CairoPath:
[legend]
Collaboration diagram for AeonGUI::CairoPath:
[legend]

Public Member Functions

 CairoPath ()
 Default constructor.
void Construct (const std::vector< DrawType > &aCommands, size_t aPathDataHint=0) final
 Build the Cairo path from a vector of draw commands.
void Construct (const DrawType *aCommands, size_t aCommandCount, size_t aPathDataHint=0) final
 Build the Cairo path from a raw array of draw commands.
 ~CairoPath ()
 Destructor. Frees path data.
const cairo_path_t * GetCairoPath () const
 Get the underlying Cairo path structure.
double GetTotalLength () const final
 Compute the total arc length of the path.
PathPoint GetPointAtLength (double aDistance) const final
 Get the position and tangent angle at a distance along the path.
bool IsClosed () const final
 Check whether the path contains a close-path command.
Public Member Functions inherited from AeonGUI::Path
virtual ~Path ()=0
 Virtual destructor.

Detailed Description

Cairo-backend path implementation.

Converts DrawType command sequences into a cached cairo_path_t structure for efficient repeated rendering.

Member Function Documentation

◆ Construct() [1/2]

void AeonGUI::CairoPath::Construct ( const DrawType * aCommands,
size_t aCommandCount,
size_t aPathDataHint = 0 )
finalvirtual

Build the Cairo path from a raw array of draw commands.

Parameters
aCommandsPointer to the command array.
aCommandCountNumber of commands.
aPathDataHintPre-computed size hint for mPathData.

Implements AeonGUI::Path.

◆ Construct() [2/2]

void AeonGUI::CairoPath::Construct ( const std::vector< DrawType > & aCommands,
size_t aPathDataHint = 0 )
finalvirtual

Build the Cairo path from a vector of draw commands.

Parameters
aCommandsThe draw command sequence.
aPathDataHintPre-computed size hint for mPathData.

Implements AeonGUI::Path.

◆ GetCairoPath()

const cairo_path_t * AeonGUI::CairoPath::GetCairoPath ( ) const

Get the underlying Cairo path structure.

Returns
Pointer to the cairo_path_t.

◆ GetPointAtLength()

PathPoint AeonGUI::CairoPath::GetPointAtLength ( double aDistance) const
finalvirtual

Get the position and tangent angle at a distance along the path.

Parameters
aDistanceDistance from the path start in user units.
Returns
PathPoint with x, y, and tangent angle.

Implements AeonGUI::Path.

◆ GetTotalLength()

double AeonGUI::CairoPath::GetTotalLength ( ) const
finalvirtual

Compute the total arc length of the path.

Returns
Total length in user units.

Implements AeonGUI::Path.

◆ IsClosed()

bool AeonGUI::CairoPath::IsClosed ( ) const
finalvirtual

Check whether the path contains a close-path command.

Returns
true if the path is closed.

Implements AeonGUI::Path.


The documentation for this class was generated from the following files:
  • /d/a/AeonGUI/AeonGUI/include/aeongui/CairoPath.hpp
  • /d/a/AeonGUI/AeonGUI/core/CairoPath.cpp