GraceFt v2.3
开源图形引擎 EGE(Easy Graphics Engine) 的高层封装库
 
载入中...
搜索中...
未找到
GFt 命名空间参考

GraceFt库的命名空间 更多...

命名空间

namespace  json
 JSON 支持库
 
namespace  literals
 字面量定义
 
namespace  Sys
 系统调用接口函数
 
namespace  TransFuncs
 过渡函数集合
 
namespace  UI
 声明式UI框架
 
namespace  Widget
 定义式UI库
 

class  Animation
 动画模板类 更多...
 
class  AnimationAbstract
 动画抽象基类 更多...
 
class  AnimationManager
 动画管理器 更多...
 
struct  AnimationParams
 动画参数结构体 更多...
 
class  AnimationPause
 暂停状态 更多...
 
class  AnimationPlay
 播放状态 更多...
 
class  AnimationState
 动画状态基类 更多...
 
class  AnimationStop
 停止状态 更多...
 
class  Application
 应用程序类 更多...
 
class  Bezier
 贝塞尔曲线 更多...
 
class  Block
 块对象 更多...
 
class  BlockFocusManager
 焦点块管理器,用于管理当前焦点块 更多...
 
class  BlockHoverManager
 鼠标悬停管理器,用于管理当前鼠标悬停块 更多...
 
class  BrushSet
 画刷设置类 更多...
 
class  Channel
 通道模板类 更多...
 
class  Circle
 圆形模板类 更多...
 
class  Color
 颜色类 更多...
 
class  ColumnLayout
 列布局类 更多...
 
class  DeclarativeUIManager
 声明式UI管理器 更多...
 
class  Ellipse
 椭圆类 更多...
 
class  Event
 事件基类 更多...
 
class  EventMonitor
 事件监视器接口类 更多...
 
class  FitCurve
 拟合曲线类 更多...
 
class  Font
 字体类 更多...
 
class  Graphics
 绘图接口类 更多...
 
class  GraphInterface
 图形绘制接口 更多...
 
class  GridLayout
 网格布局类 更多...
 
class  KeyboardEvent
 键盘事件基类 更多...
 
class  KeyboardEventMonitor
 键盘事件监视器接口类 更多...
 
class  KeyPressEvent
 键盘按键按下事件 更多...
 
class  KeyPressEventMonitor
 键盘按下事件监视器接口类 更多...
 
class  KeyReleaseEvent
 键盘按键弹起事件 更多...
 
class  KeyReleaseEventMonitor
 键盘释放事件监视器接口类 更多...
 
class  Layout
 布局基类 更多...
 
class  Line
 几何线模板类 更多...
 
class  Matrix
 矩阵类模板 更多...
 
class  MouseButtonEvent
 鼠标按钮事件基类 更多...
 
class  MouseButtonEventMonitor
 鼠标按钮事件监视器接口类 更多...
 
class  MouseButtonPressEvent
 鼠标按钮按下事件 更多...
 
class  MouseButtonPressEventMonitor
 鼠标按钮按下事件监视器接口类 更多...
 
class  MouseButtonReleaseEvent
 鼠标按钮弹起事件 更多...
 
class  MouseButtonReleaseEventMonitor
 鼠标按钮释放事件监视器接口类 更多...
 
class  MouseEvent
 鼠标事件基类 更多...
 
class  MouseEventMonitor
 鼠标事件监视器接口类 更多...
 
class  MouseMoveEvent
 鼠标移动事件 更多...
 
class  MouseMoveEventMonitor
 鼠标移动事件监视器接口类 更多...
 
class  MouseWheelEvent
 鼠标滚轮事件 更多...
 
class  MouseWheelEventMonitor
 鼠标滚轮事件监视器接口类 更多...
 
class  Path
 路径类 更多...
 
class  PenSet
 画笔设置类 更多...
 
class  PixelMap
 位图类 更多...
 
class  PlanEvent
 计划刻事件管理器 更多...
 
class  Point
 泛型点类 更多...
 
class  Polygon
 多边形类 更多...
 
class  RadioManager
 单选框管理器 更多...
 
class  Rect
 矩形模板类 更多...
 
class  RoundRect
 圆角矩形类 更多...
 
class  RowLayout
 行布局类 更多...
 
class  Signal
 信号-槽机制支持 更多...
 
class  Signal< void >
 Signal 的无参数特化版本 更多...
 
class  Size
 泛型尺寸类 更多...
 
class  TextInputEvent
 文本输入事件 更多...
 
class  TextInputEventMonitor
 文本输入事件监视器接口类 更多...
 
class  TextSet
 文本环境设置类, 更多...
 
class  Texture
 纹理类 更多...
 
class  Window
 全局窗口对象 更多...
 

概念

concept  Animatable
 此概念约束类型 Type 必须支持线性插值运算
 

类型定义

using byte = unsigned char
 
using fBezier = Bezier<float>
 浮点型贝塞尔曲线
 
using fCircle = Circle<float>
 浮点型特化圆模板类
 
using fEllipse = Ellipse<float>
 浮点椭圆类型
 
using fFitCurve = FitCurve<float>
 浮点型拟合曲线
 
using fLine = Line<float>
 浮点型直线类型
 
using fMat2x2 = Mat2x2<float>
 2x2 浮点矩阵类型
 
using fMat3x3 = Mat3x3<float>
 3x3 浮点矩阵类型
 
using fMat4x4 = Mat4x4<float>
 4x4 浮点矩阵类型
 
using fPoint = Point<float>
 浮点型点类别别名
 
using fPolygon = Polygon<float>
 浮点数多边形类型
 
using fRect = Rect<float>
 浮点型矩形类型
 
using fRoundRect = RoundRect<float>
 浮点型圆角矩形类型
 
using fSize = Size<float>
 浮点型尺寸
 
using fVec2 = Vec2<float>
 二维浮点向量类型
 
using fVec3 = Vec3<float>
 三维浮点向量类型
 
using fVec4 = Vec4<float>
 四维浮点向量类型
 
template<typename Type >
using Getter = std::function<Type()>
 
using iBezier = Bezier<int>
 整数型贝塞尔曲线
 
using iCircle = Circle<int>
 整型特化圆模板类
 
using iEllipse = Ellipse<int>
 整数椭圆类型
 
using iFitCurve = FitCurve<int>
 整数型拟合曲线
 
using iLine = Line<int>
 整数型直线类型
 
using iMat2x2 = Mat2x2<int>
 2x2 整数矩阵类型
 
using iMat3x3 = Mat3x3<int>
 3x3 整数矩阵类型
 
using iMat4x4 = Mat4x4<int>
 4x4 整数矩阵类型
 
template<typename Type >
using Initial = std::variant<Type, Getter<Type>>
 
using iPoint = Point<int>
 整数型点类别别名
 
using iPolygon = Polygon<int>
 整数多边形类型
 
using iRect = Rect<int>
 整数型矩形类型
 
using iRoundRect = RoundRect<int>
 整型圆角矩形类型
 
using iSize = Size<int>
 整数型尺寸
 
using iVec2 = Vec2<int>
 二维整数向量类型
 
using iVec3 = Vec3<int>
 三维整数向量类型
 
using iVec4 = Vec4<int>
 四维整数向量类型
 
template<typename T >
using Mat2x2 = Matrix<2, 2, T>
 2x2 矩阵类型
 
template<typename T >
using Mat3x3 = Matrix<3, 3, T>
 3x3 矩阵类型
 
template<typename T >
using Mat4x4 = Matrix<4, 4, T>
 4x4 矩阵类型
 
template<typename Type >
using Setter = std::function<void(const Type&)>
 
using size = std::size_t
 
template<typename... Args>
using SlotId = std::size_t
 槽函数ID类型
 
template<typename T >
using StdString = std::basic_string<T>
 
using TimePoint = std::chrono::time_point<std::chrono::steady_clock>
 
using TransFunc = std::function<float(float)>
 
template<size N, typename T >
using Vec = Matrix<1, N, T>
 向量类型
 
template<typename T >
using Vec2 = Vec<2, T>
 二维向量类型
 
template<typename T >
using Vec3 = Vec<3, T>
 三维向量类型
 
template<typename T >
using Vec4 = Vec<4, T>
 四维向量类型
 

枚举

enum class  AnimationStateType { AnimationStateType::Stop , AnimationStateType::Play , AnimationStateType::Pause }
 动画状态类型 更多...
 
enum class  BrushStyle {
  BrushStyle::Default , BrushStyle::Texture , BrushStyle::LinearGradient , BrushStyle::RadialGradient ,
  BrushStyle::PolygonGradient
}
 画刷模式 更多...
 
enum class  CapStyle { CapStyle::Flat , CapStyle::Square , CapStyle::Round }
 线帽样式 更多...
 
enum class  FillStyle { FillStyle::Empty , FillStyle::Solid , FillStyle::Line }
 填充样式 更多...
 
enum class  FontWeight {
  FontWeight::Default = 0 , FontWeight::Thin = 100 , FontWeight::Extralight = 200 , FontWeight::Ultralight = 200 ,
  FontWeight::Light = 300 , FontWeight::Normal = 400 , FontWeight::Regular = 400 , FontWeight::Medium = 500 ,
  FontWeight::Semibold = 600 , FontWeight::Demibold = 600 , FontWeight::Bold = 700 , FontWeight::Extrabold = 800 ,
  FontWeight::Ultrabold = 800 , FontWeight::Heavy = 900 , FontWeight::Black = 900
}
 字体粗细枚举 更多...
 
enum class  JoinStyle { JoinStyle::Miter , JoinStyle::Bevel , JoinStyle::Round }
 接点样式 更多...
 
enum class  Key {
  Key::LeftMouse = 0x01 , Key::RightMouse = 0x02 , Key::MiddleMouse = 0x04 , Key::Backspace = 0x08 ,
  Key::Tab = 0x09 , Key::Enter = 0x0d , Key::Shift = 0x10 , Key::Control = 0x11 ,
  Key::Menu = 0x12 , Key::Pause = 0x13 , Key::Capslock = 0x14 , Key::Esc = 0x1b ,
  Key::Space = 0x20 , Key::Pageup = 0x21 , Key::Pagedown = 0x22 , Key::End = 0x23 ,
  Key::Home = 0x24 , Key::Left = 0x25 , Key::Up = 0x26 , Key::Right = 0x27 ,
  Key::Down = 0x28 , Key::Print = 0x2a , Key::Snapshot = 0x2c , Key::Insert = 0x2d ,
  Key::Delete = 0x2e , Key::_0 = 0x30 , Key::_1 = 0x31 , Key::_2 = 0x32 ,
  Key::_3 = 0x33 , Key::_4 = 0x34 , Key::_5 = 0x35 , Key::_6 = 0x36 ,
  Key::_7 = 0x37 , Key::_8 = 0x38 , Key::_9 = 0x39 , Key::A = 0x41 ,
  Key::B = 0x42 , Key::C = 0x43 , Key::D = 0x44 , Key::E = 0x45 ,
  Key::F = 0x46 , Key::G = 0x47 , Key::H = 0x48 , Key::I = 0x49 ,
  Key::J = 0x4a , Key::K = 0x4b , Key::L = 0x4c , Key::M = 0x4d ,
  Key::N = 0x4e , Key::O = 0x4f , Key::P = 0x50 , Key::Q = 0x51 ,
  Key::R = 0x52 , Key::S = 0x53 , Key::T = 0x54 , Key::U = 0x55 ,
  Key::V = 0x56 , Key::W = 0x57 , Key::X = 0x58 , Key::Y = 0x59 ,
  Key::Z = 0x5a , Key::LeftWin = 0x5b , Key::RightWin = 0x5c , Key::Sleep = 0x5f ,
  Key::Num0 = 0x60 , Key::Num1 = 0x61 , Key::Num2 = 0x62 , Key::Num3 = 0x63 ,
  Key::Num4 = 0x64 , Key::Num5 = 0x65 , Key::Num6 = 0x66 , Key::Num7 = 0x67 ,
  Key::Num8 = 0x68 , Key::Num9 = 0x69 , Key::Multiply = 0x6a , Key::Add = 0x6b ,
  Key::Separator = 0x6c , Key::Subtract = 0x6d , Key::Decimal = 0x6e , Key::Divide = 0x6f ,
  Key::F1 = 0x70 , Key::F2 = 0x71 , Key::F3 = 0x72 , Key::F4 = 0x73 ,
  Key::F5 = 0x74 , Key::F6 = 0x75 , Key::F7 = 0x76 , Key::F8 = 0x77 ,
  Key::F9 = 0x78 , Key::F10 = 0x79 , Key::F11 = 0x7a , Key::F12 = 0x7b ,
  Key::Numlock = 0x90 , Key::Scrolllock = 0x91 , Key::LeftShift = 0xa0 , Key::RightShift = 0xa1 ,
  Key::LeftControl = 0xa2 , Key::RightControl = 0xa3 , Key::LeftMenu = 0xa4 , Key::RightMenu = 0xa5 ,
  Key::Semicolon = 0xba , Key::Plus = 0xbb , Key::Comma = 0xbc , Key::Minus = 0xbd ,
  Key::Period = 0xbe , Key::Slash = 0xbf , Key::Tilde = 0xc0 , Key::Lbrace = 0xdb ,
  Key::Backslash = 0xdc , Key::Rbrace = 0xdd , Key::Quote = 0xde , Key::ImeProcess = 0xe5
}
 键盘按键枚举 更多...
 
enum class  LineStyle {
  LineStyle::Solid , LineStyle::Dash , LineStyle::Dot , LineStyle::DashDot ,
  LineStyle::UserDefined , LineStyle::Null
}
 画线样式 更多...
 
enum class  MouseButton {
  MouseButton::Left , MouseButton::Right , MouseButton::Middle , MouseButton::X1 ,
  MouseButton::X2 , MouseButton::Unknown
}
 鼠标按钮枚举 更多...
 
enum class  MouseWheel { MouseWheel::Up , MouseWheel::Down , MouseWheel::None }
 鼠标滚轮状态枚举 更多...
 
enum  TextAlign {
  Left = 0x1 , Center = 0x2 , Right = 0x4 , Top = 0x10 ,
  Middle = 0x20 , Bottom = 0x40
}
 文本对齐方式 更多...
 

函数

template<typename T >
requires std::is_arithmetic_v<T>
Line< TcenterSymmetric (const Line< T > &l, const Point< T > &p)
 计算直线l关于点p的对称线
 
template<typename T >
requires std::is_arithmetic_v<T>
Point< TcenterSymmetric (const Point< T > &a, const Point< T > &b)
 计算点a关于点b的对称点
 
template<typename T >
requires std::is_arithmetic_v<T>
bool contains (const Rect< T > &r, const Point< T > &p)
 判断点是否在矩形内(包含边界)
 
template<typename T >
constexpr Vec3< Tcross (const Vec3< T > &v1, const Vec3< T > &v2)
 计算向量叉乘
 
template<size N, typename T >
constexpr T dot (const Vec< N, T > &v1, const Vec< N, T > &v2)
 计算向量点乘
 
template<size M, size N, typename T >
constexpr T innerProduct (const Matrix< M, N, T > &m1, const Matrix< M, N, T > &m2)
 计算矩阵内积
 
template<typename CharT >
StdString< CharT > join (const std::vector< StdString< CharT > > &strs, CharT *delimiter)
 这是一个重载
 
template<typename CharT >
StdString< CharT > join (const std::vector< StdString< CharT > > &strs, CharT delimiter)
 这是一个重载
 
template<typename CharT , size_t N>
StdString< CharT > join (const std::vector< StdString< CharT > > &strs, const CharT(&delimiter)[N])
 这是一个重载
 
template<typename CharT >
StdString< CharT > join (const std::vector< StdString< CharT > > &strs, const StdString< CharT > &delimiter)
 字符串拼接函数
 
constexpr fVec2 makefVec2 (float x, float y)
 构造浮点二维向量
 
constexpr fVec3 makefVec3 (float x, float y, float z)
 构造浮点三维向量
 
constexpr fVec4 makefVec4 (float x, float y, float z, float w)
 构造浮点四维向量
 
constexpr iVec2 makeiVec2 (int x, int y)
 构造整数二维向量
 
constexpr iVec3 makeiVec3 (int x, int y, int z)
 构造整数三维向量
 
constexpr iVec4 makeiVec4 (int x, int y, int z, int w)
 构造整数四维向量
 
template<size N, typename T , typename... TArgs>
constexpr Vec< N, TmakeVec (TArgs... args)
 构造向量
 
template<size N, typename T >
constexpr T norm (const Vec< N, T > &v)
 计算向量模长
 
template<size N, typename T >
constexpr Vec< N, Tnormalize (const Vec< N, T > &v)
 对向量执行归一化
 
template<typename T >
requires std::is_arithmetic_v<T>
Rect< Toperator& (const Rect< T > &r1, const Rect< T > &r2)
 计算两个矩形的交集
 
template<size N, typename T >
constexpr T operator* (const Vec< N, T > &v1, const Vec< N, T > &v2)
 计算向量点乘的运算符重载
 
std::ostream & operator<< (std::ostream &os, const Color &color)
 
std::ostream & operator<< (std::ostream &os, const Font &font)
 
template<size M, size N, typename T >
std::ostream & operator<< (std::ostream &os, const Matrix< M, N, T > &mat)
 流操作符重载
 
template<size N, typename T >
std::ostream & operator<< (std::ostream &os, const Vec< N, T > &v)
 流操作符重载
 
template<typename T >
constexpr Vec3< Toperator^ (const Vec3< T > &v1, const Vec3< T > &v2)
 计算向量叉乘的运算符重载
 
template<size M, size N, typename T >
constexpr T operator| (const Matrix< M, N, T > &m1, const Matrix< M, N, T > &m2)
 计算矩阵内积的运算符重载
 
template<typename T >
constexpr double radians (T deg)
 将角度制转为弧度制
 
template<typename T >
constexpr Matrix< 3, 3, Trotate (const Vec< 2, T > &axis, float rad)
 创建二维坐标系下的旋转坐标变换矩阵
 
template<typename T >
constexpr Matrix< 4, 4, Trotate (const Vec< 3, T > &axis, float rad)
 创建三维坐标系下的旋转坐标变换矩阵
 
template<size M, typename T >
requires (M == 2) || (M == 3)
constexpr Matrix< M+1, M+1, Tscale (const Vec< M, T > &pos, const Vec< M, T > &s)
 创建缩放坐标变换矩阵
 
template<typename CharT >
std::vector< StdString< CharT > > split (const StdString< CharT > &str, CharT *delimiter)
 这是一个重载
 
template<typename CharT >
std::vector< StdString< CharT > > split (const StdString< CharT > &str, CharT delimiter)
 这是一个重载
 
template<typename CharT , size_t N>
std::vector< StdString< CharT > > split (const StdString< CharT > &str, const CharT(&delimiter)[N])
 这是一个重载
 
template<typename CharT >
std::vector< StdString< CharT > > split (const StdString< CharT > &str, const StdString< CharT > &delimiter)
 字符串分割函数
 
template<size M, typename T >
requires (M == 2) || (M == 3)
constexpr Matrix< M+1, M+1, Ttranslate (const Vec< M, T > &v)
 创建平移坐标变换矩阵
 

详细描述

GraceFt库的命名空间

类型定义说明

◆ byte

using GFt::byte = unsigned char

◆ Getter

template<typename Type >
using GFt::Getter = std::function<Type()>

◆ Initial

template<typename Type >
using GFt::Initial = std::variant<Type, Getter<Type>>

◆ Setter

template<typename Type >
using GFt::Setter = std::function<void(const Type&)>

◆ size

using GFt::size = std::size_t

◆ SlotId

template<typename... Args>
using GFt::SlotId = std::size_t

槽函数ID类型

模板参数
Args信号/槽函数参数类型

◆ StdString

template<typename T >
using GFt::StdString = std::basic_string<T>

◆ TimePoint

using GFt::TimePoint = std::chrono::time_point<std::chrono::steady_clock>

◆ TransFunc

using GFt::TransFunc = std::function<float(float)>

函数说明

◆ operator<<() [1/4]

std::ostream & GFt::operator<< ( std::ostream & os,
const Color & color )
参数
os输出流
color颜色
返回
输出流 os

◆ operator<<() [2/4]

std::ostream & GFt::operator<< ( std::ostream & os,
const Font & font )

◆ operator<<() [3/4]

template<size M, size N, typename T >
std::ostream & GFt::operator<< ( std::ostream & os,
const Matrix< M, N, T > & mat )

流操作符重载

输出矩阵到流中

参数
os流对象
mat矩阵对象
返回
流对象 os

◆ operator<<() [4/4]

template<size N, typename T >
std::ostream & GFt::operator<< ( std::ostream & os,
const Vec< N, T > & v )

流操作符重载

输出向量到流中

参数
os流对象
v向量对象
返回
流对象 os