You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

89 lines
2.3 KiB
C

1 month ago
//////////////////////////////////////////////////////////////////////////////
//<2F>ļ<EFBFBD> Rect8.h
/////////////////////////////////////////////////////////////////////////////
#pragma once
#ifndef AFX_EXT_CLASS
#define AFX_EXT_CLASS Q_DECL_IMPORT
#endif
#include "Point2D.h"
namespace GBase
{
class AFX_EXT_CLASS CRect8
{
public:
CRect8(void);
// (left, top, right, bottom)<29><>ʽ<EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>
explicit CRect8(CString strVal);
CRect8(double left, double top, double right, double bottom);
//#ifdef _QT_VERSION
// CRect8( DF_Rect& rect);
//#endif
~CRect8(void);
virtual void Serialize(CArchive& ar, const short &ver);
void SetRect(double left, double top, double right, double bottom);
void SetRect(const CPoint2D& TopLeft, const CPoint2D& RightBottom);
double Width(void);
double Height(void);
CSize8 GetSize(void);
void SetOne(void);
void ToInt(CRect& rect);
bool operator==(const CRect8& rt);
void operator= (const CRect8& rt);
void operator= (CRect& rt);
void operator*=(double sv);
bool PtInRect(const CPoint2D& point);
bool PtInRect(double x, double y);
virtual bool RtInRect(CRect8& rect);
//<2F>ж<EFBFBD><D0B6><EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɵ<EFBFBD><C9B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD>Rect<63><74>Χ<EFBFBD><CEA7>
bool IsInRange(double* x, double* y, int num);
bool ContainRect(CRect8& rect);
CPoint2D TopLeft(void);
CPoint2D BottomRight(void);
CPoint2D CenterPoint(void);
void CombinRect(const CRect8& rect);
void CombinRect(double xmin, double ymin, double xmax, double ymax);
void CombinPoint(double x, double y);
void CombinPoint(const CPoint2D& point);
void Empty(void);
bool IsEmpty(void);
void InflateRect(double x, double y);
void DeflateRect(double x, double y);
void InflateRect(double l, double t, double r, double b);
void DeflateRect(double l, double t, double r, double b);
void IntersectRect(CRect8& rect);
void RotateRect(double x0, double y0, double angle);
void OffsetRect(double dx, double dy);
void NormalizeRect(void);
virtual void ScaleCoor(double xs,double ys,double dx,double dy);
virtual void ExchangeXY(void); //<2F><><EFBFBD><EFBFBD>XY<58><59><EFBFBD><EFBFBD>
virtual void Serialize(CArchive& ar);
// void Write(CDFile& fw);
// int Read(CDFile& fr);
//<2F>ж<EFBFBD><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7>
bool IsIntersected(CRect8& other);
public:
double left,right,top,bottom;
};
};
using namespace GBase;