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