25 #ifndef _FXCRT_COORDINATES_ 26 #define _FXCRT_COORDINATES_ 43 template<
class BaseType>
235 #define CFX_FloatPoint CFX_PointF 238 template<
class baseType>
249 void Set(
const FXT_POINT &p1,
const FXT_POINT &p2) {
FXT_PSV::x = p2.x - p1.x,
FXT_PSV::y = p2.y - p1.y;}
266 FX_BOOL IsParallel(
const FXT_VECTOR &v)
const {
return IsParallel(v.x, v.y);}
267 FX_BOOL IsPerpendicular(baseType
x, baseType
y)
const {baseType t = DotProduct(
x,
y);
return FXSYS_fabs(t) < 0.0001f;}
268 FX_BOOL IsPerpendicular(
const FXT_VECTOR &v)
const {
return IsPerpendicular(v.x, v.y);}
282 friend FX_FLOAT Cosine(
const FXT_VECTOR &v1,
const FXT_VECTOR &v2)
284 FXSYS_assert(v1.SquareLength() != 0 && v2.SquareLength() != 0);
285 FX_FLOAT dotProduct = v1.DotProduct(v2);
288 friend FX_FLOAT ArcCosine(
const FXT_VECTOR &v1,
const FXT_VECTOR &v2)
292 friend FX_FLOAT SlopeAngle(
const FXT_VECTOR &v)
297 return v.y < 0 ? -fSlope : fSlope;
307 template<
class baseType>
316 void Set(baseType x, baseType y, baseType x1, baseType y1, baseType x2, baseType y2) {FXT_PARAL::x = x, FXT_PARAL::y = y, FXT_PARAL::x1 = x1, FXT_PARAL::y1 = y1, FXT_PARAL::x2 = x2, FXT_PARAL::y2 = y2;}
317 void Set(
const FXT_POINT &p,
const FXT_VECTOR &v1,
const FXT_VECTOR &v2) {FXT_PARAL::P(p), FXT_PARAL::V1(v1), FXT_PARAL::V2(v2);}
318 void Reset() {FXT_PARAL::x = FXT_PARAL::y = FXT_PARAL::x1 = FXT_PARAL::y1 = FXT_PARAL::x2 = FXT_PARAL::y2 = 0;}
320 CFX_PRLTemplate& operator += (
const FXT_POINT &p) {x += p.x; y += p.y;
return *
this;}
321 CFX_PRLTemplate& operator -= (
const FXT_POINT &p) {x -= p.x; y -= p.y;
return *
this;}
323 FXT_POINT P()
const {FXT_POINT p; p.x = x, p.y = y;
return p;}
324 void P(FXT_POINT p) {x = p.x, y = p.y;}
325 FXT_VECTOR V1()
const {FXT_VECTOR v; v.x = x1, v.y = y1;
return v;}
326 void V1(FXT_VECTOR v) {x1 = v.x, y1 = v.y;}
327 FXT_VECTOR V2()
const {FXT_VECTOR v; v.x = x2, v.y = y2;
return v;}
328 void V2(FXT_VECTOR v) {x2 = v.x, y2 = v.y;}
330 FX_BOOL IsEmpty()
const {
return V1().IsParallel(x2, y2);}
331 FX_BOOL IsRect()
const {
return V1().IsPerpendicular(x2, y2);}
332 FXT_SIZE Size()
const {FXT_SIZE s; s.x = V1().Length(); s.y = V2().Length();
return s;}
333 FXT_POINT Center()
const {
return (V1() + V2()) / 2 + P();}
334 FXT_POINT P1()
const {
return P();}
335 FXT_POINT P2()
const {
return P() + V1();}
336 FXT_POINT P3()
const {
return P() + V1() + V2();}
337 FXT_POINT P4()
const {
return P() + V2();}
351 template<
class baseType>
361 void Set(baseType left, baseType top, baseType width, baseType height) {FXT_RECT::left = left, FXT_RECT::top = top, FXT_RECT::width = width, FXT_RECT::height = height;}
362 void Set(baseType left, baseType top,
const FXT_SIZE &size) {FXT_RECT::left = left, FXT_RECT::top = top, FXT_RECT::Size(size);}
363 void Set(
const FXT_POINT &p, baseType width, baseType height) {TopLeft(p), FXT_RECT::width = width, FXT_RECT::height = height;}
364 void Set(
const FXT_POINT &p1,
const FXT_POINT &p2) {TopLeft(p1), FXT_RECT::width = p2.
x - p1.x, FXT_RECT::height = p2.y - p1.y, FXT_RECT::Normalize();}
365 void Set(
const FXT_POINT &p,
const FXT_VECTOR &v) {TopLeft(p), FXT_RECT::width = v.
x, FXT_RECT::height = v.y, FXT_RECT::Normalize();}
366 void Reset() {FXT_RECT::left = FXT_RECT::top = FXT_RECT::width = FXT_RECT::height = 0;}
368 FXT_RECT& operator += (
const FXT_POINT &p) {left += p.x, top += p.y;
return *
this;}
369 FXT_RECT& operator -= (
const FXT_POINT &p) {left -= p.x, top -= p.y;
return *
this;}
371 baseType right()
const {
return left + width;}
372 baseType bottom()
const {
return top + height;}
373 void Normalize() {
if (width < 0) {left += width; width = -width;}
if (height < 0) {top += height; height = -height;}}
374 void Offset(baseType dx, baseType dy) {left += dx; top += dy;}
375 void Inflate(baseType x, baseType y) {left -= x; width += x * 2; top -= y; height += y * 2;}
376 void Inflate(
const FXT_POINT &p) {Inflate(p.x, p.y);}
377 void Inflate(baseType left, baseType top, baseType right, baseType bottom) {FXT_RECT::left -= left; FXT_RECT::top -= top; FXT_RECT::width += left + right; FXT_RECT::height += top + bottom;}
378 void Inflate(
const FXT_RECT &rt) {Inflate(rt.left, rt.top, rt.left + rt.width, rt.top + rt.height);}
379 void Deflate(baseType x, baseType y) {left += x; width -= x * 2; top += y; height -= y * 2;}
380 void Deflate(
const FXT_POINT &p) {Deflate(p.x, p.y);}
381 void Deflate(baseType left, baseType top, baseType right, baseType bottom) {FXT_RECT::left += left; FXT_RECT::top += top; FXT_RECT::width -= left + right; FXT_RECT::height -= top + bottom;}
382 void Deflate(
const FXT_RECT &rt) {Deflate(rt.left, rt.top, rt.top + rt.width, rt.top + rt.height);}
383 FX_BOOL IsEmpty()
const {
return width <= 0 || height <= 0;}
384 FX_BOOL IsEmpty(
FX_FLOAT fEpsilon)
const {
return width <= fEpsilon || height <= fEpsilon;}
385 void Empty() {width = height = 0;}
386 FX_BOOL Contains(baseType x, baseType y)
const {
return x >= left && x < left + width && y >= top && y < top + height;}
387 FX_BOOL Contains(
const FXT_POINT &p)
const {
return Contains(p.x, p.y);}
388 FX_BOOL Contains(
const FXT_RECT &rt)
const {
return rt.left >= left && rt.right() <= right() && rt.top >= top && rt.bottom() <= bottom();}
389 baseType Width()
const {
return width;}
390 baseType Height()
const {
return height;}
391 FXT_SIZE Size()
const {FXT_SIZE size; size.Set(width, height);
return size;}
392 void Size(FXT_SIZE s) {width = s.x, height = s.y;}
393 FXT_POINT TopLeft()
const {FXT_POINT p; p.x = left; p.y = top;
return p;}
394 FXT_POINT TopRight()
const {FXT_POINT p; p.x = left + width; p.y = top;
return p;}
395 FXT_POINT BottomLeft()
const {FXT_POINT p; p.x = left; p.y = top + height;
return p;}
396 FXT_POINT BottomRight()
const {FXT_POINT p; p.x = left + width; p.y = top + height;
return p;}
397 void TopLeft(FXT_POINT tl) {left = tl.x; top = tl.y;}
398 void TopRight(FXT_POINT tr) {width = tr.x - left; top = tr.y;}
399 void BottomLeft(FXT_POINT bl) {left = bl.x; height = bl.y - top;}
400 void BottomRight(FXT_POINT br) {width = br.x - left; height = br.y - top;}
401 FXT_POINT Center()
const {FXT_POINT p; p.x = left + width / 2; p.y = top + height / 2;
return p;}
403 void GetParallelogram(FXT_PARAL &pg)
const {pg.x = left, pg.y = top; pg.x1 = width, pg.y1 = 0; pg.x2 = 0, pg.y2 = height;}
405 void Union(baseType x, baseType y)
407 baseType r = right(), b = bottom();
408 if (left > x) left = x;
410 if (top > y) top = y;
415 void Union(
const FXT_POINT &p) {Union(p.x, p.y);}
416 void Union(
const FXT_RECT &rt)
418 baseType r = right(), b = bottom();
419 if (left > rt.left) left = rt.left;
420 if (r < rt.right()) r = rt.right();
421 if (top > rt.top) top = rt.top;
422 if (b < rt.bottom()) b = rt.bottom();
426 void Intersect(
const FXT_RECT &rt)
428 baseType r = right(), b = bottom();
429 if (left < rt.left) left = rt.left;
430 if (r > rt.right()) r = rt.right();
431 if (top < rt.top) top = rt.top;
432 if (b > rt.bottom()) b = rt.bottom();
436 FX_BOOL IntersectWith(
const FXT_RECT &rt)
const 439 rect.Intersect(*
this);
440 return !rect.IsEmpty();
445 rect.Intersect(*
this);
446 return !rect.IsEmpty(fEpsilon);
449 friend FX_BOOL operator == (
const FXT_RECT &rc1,
const FXT_RECT &rc2) {
return rc1.left == rc2.left && rc1.top == rc2.top && rc1.width == rc2.width && rc1.height == rc2.height;}
450 friend FX_BOOL operator != (
const FXT_RECT &rc1,
const FXT_RECT &rc2) {
return rc1.left != rc2.left || rc1.top != rc2.top || rc1.width != rc2.width || rc1.height != rc2.height;}
453 baseType width, height;
472 template<
class baseType>
481 void Set(baseType left, baseType top, baseType width, baseType height) {FXT_RECT::left = left, FXT_RECT::top = top, FXT_RECT::width = width, FXT_RECT::height = height;}
482 void Set(baseType left, baseType top,
const FXT_SIZE &size) {FXT_RECT::left = left, FXT_RECT::top = top, FXT_RECT::Size(size);}
483 void Set(
const FXT_POINT &p, baseType width, baseType height) {FXT_RECT::TopLeft(p), FXT_RECT::width = width, FXT_RECT::height = height;}
484 void Set(
const FXT_POINT &p1,
const FXT_POINT &p2) {FXT_RECT::TopLeft(p1), FXT_RECT::width = p2.x - p1.x, FXT_RECT::height = p2.y - p1.y, FXT_RECT::Normalize();}
485 void Set(
const FXT_POINT &p,
const FXT_VECTOR &v) {FXT_RECT::TopLeft(p), FXT_RECT::width = v.x, FXT_RECT::height = v.y, FXT_RECT::Normalize();}
486 void SetRadius(
const FXT_POINT &p, baseType xRadius, baseType yRadius) {FXT_RECT::left = p.x - xRadius, FXT_RECT::top = p.y - yRadius, FXT_RECT::width = xRadius * 2, FXT_RECT::height = yRadius * 2;}
487 void Reset() {FXT_RECT::left = FXT_RECT::top = FXT_RECT::width = FXT_RECT::height = 0;}
489 FX_BOOL Contains(baseType x, baseType y)
const 491 x -= FXT_RECT::left + FXT_RECT::width / 2;
492 y -= FXT_RECT::top + FXT_RECT::height / 2;
495 FX_BOOL Contains(
const FXT_POINT &p)
const {
return Contains(p.x, p.y);}
496 FX_BOOL Contains(
const FXT_RECT &rt)
const {
return Contains(rt.TopLeft()) && Contains(rt.BottomRight());}
498 baseType XRadius()
const {
return FXT_RECT::width / 2;}
499 baseType YRadius()
const {
return FXT_RECT::height / 2;}
509 point.
x = fRadian * cosValue / d + FXT_RECT::left + a;
510 point.
y = fRadian * sinValue / d + FXT_RECT::top + b;
515 GetPointF(fRadian, p);
527 template<
class baseType>
536 void Set(baseType left, baseType top, baseType width, baseType height, baseType
xRadius, baseType
yRadius) {FXT_RECT::left = left, FXT_RECT::top = top, FXT_RECT::width = width, FXT_RECT::height = height,
FXT_RRECT::xRadius =
xRadius,
FXT_RRECT::yRadius =
yRadius;}
554 template<
class baseType>
564 void Set(baseType left, baseType top, baseType width, baseType height,
FX_FLOAT startAngle,
FX_FLOAT sweepAngle) {FXT_RECT::left = left, FXT_RECT::top = top, FXT_RECT::width = width, FXT_RECT::height = height,
FXT_ARC::startAngle =
startAngle,
FXT_ARC::sweepAngle =
sweepAngle;}
575 void EndPointF(
CFX_PointF &point)
const {FXT_ELLIPSE::GetPointF(EndAngle(), point);}
577 void EndPoint(
CFX_Point &point)
const {FXT_ELLIPSE::GetPoint(EndAngle(), point);}
625 FX_RECT(
int left1,
int top1,
int right1,
int bottom1)
1095 {
a = a1;
b = b1;
c = c1;
d = d1;
e = e1;
f = f1;}
1350 #ifdef _FXGE_IMAGERENDER_SHORTCUT_ 1351 const FX_INT32 GetRotation()
const;
1352 const FX_BOOL NeedTransform()
const;
1637 class CFX_Vector_3by1 :
public CFX_Object
1655 class CFX_Matrix_3by3 :
public CFX_Object
1658 CFX_Matrix_3by3():a(0.0f), b(0.0f), c(0.0f), d(0.0f), e(0.0f), f(0.0f), g(0.0f), h(0.0f), i(0.0f)
1662 a(a1), b(b1), c(c1), d(d1), e(e1), f(f1), g(g1), h(h1), i(i1)
1664 CFX_Matrix_3by3 Inverse();
1665 CFX_Matrix_3by3 Multiply(
const CFX_Matrix_3by3 &m);
1666 CFX_Vector_3by1 TransformVector(
const CFX_Vector_3by1 &v)
const;
1679 #define CFX_AffineMatrix CFX_Matrix 1682 #endif //_FXCRT_COORDINATES_ CFX_PSVTemplate(BaseType new_x, BaseType new_y)
带参数的构造函数。
Definition: fx_coordinates.h:60
int top
上边界
Definition: fx_coordinates.h:601
FX_BOOL Valid() const
检查当前矩形是否有效。
CFX_PRLTemplate< FX_INT32 > CFX_Parallelogram
整数平行四边形的类型定义。
Definition: fx_coordinates.h:345
CFX_PSVTemplate()
构造函数。
Definition: fx_coordinates.h:52
void Set(BaseType x, BaseType y)
设置值。
Definition: fx_coordinates.h:77
static CFX_FloatRect GetBBox(const CFX_PointF *pPoints, int nPoints)
获取输入点数组的边界框。
FX_RECT GetOutterRect() const
转换为外部整数矩形。
int bottom
下边界
Definition: fx_coordinates.h:605
void Normalize()
规范化矩形。确保left <= right,top <= bottom。
int Width() const
获取矩形的宽度。
Definition: fx_coordinates.h:633
void Intersect(int left1, int top1, int right1, int bottom1)
与矩形求交集。
Definition: fx_coordinates.h:675
CFX_ArrayTemplate< CFX_FloatRect > CFX_RectArray
矩形数组。
Definition: fx_coordinates.h:1066
void TransformRect(CFX_FloatRect &rect) const
变换一个矩形并返回边界矩形。 结果矩形总是标准化的:left <= right,且 bottom <= top。
Definition: fx_coordinates.h:1551
FXT_PSV & operator *=(BaseType lamda)
重载运算符*=。
Definition: fx_coordinates.h:134
void TransformPoint(FX_FLOAT &x, FX_FLOAT &y) const
变换由X和Y值指定的点。
void TranslateI(FX_INT32 x, FX_INT32 y, FX_BOOL bPrepended=false)
平移矩阵。使用整数值。
Definition: fx_coordinates.h:1255
int Height() const
获取矩形的高度。
Definition: fx_coordinates.h:640
void TransformVector(CFX_VectorF &v) const
变换一个向量。
void Transform(FX_FLOAT x, FX_FLOAT y, FX_FLOAT &x1, FX_FLOAT &y1) const
变换一个点。
Definition: fx_coordinates.h:1472
FX_RECT GetClosestRect() const
获取最接近的整数矩形。
BaseType x
点的x坐标。
Definition: fx_coordinates.h:209
FX_BOOL operator !=(const CFX_FloatRect &src) const
比较(!=)运算符重载。比较两个矩形。请确保它们首先被规范化。
Definition: fx_coordinates.h:835
FX_BOOL Contains(const FX_RECT &other_rect) const
检查当前矩形是否完全包含其他提供的矩形。 即检查其他矩形是否完全在当前矩形内部。
Definition: fx_coordinates.h:724
CFX_ArrayTemplate< CFX_RectF > CFX_RectFArray
矩形数组的类型定义。
Definition: fx_coordinates.h:469
FX_RECT(int left1, int top1, int right1, int bottom1)
用左上角和右下角构造矩形。
Definition: fx_coordinates.h:625
int FXSYS_round(FX_FLOAT f)
获取最接近的整数
FX_FLOAT TransformYDistance(FX_FLOAT dy) const
变换Y距离。
CFX_RTemplate< FX_FLOAT > * FX_LPRECTF
浮点数矩形指针的类型定义。
Definition: fx_coordinates.h:463
CFX_ArrayTemplate< CFX_PointF > CFX_PointsF
浮点数点数组的类型定义。
Definition: fx_coordinates.h:224
FX_FLOAT b
系数b。
Definition: fx_coordinates.h:1626
void Reset()
重置当前矩阵。
Definition: fx_coordinates.h:1197
void Normalize()
规范化矩形。确保left <= right,以及bottom <= top。
CFX_RRTemplate< FX_FLOAT > CFX_RoundRectF
浮点数圆角矩形类的类型定义。
Definition: fx_coordinates.h:551
void TransformRect(CFX_RectF &rect) const
变换一个矩形并返回边界矩形。 结果矩形总是标准化的:left <= right,且 top <= bottom。
CFX_ArrayTemplate< CFX_Point > CFX_Points
整数点数组的类型定义。
Definition: fx_coordinates.h:222
void Union(const FX_RECT &other_rect)
与矩形求并集。
void Inflate(const CFX_FloatRect &rt)
增加矩形的宽度和高度。
Definition: fx_coordinates.h:986
Definition: fx_coordinates.h:30
FX_FLOAT sweepAngle
绘制弧线的扫描角度。从起始角度开始正值为逆时针,单位为弧度。
Definition: fx_coordinates.h:582
void Concat(FX_FLOAT a, FX_FLOAT b, FX_FLOAT c, FX_FLOAT d, FX_FLOAT e, FX_FLOAT f, FX_BOOL bPrepended=false)
与另一个矩阵连接。
#define FXSYS_sin
计算浮点数从弧度参数的正弦值。
Definition: fx_system.h:1434
FX_BOOL IsScaled() const
此矩阵是否仅包含缩放(或平移)。没有旋转。
CFX_PRLTemplate< FX_FLOAT > CFX_ParallelogramF
浮点数平行四边形的类型定义。
Definition: fx_coordinates.h:347
FXT_PSV & operator -=(const FXT_PSV &obj)
重载运算符-=。
Definition: fx_coordinates.h:126
int right
右边界
Definition: fx_coordinates.h:603
FX_FLOAT GetA() const
获取系数a。
Definition: fx_coordinates.h:1585
CFX_ATemplate< FX_INT32 > CFX_Arc
整数弧线类的类型定义。
Definition: fx_coordinates.h:586
void SetIdentity()
将矩阵设置为单位变换矩阵。
Definition: fx_coordinates.h:1149
FX_RECT GetInnerRect() const
转换为内部整数矩形。
void Inflate(FX_FLOAT x, FX_FLOAT y)
增加矩形的宽度和高度。
Definition: fx_coordinates.h:966
void Transform(const CFX_Matrix *pMatrix)
变换矩形。结果矩形总是规范化的。
CFX_PSVTemplate< FX_FLOAT > * FX_LPPOINTF
浮点数点指针的类型定义。
Definition: fx_coordinates.h:228
void InitRect(FX_FLOAT x, FX_FLOAT y)
将矩形初始化为单个点。
Definition: fx_coordinates.h:932
CFX_FloatRect(FX_FLOAT left1, FX_FLOAT bottom1, FX_FLOAT right1, FX_FLOAT top1)
用左下角和右上角构造矩形。
Definition: fx_coordinates.h:787
CFX_PSVTemplate< FX_INT32 > CFX_Point
整数点类的类型定义。
Definition: fx_coordinates.h:214
CFX_FloatRect()
构造一个空矩形。
Definition: fx_coordinates.h:777
FX_SHORT Left
左边界
Definition: fx_coordinates.h:758
CFX_Matrix()
构造一个单位变换矩阵。
Definition: fx_coordinates.h:1082
FX_BOOL FX_IsRectAdjacent(const CFX_FloatRect &rect1, const CFX_FloatRect &rect2, FX_FLOAT alignmentTolerance, FX_FLOAT distanceTolerance, int direction)
检查一个矩形是否在水平或垂直方向上与另一个矩形相邻。
FX_FLOAT startAngle
绘制弧线的起始角度。正值为逆时针,单位为弧度。
Definition: fx_coordinates.h:580
baseType xRadius
圆角的x半径。不得超过宽度的一半。
Definition: fx_coordinates.h:543
void ConcatInverse(const CFX_Matrix &m, FX_BOOL bPrepended=false)
连接另一个矩阵的逆矩阵。
void Offset(int dx, int dy)
通过x和y方向的增量值移动坐标。
Definition: fx_coordinates.h:714
FX_FLOAT Width() const
获取矩形的宽度。
Definition: fx_coordinates.h:949
int FX_INT32
32位有符号整数。
Definition: fx_system.h:683
friend FXT_PSV operator -(const FXT_PSV &obj1, const FXT_PSV &obj2)
重载运算符-。
Definition: fx_coordinates.h:179
FX_BOOL IsInvertible() const
确定矩阵是否可逆。
void * FXSYS_memset32(void *dst, FX_INT32 v, size_t size)
将缓冲区数据设置为指定值。
void Union(const CFX_FloatRect &other_rect)
与矩形求并集。
CFX_RTemplate< FX_INT32 > * FX_LPRECT
整数矩形指针的类型定义。
Definition: fx_coordinates.h:461
FX_FLOAT GetXUnit() const
获取X方向的单位大小。
FX_SHORT Bottom
下边界
Definition: fx_coordinates.h:764
FX_FLOAT GetF() const
获取系数f。
Definition: fx_coordinates.h:1620
void GetUnitParallelogram(CFX_ParallelogramF &pg) const
获取由两个单位向量组成的平行四边形。
int FX_BOOL
布尔变量(应为TRUE或FALSE)。
Definition: fx_system.h:691
FX_FLOAT GetYUnit() const
获取Y方向的单位大小。
FX_BOOL operator !=(const CFX_Matrix &src) const
比较(!=)运算符重载。比较两个矩阵。
Definition: fx_coordinates.h:1116
CFX_PSVTemplate< FX_FLOAT > const * FX_LPCPOINTF
浮点数点常量指针的类型定义。
Definition: fx_coordinates.h:232
FXT_PSV & operator/=(BaseType lamda)
重载运算符/=。
Definition: fx_coordinates.h:142
FX_FLOAT c
系数c。
Definition: fx_coordinates.h:1628
void TransformParallelogram(CFX_ParallelogramF &pg) const
变换一个平行四边形。
CFX_PSVTemplate< FX_INT32 > const * FX_LPCPOINT
整数点常量指针的类型定义。
Definition: fx_coordinates.h:230
FX_FLOAT a
系数a。
Definition: fx_coordinates.h:1624
int Substract4(CFX_FloatRect &substract_rect, CFX_FloatRect *pRects)
从此矩形中减去一个矩形区域。结果可能最多有4个矩形。 返回结果矩形的数量。调用者必须准备足够的矩形(最多4个)。
FX_BOOL IsEmpty() const
验证矩形是否为空。
Definition: fx_coordinates.h:808
CFX_ATemplate< FX_FLOAT > CFX_ArcF
浮点数弧线类的类型定义。
Definition: fx_coordinates.h:588
CFX_RTemplate< FX_FLOAT > const * FX_LPCRECTF
浮点数矩形常量指针的类型定义。
Definition: fx_coordinates.h:467
FX_BOOL IsEmpty() const
验证矩形是否为空。
Definition: fx_coordinates.h:647
void Add(BaseType x, BaseType y)
添加一个点。
Definition: fx_coordinates.h:94
FX_FLOAT GetD() const
获取系数d。
Definition: fx_coordinates.h:1606
void TransformPoints(CFX_PointF *points, FX_INT32 iCount) const
变换点数组。
#define FXSYS_acos
计算浮点数的反余弦值,以弧度为单位。
Definition: fx_system.h:1429
void Reset()
重置到基点。
Definition: fx_coordinates.h:109
short FX_SHORT
短整数(16位)。
Definition: fx_system.h:675
void Transform(FX_FLOAT &x, FX_FLOAT &y) const
变换一个点。
Definition: fx_coordinates.h:1460
#define FXSYS_fabs
计算绝对值。FXSYS_fabs(x) 表示 |x|。
Definition: fx_system.h:1404
FX_FLOAT GetC() const
获取系数c。
Definition: fx_coordinates.h:1599
#define FXSYS_cos
计算浮点数从弧度参数的余弦值。
Definition: fx_system.h:1424
void Deflate(FX_FLOAT x, FX_FLOAT y)
减少矩形的宽度和高度。
Definition: fx_coordinates.h:996
int left
左边界
Definition: fx_coordinates.h:599
Definition: fx_basic.h:1278
CFX_PSVTemplate< FX_FLOAT > CFX_SizeF
浮点数大小类的类型定义。
Definition: fx_coordinates.h:220
void SetReverse(const CFX_Matrix &m)
将另一个矩阵的逆矩阵的系数设置到此矩阵中。
FX_FLOAT Height() const
获取矩形的高度。
Definition: fx_coordinates.h:956
FX_BOOL Is90Rotated() const
此矩阵是否包含90度或-90度的旋转。
CFX_ETemplate< FX_INT32 > CFX_Ellipse
整数椭圆类的类型定义。
Definition: fx_coordinates.h:522
CFX_FloatRect GetUnitRect() const
获取由两个单位向量组成的平行四边形的边界矩形。
void Translate(FX_FLOAT x, FX_FLOAT y, FX_BOOL bPrepended=false)
平移矩阵。
float FX_FLOAT
32位浮点数。
Definition: fx_system.h:685
void UpdateRect(FX_FLOAT x, FX_FLOAT y)
更新矩形以包含指定的点。
#define FXSYS_assert
断言。
Definition: fx_system.h:804
FXT_PSV & operator+=(const FXT_PSV &obj)
重载运算符+=。
Definition: fx_coordinates.h:118
CFX_PSVTemplate< FX_INT32 > * FX_LPPOINT
整数点指针的类型定义。
Definition: fx_coordinates.h:226
Definition: fx_coordinates.h:33
void Set(FX_FLOAT a, FX_FLOAT b, FX_FLOAT c, FX_FLOAT d, FX_FLOAT e, FX_FLOAT f)
更改矩阵中的系数。
CFX_RTemplate< FX_INT32 > CFX_Rect
整数矩形类的类型定义。
Definition: fx_coordinates.h:457
Definition: fx_coordinates.h:596
FX_FLOAT GetUnitArea() const
获取由两个单位向量组成的平行四边形的面积。
void Inflate(FX_FLOAT left, FX_FLOAT bottom, FX_FLOAT right, FX_FLOAT top)
增加矩形的宽度和高度。
Definition: fx_coordinates.h:977
void RotateAt(FX_FLOAT fRadian, FX_FLOAT x, FX_FLOAT y, FX_BOOL bPrepended=false)
在指定位置旋转矩阵。
FX_BOOL Contains(int x, int y) const
检查当前矩形是否包含提供的点。 即检查提供的点是否在当前矩形内部。
Definition: fx_coordinates.h:739
friend FXT_PSV operator/(const FXT_PSV &obj, BaseType lamda)
重载运算符/。
Definition: fx_coordinates.h:206
friend FX_BOOL operator !=(const FXT_PSV &obj1, const FXT_PSV &obj2)
重载运算符!=。
Definition: fx_coordinates.h:161
void Deflate(FX_FLOAT left, FX_FLOAT bottom, FX_FLOAT right, FX_FLOAT top)
减少矩形的宽度和高度。
Definition: fx_coordinates.h:1007
friend FX_BOOL operator==(const FXT_PSV &obj1, const FXT_PSV &obj2)
重载运算符==。
Definition: fx_coordinates.h:152
FX_SHORT Top
上边界
Definition: fx_coordinates.h:760
CFX_RTemplate< FX_INT32 > const * FX_LPCRECT
整数矩形常量指针的类型定义。
Definition: fx_coordinates.h:465
void Copy(const CFX_Matrix &m)
从另一个矩阵复制系数。
Definition: fx_coordinates.h:1206
CFX_VTemplate< FX_FLOAT > CFX_VectorF
浮点数向量类。
Definition: fx_coordinates.h:304
FX_FLOAT GetB() const
获取系数b。
Definition: fx_coordinates.h:1592
friend FXT_PSV operator+(const FXT_PSV &obj1, const FXT_PSV &obj2)
重载运算符+。
Definition: fx_coordinates.h:170
FX_FLOAT f
系数f。
Definition: fx_coordinates.h:1634
FX_FLOAT right
右边界。
Definition: fx_coordinates.h:1040
void Intersect(const CFX_FloatRect &other_rect)
与矩形求交集。
void MatchRect(const CFX_FloatRect &dest, const CFX_FloatRect &src)
获取将源矩形变换到目标矩形的矩阵。
FX_FLOAT TransformDistance(FX_FLOAT dx, FX_FLOAT dy) const
变换由X和Y值指定的距离。
Definition: fx_coordinates.h:34
CFX_FloatRect(const FX_FLOAT *pArray)
用左、下、右、上值的数组构造矩形。
Definition: fx_coordinates.h:794
CFX_PSVTemplate< FX_INT32 > CFX_Size
整数大小类的类型定义。
Definition: fx_coordinates.h:218
Definition: fx_coordinates.h:31
FX_FLOAT bottom
底部边界。
Definition: fx_coordinates.h:1042
FX_BOOL operator !=(const FX_RECT &src) const
比较(!=)运算符重载。比较两个矩形。请确保它们首先被规范化。
Definition: fx_coordinates.h:703
void Intersect(const FX_RECT &src)
与矩形求交集。
Definition: fx_coordinates.h:32
void Shear(FX_FLOAT fAlphaRadian, FX_FLOAT fBetaRadian, FX_BOOL bPrepended=false)
剪切矩阵。
FX_BOOL Contains(const CFX_FloatRect &other_rect) const
检查当前矩形是否完全包含其他提供的矩形。 即检查其他矩形是否完全在当前矩形内部。
Definition: fx_coordinates.h:36
CFX_PSVTemplate< FX_FLOAT > CFX_PointF
浮点数点类的类型定义。
Definition: fx_coordinates.h:216
FX_FLOAT left
左边界。
Definition: fx_coordinates.h:1038
CFX_ETemplate< FX_FLOAT > CFX_EllipseF
浮点数椭圆类的类型定义。
Definition: fx_coordinates.h:524
Definition: fx_coordinates.h:35
void Reset()
重置矩形,将坐标设置为0。
Definition: fx_coordinates.h:844
void Rotate(FX_FLOAT fRadian, FX_BOOL bPrepended=false)
旋转矩阵。
BaseType y
点的y坐标。
Definition: fx_coordinates.h:211
FX_FLOAT TransformXDistance(FX_FLOAT dx) const
变换X距离。
Definition: fx_coordinates.h:1076
void Set(const FXT_PSV &psv)
设置值。
Definition: fx_coordinates.h:85
#define FXSYS_sqrt
计算平方根。FXSYS_sqrt(x) 表示 sqrt(x)。
Definition: fx_system.h:1399
FX_BOOL operator==(const CFX_FloatRect &src) const
比较(==)运算符重载。比较两个矩形。请确保它们首先被规范化。
Definition: fx_coordinates.h:824
FX_BOOL operator==(const CFX_Matrix &src) const
比较(==)运算符重载。比较两个矩阵。
Definition: fx_coordinates.h:1104
void Scale(FX_FLOAT sx, FX_FLOAT sy, FX_BOOL bPrepended=false)
缩放矩阵。
FX_FLOAT top
顶部边界。
Definition: fx_coordinates.h:1044
FX_RECT()
构造一个未初始化的矩形。
Definition: fx_coordinates.h:610
FX_FLOAT GetE() const
获取系数e。
Definition: fx_coordinates.h:1613
CFX_RRTemplate< FX_INT32 > CFX_RoundRect
整数圆角矩形类的类型定义。
Definition: fx_coordinates.h:549
void Translate(FX_FLOAT e, FX_FLOAT f)
平移矩形。
Definition: fx_coordinates.h:1025
CFX_RTemplate< FX_FLOAT > CFX_RectF
浮点数矩形类的类型定义。
Definition: fx_coordinates.h:459
baseType yRadius
圆角的y半径。不得超过高度的一半。
Definition: fx_coordinates.h:545
void TransformRoundRect(CFX_RoundRectF &rr) const
变换一个圆角矩形。
friend FXT_PSV operator *(const FXT_PSV &obj, BaseType lamda)
重载运算符*。
Definition: fx_coordinates.h:188
void Deflate(const CFX_FloatRect &rt)
减少矩形的宽度和高度。
Definition: fx_coordinates.h:1015
CFX_Matrix(FX_FLOAT a1, FX_FLOAT b1, FX_FLOAT c1, FX_FLOAT d1, FX_FLOAT e1, FX_FLOAT f1)
用六个输入系数构造矩阵。
Definition: fx_coordinates.h:1094
CFX_PSVTemplate(const CFX_PSVTemplate &other)
拷贝构造函数。
Definition: fx_coordinates.h:67
Definition: fx_coordinates.h:771
FX_SHORT Right
右边界
Definition: fx_coordinates.h:762
FX_FLOAT d
系数d。
Definition: fx_coordinates.h:1630
FX_BOOL IsIdentity() const
确定矩阵是否为单位变换。
Definition: fx_coordinates.h:1213
FX_BOOL operator==(const FX_RECT &src) const
比较(==)运算符重载。比较两个矩形。请确保它们首先被规范化。
Definition: fx_coordinates.h:693
Definition: fx_coordinates.h:755
FX_FLOAT e
系数e。
Definition: fx_coordinates.h:1632
void Subtract(BaseType x, BaseType y)
减去一个点。
Definition: fx_coordinates.h:103
CFX_VTemplate< FX_INT32 > CFX_Vector
整数向量类。
Definition: fx_coordinates.h:302