pub fn show(&mut self, ui: &mut egui::Ui, query: &mut Query<'_, '_, &mut Concrete>) {
        egui::menu::menu(ui, "Memory", |ui| {
            for (idx, slot) in self.0.iter_mut().enumerate() {
                match slot {
                    // Shows an empty slot.
                    None => {
                        egui::CollapsingHeader::new("Empty")
                            .id_source(idx)
                            .show(ui, |ui| {
                                if ui.button("Save").clicked() {
                                    if let Some(p) = query.iter_mut().next() {
                                        *slot = Some(p.clone());
                                    }
                                }
                            });
                    }

                    // Shows a slot with a polytope on it.
                    Some(poly) => {
                        let clear = egui::CollapsingHeader::new(slot_label(idx))
                            .id_source(idx)
                            .show(ui, |ui| {
                                // Clones a polytope from memory.
                                if ui.button("Load").clicked() {
                                    *query.iter_mut().next().unwrap() = poly.clone();
                                }

                                // Swaps the current polytope with the one on memory.
                                if ui.button("Swap").clicked() {
                                    std::mem::swap(query.iter_mut().next().unwrap().as_mut(), poly);
                                }

                                // Clones a polytope into memory.
                                if ui.button("Save").clicked() {
                                    *poly = query.iter_mut().next().unwrap().clone();
                                }

                                // Clears a polytope from memory.
                                ui.button("Clear").clicked()
                            });

                        if clear.body_returned == Some(true) {
                            *slot = None;
                        }
                    }
                }
            }
        });
    }
/// Shows the memory menu in a specified Ui.
Shows the memory menu in a specified Ui.
Shows the memory menu in a specified Ui .
pub fn show(&mut self, ui: &mut egui::Ui, query: &mut Query<'_, '_, &mut Concrete>) {
        egui::menu::menu(ui, "Memory", |ui| {
            for (idx, slot) in self.0.iter_mut().enumerate() {
                match slot {
                    // Shows an empty slot.
                    None => {
                        egui::CollapsingHeader::new("Empty")
                            .id_source(idx)
                            .show(ui, |ui| {
                                if ui.button("Save").clicked() {
                                    if let Some(p) = query.iter_mut().next() {
                                        *slot = Some(p.clone());
                                    }
                                }
                            });
                    }
                    // Shows a slot with a polytope on it.
                    Some(poly) => {
                        let clear = egui::CollapsingHeader::new(slot_label(idx))
                            .id_source(idx)
                            .show(ui, |ui| {
                                // Clones a polytope from memory.
                                if ui.button("Load").clicked() {
                                    *query.iter_mut().next().unwrap() = poly.clone();
                                }
                                // Swaps the current polytope with the one on memory.
                                if ui.button("Swap").clicked() {
                                    std::mem::swap(query.iter_mut().next().unwrap().as_mut(), poly);
                                }
                                // Clones a polytope into memory.
                                if ui.button("Save").clicked() {
                                    *poly = query.iter_mut().next().unwrap().clone();
                                }
                                // Clears a polytope from memory.
                                ui.button("Clear").clicked()
                            });
                        if clear.body_returned == Some(true) {
                            *slot = None;
                        }
                    }
                }
            }
        });
    }
pub fn show ( & mut self , ui : & mut egui :: Ui , query : & mut Query < ' _ , ' _ , & mut Concrete > ) { egui :: menu :: menu ( ui , " " , | ui | { for ( idx , slot ) in self . 0 . iter_mut ( ) . enumerate ( ) { match slot { // Shows an empty slot. None => { egui :: CollapsingHeader :: new ( " " ) . id_source ( idx ) . show ( ui , | ui | { if ui . button ( " " ) . clicked ( ) { if let Some ( p ) = query . iter_mut ( ) . next ( ) { * slot = Some ( p . clone ( ) ) ; } } } ) ; } // Shows a slot with a polytope on it. Some ( poly ) => { let clear = egui :: CollapsingHeader :: new ( slot_label ( idx ) ) . id_source ( idx ) . show ( ui , | ui | { // Clones a polytope from memory. if ui . button ( " " ) . clicked ( ) { * query . iter_mut ( ) . next ( ) . unwrap ( ) = poly . clone ( ) ; } // Swaps the current polytope with the one on memory. if ui . button ( " " ) . clicked ( ) { std :: mem :: swap ( query . iter_mut ( ) . next ( ) . unwrap ( ) . as_mut ( ) , poly ) ; } // Clones a polytope into memory. if ui . button ( " " ) . clicked ( ) { * poly = query . iter_mut ( ) . next ( ) . unwrap ( ) . clone ( ) ; } // Clears a polytope from memory. ui . button ( " " ) . clicked ( ) } ) ; if clear . body_returned == Some ( true ) { * slot = None ; } } } } } ) ; }
Shows the memory menu in a specified Ui.
Shows the memory menu in a specified Ui .
&mut self
ui
&mut egui::Ui
query
&mut Query<'_, '_, &mut Concrete>
&mut self
ui
&mut egui::Ui
query
&mut Query<'_, '_, &mut Concrete>