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
40
//! Compact public event vocabulary for zone monitors.
use crate::{TrackId, ZoneId};
/// The direction in which a track crossed a directed line segment.
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum Direction {
/// The track moved from the line's algebraic left half-plane to its right.
LeftToRight,
/// The track moved from the line's algebraic right half-plane to its left.
RightToLeft,
}
/// A membership or crossing transition observed for a track and zone.
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum VisionEvent {
/// A track entered a polygon zone.
Entered {
/// The track that entered.
track_id: TrackId,
/// The polygon zone that was entered.
zone_id: ZoneId,
},
/// A track exited a polygon zone.
Exited {
/// The track that exited.
track_id: TrackId,
/// The polygon zone that was exited.
zone_id: ZoneId,
},
/// A track crossed a finite line zone.
Crossed {
/// The track that crossed.
track_id: TrackId,
/// The line zone that was crossed.
zone_id: ZoneId,
/// The crossing direction relative to the directed line segment.
direction: Direction,
},
}