00001 ////////////////////////////////////////////////////////////////////// 00002 00003 #include "bcal_euclidean_transformation.h" 00004 #include <vcl_iostream.h> 00005 #include <vcl_cassert.h> 00006 00007 bool bcal_euclidean_transformation::is_valid(void) const 00008 { 00009 return trans_.size()!=0; 00010 } 00011 00012 void bcal_euclidean_transformation::set_beat(vcl_vector<double> const& new_beat) 00013 { 00014 vcsl_spatial_transformation::set_beat(new_beat); 00015 00016 // allocate new space for data 00017 this->remove(); 00018 int nBeats = new_beat.size(); 00019 trans_.resize(nBeats); 00020 } 00021 00022 int bcal_euclidean_transformation::remove() 00023 { 00024 trans_.clear(); 00025 return 0; 00026 } 00027 00028 bool bcal_euclidean_transformation::is_invertible(double time) const 00029 { 00030 assert(valid_time(time)); 00031 return true; 00032 } 00033 00034 vnl_vector<double> bcal_euclidean_transformation::execute(const vnl_vector<double> &v, double /* tims */) const 00035 { 00036 // require not completed yet 00037 assert(is_valid()); 00038 assert(v.size()==3); 00039 assert(v[2] == 1); 00040 00041 return v; 00042 } 00043 00044 00045 vnl_vector<double> bcal_euclidean_transformation::inverse(const vnl_vector<double> &v, double /* time */) const 00046 { 00047 // not finished yet 00048 vcl_cerr<<"\n bcal_euclidean_transformation::inverse() ----- not finished yet\n"; 00049 return v; 00050 } 00051 00052 void bcal_euclidean_transformation::print(vcl_ostream& os) 00053 { 00054 for (unsigned int i=0; i<trans_.size(); i++){ 00055 os << "\n the "<<i+1<<"-th transformation is:\n"<< trans_[i]; 00056 } 00057 } 00058 00059 00060 vnl_double_4x4 bcal_euclidean_transformation::get_trans_matrix(int i) 00061 { 00062 return trans_[i].get_matrix(); 00063 }
1.5.1