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

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

#include <ygdibase.h>

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

Public 成员函数

yconstfn DefDeCtor (Rect) explicit 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 值。 更多...
 
yconstfn DefDeCopyCtor (Rect) DefDeCopyAssignment(Rect) Rect &operator
 复制构造:默认实现。 更多...
 
Rectoperator|= (const Rect &) ynothrow
 求与另一个屏幕标准矩形的并。 更多...
 
bool Contains (int px, int py) const ynothrow
 判断点 (px, py) 是否在矩形内或边上。 更多...
 
 PDefH (bool, Contains, const Point &pt) const ynothrow ImplRet(Contains(pt.X
 判断点 pt 是否在矩形内或边上。 更多...
 
pt Y bool Contains (const Rect &) const ynothrow
 判断矩形是否在矩形内或边上。 更多...
 
bool ContainsStrict (int px, int py) const ynothrow
 判断点 (px, py) 是否在矩形内。 更多...
 
 PDefH (bool, ContainsStrict, const Point &pt) const ynothrow ImplRet(ContainsStrict(pt.X
 判断点 pt 是否在矩形内。 更多...
 
pt Y bool ContainsStrict (const Rect &) const ynothrow
 判断矩形是否在矩形内或边上。 更多...
 
yconstfn DefGetter (const ynothrow, const Point &, Point, static_cast< const Point & >(*this)) DefGetter(ynothrow
 取左上角位置。 更多...
 
yconstfn Point static_cast
< Point & > this yconstfn 
DefGetter (const ynothrow, const Size &, Size, static_cast< const Size & >(*this)) DefGetter(ynothrow
 取大小。 更多...
 

Public 属性

yconstfn Point PointRef
 
yconstfn Point static_cast
< Point & > this yconstfn Size 
SizeRef
 

静态 Public 属性

static const Rect Invalid
 无效对象。 更多...
 

相关函数

(请注意: 这些不是成员函数.)

yconstfn bool operator== (const Rect &x, const Rect &y) ynothrow
 比较:屏幕标准矩形相等关系。 更多...
 
yconstfn bool operator!= (const Rect &x, const Rect &y) ynothrow
 比较:屏幕标准矩形不等关系。 更多...
 
yconstfn Rect operator+ (const Rect &r, const Vec &v) ynothrow
 加法:使用标准矩形 r 和偏移向量 v 构造屏幕标准矩形。 更多...
 
yconstfn Rect operator- (const Rect &r, const Vec &v) ynothrow
 减法:使用标准矩形 r 和偏移向量的加法逆元 v 构造屏幕标准矩形。 更多...
 
YF_API Rect operator& (const Rect &, const Rect &) ynothrow
 求两个屏幕标准矩形的交。 更多...
 
YF_API Rect operator| (const Rect &, const Rect &) ynothrow
 求两个屏幕标准矩形的并。 更多...
 
void Diminish (Rect &r, SDst off1=1, SDst off2=2)
 按指定大小缩小矩形。 更多...
 

额外继承的成员函数

- Private 成员函数 继承自 YSLib::Drawing::GBinaryGroup< SPos >
yconstfn GBinaryGroup () ynothrow
 无参数构造。 更多...
 
yconstfn GBinaryGroup (const Rect &) ynothrow
 构造:使用 Rect 对象。 更多...
 
yconstfn GBinaryGroup (_tScalar1 x, _tScalar2 y) ynothrow
 构造:使用两个纯量。 更多...
 
yconstfn GBinaryGroup (const _tPair &pr) ynothrow
 构造:使用纯量对。 更多...
 
yconstfn DefDeCopyCtor (GBinaryGroup) explicit yconstfn GBinaryGroup(const Size &) ynothrow
 复制构造:默认实现。 更多...
 
yconstfn GBinaryGroup operator- () const ynothrow
 负运算:取加法逆元。 更多...
 
GBinaryGroupoperator+= (const GBinaryGroup &val) ynothrow
 加法赋值。 更多...
 
GBinaryGroupoperator-= (const GBinaryGroup &val) ynothrow
 减法赋值。 更多...
 
yconstfn DefGetter (const ynothrow, SPos, X, X) yconstfn DefGetter(const ynothrow
 
yconstfn Y DefSetter (SPos, X, X) DefSetter(SPos
 
- 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
 构造:使用两个纯量。 更多...
 
- Private 属性 继承自 YSLib::Drawing::GBinaryGroup< SPos >
SPos X
 
SPos Y
 分量。 更多...
 
yconstfn Y
 
yconstfnY
 
yconstfn _type
 
- Private 属性 继承自 YSLib::Drawing::Size
SDst Width
 
SDst Height
 宽和高。 更多...
 
- 静态 Private 属性 继承自 YSLib::Drawing::GBinaryGroup< SPos >
static const GBinaryGroup Invalid
 无效(不在屏幕坐标系中)对象。 更多...
 
- 静态 Private 属性 继承自 YSLib::Drawing::Size
static const Size Invalid
 无效对象。 更多...
 

详细描述

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

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

在文件 ygdibase.h416 行定义.

构造及析构函数说明

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

构造:使用 Size 对象。

自从
build 399

在文件 ygdibase.h469 行定义.

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

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

自从
build 319

在文件 ygdibase.h477 行定义.

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

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

自从
build 319

在文件 ygdibase.h485 行定义.

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

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

自从
build 319

在文件 ygdibase.h493 行定义.

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

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

自从
build 319

在文件 ygdibase.h501 行定义.

成员函数说明

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

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

自从
build 319

在文件 ygdibase.cpp80 行定义.

参考自 YSLib::UI::CheckPoint() , 以及 YSLib::Drawing::PlotPixel().

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

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

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

注解
空矩形总是不被包含。
自从
build 319

在文件 ygdibase.cpp85 行定义.

参考 YSLib::Drawing::r.

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

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

自从
build 319

在文件 ygdibase.cpp92 行定义.

参考 YSLib::Drawing::Width.

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

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

注解
空矩形总是不被包含。
自从
build 319

在文件 ygdibase.cpp97 行定义.

参考 YSLib::Drawing::r , 以及 YSLib::Drawing::Width.

yconstfn YSLib::Drawing::Rect::DefDeCopyCtor ( Rect  )

复制构造:默认实现。

自从
build 319
yconstfn YSLib::Drawing::Rect::DefDeCtor ( Rect  ) const
inline

无参数构造:默认实现。

自从
build 453

构造:使用屏幕二维点。

自从
build 319

在文件 ygdibase.h455 行定义.

yconstfn YSLib::Drawing::Rect::DefGetter ( const ynothrow  ,
const Point ,
Point  ,
static_cast< const Point & > *  this 
)

取左上角位置。

取左上角位置引用。

自从
build 296
yconstfn Point static_cast<Point&> this yconstfn YSLib::Drawing::Rect::DefGetter ( const ynothrow  ,
const Size ,
Size  ,
static_cast< const Size & > *  this 
)

取大小。

取大小引用。

自从
build 296
Rect & YSLib::Drawing::Rect::operator|= ( const Rect r)

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

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

在文件 ygdibase.cpp114 行定义.

参考 YSLib::Drawing::r, YSLib::Drawing::Width, YSLib::Drawing::X , 以及 YSLib::Drawing::Y.

YSLib::Drawing::Rect::PDefH ( bool  ,
Contains  ,
const Point pt 
) const

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

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

判断点 pt 是否在矩形内。

自从
build 319

友元及相关函数文档

void Diminish ( Rect r,
SDst  off1 = 1,
SDst  off2 = 2 
)
related

按指定大小缩小矩形。

前置条件
断言:矩形的当前大小足够缩小。
自从
build 479

在文件 ygdibase.h696 行定义.

参考 YAssert , 以及 yunseq.

yconstfn bool operator!= ( const Rect x,
const Rect y 
)
related

比较:屏幕标准矩形不等关系。

自从
build 319

在文件 ygdibase.h648 行定义.

YF_API Rect operator& ( const Rect ,
const Rect  
)
related

求两个屏幕标准矩形的交。

参见
Rect::operator&=
自从
build 452

在文件 ygdibase.cpp128 行定义.

yconstfn Rect operator+ ( const Rect r,
const Vec v 
)
related

加法:使用标准矩形 r 和偏移向量 v 构造屏幕标准矩形。

自从
build 319

在文件 ygdibase.h659 行定义.

参考 YSLib::Drawing::r , 以及 v.

yconstfn Rect operator- ( const Rect r,
const Vec v 
)
related

减法:使用标准矩形 r 和偏移向量的加法逆元 v 构造屏幕标准矩形。

自从
build 319

在文件 ygdibase.h669 行定义.

参考 YSLib::Drawing::r , 以及 v.

yconstfn bool operator== ( const Rect x,
const Rect y 
)
related

比较:屏幕标准矩形相等关系。

自从
build 319

在文件 ygdibase.h638 行定义.

YF_API Rect operator| ( const Rect ,
const Rect  
)
related

求两个屏幕标准矩形的并。

参见
Rect::operator|=
自从
build 452

在文件 ygdibase.cpp134 行定义.

类成员变量说明

const Rect YSLib::Drawing::Rect::Invalid
static

无效对象。

自从
build 296

在文件 ygdibase.h423 行定义.

yconstfn Point YSLib::Drawing::Rect::PointRef

在文件 ygdibase.h618 行定义.

yconstfn Point static_cast<Point&> this yconstfn Size YSLib::Drawing::Rect::SizeRef

在文件 ygdibase.h628 行定义.


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