use geometry::{Attribute, Geometry};
use graph::Mesh;
use graph::storage::OpaqueKey;
mod edge;
mod face;
mod vertex;
pub use self::edge::{EdgeKeyTopology, EdgeView, OrphanEdgeView};
pub use self::face::{FaceKeyTopology, FaceView, OrphanFaceView};
pub use self::vertex::{OrphanVertexView, VertexView};
pub type EdgeRef<'a, G> = EdgeView<&'a Mesh<G>, G>;
pub type EdgeMut<'a, G> = EdgeView<&'a mut Mesh<G>, G>;
pub type OrphanEdgeMut<'a, G> = OrphanEdgeView<'a, G>;
pub type FaceRef<'a, G> = FaceView<&'a Mesh<G>, G>;
pub type FaceMut<'a, G> = FaceView<&'a mut Mesh<G>, G>;
pub type OrphanFaceMut<'a, G> = OrphanFaceView<'a, G>;
pub type VertexRef<'a, G> = VertexView<&'a Mesh<G>, G>;
pub type VertexMut<'a, G> = VertexView<&'a mut Mesh<G>, G>;
pub type OrphanVertexMut<'a, G> = OrphanVertexView<'a, G>;
pub trait Topological {
type Key: OpaqueKey;
type Attribute: Attribute;
}
pub trait View<M, G>
where
M: AsRef<Mesh<G>>,
G: Geometry,
{
type Topology: Topological;
fn from_mesh(mesh: M, key: <Self::Topology as Topological>::Key) -> Self;
}
pub trait OrphanView<'a, G>
where
G: Geometry,
{
type Topology: Topological;
fn from_topology(
topology: &'a mut Self::Topology,
key: <Self::Topology as Topological>::Key,
) -> Self;
}