Skip to content

Commit

Permalink
apply clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwigway committed Nov 29, 2023
1 parent 0008373 commit b208aa8
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 25 deletions.
7 changes: 6 additions & 1 deletion src/extractor/extraction_containers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,12 @@ void ExtractionContainers::PrepareEdges(ScriptingEnvironment &scripting_environm
const auto accurate_distance =
util::coordinate_calculation::greatCircleDistance(source_coord, target_coord);

ExtractionSegment segment(source_coord, target_coord, distance, weight, duration, edge_iterator->result.flags);
ExtractionSegment segment(source_coord,
target_coord,
distance,
weight,
duration,
edge_iterator->result.flags);
scripting_environment.ProcessSegment(segment);

auto &edge = edge_iterator->result;
Expand Down
53 changes: 29 additions & 24 deletions src/extractor/scripting_environment_lua.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -471,29 +471,35 @@ void Sol2ScriptingEnvironment::InitContext(LuaScriptingContext &context)
[](ExtractionRelationContainer &cont, const ExtractionRelation::OsmIDTyped &rel_id)
-> const ExtractionRelation & { return cont.GetRelationData(rel_id); });

context.state.new_usertype<NodeBasedEdgeClassification>("NodeBasedEdgeClassification",
"forward",
// can't just do &NodeBasedEdgeClassification::forward with bitfields
sol::property([](NodeBasedEdgeClassification &c) -> bool { return c.forward; }),
"backward",
sol::property([](NodeBasedEdgeClassification &c) -> bool { return c.backward; }),
"is_split",
sol::property([](NodeBasedEdgeClassification &c) -> bool { return c.is_split; }),
"roundabout",
sol::property([](NodeBasedEdgeClassification &c) -> bool { return c.roundabout; }),
"circular",
sol::property([](NodeBasedEdgeClassification &c) -> bool { return c.circular; }),
"startpoint",
sol::property([](NodeBasedEdgeClassification &c) -> bool { return c.startpoint; }),
"restricted",
sol::property([](NodeBasedEdgeClassification &c) -> bool { return c.restricted; }),
"road_classification",
sol::property([](NodeBasedEdgeClassification &c) -> RoadClassification { return c.road_classification; }),
"highway_turn_classification",
sol::property([](NodeBasedEdgeClassification &c) -> uint8_t { return c.highway_turn_classification; }),
"access_turn_classification",
sol::property([](NodeBasedEdgeClassification &c) -> uint8_t { return c.access_turn_classification; })
);
context.state.new_usertype<NodeBasedEdgeClassification>(
"NodeBasedEdgeClassification",
"forward",
// can't just do &NodeBasedEdgeClassification::forward with bitfields
sol::property([](NodeBasedEdgeClassification &c) -> bool { return c.forward; }),
"backward",
sol::property([](NodeBasedEdgeClassification &c) -> bool { return c.backward; }),
"is_split",
sol::property([](NodeBasedEdgeClassification &c) -> bool { return c.is_split; }),
"roundabout",
sol::property([](NodeBasedEdgeClassification &c) -> bool { return c.roundabout; }),
"circular",
sol::property([](NodeBasedEdgeClassification &c) -> bool { return c.circular; }),
"startpoint",
sol::property([](NodeBasedEdgeClassification &c) -> bool { return c.startpoint; }),
"restricted",
sol::property([](NodeBasedEdgeClassification &c) -> bool { return c.restricted; }),
"road_classification",
sol::property([](NodeBasedEdgeClassification &c) -> RoadClassification {
return c.road_classification;
}),
"highway_turn_classification",
sol::property([](NodeBasedEdgeClassification &c) -> uint8_t {
return c.highway_turn_classification;
}),
"access_turn_classification",
sol::property([](NodeBasedEdgeClassification &c) -> uint8_t {
return c.access_turn_classification;
}));

context.state.new_usertype<ExtractionSegment>("ExtractionSegment",
"source",
Expand All @@ -509,7 +515,6 @@ void Sol2ScriptingEnvironment::InitContext(LuaScriptingContext &context)
"flags",
&ExtractionSegment::flags);


// Keep in mind .location is available only if .pbf is preprocessed to set the location with the
// ref using osmium command "osmium add-locations-to-ways"
context.state.new_usertype<osmium::NodeRef>(
Expand Down

0 comments on commit b208aa8

Please sign in to comment.