The R-tree appears to split the nodes properly, but a basic search fails . . .
[aesalon.git] / src / monitor / Aesalon.cpp
blobd653d908f9ff182736acf816f71becb759e5631f
1 /** Aesalon, a tool to visualize program behaviour in real time.
2 Copyright (C) 2009-2011, Aesalon development team.
4 Aesalon is distributed under the terms of the GNU GPLv3. See
5 the included file LICENSE for more information.
7 @file src/monitor/Aesalon.cpp
8 */
10 #include "monitor/Coordinator.h"
12 #include "storage/RTree.h"
14 #if 0
15 int main(int argc, char *argv[]) {
18 Monitor::Coordinator coordinator(argv);
19 coordinator.run();
20 return coordinator.returnValue();
22 #endif
25 int main(int argc, char *argv[]) {
26 typedef Storage::RTree<double, int, 1, 4, 2> RTree;
28 RTree rt;
30 RTree::Bound b;
31 b.setRange(RTree::Range(-2.0, 2.0), 0);
32 rt.insert(b, 0);
33 b.setRange(RTree::Range(-1.0, 1.0), 0);
34 rt.insert(b, 1);
35 b.setRange(RTree::Range(-1.5, 1.0), 0);
36 rt.insert(b, 2);
37 b.setRange(RTree::Range(3.5, 6.0), 0);
38 rt.insert(b, 3);
39 b.setRange(RTree::Range(-6.0, -3.5), 0);
40 rt.insert(b, 4);
42 class Processor : public RTree::SearchProcessor {
43 public:
44 virtual bool process(const RTree::Bound &bound, int value) {
45 Message(Debug, "Found value " << value);
46 return true;
50 Processor p;
52 RTree::Range searchRange[] = {
53 RTree::Range(-3.0, 3.0)
56 RTree::Bound sb(searchRange);
58 rt.search(searchRange, &p);
60 return 0;