![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
strategy::buffer::join_roundBoost , Chapter 1. Geometry , Strategies
|
Функция |
Описание |
Параметры |
---|---|---|
<join_round(std::size_tpoints_per_circle=90)> | Построение стратегии. | std::size_t:points_per_circle: points that will used for a full circle |
#include <boost/geometry/strategies/cartesian/buffer_join_round.hpp>
Показывает, как стратегия join_round может использоваться в качестве стратегии для создания закругленных углов.
#include <boost/geometry.hpp> #include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/geometries/geometries.hpp> int main() { typedef boost::geometry::model::d2::point_xy<double> point; typedef boost::geometry::model::polygon<point> polygon; // Declare the join_round strategy with 72 points for a full circle boost::geometry::strategy::buffer::join_round join_strategy(72); // Declare other strategies boost::geometry::strategy::buffer::distance_symmetric<double> distance_strategy(1.0); boost::geometry::strategy::buffer::end_flat end_strategy; boost::geometry::strategy::buffer::side_straight side_strategy; boost::geometry::strategy::buffer::point_circle point_strategy; // Declare/fill a multi polygon boost::geometry::model::multi_polygon<polygon> mp; boost::geometry::read_wkt("MULTIPOLYGON(((5 5,7 8,9 5,5 5)),((8 7,8 10,11 10,11 7,8 7)))", mp); // Create the buffered geometry with rounded corners boost::geometry::model::multi_polygon<polygon> result; boost::geometry::buffer(mp, result, distance_strategy, side_strategy, join_strategy, end_strategy, point_strategy); return 0; }
Статья strategy::buffer::join_round раздела Chapter 1. Geometry Strategies может быть полезна для разработчиков на c++ и boost.
Материалы статей собраны из открытых источников, владелец сайта не претендует на авторство. Там где авторство установить не удалось, материал подаётся без имени автора. В случае если Вы считаете, что Ваши права нарушены, пожалуйста, свяжитесь с владельцем сайта.
:: Главная :: Strategies ::
реклама |