YSTest  PreAlpha_b400_20130424
The YSLib Test Project
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
YSLib::Drawing::Rect类 参考

屏幕标准矩形:表示屏幕矩形区域。 更多...

#include <ygdibase.h>

类 YSLib::Drawing::Rect 继承关系图:
YSLib::Drawing::Rect 的协作图:

Public 成员函数

yconstfn Rect () ynothrow
 无参数构造。
 
yconstfn Rect (const Rect &)=default
 复制构造:默认实现。
 
yconstfn Rect (const Point &pt) ynothrow
 构造:使用屏幕二维点。
 
yconstfn Rect (const Size &s) ynothrow
 构造:使用 Size 对象。
 
yconstfn Rect (const Point &pt, const Size &s) ynothrow
 构造:使用屏幕二维点和 Size 对象。
 
yconstfn Rect (const Point &pt, SDst w, SDst h) ynothrow
 构造:使用屏幕二维点和表示长宽的两个 SDst 值。
 
yconstfn Rect (SPos x, SPos y, const Size &s) ynothrow
 构造:使用表示位置的两个 SPos 值和 Size 对象。
 
yconstfn Rect (SPos x, SPos y, SDst w, SDst h) ynothrow
 构造:使用表示位置的两个 SPos 值和表示大小的两个 SDst 值。
 
Rectoperator= (const Rect &)=default
 
Rectoperator&= (const Rect &) ynothrow
 求与另一个屏幕标准矩形的交。
 
Rectoperator|= (const Rect &) ynothrow
 求与另一个屏幕标准矩形的并。
 
bool Contains (int px, int py) const ynothrow
 判断点 (px, py) 是否在矩形内或边上。
 
bool Contains (const Point &pt) const ynothrow
 判断点 pt 是否在矩形内或边上。
 
bool Contains (const Rect &r) const ynothrow
 判断矩形 r 是否在矩形内或边上。
 
bool ContainsStrict (int px, int py) const ynothrow
 判断点 (px, py) 是否在矩形内。
 
bool ContainsStrict (const Point &pt) const ynothrow
 判断点 pt 是否在矩形内。
 
bool ContainsStrict (const Rect &r) const ynothrow
 判断矩形 r 是否在矩形内或边上。
 
yconstfn const PointGetPoint () const ynothrow
 取左上角位置。
 
PointGetPointRef () ynothrow
 取左上角位置引用。
 
yconstfn const SizeGetSize () const ynothrow
 取大小。
 
SizeGetSizeRef () ynothrow
 取大小引用。
 
Rectoperator= (const Point &pt) ynothrow
 
Rectoperator= (const Size &s) ynothrow
 

静态 Public 属性

static const Rect Invalid
 无效对象。
 

额外继承的成员函数

- Private 成员函数 继承自 YSLib::Drawing::GBinaryGroup< SPos >
yconstfn GBinaryGroup () ynothrow
 无参数构造。
 
yconstfn GBinaryGroup (const GBinaryGroup &)=default
 复制构造:默认实现。
 
yconstfn GBinaryGroup (const Size &) ynothrow
 构造:使用 Size 对象。
 
yconstfn GBinaryGroup (const Rect &) ynothrow
 构造:使用 Rect 对象。
 
yconstfn GBinaryGroup (_tScalar1 x, _tScalar2 y) ynothrow
 构造:使用两个纯量。
 
yconstfn GBinaryGroup operator- () ynothrow
 负运算:取加法逆元。
 
GBinaryGroupoperator+= (const GBinaryGroup &val) ynothrow
 加法赋值。
 
GBinaryGroupoperator-= (const GBinaryGroup &val) ynothrow
 减法赋值。
 
yconstfn SPos GetX () const ynothrow
 
yconstfn SPos GetY () const ynothrow
 
void SetX (SPos_tempArgName)
 
void SetY (SPos_tempArgName)
 
yconstfn bool IsZero () const ynothrow
 判断是否是零元素。
 
SPos & GetRef (bool b=true) ynothrow
 选择分量引用。
 
const SPos & GetRef (bool b=true) const ynothrow
 选择分量常量引用。
 
- Private 成员函数 继承自 YSLib::Drawing::Size
yconstfn Size () ynothrow
 无参数构造。
 
yconstfn Size (const Size &s) ynothrow
 复制构造。
 
yconstfn Size (const Rect &) ynothrow
 构造:使用 Rect 对象。
 
template<typename _type >
yconstfn Size (const GBinaryGroup< _type > &val) ynothrow
 构造:使用屏幕二元组。
 
template<typename _tScalar1 , typename _tScalar2 >
yconstfn Size (_tScalar1 w, _tScalar2 h) ynothrow
 构造:使用两个纯量。
 
yconstfn bool operator! () const ynothrow
 判断是否为空。
 
yconstfn operator bool () const ynothrow
 判断是否非空。
 
yconstfn operator Vec () const ynothrow
 转换:屏幕二维向量。
 
yconstfn bool IsLineSegment () const ynothrow
 判断是否为线段:长或宽中有且一个数值等于 0 。
 
yconstfn bool IsUnstrictlyEmpty () const ynothrow
 判断是否为不严格的空矩形区域:包括空矩形和线段。
 
SDst & GetRef (bool b=true) ynothrow
 选择分量引用。
 
const SDst & GetRef (bool b=true) const ynothrow
 选择分量常量引用。
 
- Private 属性 继承自 YSLib::Drawing::GBinaryGroup< SPos >
SPos X
 
SPos Y
 分量。
 
- Private 属性 继承自 YSLib::Drawing::Size
SDst Width
 
SDst Height
 宽和高。
 
- 静态 Private 属性 继承自 YSLib::Drawing::GBinaryGroup< SPos >
static yconstexpr GBinaryGroup Invalid
 无效(不在屏幕坐标系中)对象。
 
- 静态 Private 属性 继承自 YSLib::Drawing::Size
static const Size Invalid
 无效对象。
 

详细描述

屏幕标准矩形:表示屏幕矩形区域。

注解
边平行于水平直线;使用左上点屏幕坐标、宽和高表示。
警告
非虚析构。
自从
build 161

在文件 ygdibase.h402 行定义.

构造及析构函数说明

yconstfn YSLib::Drawing::Rect::Rect ( )
inline

无参数构造。

注解
零初始化。
自从
build 319

在文件 ygdibase.h443 行定义.

yconstfn YSLib::Drawing::Rect::Rect ( const Rect )
default

复制构造:默认实现。

yconstfn YSLib::Drawing::Rect::Rect ( const Point pt)
inlineexplicit

构造:使用屏幕二维点。

自从
build 319

在文件 ygdibase.h455 行定义.

yconstfn YSLib::Drawing::Rect::Rect ( const Size s)
inline

构造:使用 Size 对象。

自从
build 399

在文件 ygdibase.h463 行定义.

yconstfn YSLib::Drawing::Rect::Rect ( const Point pt,
const Size s 
)
inline

构造:使用屏幕二维点和 Size 对象。

自从
build 319

在文件 ygdibase.h471 行定义.

yconstfn YSLib::Drawing::Rect::Rect ( const Point pt,
SDst  w,
SDst  h 
)
inline

构造:使用屏幕二维点和表示长宽的两个 SDst 值。

自从
build 319

在文件 ygdibase.h479 行定义.

yconstfn YSLib::Drawing::Rect::Rect ( SPos  x,
SPos  y,
const Size s 
)
inline

构造:使用表示位置的两个 SPos 值和 Size 对象。

自从
build 319

在文件 ygdibase.h487 行定义.

yconstfn YSLib::Drawing::Rect::Rect ( SPos  x,
SPos  y,
SDst  w,
SDst  h 
)
inline

构造:使用表示位置的两个 SPos 值和表示大小的两个 SDst 值。

自从
build 319

在文件 ygdibase.h495 行定义.

成员函数说明

bool YSLib::Drawing::Rect::Contains ( int  px,
int  py 
) const

判断点 (px, py) 是否在矩形内或边上。

自从
build 319

参考自 Contains().

这是这个函数的调用关系图:

bool YSLib::Drawing::Rect::Contains ( const Point pt) const
inline

判断点 pt 是否在矩形内或边上。

自从
build 319

在文件 ygdibase.h556 行定义.

bool YSLib::Drawing::Rect::Contains ( const Rect r) const

判断矩形 r 是否在矩形内或边上。

自从
build 319
bool YSLib::Drawing::Rect::ContainsStrict ( int  px,
int  py 
) const

判断点 (px, py) 是否在矩形内。

自从
build 319
bool YSLib::Drawing::Rect::ContainsStrict ( const Point pt) const
inline

判断点 pt 是否在矩形内。

自从
build 319

在文件 ygdibase.h575 行定义.

bool YSLib::Drawing::Rect::ContainsStrict ( const Rect r) const

判断矩形 r 是否在矩形内或边上。

自从
build 319
Point& YSLib::Drawing::Rect::GetPointRef ( )
inline

取左上角位置引用。

自从
build 296

在文件 ygdibase.h606 行定义.

Size& YSLib::Drawing::Rect::GetSizeRef ( )
inline

取大小引用。

自从
build 296

在文件 ygdibase.h616 行定义.

Rect & Rect::operator&= ( const Rect r)

求与另一个屏幕标准矩形的交。

注解
若相离结果为 Rect() ,否则为包含于两个参数中的最大矩形。
自从
build 320

在文件 ygdibase.cpp68 行定义.

参考 Width,platform::KeyCodes::X , 以及 platform::KeyCodes::Y.

Rect& YSLib::Drawing::Rect::operator= ( const Rect )
default
Rect& YSLib::Drawing::Rect::operator= ( const Point pt)
inline
自从
build 319

在文件 ygdibase.h503 行定义.

参考 platform::KeyCodes::X,platform::KeyCodes::Y , 以及 yunseq().

函数调用图:

Rect& YSLib::Drawing::Rect::operator= ( const Size s)
inline

在文件 ygdibase.h509 行定义.

参考 Width , 以及 yunseq().

函数调用图:

Rect & Rect::operator|= ( const Rect r)

求与另一个屏幕标准矩形的并。

注解
结果为包含两个参数中的最小矩形。
自从
build 320

在文件 ygdibase.cpp77 行定义.

参考 Width,platform::KeyCodes::X , 以及 platform::KeyCodes::Y.

类成员变量说明

const Rect Rect::Invalid
static

无效对象。

自从
build 296

在文件 ygdibase.h409 行定义.


该类的文档由以下文件生成: