-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsEllipse.cpp
More file actions
69 lines (60 loc) · 1.39 KB
/
sEllipse.cpp
File metadata and controls
69 lines (60 loc) · 1.39 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
#include "stdafx.h"
#include "sEllipse.h"
sEllipse::sEllipse()
{
name = "Ellipse";
}
sEllipse::sEllipse(CPoint start, CPoint end)
{
name = "Ellipse";
this->start = start;
this->end = end;
}
sEllipse::~sEllipse(void)
{
}
void sEllipse::DrawShape(CDC *pdc, CPoint start, CPoint end)
{
CPen* penne = new CPen(lineType, lineThickness, lineColor);
pdc->SelectObject(penne);
rect.SetRect(start.x, start.y, end.x, end.y);
pdc->Ellipse(start.x, start.y, end.x, end.y);
this->start = start;
this->end = end;
PaintText(pdc);
delete penne;
}
void sEllipse::DrawShape(CDC *pdc)
{
CPen* penne = new CPen(lineType, lineThickness, lineColor);
pdc->SelectObject(penne);
rect.SetRect(start.x, start.y, end.x, end.y);
pdc->Ellipse(start.x, start.y, end.x, end.y);
PaintText(pdc);
delete penne;
}
void sEllipse::IsSelected(CDC *pdc)
{
CPen* penne = new CPen(PS_DOT, 1, RGB(150,150,150));
pdc->SelectObject(penne);
pdc->Ellipse(rect);
PaintText(pdc);
delete penne;
}
void sEllipse::DrawAuxiliary(CDC *pdc, CPoint start, CPoint end)
{
pdc->Ellipse(start.x, start.y, end.x, end.y);
}
string sEllipse::ToString()
{
CT2CA pszConvertedAnsiString (text);
std::string strStd (pszConvertedAnsiString);
return name
+ "," + ltos(lineType)
+ "," + ltos(lineThickness)
+ "," + ltos(lineColor)
+ "," + strStd
+ "," + ltos(start.x) + "," + ltos(start.y)
+ "," + ltos(end.x) + "," + ltos(end.y)
+ "\n";
}