PageRenderTime 5ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/Src/Dependencies/Boost/libs/geometry/doc/src/examples/core/set_point.cpp

http://hadesmem.googlecode.com/
C++ | 42 lines | 12 code | 13 blank | 17 comment | 0 complexity | ee7f5e7cbf130ce6729b47c7e09107aa MD5 | raw file
 1// Boost.Geometry (aka GGL, Generic Geometry Library)
 2// QuickBook Example
 3
 4// Copyright (c) 2011 Barend Gehrels, Amsterdam, the Netherlands.
 5
 6// Use, modification and distribution is subject to the Boost Software License,
 7// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
 8// http://www.boost.org/LICENSE_1_0.txt)
 9
10//[set_point
11//` Set the coordinate of a point
12
13#include <iostream>
14
15#include <boost/geometry.hpp>
16#include <boost/geometry/geometries/point_xy.hpp>
17
18namespace bg = boost::geometry;
19
20int main()
21{
22    bg::model::d2::point_xy<double> point;
23
24    bg::set<0>(point, 1);
25    bg::set<1>(point, 2);
26
27    std::cout << "Location: " << bg::dsv(point) << std::endl;
28
29    return 0;
30}
31
32//]
33
34
35//[set_point_output
36/*`
37Output:
38[pre
39Location: (1, 2)
40]
41*/
42//]