Добавление полилинии.
#include <gis/gis_surfacemanager.h>gis_userobject_t gis_render_sm_userdata_add_polyline( gis_render_sm_context_t sm_ctx, double_point_t *array, int length, uint32_t color, int pen_width, int line_type );
surfacemanager
Функция создаёт пользовательский объект типа полилиния.
vector<double_point_t> degree_vector;gis_userobject_t line;uint32_t color = 0xFFAFAFAF;int pen_width = 10;int line_type = 1;degree_vector.push_back( { 25, 20 } );degree_vector.push_back( { 25, 25 } );gis_render_sm_context_t sm_ctx;gis_data_engine_context_t ctx;gis_core_connection_t connection;gis_core_link_init( &connection );gis_core_link_connect( &connection, 777 );uint32_t width = 100;uint32_t height = 100;gis_data_engine_alloc( width, height, GIS_DATA_ENGINE_MODE_SM, GIS_DATA_ENGINE_BPP_32, &connection, &ctx );gis_render_sm_alloc( &sm_ctx, ctx, 1000, 0.5, 0 );line = gis_render_sm_userdata_add_polyline( sm_ctx, degree_vector.data(),degree_vector.size(), color, pen_width, line_type );int retval = 0;if ( !line )retval += 1;gis_render_sm_free( &sm_ctx );gis_data_engine_free( &ctx );gis_core_databuffer_detach();gis_core_link_destroy( &connection, true );return retval;
ПК ЦКИ для ЗОСРВ «Нейтрино»
gis_render_sm_context_t, gis_render_sm_calculate_distance()
Предыдущий раздел: Описание API картографического фреймворка