-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathBandsRange.h
49 lines (37 loc) · 1.39 KB
/
BandsRange.h
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
/*
* Copyright (c) 2011-2021 United States Government as represented by
* the National Aeronautics and Space Administration. No copyright
* is claimed in the United States under Title 17, U.S.Code. All Other
* Rights Reserved.
*/
#ifndef BANDSRANGE_H_
#define BANDSRANGE_H_
#include "Interval.h"
#include "BandsRegion.h"
#include "ColorValue.h"
namespace larcfm {
class BandsRange {
public:
// This numeric type is used for index variables over vectors of BandsRange
typedef std::vector<BandsRange>::size_type nat;
Interval interval;
BandsRegion::Region region;
BandsRange(const Interval& i, BandsRegion::Region r);
/*
* Transforms a list of color values into a list of BandRanges.
* This function avoids adding color points where the left and right colors are the same.
*/
static void makeRangesFromColorValues(std::vector<BandsRange>& ranges, const std::vector<ColorValue>& l, bool recovery);
/**
* Return index in ranges_ where val is found, -1 if invalid input or not found. Notice that values at
* the limits may be included or not depending on the regions.
*/
static int index_of(const std::vector<BandsRange>& ranges, double val, double mod);
std::string toString() const;
std::string toPVS() const;
private:
// NONE's when in recovery, become RECOVERY
static BandsRegion::Region resolution_region(BandsRegion::Region region, bool recovery);
};
}
#endif