NovaSVG 0.11.5
An SVG library
Loading...
Searching...
No Matches
nova::vg::box Class Reference

Represents a 2D axis-aligned bounding box. More...

#include <geometry.h>

Public Member Functions

 box ()=default
 Constructs a box with zero dimensions.
 box (float x, float y, float w, float h)
 Constructs a box with the specified position and size.
box & transform (const stb::matrix &matrix)
 Transforms the box using the specified matrix.
box transformed (const stb::matrix &matrix) const
 Returns a new box transformed by the specified matrix.

Public Attributes

float x {0}
 The x-coordinate of the box's origin.
float y {0}
 The y-coordinate of the box's origin.
float w {0}
 The width of the box.
float h {0}
 The height of the box.

Detailed Description

Represents a 2D axis-aligned bounding box.

Definition at line 18 of file geometry.h.

Constructor & Destructor Documentation

◆ box() [1/2]

nova::vg::box::box ( )
default

Constructs a box with zero dimensions.

Referenced by transform(), and transformed().

◆ box() [2/2]

nova::vg::box::box ( float x,
float y,
float w,
float h )

Constructs a box with the specified position and size.

Parameters
xThe x-coordinate of the box's origin.
yThe y-coordinate of the box's origin.
wThe width of the box.
hThe height of the box.

References h, w, x, and y.

Member Function Documentation

◆ transform()

box & nova::vg::box::transform ( const stb::matrix & matrix)

Transforms the box using the specified matrix.

Parameters
matrixThe transformation matrix.
Returns
A reference to this box, modified by the transformation.

References box().

◆ transformed()

box nova::vg::box::transformed ( const stb::matrix & matrix) const

Returns a new box transformed by the specified matrix.

Parameters
matrixThe transformation matrix.
Returns
A new box, transformed by the matrix.

References box().

Member Data Documentation

◆ h

float nova::vg::box::h {0}

The height of the box.

Definition at line 51 of file geometry.h.

Referenced by box().

◆ w

float nova::vg::box::w {0}

The width of the box.

Definition at line 50 of file geometry.h.

Referenced by box().

◆ x

float nova::vg::box::x {0}

The x-coordinate of the box's origin.

Definition at line 48 of file geometry.h.

Referenced by box().

◆ y

float nova::vg::box::y {0}

The y-coordinate of the box's origin.

Definition at line 49 of file geometry.h.

Referenced by box().


The documentation for this class was generated from the following file:
  • /home/runner/work/novasvg/novasvg/include/nova/vg/geometry.h