forked from neuks/Indicator
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCCentroid.h
More file actions
98 lines (81 loc) · 2.17 KB
/
CCentroid.h
File metadata and controls
98 lines (81 loc) · 2.17 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#pragma once
/*****************************************************************************
* ìøÂÛ¿ÉÊÓ»¯·ÖÎöϵͳ
* Copyright (C) 2016, Martin Tang
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*****************************************************************************/
class CCentroid
{
private:
int nTop1, nTop2, nBot1, nBot2;
int nLines, nStart, nEnd;
bool m_bInCentre;
float fTop1, fTop2, fBot1, fBot2;
float fHigh, fLow, fPHigh, fPLow;
public:
CCentroid(void);
~CCentroid();
// const method
int GetEnd(void) const;
float GetHigh(void) const;
int GetLines(void) const;
float GetLow(void) const;
float GetPrevHigh(void) const;
float GetPrevLow(void) const;
int GetStart(void) const;
bool IsBottom1AboveBottom2(void) const;
bool IsInCentre(void) const;
bool IsTop1BelowTop2(void) const;
// non-const method
bool PushHigh(int nIndex, float fValue);
bool PushLow(int nIndex, float fValue);
};
inline int CCentroid::GetEnd(void) const
{
return nEnd;
}
inline float CCentroid::GetHigh(void) const
{
return fHigh;
}
inline int CCentroid::GetLines(void) const
{
return nLines;
}
inline float CCentroid::GetLow(void) const
{
return fLow;
}
inline float CCentroid::GetPrevHigh(void) const
{
return fPHigh;
}
inline float CCentroid::GetPrevLow(void) const
{
return fPLow;
}
inline int CCentroid::GetStart(void) const
{
return nStart;
}
inline bool CCentroid::IsBottom1AboveBottom2(void) const
{
return fBot1 > fBot2;
}
inline bool CCentroid::IsInCentre(void) const
{
return m_bInCentre;
}
inline bool CCentroid::IsTop1BelowTop2(void) const
{
return fTop1 < fTop2;
}