Go to the documentation of this file.00001 #ifndef mbl_clamped_plate_spline_2d_h_
00002 #define mbl_clamped_plate_spline_2d_h_
00003
00004
00005
00006
00007
00008
00009 #include <vgl/vgl_point_2d.h>
00010 #include <vcl_vector.h>
00011 #include <vnl/vnl_vector.h>
00012 #include <vnl/vnl_matrix.h>
00013 #include <vsl/vsl_binary_io.h>
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 class mbl_clamped_plate_spline_2d {
00034 private:
00035 vnl_vector<double> Wx_,Wy_;
00036
00037 vcl_vector<vgl_point_2d<double> > src_pts_;
00038
00039
00040 vnl_matrix<double> L_inv_;
00041
00042
00043 bool all_in_unit_circle(const vcl_vector<vgl_point_2d<double> >& pts);
00044
00045
00046 void set_params(const vnl_vector<double>& Wx,
00047 const vnl_vector<double>& Wy);
00048
00049 void set_up_rhs(vnl_vector<double>& Bx,
00050 vnl_vector<double>& By,
00051 const vcl_vector<vgl_point_2d<double> >& src_pts,
00052 const vcl_vector<vgl_point_2d<double> >& dest_pts);
00053
00054 public:
00055
00056
00057 mbl_clamped_plate_spline_2d();
00058
00059
00060 virtual ~mbl_clamped_plate_spline_2d();
00061
00062
00063 void build(const vcl_vector<vgl_point_2d<double> >& source_pts,
00064 const vcl_vector<vgl_point_2d<double> >& dest_pts);
00065
00066
00067
00068
00069 void set_source_pts(const vcl_vector<vgl_point_2d<double> >& source_pts);
00070
00071
00072 void build(const vcl_vector<vgl_point_2d<double> >& dest_pts);
00073
00074
00075 vgl_point_2d<double> operator()(double x, double y) const;
00076
00077
00078 vgl_point_2d<double> operator()(const vgl_point_2d<double>& p) const
00079 { return operator()(p.x(),p.y()); }
00080
00081
00082 short version_no() const;
00083
00084
00085 void print_summary(vcl_ostream& os) const;
00086
00087
00088 void b_write(vsl_b_ostream& bfs) const;
00089
00090
00091 void b_read(vsl_b_istream& bfs);
00092
00093
00094 bool operator==(const mbl_clamped_plate_spline_2d& tps) const;
00095 };
00096
00097
00098 void vsl_b_write(vsl_b_ostream& bfs, const mbl_clamped_plate_spline_2d& b);
00099
00100
00101 void vsl_b_read(vsl_b_istream& bfs, mbl_clamped_plate_spline_2d& b);
00102
00103
00104 vcl_ostream& operator<<(vcl_ostream& os,const mbl_clamped_plate_spline_2d& b);
00105
00106 #endif
00107
00108