MapRectangle.cpp
上传用户:bjslfz
上传日期:2022-07-25
资源大小:4430k
文件大小:1k
- #include "stdafx.h"
- #include "MapRectangle.h"
- CMapRectangle::CMapRectangle()
- {
- m_dbLeft = 0.0;
- m_dbRight = 0.0;
- m_dbTop = 0.0;
- m_dbBottom = 0.0;
- }
- CMapRectangle::CMapRectangle(CMapRectangle& MapRectangle )
- {
- m_dbLeft = MapRectangle.m_dbLeft;
- m_dbRight = MapRectangle.m_dbRight;
- m_dbTop = MapRectangle.m_dbTop;
- m_dbBottom = MapRectangle.m_dbBottom;
- }
- CMapRectangle::~CMapRectangle()
- {
- }
- BOOL CMapRectangle::IsPointIn(CMapPoint& point)
- {
- if ( min(m_dbLeft,m_dbRight) < point.GetX() && point.GetX()<max(m_dbLeft,m_dbRight)
- && min(m_dbTop,m_dbBottom) < point.GetY() && point.GetY()<max(m_dbTop,m_dbBottom))
- return TRUE;
- else
- return FALSE;
- }
- BOOL CMapRectangle::IsInsercet(CMapRectangle& rc)
- {
- if (m_dbRight < rc.GetLeft() || m_dbLeft > rc.GetRight()
- || m_dbTop < rc.GetBottom() || m_dbBottom > rc.GetTop() )
- return FALSE;
- else
- return TRUE;
- }