-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsCircle.cpp
More file actions
71 lines (62 loc) · 1.51 KB
/
sCircle.cpp
File metadata and controls
71 lines (62 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#include "stdafx.h"
#include "sCircle.h"
sCircle::sCircle()
{
name = "Circle";
}
sCircle::sCircle(CPoint start, CPoint end)
{
name = "Circle";
this->start = start;
this->end = end;
}
sCircle::~sCircle(void)
{
}
void sCircle::DrawShape(CDC *pdc, CPoint start, CPoint end)
{
CPen* penne = new CPen(lineType, lineThickness, lineColor);
pdc->SelectObject(penne);
rect.SetRect(start.x, start.y, start.x + (end.x - start.x), start.y + (end.x - start.x));
pdc->Ellipse(rect);
this->start = start;
this->end = end;
PaintText(pdc);
delete penne;
}
void sCircle::DrawShape(CDC *pdc)
{
CPen* penne = new CPen(lineType, lineThickness, lineColor);
pdc->SelectObject(penne);
rect.SetRect(start.x, start.y, start.x + (end.x - start.x), start.y + (end.x - start.x));
rect.NormalizeRect();
pdc->Ellipse(rect);
PaintText(pdc);
delete penne;
}
void sCircle::IsSelected(CDC *pdc)
{
CPen* penne = new CPen(PS_DOT, 1, RGB(150,150,150));
pdc->SelectObject(penne);
pdc->Ellipse(rect);
rect.NormalizeRect();
PaintText(pdc);
delete penne;
}
void sCircle::DrawAuxiliary(CDC *pdc, CPoint start, CPoint end)
{
pdc->Ellipse(start.x, start.y, start.x + (end.x - start.x), start.y + (end.x - start.x));
}
string sCircle::ToString()
{
CT2CA pszConvertedAnsiString (text);
std::string strStd (pszConvertedAnsiString);
return name
+ "," + ltos(lineType)
+ "," + ltos(lineThickness)
+ "," + ltos(lineColor)
+ "," + strStd //formatted text
+ "," + ltos(start.x) + "," + ltos(start.y)
+ "," + ltos(end.x) + "," + ltos(end.y)
+ "\n";
}