GraceFt v2.3
开源图形引擎 EGE(Easy Graphics Engine) 的高层封装库
 
载入中...
搜索中...
未找到
GFt::Ellipse< T > 模板类 参考

椭圆类 更多...

#include <Ellipse.hpp>

Public 成员函数

constexpr Ellipse (const Point< T > &center, T rx, T ry)
 构造函数
 
constexpr Ellipse (const Rect< T > &rect)
 构造函数
 
constexpr auto area () const
 椭圆的面积
 
constexpr Point< Tcenter () const
 椭圆的圆心
 
constexpr T height () const
 椭圆的高度
 
template<typename U >
requires std::is_arithmetic_v<U>
constexpr operator Ellipse< U > () const
 类型转换函数
 
constexpr bool operator!= (const Ellipse< T > &other) const
 判断两个椭圆是否不同
 
constexpr bool operator== (const Ellipse< T > &other) const
 判断两个椭圆是否相同
 
constexpr const Rect< T > & rect () const
 椭圆的外接矩形
 
constexpr T rx () const
 椭圆的水平半径
 
constexpr T ry () const
 椭圆的竖直半径
 
constexpr T width () const
 椭圆的宽度
 

友元

std::ostream & operator<< (std::ostream &os, const Ellipse< T > &elliptic)
 流操作运算符
 

详细描述

template<typename T>
requires std::is_arithmetic_v<T>
class GFt::Ellipse< T >

椭圆类

模板参数
T数值类型, 要求为算术类型

构造及析构函数说明

◆ Ellipse() [1/2]

template<typename T >
GFt::Ellipse< T >::Ellipse ( const Rect< T > & rect)
inlineconstexpr

构造函数

参数
rect椭圆的外接矩形

◆ Ellipse() [2/2]

template<typename T >
GFt::Ellipse< T >::Ellipse ( const Point< T > & center,
T rx,
T ry )
inlineconstexpr

构造函数

参数
center椭圆的中心点
rx椭圆的水平半径
ry椭圆的竖直半径

成员函数说明

◆ area()

template<typename T >
auto GFt::Ellipse< T >::area ( ) const
inlineconstexpr

椭圆的面积

返回
椭圆的面积

◆ center()

template<typename T >
Point< T > GFt::Ellipse< T >::center ( ) const
inlineconstexpr

椭圆的圆心

返回
椭圆的圆心

◆ height()

template<typename T >
T GFt::Ellipse< T >::height ( ) const
inlineconstexpr

椭圆的高度

返回
椭圆的高度

◆ operator Ellipse< U >()

template<typename T >
template<typename U >
requires std::is_arithmetic_v<U>
GFt::Ellipse< T >::operator Ellipse< U > ( ) const
inlineconstexpr

类型转换函数

模板参数
U目标类型
返回
目标类型椭圆

◆ operator!=()

template<typename T >
bool GFt::Ellipse< T >::operator!= ( const Ellipse< T > & other) const
inlineconstexpr

判断两个椭圆是否不同

参数
other另一个椭圆
返回
若两个椭圆不同, 则返回 true, 否则返回 false

◆ operator==()

template<typename T >
bool GFt::Ellipse< T >::operator== ( const Ellipse< T > & other) const
inlineconstexpr

判断两个椭圆是否相同

参数
other另一个椭圆
返回
若两个椭圆相同, 则返回 true, 否则返回 false

◆ rect()

template<typename T >
const Rect< T > & GFt::Ellipse< T >::rect ( ) const
inlineconstexpr

椭圆的外接矩形

返回
椭圆的外接矩形

◆ rx()

template<typename T >
T GFt::Ellipse< T >::rx ( ) const
inlineconstexpr

椭圆的水平半径

返回
椭圆的水平半径

◆ ry()

template<typename T >
T GFt::Ellipse< T >::ry ( ) const
inlineconstexpr

椭圆的竖直半径

返回
椭圆的竖直半径

◆ width()

template<typename T >
T GFt::Ellipse< T >::width ( ) const
inlineconstexpr

椭圆的宽度

返回
椭圆的宽度

友元及相关符号说明

◆ operator<<

template<typename T >
std::ostream & operator<< ( std::ostream & os,
const Ellipse< T > & elliptic )
friend

流操作运算符

参数
os输出流
elliptic椭圆
返回
输出流 os