-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathShape.cpp
61 lines (50 loc) · 1019 Bytes
/
Shape.cpp
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
#include "stdafx.h"
#include "Shape.h"
CShape::CShape(int nId, int nX, int nY, int nWidth, int nHeight)
{
this->nId = nId;
this->nX = nX;
this->nY = nY;
this->nWidth = nWidth;
this->nHeight = nHeight;
bSelectedState = FALSE;
nRed = 0; nGreen = 0; nBlue = 0;
m_nType = TYPE_DEFAULT;
}
CShape::CShape(CShape * tmpShape)
{
this->nId = tmpShape->nId;
this->nX = tmpShape->nX;
this->nY = tmpShape->nY;
this->nWidth = tmpShape->nWidth;
this->nHeight = tmpShape->nHeight;
this->bSelectedState = bSelectedState;
this->nRed = nRed;
this->nGreen = nGreen;
this->nBlue = nBlue;
}
CShape::~CShape()
{
}
void CShape::SetRect(int nX, int nY, int nWidth, int nHeight)
{
this->nX = nX;
this->nY = nY;
this->nWidth = nWidth;
this->nHeight = nHeight;
nRed = 0; nGreen = 0; nBlue = 0;
}
void CShape::SetColor(int nRed, int nGreen, int nBlue)
{
this->nRed = nRed;
this->nGreen = nGreen;
this->nBlue = nBlue;
}
int CShape::GetId()
{
return nId;
}
void CShape::SetId(int nId)
{
this->nId = nId;
}