Skip to content

Commit 7332cc2

Browse files
committed
format files
1 parent d9c7fc9 commit 7332cc2

File tree

15 files changed

+140
-35
lines changed

15 files changed

+140
-35
lines changed

include/Lane.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,16 @@ struct LaneKey
3737
return this->road_id == other.road_id && this->lanesection_s0 == other.lanesection_s0 && this->lane_id == other.lane_id;
3838
}
3939

40-
bool operator!=(const LaneKey& other) const { return !(*this == other); }
40+
bool operator!=(const LaneKey& other) const
41+
{
42+
return !(*this == other);
43+
}
4144
};
4245

43-
inline std::ostream& operator<<(std::ostream& os, const LaneKey& lk) { return os << lk.to_string(); }
46+
inline std::ostream& operator<<(std::ostream& os, const LaneKey& lk)
47+
{
48+
return os << lk.to_string();
49+
}
4450

4551
struct Lane : public XmlNode
4652
{

include/RoutingGraph.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ struct equal_to<odr::RoutingGraphEdge>
5454
template<>
5555
struct hash<odr::WeightedLaneKey>
5656
{
57-
size_t operator()(const odr::WeightedLaneKey& w_key) const { return (hash<odr::LaneKey>()(w_key) ^ (hash<double>()(w_key.weight) << 1)); }
57+
size_t operator()(const odr::WeightedLaneKey& w_key) const
58+
{
59+
return (hash<odr::LaneKey>()(w_key) ^ (hash<double>()(w_key.weight) << 1));
60+
}
5861
};
5962

6063
template<>

include/Utils.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ namespace odr
3333
template<class C, class T, T C::*member>
3434
struct PtrCmp
3535
{
36-
bool operator()(const C* lhs, const C* rhs) const { return (*lhs).*member < (*rhs).*member; }
36+
bool operator()(const C* lhs, const C* rhs) const
37+
{
38+
return (*lhs).*member < (*rhs).*member;
39+
}
3740
};
3841

3942
template<class K, class V>

include/earcut.hpp

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ namespace util
3838
template<std::size_t I, typename T>
3939
struct nth
4040
{
41-
inline static typename std::tuple_element<I, T>::type get(const T& t) { return std::get<I>(t); };
41+
inline static typename std::tuple_element<I, T>::type get(const T& t)
42+
{
43+
return std::get<I>(t);
44+
};
4245
};
4346

4447
} // namespace util
@@ -122,8 +125,14 @@ class Earcut
122125
{
123126
public:
124127
ObjectPool() {}
125-
ObjectPool(std::size_t blockSize_) { reset(blockSize_); }
126-
~ObjectPool() { clear(); }
128+
ObjectPool(std::size_t blockSize_)
129+
{
130+
reset(blockSize_);
131+
}
132+
~ObjectPool()
133+
{
134+
clear();
135+
}
127136
template<typename... Args>
128137
T* construct(Args&&... args)
129138
{
@@ -148,7 +157,10 @@ class Earcut
148157
currentBlock = nullptr;
149158
currentIndex = blockSize;
150159
}
151-
void clear() { reset(blockSize); }
160+
void clear()
161+
{
162+
reset(blockSize);
163+
}
152164

153165
private:
154166
T* currentBlock = nullptr;

src/Geometries/Arc.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ Arc::Arc(double s0, double x0, double y0, double hdg0, double length, double cur
1010
{
1111
}
1212

13-
std::unique_ptr<RoadGeometry> Arc::clone() const { return std::make_unique<Arc>(*this); }
13+
std::unique_ptr<RoadGeometry> Arc::clone() const
14+
{
15+
return std::make_unique<Arc>(*this);
16+
}
1417

1518
Vec2D Arc::get_xy(double s) const
1619
{

src/Geometries/CubicSpline.cpp

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,15 @@ Poly3::Poly3(double s0, double a, double b, double c, double d)
2626
this->d = d;
2727
}
2828

29-
double Poly3::get(double s) const { return a + b * s + c * s * s + d * s * s * s; }
29+
double Poly3::get(double s) const
30+
{
31+
return a + b * s + c * s * s + d * s * s * s;
32+
}
3033

31-
double Poly3::get_grad(double s) const { return b + 2 * c * s + 3 * d * s * s; }
34+
double Poly3::get_grad(double s) const
35+
{
36+
return b + 2 * c * s + 3 * d * s * s;
37+
}
3238

3339
double Poly3::get_max(double s_start, double s_end) const
3440
{
@@ -102,7 +108,10 @@ void Poly3::negate()
102108
d = -d;
103109
}
104110

105-
bool Poly3::is_zero() const { return (a == 0) && (b == 0) && (c == 0) && (d == 0); }
111+
bool Poly3::is_zero() const
112+
{
113+
return (a == 0) && (b == 0) && (c == 0) && (d == 0);
114+
}
106115

107116
void Poly3::set_zero()
108117
{
@@ -112,11 +121,20 @@ void Poly3::set_zero()
112121
d = 0;
113122
}
114123

115-
bool Poly3::isnan() const { return (std::isnan(this->a) || std::isnan(this->b) || std::isnan(this->c) || std::isnan(this->d)); }
124+
bool Poly3::isnan() const
125+
{
126+
return (std::isnan(this->a) || std::isnan(this->b) || std::isnan(this->c) || std::isnan(this->d));
127+
}
116128

117-
bool CubicSpline::empty() const { return this->s0_to_poly.empty(); }
129+
bool CubicSpline::empty() const
130+
{
131+
return this->s0_to_poly.empty();
132+
}
118133

119-
std::size_t CubicSpline::size() const { return this->s0_to_poly.size(); }
134+
std::size_t CubicSpline::size() const
135+
{
136+
return this->s0_to_poly.size();
137+
}
120138

121139
double CubicSpline::get(double s, double default_val, bool extend_start) const
122140
{

src/Geometries/Line.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ namespace odr
99

1010
Line::Line(double s0, double x0, double y0, double hdg0, double length) : RoadGeometry(s0, x0, y0, hdg0, length, GeometryType_Line) {}
1111

12-
std::unique_ptr<RoadGeometry> Line::clone() const { return std::make_unique<Line>(*this); }
12+
std::unique_ptr<RoadGeometry> Line::clone() const
13+
{
14+
return std::make_unique<Line>(*this);
15+
}
1316

1417
Vec2D Line::get_xy(double s) const
1518
{
@@ -18,8 +21,14 @@ Vec2D Line::get_xy(double s) const
1821
return Vec2D{x, y};
1922
}
2023

21-
Vec2D Line::get_grad(double s) const { return {{std::cos(hdg0), std::sin(hdg0)}}; }
24+
Vec2D Line::get_grad(double s) const
25+
{
26+
return {{std::cos(hdg0), std::sin(hdg0)}};
27+
}
2228

23-
std::set<double> Line::approximate_linear(double eps) const { return {s0, s0 + length}; }
29+
std::set<double> Line::approximate_linear(double eps) const
30+
{
31+
return {s0, s0 + length};
32+
}
2433

2534
} // namespace odr

src/Geometries/ParamPoly3.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@ ParamPoly3::ParamPoly3(double s0,
5151
this->cubic_bezier.valid_length = length;
5252
}
5353

54-
std::unique_ptr<RoadGeometry> ParamPoly3::clone() const { return std::make_unique<ParamPoly3>(*this); }
54+
std::unique_ptr<RoadGeometry> ParamPoly3::clone() const
55+
{
56+
return std::make_unique<ParamPoly3>(*this);
57+
}
5558

5659
Vec2D ParamPoly3::get_xy(double s) const
5760
{

src/Geometries/Spiral.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ Spiral::Spiral(double s0, double x0, double y0, double hdg0, double length, doub
1818
odrSpiral(s0_spiral, c_dot, &x0_spiral, &y0_spiral, &a0_spiral);
1919
}
2020

21-
std::unique_ptr<RoadGeometry> Spiral::clone() const { return std::make_unique<Spiral>(*this); }
21+
std::unique_ptr<RoadGeometry> Spiral::clone() const
22+
{
23+
return std::make_unique<Spiral>(*this);
24+
}
2225

2326
Vec2D Spiral::get_xy(double s) const
2427
{

src/Lane.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ HeightOffset::HeightOffset(double inner, double outer) : inner(inner), outer(out
1111

1212
LaneKey::LaneKey(std::string road_id, double lanesection_s0, int lane_id) : road_id(road_id), lanesection_s0(lanesection_s0), lane_id(lane_id) {}
1313

14-
std::string LaneKey::to_string() const { return string_format("%s/%.17g/%d", this->road_id.c_str(), this->lanesection_s0, this->lane_id); }
14+
std::string LaneKey::to_string() const
15+
{
16+
return string_format("%s/%.17g/%d", this->road_id.c_str(), this->lanesection_s0, this->lane_id);
17+
}
1518

1619
Lane::Lane(std::string road_id, double lanesection_s0, int id, bool level, std::string type) :
1720
key(road_id, lanesection_s0, id), id(id), level(level), type(type)

0 commit comments

Comments
 (0)