00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __MAPPING_HPP__
00022 #define __MAPPING_HPP__
00023
00024 #include <stdio.h>
00025 #include <vector>
00026 #include "Vector.hpp"
00027 #include "Pair.hpp"
00028
00032 enum WhichImage {LEFT = 1, RIGHT = 2};
00033
00037 class Mapping
00038 {
00039 private:
00043 std::vector<Pair> pairList;
00044
00048 int selected;
00049
00050 public:
00051
00055 static const int NONE = -1;
00056
00060 Mapping();
00061
00065 ~Mapping();
00066
00071 int getLength() const;
00072
00076 void add(const Pair& pair);
00077
00081 void removeSelected();
00082
00088 void select(const Vector& point, WhichImage which);
00089
00094 void save(FILE* out) const;
00095
00100 void load(FILE* in);
00101
00107 const Pair& getPair(int index) const;
00108
00113 int getSelectedIndex() const;
00114
00120 void moveSelected(const Vector& point, WhichImage which);
00121
00126 const Pair* getPairList() const;
00127
00134 const Vector& getPoint(int index, WhichImage which);
00135 };
00136
00137
00138 #endif // __MAPPING_HPP__