diff --git a/Cargo.toml b/Cargo.toml index 9dba7b4..3fc75b4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,6 +17,9 @@ version = "0.6.3" [dependencies.spade] version = "2.2.0" +[dependencies.fixedbitset] +version = "0.4.0" + [dependencies.sdl2] version = "0.35.2" default-features = false diff --git a/src/layout.rs b/src/layout.rs index d931262..3d62782 100644 --- a/src/layout.rs +++ b/src/layout.rs @@ -17,7 +17,7 @@ use crate::shape::Shape; pub type RTreeWrapper = GeomWithData; pub struct Layout { - pub rtree: RTree, + rtree: RTree, pub graph: StableDiGraph, } @@ -218,57 +218,6 @@ impl Layout { Bow::new(bend, &self.graph) } - /*fn triangulate(&mut self) { - let peer_edge_indices: Vec> = self - .graph - .edge_indices() - .filter(|index| *self.graph.edge_weight(*index).unwrap() == Label::Peer) - .collect(); - - for edge_index in peer_edge_indices { - self.graph.remove_edge(edge_index); - } - - struct TriangulationVertex { - pub index: NodeIndex, - x: f64, - y: f64, - } - - impl HasPosition for TriangulationVertex { - type Scalar = f64; - fn position(&self) -> Point2 { - Point2::new(self.x, self.y) - } - } - - let mut triangulation: DelaunayTriangulation<_> = DelaunayTriangulation::new(); - - for node_index in self - .graph - .node_indices() - .filter(|index| self.graph.node_weight(*index).unwrap().is_dot()) - { - let center = self - .primitive(Index::