/
usr
/
include
/
boost
/
geometry
/
strategies
/
cartesian
/
/usr/include/boost/geometry/strategies/cartesian
mkdir
upload
Name
Size
Mode
Actions
area.hpp
3958
0644
edit
dl
rm
area_surveyor.hpp
1221
0644
edit
dl
rm
azimuth.hpp
1212
0644
edit
dl
rm
box_in_box.hpp
10614
0644
edit
dl
rm
buffer_end_flat.hpp
3757
0644
edit
dl
rm
buffer_end_round.hpp
6084
0644
edit
dl
rm
buffer_join_miter.hpp
4540
0644
edit
dl
rm
buffer_join_round.hpp
6206
0644
edit
dl
rm
buffer_join_round_by_divide.hpp
4659
0644
edit
dl
rm
buffer_point_circle.hpp
4016
0644
edit
dl
rm
buffer_point_square.hpp
3654
0644
edit
dl
rm
buffer_side_straight.hpp
4587
0644
edit
dl
rm
centroid_average.hpp
2880
0644
edit
dl
rm
centroid_bashein_detmer.hpp
8541
0644
edit
dl
rm
centroid_weighted_length.hpp
4855
0644
edit
dl
rm
densify.hpp
3902
0644
edit
dl
rm
disjoint_box_box.hpp
2985
0644
edit
dl
rm
disjoint_segment_box.hpp
8965
0644
edit
dl
rm
distance_projected_point.hpp
9635
0644
edit
dl
rm
distance_projected_point_ax.hpp
9835
0644
edit
dl
rm
distance_pythagoras.hpp
7674
0644
edit
dl
rm
distance_pythagoras_box_box.hpp
8993
0644
edit
dl
rm
distance_pythagoras_point_box.hpp
9230
0644
edit
dl
rm
distance_segment_box.hpp
6893
0644
edit
dl
rm
envelope.hpp
4299
0644
edit
dl
rm
envelope_box.hpp
3479
0644
edit
dl
rm
envelope_multipoint.hpp
1442
0644
edit
dl
rm
envelope_point.hpp
2963
0644
edit
dl
rm
envelope_segment.hpp
2458
0644
edit
dl
rm
expand_box.hpp
1868
0644
edit
dl
rm
expand_point.hpp
3340
0644
edit
dl
rm
expand_segment.hpp
1900
0644
edit
dl
rm
index.hpp
6976
0644
edit
dl
rm
intersection.hpp
30855
0644
edit
dl
rm
io.hpp
1873
0644
edit
dl
rm
line_interpolate.hpp
3772
0644
edit
dl
rm
point_in_box.hpp
8761
0644
edit
dl
rm
point_in_point.hpp
3543
0644
edit
dl
rm
point_in_poly_crossings_multiply.hpp
3593
0644
edit
dl
rm
point_in_poly_franklin.hpp
3464
0644
edit
dl
rm
point_in_poly_winding.hpp
9889
0644
edit
dl
rm
point_order.hpp
1024
0644
edit
dl
rm
side_by_triangle.hpp
9669
0644
edit
dl
rm
turn_in_ring_winding.hpp
7463
0644
edit
dl
rm
Edit:
/usr/include/boost/geometry/strategies/cartesian/line_interpolate.hpp
(3772B)
// Boost.Geometry // Copyright (c) 2018, Oracle and/or its affiliates. // Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle // Licensed under the Boost Software License version 1.0. // http://www.boost.org/users/license.html #ifndef BOOST_GEOMETRY_STRATEGIES_CARTESIAN_LINE_INTERPOLATE_HPP #define BOOST_GEOMETRY_STRATEGIES_CARTESIAN_LINE_INTERPOLATE_HPP #include <boost/geometry/core/assert.hpp> #include <boost/geometry/core/coordinate_dimension.hpp> #include <boost/geometry/core/coordinate_type.hpp> #include <boost/geometry/strategies/line_interpolate.hpp> #include <boost/geometry/strategies/cartesian/distance_pythagoras.hpp> #include <boost/geometry/util/select_calculation_type.hpp> namespace boost { namespace geometry { namespace strategy { namespace line_interpolate { /*! \brief Interpolate point on a cartesian segment. \ingroup strategies \tparam CalculationType \tparam_calculation \tparam DistanceStrategy The underlying point-point distance strategy \qbk{ [heading See also] \* [link geometry.reference.algorithms.line_interpolate.line_interpolate_4_with_strategy line_interpolate (with strategy)] } */ template < typename CalculationType = void, typename DistanceStrategy = distance::pythagoras<CalculationType> > class cartesian { public: // point-point strategy getters struct distance_pp_strategy { typedef DistanceStrategy type; }; inline typename distance_pp_strategy::type get_distance_pp_strategy() const { typedef typename distance_pp_strategy::type distance_type; return distance_type(); } template <typename Point, typename Fraction, typename Distance> inline void apply(Point const& p0, Point const& p1, Fraction const& fraction, Point & p, Distance const&) const { typedef typename select_calculation_type_alt < CalculationType, Point >::type calc_t; typedef model::point < calc_t, geometry::dimension<Point>::value, cs::cartesian > calc_point_t; calc_point_t cp0, cp1; geometry::detail::conversion::convert_point_to_point(p0, cp0); geometry::detail::conversion::convert_point_to_point(p1, cp1); //segment convex combination: p0*fraction + p1*(1-fraction) Fraction const one_minus_fraction = 1-fraction; for_each_coordinate(cp1, detail::value_operation < Fraction, std::multiplies >(fraction)); for_each_coordinate(cp0, detail::value_operation < Fraction, std::multiplies >(one_minus_fraction)); for_each_coordinate(cp1, detail::point_operation < calc_point_t, std::plus >(cp0)); assert_dimension_equal<calc_point_t, Point>(); geometry::detail::conversion::convert_point_to_point(cp1, p); } }; #ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS namespace services { template <> struct default_strategy<cartesian_tag> { typedef strategy::line_interpolate::cartesian<> type; }; } // namespace services #endif // DOXYGEN_NO_STRATEGY_SPECIALIZATIONS }} // namespace strategy::line_interpolate }} // namespace boost::geometry #endif // BOOST_GEOMETRY_STRATEGIES_CARTESIAN_LINE_INTERPOLATE_HPP
Save
cmd:
run