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

strategy::buffer::distance_symmetric

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

Пусть буферный алгоритм создает буферы с одинаковыми расстояниями.

Synopsis

template<typename NumericType>
class strategy::buffer::distance_symmetric
{
  // ...
};

Template parameter(s)

Параметр

Описание

Constructor(s)

Функция

Описание

Параметры

distance_symmetric(NumericType const & distance)

distance_symmetric(NumericType const & distance)

[ORIG_END] -->
Номер Type const &: distance: Расстояние (или радиус) буфера

Header

#include <boost/geometry/strategies/agnostic/buffer_distance_symmetric.hpp>

Example

Показывает, как дистанционная стратегия может быть использована для создания симметричных буферов

#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::linestring<point> linestring;
    typedef boost::geometry::model::polygon<point> polygon;
    // Declare the symmetric distance strategy
    boost::geometry::strategy::buffer::distance_symmetric<double> distance_strategy(0.5);
    // Declare other strategies
    boost::geometry::strategy::buffer::side_straight side_strategy;
    boost::geometry::strategy::buffer::join_round join_strategy;
    boost::geometry::strategy::buffer::end_round end_strategy;
    boost::geometry::strategy::buffer::point_circle point_strategy;
    // Declare/fill a multi linestring
    boost::geometry::model::multi_linestring<linestring> ml;
    boost::geometry::read_wkt("MULTILINESTRING((3 5,5 10,7 5),(7 7,11 10,15 7,19 10))", ml);
    // Create the buffered geometry with left/right the same distance
    boost::geometry::model::multi_polygon<polygon> result;
    boost::geometry::buffer(ml, result,
                distance_strategy, side_strategy,
                join_strategy, end_strategy, point_strategy);
    return 0;
}

Output

buffer_distance_symmetric

See also

PrevUpHomeNext

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




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



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


реклама


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

Время компиляции файла: 2024-08-30 11:47:00
2025-05-20 00:16:32/0.0037169456481934/0