pub fn visualize(factor_graph: &FactorGraph) {
    let mut window = Window::new("gs-rs");
    let visual_factor_graph = add_factor_graph_to_window(&mut window, &factor_graph);
    let init_point = match factor_graph.node_indices.len() {
        0 => Point3::new(0.0, 0.0, 0.0),
        _ => get_var_point(factor_graph.get_var(factor_graph.node_indices[0])),
    };
    let mut cam = ArcBall::new(Point3::new(0.0, 0.0, 50.0), init_point);
    while window.render_with_camera(&mut cam) {
        visual_factor_graph
            .lines
            .iter()
            .for_each(|line| window.draw_line(&line[0], &line[1], &line[2]));
    }
}
// TODO: Does not work multiple times in a single execution of the program.
/// Displays the visualization of the given factor graph in a new window.
Does not work multiple times in a single execution of the program.
Displays the visualization of the given factor graph in a new window.
Does not work multiple times in a single execution of the program . Displays the visualization of the given factor graph in a new window .
pub fn visualize(factor_graph: &FactorGraph) {
    let mut window = Window::new("gs-rs");
    let visual_factor_graph = add_factor_graph_to_window(&mut window, &factor_graph);
    let init_point = match factor_graph.node_indices.len() {
        0 => Point3::new(0.0, 0.0, 0.0),
        _ => get_var_point(factor_graph.get_var(factor_graph.node_indices[0])),
    };
    let mut cam = ArcBall::new(Point3::new(0.0, 0.0, 50.0), init_point);
    while window.render_with_camera(&mut cam) {
        visual_factor_graph
            .lines
            .iter()
            .for_each(|line| window.draw_line(&line[0], &line[1], &line[2]));
    }
}
pub fn visualize ( factor_graph : & FactorGraph ) { let mut window = Window :: new ( " " ) ; let visual_factor_graph = add_factor_graph_to_window ( & mut window , & factor_graph ) ; let init_point = match factor_graph . node_indices . len ( ) { 0 => Point3 :: new ( 0.0 , 0.0 , 0.0 ) , _ => get_var_point ( factor_graph . get_var ( factor_graph . node_indices [ 0 ] ) ) , } ; let mut cam = ArcBall :: new ( Point3 :: new ( 0.0 , 0.0 , 50.0 ) , init_point ) ; while window . render_with_camera ( & mut cam ) { visual_factor_graph . lines . iter ( ) . for_each ( | line | window . draw_line ( & line [ 0 ] , & line [ 1 ] , & line [ 2 ] ) ) ; } }
TODO: Does not work multiple times in a single execution of the program.
TODO : Does not work multiple times in a single execution of the program .
factor_graph
&FactorGraph