-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bare-bones Tds ctor, make data optional
- Basic (not yet correct) new function for triangulation data structures. - Data fields for vertices and cells are now optional It's expected that data will be inserted later, after calculations done on the triangulation.
- Loading branch information
1 parent
0b137ab
commit 218cfc3
Showing
5 changed files
with
107 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,39 @@ | ||
pub fn tds() -> i32 { | ||
use super::{cell::Cell, point::Point, vertex::Vertex}; | ||
use std::collections::HashMap; | ||
use uuid::Uuid; | ||
|
||
#[derive(Debug)] | ||
pub struct Tds<T, U, V> { | ||
pub vertices: HashMap<Uuid, Vertex<U, V>>, | ||
pub cells: HashMap<Uuid, Cell<T, U, V>>, | ||
} | ||
|
||
impl<T, U, V> Tds<T, U, V> { | ||
pub fn new(_points: Vec<Point<U>>) -> Self { | ||
let vertices = HashMap::new(); | ||
let cells = HashMap::new(); | ||
Self { vertices, cells } | ||
} | ||
} | ||
|
||
pub fn hello() -> i32 { | ||
println!("Hello, world!"); | ||
1 | ||
} | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
|
||
use crate::delaunay_core::triangulation_data_structure; | ||
|
||
use super::*; | ||
|
||
#[test] | ||
fn make_tds() { | ||
let tds: triangulation_data_structure::Tds<usize, f64, usize> = | ||
Tds::new(vec![Point::new(1.0, 2.0, 3.0)]); | ||
println!("{:?}", tds); | ||
assert_eq!(tds.vertices.len(), 0); | ||
assert_eq!(tds.cells.len(), 0); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters