diff options
| author | Andreas Grois <andreas.grois@jku.at> | 2015-11-10 13:39:56 +0100 |
|---|---|---|
| committer | Andreas Grois <andreas.grois@jku.at> | 2015-11-10 13:39:56 +0100 |
| commit | fc46d20e8411fe4b67269733f69d8a9dded4a42f (patch) | |
| tree | a3de639d552dd78ecdebc8cac8d703e3eb6bad4b /angleclass.cpp | |
| parent | 4aa67d78e9238a65eb94a762328465e2541fd4c4 (diff) | |
Add angle sets (disjoint ranges) - initial support
By adding a new angleset class, things get much easier to read. Also, the part of the previous commit that dealt with combining the individual ranges was kind of stupid.
Things missing:
o) functions to remove angle ranges from a set
o) deferred add functions, that allow adding multiple ranges without calling the O(n²) function angleset::combine() in between.
Diffstat (limited to 'angleclass.cpp')
| -rw-r--r-- | angleclass.cpp | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/angleclass.cpp b/angleclass.cpp index e1981d1..8f30d69 100644 --- a/angleclass.cpp +++ b/angleclass.cpp @@ -52,58 +52,58 @@ void angleclass::setval(const double setme) value=shiftinrange(setme); } -double angleclass::getval() +double angleclass::getval() const { return(value); } -angleclass angleclass::operator *(angleclass other) +angleclass angleclass::operator *(const angleclass other) const { - return(angleclass(value*other.getval())); + return(angleclass(value*other.value)); } -angleclass angleclass::operator-(angleclass other) +angleclass angleclass::operator-(const angleclass other) const { - return(angleclass(value-other.getval())); + return(angleclass(value-other.value)); } -angleclass angleclass::operator+(angleclass other) +angleclass angleclass::operator+(const angleclass other) const { - return(angleclass(value+other.getval())); + return(angleclass(value+other.value)); } -angleclass angleclass::operator/(angleclass other) +angleclass angleclass::operator/(const angleclass other) const { - return(angleclass(value/other.getval())); + return(angleclass(value/other.value)); } -bool angleclass::operator<(angleclass other) +bool angleclass::operator<(const angleclass other) const { - return(value<other.getval()); + return(value<other.value); } -bool angleclass::operator>(angleclass other) +bool angleclass::operator>(const angleclass other) const { - return(value>other.getval()); + return(value>other.value); } -bool angleclass::operator<=(angleclass other) +bool angleclass::operator<=(const angleclass other) const { - return(value<=other.getval()); + return(value<=other.value); } -bool angleclass::operator>=(angleclass other) +bool angleclass::operator>=(const angleclass other) const { - return(value>=other.getval()); + return(value>=other.value); } -bool angleclass::operator==(angleclass other) +bool angleclass::operator==(const angleclass other) const { - return(value==other.getval()); + return(value==other.value); } -bool angleclass::operator!=(angleclass other) +bool angleclass::operator!=(const angleclass other) const { - return(value!=other.getval()); + return(value!=other.value); } |
