00001 // bcal_calibrate_plane.cpp: implementation of the bcal_calibrate_plane class. 00002 // 00003 ////////////////////////////////////////////////////////////////////// 00004 00005 #include "bcal_calibrate_plane.h" 00006 #include <vcl_fstream.h> 00007 #include <vcl_iostream.h> 00008 00009 ////////////////////////////////////////////////////////////////////// 00010 // Construction/Destruction 00011 ////////////////////////////////////////////////////////////////////// 00012 00013 bcal_calibrate_plane::bcal_calibrate_plane() 00014 { 00015 } 00016 00017 bcal_calibrate_plane::~bcal_calibrate_plane() 00018 { 00019 } 00020 00021 00022 int bcal_calibrate_plane::readData(const char *fname) 00023 { 00024 vcl_ifstream in(fname); 00025 00026 if (!in){ 00027 vcl_cerr<<"cannot open the file: "<<fname << vcl_endl; 00028 return 1; 00029 } 00030 if (pts_.size() != 0){ 00031 pts_.clear(); 00032 } 00033 00034 while (!in.eof()){ 00035 double u, v; 00036 in>>u>>v; 00037 vgl_homg_point_2d<double> pt(u, v); 00038 pts_.push_back(pt); 00039 } 00040 00041 return 0; 00042 } 00043 00044 int bcal_calibrate_plane::read_data(vcl_vector<vgl_homg_point_2d<double> > &pts) 00045 { 00046 pts_ = pts; 00047 00048 return 0; 00049 }
1.5.1