Fluid
Loading...
Searching...
No Matches
Public Member Functions | Properties | List of all members
Fluid::CornersGroup Class Reference

Represents the corner radii for a rectangular material-design shape. More...

#include <cornersgroup.h>

Public Member Functions

Q_INVOKABLE CornersGroup () noexcept
 Default constructs all radii to 0.
 
Q_INVOKABLE CornersGroup (qreal) noexcept
 Constructs with all four radii set to r.
 
Q_INVOKABLE CornersGroup (qreal topLeft, qreal topRight, qreal bottomLeft, qreal bottomRight) noexcept
 Constructs with individually specified radii.
 
 ~CornersGroup ()
 Default destructor.
 
 CornersGroup (const CornersGroup &)=default
 
 CornersGroup (CornersGroup &&)=default
 
CornersGroupoperator= (const CornersGroup &)=default
 
CornersGroupoperator= (CornersGroup &&)=default
 
qreal radius () const noexcept
 Returns the largest of the four corner radii.
 
void setRadius (qreal) noexcept
 Sets all four corner radii to the same value.
 
qreal topLeft () const noexcept
 Returns the top-left corner radius.
 
void setTopLeft (qreal newTopLeft) noexcept
 Sets the top-left corner radius.
 
qreal topRight () const noexcept
 Returns the top-right corner radius.
 
void setTopRight (qreal newTopRight) noexcept
 Sets the top-right corner radius.
 
qreal bottomLeft () const noexcept
 Returns the bottom-left corner radius.
 
void setBottomLeft (qreal newBottomLeft) noexcept
 Sets the bottom-left corner radius.
 
qreal bottomRight () const noexcept
 Returns the bottom-right corner radius.
 
void setBottomRight (qreal newBottomRight) noexcept
 Sets the bottom-right corner radius.
 
Q_INVOKABLE QVector4D toVector4D () const noexcept
 Converts the corner radii to a QVector4D.
 
 operator QVector4D () const noexcept
 Conversion operator to QVector4D.
 

Properties

QML_CONSTRUCTIBLE_VALUEqreal radius
 
qreal topLeft
 
qreal topRight
 
qreal bottomLeft
 
qreal bottomRight
 

Detailed Description

Represents the corner radii for a rectangular material-design shape.

CornersGroup stores four independent corner radii (top-left, top-right, bottom-left, bottom-right) used to describe the rounded corners of a shape. Radii are expressed in the framework's logical units (qreal) and may be converted to a QVector4D for GPU/paint operations or uniform uploads.

The class is lightweight, trivially copyable, and all accessor and mutator operations are noexcept.

Usage notes:

Threading:

Examples:

// uniform rounded rectangle
// different radii
Fluid::CornersGroup c(5.0, 3.0, 4.0, 2.0);
// upload to shader as vec4: (tl, tr, bl, br)
QVector4D v = c.toVector4D();
Represents the corner radii for a rectangular material-design shape.
Definition cornersgroup.h:24

Constructor & Destructor Documentation

◆ CornersGroup() [1/5]

Fluid::CornersGroup::CornersGroup ( )
noexcept

Default constructs all radii to 0.

◆ CornersGroup() [2/5]

Fluid::CornersGroup::CornersGroup ( qreal  r)
noexcept

Constructs with all four radii set to r.

Parameters
rRadius applied to all corners.

◆ CornersGroup() [3/5]

Fluid::CornersGroup::CornersGroup ( qreal  topLeft,
qreal  topRight,
qreal  bottomLeft,
qreal  bottomRight 
)
noexcept

Constructs with individually specified radii.

Parameters
topLeftRadius for the top-left corner.
topRightRadius for the top-right corner.
bottomLeftRadius for the bottom-left corner.
bottomRightRadius for the bottom-right corner.

◆ ~CornersGroup()

Fluid::CornersGroup::~CornersGroup ( )

Default destructor.

◆ CornersGroup() [4/5]

Fluid::CornersGroup::CornersGroup ( const CornersGroup )
default

◆ CornersGroup() [5/5]

Fluid::CornersGroup::CornersGroup ( CornersGroup &&  )
default

Member Function Documentation

◆ bottomLeft()

qreal Fluid::CornersGroup::bottomLeft ( ) const
noexcept

Returns the bottom-left corner radius.

Returns
bottom-left corner radius.

◆ bottomRight()

qreal Fluid::CornersGroup::bottomRight ( ) const
noexcept

Returns the bottom-right corner radius.

Returns
bottom-right corner radius.

◆ operator QVector4D()

Fluid::CornersGroup::operator QVector4D ( ) const
noexcept

Conversion operator to QVector4D.

Returns
QVector4D representation of the corner radii.

◆ operator=() [1/2]

CornersGroup & Fluid::CornersGroup::operator= ( const CornersGroup )
default

◆ operator=() [2/2]

CornersGroup & Fluid::CornersGroup::operator= ( CornersGroup &&  )
default

◆ radius()

auto Fluid::CornersGroup::radius ( ) const
noexcept

Returns the largest of the four corner radii.

  • Useful when computing a conservative inset or collision radius.
    Returns
    maximum of (top-left, top-right, bottom-left, bottom-right).

◆ setBottomLeft()

void Fluid::CornersGroup::setBottomLeft ( qreal  newBottomLeft)
noexcept

Sets the bottom-left corner radius.

Parameters
newBottomLeftNew radius for the bottom-left corner.

◆ setBottomRight()

void Fluid::CornersGroup::setBottomRight ( qreal  newBottomRight)
noexcept

Sets the bottom-right corner radius.

Parameters
newBottomRightNew radius for the bottom-right corner.

◆ setRadius()

void Fluid::CornersGroup::setRadius ( qreal  v)
noexcept

Sets all four corner radii to the same value.

Parameters
vRadius value applied to every corner.

◆ setTopLeft()

void Fluid::CornersGroup::setTopLeft ( qreal  newTopLeft)
noexcept

Sets the top-left corner radius.

Parameters
newTopLeftNew radius for the top-left corner.

◆ setTopRight()

void Fluid::CornersGroup::setTopRight ( qreal  newTopRight)
noexcept

Sets the top-right corner radius.

Parameters
newTopRightNew radius for the top-right corner.

◆ topLeft()

qreal Fluid::CornersGroup::topLeft ( ) const
noexcept

Returns the top-left corner radius.

Returns
top-left corner radius.

◆ topRight()

qreal Fluid::CornersGroup::topRight ( ) const
noexcept

Returns the top-right corner radius.

Returns
top-right corner radius.

◆ toVector4D()

QVector4D Fluid::CornersGroup::toVector4D ( ) const
noexcept

Converts the corner radii to a QVector4D.

Returns
QVector4D representation of the corner radii.

Property Documentation

◆ bottomLeft

qreal Fluid::CornersGroup::bottomLeft
readwrite

◆ bottomRight

qreal Fluid::CornersGroup::bottomRight
readwrite

◆ radius

QML_CONSTRUCTIBLE_VALUEqreal Fluid::CornersGroup::radius
read

◆ topLeft

qreal Fluid::CornersGroup::topLeft
readwrite

◆ topRight

qreal Fluid::CornersGroup::topRight
readwrite

The documentation for this class was generated from the following files: