SLAM
mapprocess.h
1 #ifndef MAPPROCESS_H
2 #define MAPPROCESS_H
3 
4 #include <QObject>
5 #include <QPoint>
6 #include <armadillo>
7 
8 #include "mapclass.h"
9 
10 using namespace arma;
11 
17 struct square_t {
18  square_t() {
19  points = zeros<mat>(100, 100);
20  xCoordStart = 0;
21  realRelativeStart.setX(0);
22  realRelativeStart.setY(0);
23  realRelativeEnd.setX(0);
24  realRelativeEnd.setY(0);
25  assigned = false;
26  }
27 
28  bool assigned;
29  int xCoordStart;
30  mat points;
31 
32  //squere_t *left;
33  //squere_t *right;
34  square_t *top;
35  square_t *bottom;
36 
37  QPoint realRelativeStart;
38  QPoint realRelativeEnd;
39 };
40 
46 struct sector_t {
47  sector_t() {
48  assigned = false;
49  yCoordStart = 0;
50  squaresCount = 0;
51  actualIndex = -1;
52  }
53 
54  bool assigned;
55  int squaresCount;
56  int actualIndex;
57  square_t **squares; // squeres on x axe
58  int yCoordStart; // size is always 100 -> yCoordStart + 100 = end
59 };
60 
70 class MapProcess : QObject
71 {
72  Q_OBJECT
73 
74 public:
75  MapProcess(QObject *parent = 0);
76  ~MapProcess();
77  void addSubmap(submap_t *submap);
78 
79 private:
80  int sectorsCount;
81  int actualIndex;
82  sector_t **sectors;
83 
84  int getSectorIndex(int y, int actual);
85  int insertSectorBefore(int before, int yStart);
86  void expandSectorArray();
87  void insertSquare(sector_t *sector, int x, int y);
88  void expandSquareArray(sector_t *sector);
89 };
90 
91 #endif // MAPPROCESS_H
Struktura představující osu x v každém sektoru.
Definition: mapprocess.h:17
Struktura představující sektory na ose y.
Definition: mapprocess.h:46
Struktura k ukládáná submap.
Definition: submapstruct.h:12
Třída pro práci s mapou. Zatím testovací a nepoužita.
Definition: mapprocess.h:70