LARS
LARS (Light Augmented Reality System) is an open-source framework for light-based interaction and real-time tracking in multi-robot experiments. Inspired by ARK, LARS extends the augmented reality paradigm to robotic collectives by projecting dynamic visual cues and environments onto the arena, enabling new experimental possibilities for collective robotics research, education, and outreach. LARS features integrated tracking, light projection, and modular experiment control with a user-friendly Qt GUI.
Loading...
Searching...
No Matches
voronoi_diagram.h
1#ifndef VORONOI_DIAGRAM_H
2#define VORONOI_DIAGRAM_H
3
4#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
5#include <CGAL/Delaunay_triangulation_2.h>
6#include <iterator>
7#include <geom/geom.h>
8#include <QList>
9#include <QDebug>
10#include "worldmodel.h"
11
12typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
13typedef K::Point_2 Point_2;
14typedef K::Iso_rectangle_2 Iso_rectangle_2;
15typedef K::Segment_2 Segment_2;
16typedef K::Ray_2 Ray_2;
17typedef K::Line_2 Line_2;
18typedef CGAL::Delaunay_triangulation_2<K> Delaunay_triangulation_2;
19
20//A class to recover Voronoi diagram from stream.
21//Rays, lines and segments are cropped to a rectangle
22//so that only segments are stored
23struct Cropped_voronoi_from_delaunay
24{
25 std::vector<Segment_2> m_cropped_vd;
26 Iso_rectangle_2 m_bbox;
27
28 Cropped_voronoi_from_delaunay(const Iso_rectangle_2& bbox):m_bbox(bbox){}
29
30 template <class RSL>
31 void crop_and_extract_segment(const RSL& rsl){
32 CGAL::Object obj = CGAL::intersection(rsl,m_bbox);
33 const Segment_2* s=CGAL::object_cast<Segment_2>(&obj);
34 if (s) m_cropped_vd.push_back(*s);
35 }
36
37 void operator<<(const Ray_2& ray) { crop_and_extract_segment(ray); }
38 void operator<<(const Line_2& line) { crop_and_extract_segment(line); }
39 void operator<<(const Segment_2& seg){ crop_and_extract_segment(seg); }
40};
41
42class Voronoi_Diagram
43{
44public:
45 Voronoi_Diagram();
46 QList<Vector2D> calculate(QList<Vector2D> in_points);
47 void setWorldModel(WorldModel *wm);
48
49private:
50 WorldModel *wm;
51 };
52
53#endif // VORONOI_DIAGRAM_H
Definition worldmodel.h:41
geometry library Header File