myCirc.cpp
资源名称:Shapes.zip [点击查看]
上传用户:wenshuihe
上传日期:2007-01-14
资源大小:10k
文件大小:1k
源码类别:
BREW编程
开发平台:
Visual C++
- // Circ.cpp: implementation of the CCirc class.
- //
- //////////////////////////////////////////////////////////////////////
- #include "myCirc.h"
- //////////////////////////////////////////////////////////////////////
- // Construction/Destruction
- //////////////////////////////////////////////////////////////////////
- CCirc::CCirc()
- {
- }
- CCirc::~CCirc()
- {
- }
- CPoint* CCirc::getCenter()
- {
- return &m_center;
- }
- uint16 CCirc::getRad() const
- {
- return m_rad;
- }
- boolean CCirc::draw(IGraphics *pg)
- {
- AEECircle c;
- c.cx = m_center.getx();
- c.cy = m_center.gety();
- c.r = m_rad;
- boolean rval = (IGRAPHICS_DrawCircle(pg,&c) == SUCCESS);
- return rval;
- }
- CCirc::CCirc(uint16 r, CPoint c, RGBVAL col): CShape(CColor(col)), m_rad(r), m_center(c)
- {
- }
- void CCirc::setCenter(CPoint c)
- {
- m_center = c;
- }
- void CCirc::setCenter(int16 x, int16 y)
- {
- m_center = CPoint(x,y);
- }
- void CCirc::setr(uint16 r)
- {
- m_rad = r;
- }
- void* CCirc::operator new(size_t sz)
- {
- return MALLOC(sz);
- }
- void CCirc::operator delete(void *p)
- {
- FREE(p);
- }