Esempio n. 1
1
void  MyCircle::draw(CDC& dc)const
{
	if (enable)
	if (isPoint())
	{
		return ;
	}
	else
	{
		CPen pen(m_style,m_width,m_clr); 
		CPen *penOld = dc.SelectObject( &pen ); 
		dc.SelectStockObject(NULL_BRUSH);   
		
		int r = (int)sqrt((_x1-_x2)*(_x1-_x2)+(_y1-_y2)*(_y1-_y2));
		dc.Ellipse(_x1-r,_y1-r,_x1+r,_y1+r);

		dc.SelectObject(penOld);
		pen.DeleteObject();
	}
}
Esempio n. 2
0
double KNNDis(struct Point *point, struct Rect *rect,int dist_func)
{

	if(isPoint(rect))
	{
		Point p = Center(rect);
		return Distance(point,&p, dist_func);
	}
	else return Distance (point, rect, dist_func);
}
Esempio n. 3
0
void MyLine::draw(CDC& dc)const
{
	if (enable)
	{
		if (isPoint())
		{
			MyPoint p;
			p.draw(dc);
			return;
		}
		CPen pen(m_style,m_width,m_clr); 
		CPen *penOld = dc.SelectObject( &pen ); 
	
		dc.MoveTo(_x1,_y1);
		dc.LineTo(_x2,_y2);

		dc.SelectObject(penOld);
		pen.DeleteObject();
	}
}
Esempio n. 4
0
File: Line.hpp Progetto: psyllo/misc
 bool isHorizontal() { return (!isPoint() && y1 == y2); }
Esempio n. 5
0
File: Line.hpp Progetto: psyllo/misc
 bool isVertical() { return (!isPoint() && x1 == x2); }