Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009 #include "msm_reflect_shape.h"
00010 #include <vcl_cassert.h>
00011
00012
00013
00014 void msm_reflect_shape_along_x(const msm_points& points,
00015 const vcl_vector<unsigned>& sym_pts,
00016 msm_points& new_points,
00017 double ax)
00018 {
00019 unsigned n= points.size();
00020 assert(sym_pts.size()==n);
00021 new_points.set_size(n);
00022 for (unsigned i=0;i<n;++i)
00023 {
00024 vgl_point_2d<double> p=points[i];
00025 double x = ax - (p.x()-ax);
00026 assert(sym_pts[i]<n);
00027 new_points.set_point(sym_pts[i],x,p.y());
00028 }
00029 }
00030