Skip to content

Commit

Permalink
chore: change point_type to point_type_t and use 'using' at those places
Browse files Browse the repository at this point in the history
  • Loading branch information
barendgehrels committed Oct 21, 2024
1 parent 8d2d399 commit 19f22c2
Show file tree
Hide file tree
Showing 85 changed files with 285 additions and 343 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ inline void simplify_input(RangeIn const& range,
template <typename RingOutput>
struct buffer_range
{
typedef typename point_type<RingOutput>::type output_point_type;
typedef typename coordinate_type<RingOutput>::type coordinate_type;
using output_point_type = point_type_t<RingOutput>;
using coordinate_type = coordinate_type_t<RingOutput>;

template
<
Expand Down Expand Up @@ -432,7 +432,7 @@ struct buffer_inserter<point_tag, Point, RingOutput>
{
detail::buffer::buffer_point
<
typename point_type<RingOutput>::type
point_type_t<RingOutput>
>(point, collection, distance_strategy, point_strategy);
}
};
Expand All @@ -446,7 +446,7 @@ template
>
struct buffer_inserter_ring
{
using output_point_type = typename point_type<RingOutput>::type;
using output_point_type = point_type_t<RingOutput>;

template
<
Expand Down Expand Up @@ -609,8 +609,8 @@ template
>
struct buffer_inserter<linestring_tag, Linestring, Polygon>
{
using output_ring_type = typename ring_type<Polygon>::type;
using output_point_type = typename point_type<output_ring_type>::type;
using output_ring_type = ring_type_t<Polygon>;
using output_point_type = point_type_t<output_ring_type>;

template
<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,13 @@ struct buffer_all<Input, Output, TagIn, multi_polygon_tag>
{
typedef typename boost::range_value<Output>::type polygon_type;

typedef typename point_type<Input>::type point_type;

if (geometry::is_empty(geometry_in))
{
// Then output geometry is kept empty as well
return;
}

model::box<point_type> box;
model::box<point_type_t<Input>> box;
geometry::envelope(geometry_in, box);
geometry::buffer(box, box, distance_strategy.max_distance(join_strategy, end_strategy));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,8 @@ class geometry_to_range
typename strategy::distance::services::return_type
<
Strategy,
typename point_type<Geometry>::type,
typename point_type
<
typename std::iterator_traits
<
RangeIterator
>::value_type
>::type
point_type_t<Geometry>,
point_type_t<typename std::iterator_traits<RangeIterator>::value_type>
>::type dist_min;

return apply(geometry, first, last, strategy, dist_min);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,14 +177,14 @@ class range_to_range_rtree
typename strategy::distance::services::return_type
<
Strategy,
typename point_type<rtree_value_type>::type,
typename point_type
point_type_t<rtree_value_type>,
point_type_t
<
typename std::iterator_traits
<
QueryRangeIterator
>::value_type
>::type
>
>::type dist_min;

return apply(rtree_first, rtree_last, queries_first, queries_last,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ struct linear_to_areal
using point_type = typename std::conditional
<
std::is_same<typename coordinate_type<Linear>::type, most_precise_type>::value,
typename point_type<Linear>::type,
typename point_type<Areal>::type
point_type_t<Linear>,
point_type_t<Areal>
>::type;

using linestring_type = geometry::model::linestring<point_type>;
Expand Down Expand Up @@ -108,7 +108,7 @@ struct segment_to_areal
Strategies const& strategies,
bool = false)
{
using linestring_type = geometry::model::linestring<typename point_type<Segment>::type>;
using linestring_type = geometry::model::linestring<point_type_t<Segment>>;
linestring_type linestring;
convert(segment, linestring);
linear_to_areal::apply(linestring, areal, shortest_seg, strategies);
Expand Down Expand Up @@ -142,8 +142,8 @@ struct areal_to_areal
using point_type = typename std::conditional
<
std::is_same<typename coordinate_type<Areal1>::type, most_precise_type>::value,
typename point_type<Areal1>::type,
typename point_type<Areal2>::type
point_type_t<Areal1>,
point_type_t<Areal2>
>::type;

using linestring_type = geometry::model::linestring<point_type>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ struct linear_to_linear
{
dispatch::closest_points
<
typename point_type<Linear1>::type,
point_type_t<Linear1>,
Linear2
>::apply(*points_begin(linear1), linear2, shortest_seg, strategies);
return;
Expand All @@ -53,7 +53,7 @@ struct linear_to_linear
{
dispatch::closest_points
<
typename point_type<Linear2>::type,
point_type_t<Linear2>,
Linear1
>::apply(*points_begin(linear2), linear1, shortest_seg, strategies);
detail::closest_points::swap_segment_points::apply(shortest_seg);
Expand Down Expand Up @@ -91,7 +91,7 @@ struct segment_to_linear
bool = false)
{
using linestring_type = geometry::model::linestring
<typename point_type<Segment>::type>;
<point_type_t<Segment>>;
linestring_type linestring;
convert(segment, linestring);
linear_to_linear::apply(linestring, linear, shortest_seg, strategies);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ struct segment_to_multipoint
{
using linestring_type = geometry::model::linestring
<
typename point_type<Segment>::type
point_type_t<Segment>
>;
linestring_type linestring;
convert(segment, linestring);
Expand All @@ -150,7 +150,7 @@ struct multipoint_to_segment
{
using linestring_type = geometry::model::linestring
<
typename point_type<Segment>::type
point_type_t<Segment>
>;
linestring_type linestring;
convert(segment, linestring);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ struct point_to_segment
static inline void apply(Point const& point, Segment const& segment,
OutputSegment& shortest_seg, Strategies const& strategies)
{
typename point_type<Segment>::type p[2];
point_type_t<Segment> p[2];
geometry::detail::assign_point_from_index<0>(segment, p[0]);
geometry::detail::assign_point_from_index<1>(segment, p[1]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class segment_to_segment
{
using intersection_return_type = segment_intersection_points
<
typename point_type<Segment1>::type
point_type_t<Segment1>
>;

using intersection_policy = policies::relate::segments_intersection_points
Expand All @@ -74,11 +74,11 @@ class segment_to_segment
return;
}

typename point_type<Segment1>::type p[2];
point_type_t<Segment1> p[2];
detail::assign_point_from_index<0>(segment1, p[0]);
detail::assign_point_from_index<1>(segment1, p[1]);

typename point_type<Segment2>::type q[2];
point_type_t<Segment2> q[2];
detail::assign_point_from_index<0>(segment2, q[0]);
detail::assign_point_from_index<1>(segment2, q[1]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ using creturn_t = typename strategy::distance::services::return_type
<
distance_strategy_t<Geometry1, Geometry2, Strategies>
>::type,
typename point_type<Geometry1>::type,
typename point_type<Geometry2>::type
point_type_t<Geometry1>,
point_type_t<Geometry2>
>::type;


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ struct convex_hull
detail::convex_hull::input_geometry_proxy<Geometry> in_proxy(geometry);
detail::convex_hull::graham_andrew
<
typename point_type<Geometry>::type
point_type_t<Geometry>
>::apply(in_proxy, out, strategy);
}
};
Expand All @@ -234,7 +234,7 @@ struct convex_hull<Box, box_tag>
static bool const Reverse
= geometry::point_order<OutputGeometry>::value == counterclockwise;

std::array<typename point_type<OutputGeometry>::type, 4> arr;
std::array<point_type_t<OutputGeometry>, 4> arr;
// TODO: This assigns only 2d cooridnates!
// And it is also used in box_view<>!
geometry::detail::assign_box_corners_oriented<Reverse>(box, arr);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ struct geometry_covered_by_box
template <typename Geometry, typename Box, typename Strategy>
static inline bool apply(Geometry const& geometry, Box const& box, Strategy const& strategy)
{
using point_type = typename point_type<Geometry>::type;
using point_type = point_type_t<Geometry>;
using mutable_point_type = typename helper_geometry<point_type>::type;
using box_type = model::box<mutable_point_type>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ struct disjoint_no_intersections_policy
template <typename Strategy>
static inline bool apply(Geometry1 const& g1, Geometry2 const& g2, Strategy const& strategy)
{
using point_type = typename point_type<Geometry1>::type;
typename helper_geometry<point_type>::type p;
typename helper_geometry<point_type_t<Geometry1>>::type p;
geometry::point_on_border(p, g1);

return ! geometry::covered_by(p, g2, strategy);
Expand Down Expand Up @@ -183,7 +182,7 @@ class disjoint_segment_areal<Segment, Polygon, polygon_tag>
return false;
}

typename point_type<Segment>::type p;
point_type_t<Segment> p;
detail::assign_point_from_index<0>(segment, p);

return ! geometry::covered_by(p, polygon, strategy);
Expand Down Expand Up @@ -219,7 +218,7 @@ struct disjoint_segment_areal<Segment, Ring, ring_tag>
return false;
}

typename point_type<Segment>::type p;
point_type_t<Segment> p;
detail::assign_point_from_index<0>(segment, p);

return ! geometry::covered_by(p, ring, strategy);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,12 @@ struct disjoint_segment
static inline bool apply(Segment1 const& segment1, Segment2 const& segment2,
Strategy const& strategy)
{
typedef typename point_type<Segment1>::type point_type;

typedef segment_intersection_points<point_type> intersection_return_type;

typedef policies::relate::segments_intersection_points
using point_type = point_type_t<Segment1>;
using intersection_return_type = segment_intersection_points<point_type>;
using intersection_policy = policies::relate::segments_intersection_points
<
intersection_return_type
> intersection_policy;
>;

detail::segment_as_subrange<Segment1> sub_range1(segment1);
detail::segment_as_subrange<Segment2> sub_range2(segment2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ struct disjoint_range_segment_or_box
SegmentOrBox const& segment_or_box,
Strategy const& strategy)
{
using point_type = typename point_type<Range>::type;
using point_type = point_type_t<Range>;
using range_segment = typename geometry::model::referring_segment<point_type const>;

detail::closed_view<Range const> const view(range);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ class multipoint_linear
// should be passed, where envelope would be lazily calculated when needed the first time
geometry::partition
<
geometry::model::box<typename point_type<MultiPoint>::type>
geometry::model::box<point_type_t<MultiPoint>>
>::apply(multipoint, segment_range(linear), visitor,
expand_box_point<Strategy>(strategy),
overlaps_box_point<Strategy>(strategy),
Expand Down Expand Up @@ -282,9 +282,9 @@ class multi_point_single_geometry
SingleGeometry const& single_geometry,
Strategy const& strategy)
{
typedef typename point_type<MultiPoint>::type point1_type;
typedef typename point_type<SingleGeometry>::type point2_type;
typedef model::box<point2_type> box2_type;
using point1_type = point_type_t<MultiPoint>;
using point2_type = point_type_t<SingleGeometry>;
using box2_type = model::box<point2_type>;

box2_type box2;
geometry::envelope(single_geometry, box2, strategy);
Expand Down Expand Up @@ -424,11 +424,11 @@ class multi_point_multi_geometry
template <typename Strategy>
static inline bool apply(MultiPoint const& multi_point, MultiGeometry const& multi_geometry, Strategy const& strategy)
{
typedef typename point_type<MultiPoint>::type point1_type;
typedef typename point_type<MultiGeometry>::type point2_type;
typedef model::box<point1_type> box1_type;
typedef model::box<point2_type> box2_type;
typedef std::pair<box2_type, std::size_t> box_pair_type;
using point1_type = point_type_t<MultiPoint>;
using point2_type = point_type_t<MultiGeometry>;
using box1_type = model::box<point1_type>;
using box2_type = model::box<point2_type>;
using box_pair_type = std::pair<box2_type, std::size_t>;

std::size_t count2 = boost::size(multi_geometry);
std::vector<box_pair_type> boxes(count2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@ struct disjoint_segment_box_sphere_or_spheroid
DisjointPointBoxStrategy const& disjoint_point_box_strategy,
DisjointBoxBoxStrategy const& disjoint_box_box_strategy)
{
typedef typename point_type<Segment>::type segment_point;
segment_point vertex;
point_type_t<Segment> vertex;
return apply(segment, box, vertex,
azimuth_strategy,
normalize_strategy,
Expand All @@ -112,13 +111,13 @@ struct disjoint_segment_box_sphere_or_spheroid
{
assert_dimension_equal<Segment, Box>();

typedef typename point_type<Segment>::type segment_point_type;
using segment_point_type = point_type_t<Segment>;

segment_point_type p0, p1;
geometry::detail::assign_point_from_index<0>(segment, p0);
geometry::detail::assign_point_from_index<1>(segment, p1);

//vertex not computed here
// Vertex is not computed here
disjoint_info disjoint_return_value = disjoint_info::disjoint_no_vertex;

// Simplest cases first
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,20 +81,16 @@ template
class geometry_to_segment_or_box
{
private:
typedef typename point_type<SegmentOrBox>::type segment_or_box_point;

typedef distance::strategy_t<Geometry, SegmentOrBox, Strategies> strategy_type;

typedef detail::closest_feature::point_to_point_range
using segment_or_box_point = point_type_t<SegmentOrBox>;
using strategy_type = distance::strategy_t<Geometry, SegmentOrBox, Strategies>;
using point_to_point_range = detail::closest_feature::point_to_point_range
<
typename point_type<Geometry>::type,
point_type_t<Geometry>,
std::vector<segment_or_box_point>,
segment_or_box_point_range_closure<SegmentOrBox>::value
> point_to_point_range;

typedef detail::closest_feature::geometry_to_range geometry_to_range;

typedef distance::creturn_t<Geometry, SegmentOrBox, Strategies> comparable_return_type;
>;
using geometry_to_range = detail::closest_feature::geometry_to_range;
using comparable_return_type = distance::creturn_t<Geometry, SegmentOrBox, Strategies>;

// assign the new minimum value for an iterator of the point range
// of a segment or a box
Expand Down Expand Up @@ -320,7 +316,7 @@ class geometry_to_segment_or_box
:
dispatch::distance
<
typename point_type<MultiPoint>::type,
point_type_t<MultiPoint>,
SegmentOrBox,
Strategies
>::apply(*it_min, segment_or_box, strategies);
Expand Down
Loading

0 comments on commit 19f22c2

Please sign in to comment.