use stash::Stash;

use crate::*;

pub struct HalfEdgeMesh <S> {
  pub vertices : Stash <Vertex <S>, u32>,
  pub edges    : Stash <Edge, u32>,
  pub faces    : Stash <Face, u32>
}

pub struct Vertex <S> {
  pub point : Point3 <S>,
  pub edge  : EdgeId
}

pub struct Edge {
  pub base : VertexId,
  pub twin : Option <EdgeId>,
  pub face : Option <FaceId>,
  pub next : Option <EdgeId>
}

pub struct Face {
  pub edge : EdgeId
}

#[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd)]
pub struct VertexId (pub u32);
#[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd)]
pub struct EdgeId (pub u32);
#[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd)]
pub struct FaceId (pub u32);

/// Print the sizes of some types
pub fn report_sizes() {
  use std::mem::size_of;
  println!("half edge mesh report sizes...");
  show!(size_of::<Vertex <f32>>());
  show!(size_of::<Vertex <f64>>());
  show!(size_of::<Face>());
  show!(size_of::<Edge>());
  println!("...half edge mesh report sizes");
}
