Templates -- Meow  1.1.2
不能,也不應該先編譯成obj-file的templates
FeaturePointsMatch.h
Go to the documentation of this file.
1 #ifndef gra_FeaturePointsMatch_H__
2 #define gra_FeaturePointsMatch_H__
3 
4 #include "FeaturePoint.h"
5 
6 #include "../oo/ObjBase.h"
7 
8 #include <utility>
9 #include <cstdlib>
10 
11 namespace meow {
12 
14  std::pair<size_t, size_t> from;
15  std::pair<size_t, size_t> to;
16 
18  }
19  FeaturePointIndexPair(size_t ff, size_t fs,
20  size_t tf, size_t ts) {
21  from.first = ff;
22  from.second = fs;
23  to.first = tf;
24  to.second = ts;
25  }
26  bool operator==(FeaturePointIndexPair const& p) const {
27  return (from == p.from && to == p.to);
28  }
29 };
30 
31 typedef std::vector<FeaturePointIndexPair> FeaturePointIndexPairs;
32 
33 template<class Scalar, class Description>
34 class FeaturePointsMatch: public ObjBase {
35 protected:
37  }
38 public:
39  typedef std::vector<FeaturePoint<Scalar, Description> > FeaturePoints;
40  typedef std::vector<FeaturePoints > FeaturePointss;
41 
42  virtual ~FeaturePointsMatch() {
43  }
44 
45  virtual FeaturePointIndexPairs match(size_t dimension,
46  FeaturePoints const& from,
47  FeaturePoints const& to) const = 0;
48 
49  virtual FeaturePointIndexPairs match(size_t dimension,
50  FeaturePoints const& from,
51  FeaturePointss const& to) const = 0;
52 
53  virtual FeaturePointIndexPairs match(size_t dimension,
54  FeaturePointss const& from,
55  FeaturePointss const& to) const = 0;
56 
57  virtual FeaturePointIndexPairs match(size_t dimension,
58  FeaturePointss const& fpss) const = 0;
59 };
60 
61 }
62 
63 #endif // gra_FeaturePointsMatch_H__