-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUtils.h
37 lines (27 loc) · 820 Bytes
/
Utils.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//---------------------------------------------------------------------------
#ifndef UtilsH
#define UtilsH
#include <System.Classes.hpp>
#include <algorithm>
#include <iterator>
#include <memory>
namespace AreaPrj {
extern std::unique_ptr<TStringList> RetrieveFontList();
// Helper per convertire un Ring di boost.geomerty in un vector di punti GDI
template<typename R, typename T>
R ToGDIPolygon( T const & Ring )
{
R GDIPoly;
GDIPoly.reserve( Ring.size() );
std::transform(
std::begin( Ring ), end( Ring ),
std::back_inserter( GDIPoly ),
[]( auto & Pt ) {
return typename R::value_type( Pt.x(), Pt.y() );
}
);
return GDIPoly;
}
} // End of namespace AreaPrj
//---------------------------------------------------------------------------
#endif