-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathShape.cpp
More file actions
73 lines (55 loc) · 1.01 KB
/
Shape.cpp
File metadata and controls
73 lines (55 loc) · 1.01 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
72
73
#include "stdafx.h"
#include "Shape.h"
Shape::Shape()
{
}
Shape::~Shape(void)
{
}
void Shape::DrawShape(CDC *pdc, CPoint start, CPoint end) { }
void Shape::DrawShape(CDC *pdc) { }
void Shape::DrawAuxiliary(CDC *pdc, CPoint start, CPoint end) { }
string Shape::ToString() { return nullptr; }
bool Shape::IsOn(CPoint point)
{
return rect.PtInRect(point);
};
void Shape::IsSelected(CDC *pdc)
{
}
void Shape::SetLineWidth(int width)
{
this->lineThickness = width;
}
int Shape::GetLineWidth()
{
return this->lineThickness;
}
CString Shape::GetText()
{
return text;
}
void Shape::SetText(CString text)
{
this->text = text;
}
void Shape::PaintText(CDC *pdc)
{
if(!text.IsEmpty())
{
pdc->SetTextAlign(TA_CENTER);
int tmpx = start.x + ((end.x - start.x)/2);
int tmpy = start.y + ((end.y - start.y)/2);
pdc->TextOutW(tmpx, tmpy , text);
}
}
CPen* Shape::CreatePen()
{
CPen pen;
pen.CreatePen(this->lineType, this->lineThickness, this->lineColor);
return &pen;
}
string Shape::GetName()
{
return name;
}