Go to the documentation of this file.00001
00002 #ifndef fhs_arc_h_
00003 #define fhs_arc_h_
00004
00005
00006
00007
00008
00009 #include <vsl/vsl_binary_io.h>
00010 #include <vcl_vector.h>
00011 #include <vcl_iosfwd.h>
00012
00013
00014
00015
00016 class fhs_arc
00017 {
00018 private:
00019 unsigned i_;
00020 unsigned j_;
00021 double dx_;
00022 double dy_;
00023 double var_x_;
00024 double var_y_;
00025 public:
00026
00027 fhs_arc()
00028 : i_(0),j_(0),dx_(0),dy_(0),var_x_(1.0),var_y_(1.0) {}
00029
00030
00031 fhs_arc(int i, int j, double dx, double dy, double var_x, double var_y)
00032 : i_(i),j_(j),dx_(dx),dy_(dy),var_x_(var_x),var_y_(var_y) {}
00033
00034
00035 fhs_arc flipped() const
00036 { return fhs_arc(j(),i(),-dx(),-dy(),var_x(),var_y()); }
00037
00038
00039 unsigned i() const { return i_; }
00040
00041
00042 unsigned j() const { return j_; }
00043
00044
00045 double dx() const { return dx_; }
00046
00047
00048 double dy() const { return dy_; }
00049
00050
00051 double var_x() const { return var_x_; }
00052
00053
00054 double var_y() const { return var_y_; }
00055
00056
00057 void b_write(vsl_b_ostream& bfs) const;
00058
00059
00060 void b_read(vsl_b_istream& bfs);
00061 };
00062
00063
00064
00065
00066
00067 bool fhs_order_tree_from_root(const vcl_vector<fhs_arc>& arc0,
00068 vcl_vector<fhs_arc>& new_arc,
00069 vcl_vector<vcl_vector<unsigned> >& children,
00070 unsigned new_root);
00071
00072
00073
00074 vcl_ostream& operator<<(vcl_ostream& os, const fhs_arc& c);
00075
00076
00077 vcl_ostream& operator<<(vcl_ostream& os, const vcl_vector<fhs_arc>& arc);
00078
00079
00080 inline void vsl_b_write(vsl_b_ostream& bfs, const fhs_arc& t)
00081 {
00082 t.b_write(bfs);
00083 }
00084
00085
00086 inline void vsl_b_read(vsl_b_istream& bfs, fhs_arc& t)
00087 {
00088 t.b_read(bfs);
00089 }
00090
00091
00092 void vsl_print_summary(vcl_ostream& os, const fhs_arc& t);
00093
00094 #endif // fhs_arc_h_