pub fn update_changed_polytopes(
    mut meshes: ResMut<'_, Assets<Mesh>>,
    mut polies: Query<'_, '_, (&mut Concrete, &Handle<Mesh>, &Children), Changed<Concrete>>,
    wfs: Query<'_, '_, &Handle<Mesh>, Without<Concrete>>,
    mut windows: ResMut<'_, Windows>,
    mut section_state: ResMut<'_, SectionState>,
    mut element_types: ResMut<'_, ElementTypesRes>,
    name: Res<'_, PolyName>,

    orthogonal: Res<'_, ProjectionType>,
) {
    for (mut poly, mesh_handle, children) in polies.iter_mut() {
        poly.untangle_faces();
        if cfg!(debug_assertions) {
            poly.assert_valid();
        }

        if !element_types.main_updating {
            element_types.main = false;
        } else {
            element_types.main_updating = false;
        }

        *meshes.get_mut(mesh_handle).unwrap() = poly.mesh(*orthogonal);

        // Updates all wireframes.
        for child in children.iter() {
            if let Ok(wf_handle) = wfs.get_component::<Handle<Mesh>>(*child) {
                *meshes.get_mut(wf_handle).unwrap() = poly.wireframe(*orthogonal);
            }
        }

        // We reset the cross-section view if we didn't use it to change the polytope.
        if !section_state.is_changed() {
            section_state.close();
        }

        windows
            .get_primary_mut()
            .unwrap()
            .set_title(format!("{} - miratope v{}", name.0, env!("CARGO_PKG_VERSION")));

    }
}
/// Updates polytopes after an operation.
Updates polytopes after an operation.
Updates polytopes after an operation .
pub fn update_changed_polytopes(
    mut meshes: ResMut<'_, Assets<Mesh>>,
    mut polies: Query<'_, '_, (&mut Concrete, &Handle<Mesh>, &Children), Changed<Concrete>>,
    wfs: Query<'_, '_, &Handle<Mesh>, Without<Concrete>>,
    mut windows: ResMut<'_, Windows>,
    mut section_state: ResMut<'_, SectionState>,
    mut element_types: ResMut<'_, ElementTypesRes>,
    name: Res<'_, PolyName>,
    orthogonal: Res<'_, ProjectionType>,
) {
    for (mut poly, mesh_handle, children) in polies.iter_mut() {
        poly.untangle_faces();
        if cfg!(debug_assertions) {
            poly.assert_valid();
        }
        if !element_types.main_updating {
            element_types.main = false;
        } else {
            element_types.main_updating = false;
        }
        *meshes.get_mut(mesh_handle).unwrap() = poly.mesh(*orthogonal);
        // Updates all wireframes.
        for child in children.iter() {
            if let Ok(wf_handle) = wfs.get_component::<Handle<Mesh>>(*child) {
                *meshes.get_mut(wf_handle).unwrap() = poly.wireframe(*orthogonal);
            }
        }
        // We reset the cross-section view if we didn't use it to change the polytope.
        if !section_state.is_changed() {
            section_state.close();
        }
        windows
            .get_primary_mut()
            .unwrap()
            .set_title(format!("{} - miratope v{}", name.0, env!("CARGO_PKG_VERSION")));
    }
}
pub fn update_changed_polytopes ( mut meshes : ResMut < ' _ , Assets < Mesh > > , mut polies : Query < ' _ , ' _ , ( & mut Concrete , & Handle < Mesh > , & Children ) , Changed < Concrete > > , wfs : Query < ' _ , ' _ , & Handle < Mesh > , Without < Concrete > > , mut windows : ResMut < ' _ , Windows > , mut section_state : ResMut < ' _ , SectionState > , mut element_types : ResMut < ' _ , ElementTypesRes > , name : Res < ' _ , PolyName > , orthogonal : Res < ' _ , ProjectionType > , ) { for ( mut poly , mesh_handle , children ) in polies . iter_mut ( ) { poly . untangle_faces ( ) ; if cfg ! ( debug_assertions ) { poly . assert_valid ( ) ; } if ! element_types . main_updating { element_types . main = false ; } else { element_types . main_updating = false ; } * meshes . get_mut ( mesh_handle ) . unwrap ( ) = poly . mesh ( * orthogonal ) ; // Updates all wireframes. for child in children . iter ( ) { if let Ok ( wf_handle ) = wfs . get_component :: < Handle < Mesh > > ( * child ) { * meshes . get_mut ( wf_handle ) . unwrap ( ) = poly . wireframe ( * orthogonal ) ; } } // We reset the cross-section view if we didn't use it to change the polytope. if ! section_state . is_changed ( ) { section_state . close ( ) ; } windows . get_primary_mut ( ) . unwrap ( ) . set_title ( format ! ( " " name 0 env ( " " ) ) ) ; } }
Updates polytopes after an operation.
Updates polytopes after an operation .
meshes
ResMut<'_, Assets<Mesh>>
polies
Query<'_, '_, (&mut Concrete, &Handle<Mesh>, &Children), Changed<Concrete>>
wfs
Query<'_, '_, &Handle<Mesh>, Without<Concrete>>
windows
ResMut<'_, Windows>
section_state
ResMut<'_, SectionState>
element_types
ResMut<'_, ElementTypesRes>
name
Res<'_, PolyName>
orthogonal
Res<'_, ProjectionType>