-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsConnector.cpp
More file actions
60 lines (54 loc) · 1.21 KB
/
sConnector.cpp
File metadata and controls
60 lines (54 loc) · 1.21 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
#include "stdafx.h"
#include "sConnector.h"
sConnector::sConnector()
{
name = "Connector";
this->lineColor = RGB(0,0,0);
this->lineThickness = 1;
this->lineType = BS_SOLID;
}
sConnector::sConnector(CPoint start, CPoint end)
{
name = "Connector";
this->lineColor = RGB(0,0,0);
this->lineThickness = 1;
this->lineType = BS_SOLID;
this->start = start;
this->end = end;
}
sConnector::~sConnector(void)
{
}
void sConnector::DrawShape(CDC *pdc, CPoint start, CPoint end)
{
CPen* penne = new CPen(lineType, lineThickness, lineColor);
pdc->SelectObject(penne);
pdc->MoveTo(start);
pdc->LineTo(end);
this->start = start;
this->end = end;
delete penne;
}
void sConnector::DrawShape(CDC *pdc)
{
CPen* penne = new CPen(lineType, lineThickness, lineColor);
pdc->SelectObject(penne);
pdc->MoveTo(start);
pdc->LineTo(end);
this->start = start;
this->end = end;
delete penne;
}
string sConnector::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";
}