Go to the documentation of this file.00001 #include "msm_draw_shape_to_eps.h"
00002
00003
00004
00005
00006
00007 #include <vcl_iosfwd.h>
00008 #include <vcl_cassert.h>
00009
00010
00011
00012
00013 void msm_draw_shape_to_eps(mbl_eps_writer& writer,
00014 const msm_points& points,
00015 const msm_curves& curves)
00016 {
00017 vcl_vector<vgl_point_2d<double> > pts;
00018 points.get_points(pts);
00019
00020 for (unsigned c=0;c<curves.size();++c)
00021 {
00022 const vcl_vector<unsigned>& index = curves[c].index();
00023 vcl_vector<vgl_point_2d<double> > p(index.size());
00024 for (unsigned i=0;i<index.size();++i)
00025 {
00026 if (index[i]>=pts.size())
00027 vcl_cerr<<"Illegal index: "<<index[i]<<vcl_endl;
00028 assert(index[i]<pts.size());
00029 p[i]=pts[index[i]];
00030 }
00031 writer.draw_polygon(p,!curves[c].open(),false);
00032 }
00033 }
00034
00035
00036
00037
00038 void msm_draw_points_to_eps(mbl_eps_writer& writer,
00039 const msm_points& points,
00040 double radius, bool filled)
00041 {
00042 for (unsigned i=0;i<points.size();++i)
00043 {
00044 if (filled)
00045 writer.draw_disk(points[i],radius);
00046 else
00047 writer.draw_circle(points[i],radius);
00048 }
00049 }
00050