diff options
| author | Andreas Grois <andreas.grois@jku.at> | 2015-11-27 11:02:12 +0100 |
|---|---|---|
| committer | Andreas Grois <andreas.grois@jku.at> | 2015-11-27 11:02:12 +0100 |
| commit | 77618b3511ee5edb6509902126293a084f9767bf (patch) | |
| tree | ab47be7697faca724cce06f074209ceed77840dc /anglerange.h | |
| parent | fc46d20e8411fe4b67269733f69d8a9dded4a42f (diff) | |
Angleset: Change add behaviour to not run combine()
The most often used command for angleset in this tool is the add function. If at the end of every add the combine() function is being called, a lot of CPU time is wasted.
Add now doesn't call combine(), and marks the angleset as dirty instead. All functions that require a clean angleset now check if it's dirty, and if yes call combine().
Diffstat (limited to 'anglerange.h')
| -rw-r--r-- | anglerange.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/anglerange.h b/anglerange.h index 6d6d286..f0c9eec 100644 --- a/anglerange.h +++ b/anglerange.h @@ -77,11 +77,13 @@ public: //this function calculates the overlap between this anglerange and another one, returning it as //a new anglerange. - anglerange overlap(const anglerange &other); + anglerange overlap(const anglerange &other) const; //this function does the opposite of overlap: Both ranges are combined into one bigger range. //if they are disjoint, an empty range is given back. - anglerange combine(const anglerange &other); + anglerange combine(const anglerange &other) const; + + //a subtract function is not possible at this level, as single angle ranges could get disjoint by it. bool operator<(const anglerange &other) const; bool operator>(const anglerange &other) const; |
