#[repr(u32)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum MarkerType {
FilledCircle = 0,
EmptyCircle = 1,
Square = 2,
Star = 3,
Triangle = 4,
}
pub(crate) const MARKER_SIZE_PIXELS: u32 = 0;
pub(crate) const MARKER_SIZE_WORLD: u32 = 1;
#[repr(C)]
#[derive(Copy, Clone, Debug)]
pub struct Point {
pub position: [f64; 2],
pub size: f32,
pub size_mode: u32,
}
impl Point {
pub fn new(x: f64, y: f64, size: f32) -> Self {
Self {
position: [x, y],
size,
size_mode: MARKER_SIZE_PIXELS,
}
}
pub fn new_world(x: f64, y: f64, size: f64) -> Self {
Self {
position: [x, y],
size: size as f32,
size_mode: MARKER_SIZE_WORLD,
}
}
pub fn filled_circle(x: f64, y: f64, size: f32) -> Self {
Self::new(x, y, size)
}
pub fn empty_circle(x: f64, y: f64, size: f32) -> Self {
Self::new(x, y, size)
}
pub fn square(x: f64, y: f64, size: f32) -> Self {
Self::new(x, y, size)
}
pub fn star(x: f64, y: f64, size: f32) -> Self {
Self::new(x, y, size)
}
pub fn triangle(x: f64, y: f64, size: f32) -> Self {
Self::new(x, y, size)
}
pub fn filled_circle_world(x: f64, y: f64, size: f64) -> Self {
Self::new_world(x, y, size)
}
pub fn empty_circle_world(x: f64, y: f64, size: f64) -> Self {
Self::new_world(x, y, size)
}
pub fn square_world(x: f64, y: f64, size: f64) -> Self {
Self::new_world(x, y, size)
}
pub fn star_world(x: f64, y: f64, size: f64) -> Self {
Self::new_world(x, y, size)
}
pub fn triangle_world(x: f64, y: f64, size: f64) -> Self {
Self::new_world(x, y, size)
}
}