Updated examples (assign -> assign_values)

[SVN r71220]
This commit is contained in:
Barend Gehrels 2011-04-12 22:11:32 +00:00
parent 91f240188c
commit de18eb8891
8 changed files with 28 additions and 28 deletions

View File

@ -53,13 +53,13 @@ int main()
// All these types are handled the same way. We show here
// assigning them and calculating distances.
assign(pt1, 1, 1);
assign(pt2, 2, 2);
assign(pt3, 3, 3);
assign(pt4, 4, 4);
assign(pt5, 5, 5);
assign(pt6, 6, 6);
assign(pt7, 7, 7);
assign_values(pt1, 1, 1);
assign_values(pt2, 2, 2);
assign_values(pt3, 3, 3);
assign_values(pt4, 4, 4);
assign_values(pt5, 5, 5);
assign_values(pt6, 6, 6);
assign_values(pt7, 7, 7);
double d1 = distance(pt1, pt2);
@ -76,13 +76,13 @@ int main()
// 1: default, empty constructor, causing no initialization at all
model::d2::point_xy<double> p1;
// 2: as shown above, assign
// 2: as shown above, assign_values
model::d2::point_xy<double> p2;
assign(p2, 1, 1);
assign_values(p2, 1, 1);
// 3: using "set" function
// set uses the concepts behind, such that it can be applied for
// every point-type (like assign)
// every point-type (like assign_values)
model::d2::point_xy<double> p3;
set<0>(p3, 1);
set<1>(p3, 1);
@ -118,8 +118,8 @@ int main()
// There are 3-dimensional points too
model::point<double, 3, cs::cartesian> d3a, d3b;
assign(d3a, 1, 2, 3);
assign(d3b, 4, 5, 6);
assign_values(d3a, 1, 2, 3);
assign_values(d3b, 4, 5, 6);
d3 = distance(d3a, d3b);

View File

@ -79,9 +79,9 @@ int main(void)
// points can be created using "make" and added to a linestring using the std:: "push_back"
ls.push_back(make<point_2d>(1.1, 1.1));
// points can also be assigned using "assign" and added to a linestring using "append"
// points can also be assigned using "assign_values" and added to a linestring using "append"
point_2d lp;
assign(lp, 2.5, 2.1);
assign_values(lp, 2.5, 2.1);
append(ls, lp);
// Lines can be streamed using DSV (delimiter separated values)

View File

@ -41,7 +41,7 @@ int main(void)
{3.4, 2.0}, {4.1, 3.0}, {5.3, 2.6}, {5.4, 1.2}, {4.9, 0.8}, {2.9, 0.7},
{2.0, 1.3} // closing point is opening point
};
assign(poly, coor);
assign_points(poly, coor);
}
// Polygons should be closed, and directed clockwise. If you're not sure if that is the case,
@ -77,7 +77,7 @@ int main(void)
model::ring<point_2d>& inner = poly.inners().back();
const double coor[][2] = { {4.0, 2.0}, {4.2, 1.4}, {4.8, 1.9}, {4.4, 2.2}, {4.0, 2.0} };
assign(inner, coor);
assign_points(inner, coor);
}
correct(poly);

View File

@ -45,7 +45,7 @@ int main(void)
const double c[][2] = {
{160, 330}, {60, 260}, {20, 150}, {60, 40}, {190, 20}, {270, 130}, {260, 250}, {160, 330}
};
bg::assign(a, c);
bg::assign_points(a, c);
}
bg::correct(a);
std::cout << "A: " << bg::dsv(a) << std::endl;
@ -55,7 +55,7 @@ int main(void)
const double c[][2] = {
{300, 330}, {190, 270}, {150, 170}, {150, 110}, {250, 30}, {380, 50}, {380, 250}, {300, 330}
};
bg::assign(b, c);
bg::assign_points(b, c);
}
bg::correct(b);
std::cout << "B: " << bg::dsv(b) << std::endl;

View File

@ -35,13 +35,13 @@ int main(void)
bg::model::linestring<point_2d> ls;
{
const double c[][2] = { {0, 1}, {2, 5}, {5, 3} };
bg::assign(ls, c);
bg::assign_points(ls, c);
}
bg::model::polygon<point_2d> p;
{
const double c[][2] = { {3, 0}, {0, 3}, {4, 5}, {3, 0} };
bg::assign(p, c);
bg::assign_points(p, c);
}
bg::correct(p);

View File

@ -35,7 +35,7 @@ int main()
const double coor[][2] = { {0, 0}, {0, 7}, {2, 2}, {2, 0}, {0, 0} };
// note that for this syntax you have to include the two
// include files above (c_array_cartesian.hpp, std_as_linestring.hpp)
assign(poly, coor);
assign_points(poly, coor);
//read_wkt("POLYGON((0 0,0 7,4 2,2 0,0 0))", poly);
transform(poly, poly2, translate);

View File

@ -108,8 +108,8 @@ int main()
my_array_point a1 = {{0}};
my_array_point a2 = {{0}};
boost::geometry::assign(a1, 1, 2, 3);
boost::geometry::assign(a2, 3, 2, 1);
boost::geometry::assign_values(a1, 1, 2, 3);
boost::geometry::assign_values(a2, 3, 2, 1);
std::cout << "color distance "
<< boost::geometry::dsv(a1) << " to "
@ -132,8 +132,8 @@ int main()
my_class_rw crw1;
my_class_rw crw2;
boost::geometry::assign(crw1, 1, 2);
boost::geometry::assign(crw2, 3, 4);
boost::geometry::assign_values(crw1, 1, 2);
boost::geometry::assign_values(crw2, 3, 4);
std::cout << "class r/w distance "
<< boost::geometry::dsv(crw1) << " to "
<< boost::geometry::dsv(crw2) << " is "
@ -141,8 +141,8 @@ int main()
my_class_gs cgs1;
my_class_gs cgs2;
boost::geometry::assign(cgs1, 1, 2);
boost::geometry::assign(cgs2, 3, 4);
boost::geometry::assign_values(cgs1, 1, 2);
boost::geometry::assign_values(cgs2, 3, 4);
std::cout << "class g/s distance "
<< boost::geometry::dsv(crw1) << " to "
<< boost::geometry::dsv(crw2) << " is "

View File

@ -73,7 +73,7 @@ void convert(SHPObject* psShape, T& polygon)
for (int v = 0; v < psShape->nVertices; v++)
{
typename point_type<T>::type point;
assign(point, x[v], y[v]);
assign_values(point, x[v], y[v]);
append(polygon, point);
}
}