forked from torriem/QtAgOpenGPS
-
Notifications
You must be signed in to change notification settings - Fork 2
/
testlists.cpp
39 lines (31 loc) · 1.12 KB
/
testlists.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifdef TEST_LISTS
#include "vec2.h"
#include <QVector>
#include <QSharedPointer>
#include <iostream>
typedef QVector<Vec2> TriangleList;
int main(int argc, char *arv[]) {
QSharedPointer<TriangleList> triangleList;
QVector<QSharedPointer<TriangleList>> patchList;
std::cout << "Starting object creation" << std::endl;
triangleList = QSharedPointer<TriangleList>(new TriangleList);
patchList.append(triangleList);
triangleList->append(Vec2(0,0));
triangleList->append(Vec2(1,0));
triangleList->append(Vec2(2,0));
triangleList->append(Vec2(3,0));
triangleList = QSharedPointer<TriangleList>(new TriangleList);
patchList.append(triangleList);
triangleList->append(Vec2(0,1));
triangleList->append(Vec2(1,1));
triangleList->append(Vec2(2,1));
triangleList->append(Vec2(3,1));
for (int l=0;l<patchList.size();l++) {
std::cout << patchList[l]->size() << std::endl;
for (int t=0; t < patchList[l]->size(); t++) {
std::cout << (*patchList[l])[t].easting << " ";
std::cout << (*patchList[l])[t].northing << std::endl;
}
}
}
#endif