Карта сайта Kansoftware
НОВОСТИУСЛУГИРЕШЕНИЯКОНТАКТЫ
Разработка программного обеспечения

strategy::buffer::join_round

Boost , Chapter 1. Geometry , Strategies

Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

PrevUpHomeNext

Пусть буфер создает закругленные углы.

Description

Эта стратегия может быть использована в качестве стратегии для буферного алгоритма. Он создает закругленные углы вокруг каждой выпуклой вершины. Он может применяться для (много) линейных струн и (много) полигонов. Эта стратегия применима только для картезианских систем координат.

Synopsis

class strategy::buffer::join_round
{
  // ...
};

Constructor(s)

Функция

Описание

Параметры

<
join_round(std::size_tpoints_per_circle=90)
>

Построение стратегии.

std::size_t:points_per_circle: points that will used for a full circle

Header

#include <boost/geometry/strategies/cartesian/buffer_join_round.hpp>

Example

Показывает, как стратегия 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;
}

Output

buffer_join_round

See also

PrevUpHomeNext

Статья strategy::buffer::join_round раздела Chapter 1. Geometry Strategies может быть полезна для разработчиков на c++ и boost.




Материалы статей собраны из открытых источников, владелец сайта не претендует на авторство. Там где авторство установить не удалось, материал подаётся без имени автора. В случае если Вы считаете, что Ваши права нарушены, пожалуйста, свяжитесь с владельцем сайта.



:: Главная :: Strategies ::


реклама


©KANSoftWare (разработка программного обеспечения, создание программ, создание интерактивных сайтов), 2007
Top.Mail.Ru

Время компиляции файла: 2024-08-30 11:47:00
2025-05-20 02:18:04/0.0036399364471436/0