MCPcopy Create free account
hub / github.com/Tencent/TAD_Sim / roadEle

Method roadEle

common/map_sdk/map_import/src/OpenDriveStruct.cpp:2257–2281  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2255}
2256
2257void ODRoad::roadEle(std::vector<double>& ele, const std::vector<double>* intervals) const {
2258 ele.clear();
2259
2260 if (elevation.empty()) {
2261 return;
2262 } else {
2263 std::vector<double> interval;
2264 if (intervals && !intervals->empty()) {
2265 interval = *intervals;
2266 } else {
2267 roadInterval(interval);
2268 }
2269
2270 size_t index = 0;
2271 for (size_t i = 0; i < interval.size();) {
2272 if (index + 1 < elevation.size() && interval[i] > elevation[index + 1].offset()) {
2273 index++;
2274 } else {
2275 double dis = interval[i] - elevation[index].offset();
2276 ele.push_back(elevation[index].value(dis));
2277 i++;
2278 }
2279 }
2280 }
2281}
2282
2283void ODRoad::roadEleControlPoint(std::vector<std::vector<double>>& ele, double length, std::string mapversion) {
2284 ele.clear();

Callers 1

DoRoadMethod · 0.80

Calls 6

clearMethod · 0.45
emptyMethod · 0.45
sizeMethod · 0.45
offsetMethod · 0.45
push_backMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected