pub fn find_path(&self, from: ID, to: ID) -> Result<Vec<ID>> {
        if !self.level_exists(from) {
            return Err(QDFError::LevelDoesNotExists(from));
        }
        if !self.level_exists(to) {
            return Err(QDFError::LevelDoesNotExists(to));
        }
        if let Some((_, levels)) = astar(&self.graph, from, |f| f == to, |_| 0, |_| 0) {
            Ok(levels)
        } else {
            Ok(vec![])
        }
    }
/// Gets list of space level IDs that defines shortest path between two space levels,
/// or throws error if level does not exists. Levels must lay on the same zoom level!
///
/// # Arguments
/// * `from` - source level id.
/// * `to` - target level id.
///
/// # Examples
/// ```
/// use quantized_density_fields::LOD;
///
/// let lod = LOD::new(2, 1, 16);
/// let subs = lod.level(lod.root()).sublevels();
/// assert_eq!(lod.find_path(subs[1], subs[3]).unwrap(), vec![subs[1], subs[0], subs[3]]);
/// ```
Gets list of space level IDs that defines shortest path between two space levels,
or throws error if level does not exists. Levels must lay on the same zoom level!
Gets list of space level IDs that defines shortest path between two space levels or throws error if level does not exists . Levels must lay on the same zoom level!
pub fn find_path(&self, from: ID, to: ID) -> Result<Vec<ID>> {
        if !self.level_exists(from) {
            return Err(QDFError::LevelDoesNotExists(from));
        }
        if !self.level_exists(to) {
            return Err(QDFError::LevelDoesNotExists(to));
        }
        if let Some((_, levels)) = astar(&self.graph, from, |f| f == to, |_| 0, |_| 0) {
            Ok(levels)
        } else {
            Ok(vec![])
        }
    }
pub fn find_path ( & self , from : ID , to : ID ) -> Result < Vec < ID > > { if ! self . level_exists ( from ) { return Err ( QDFError :: LevelDoesNotExists ( from ) ) ; } if ! self . level_exists ( to ) { return Err ( QDFError :: LevelDoesNotExists ( to ) ) ; } if let Some ( ( _ , levels ) ) = astar ( & self . graph , from , | f | f == to , | _ | 0 , | _ | 0 ) { Ok ( levels ) } else { Ok ( vec ! [ ] ) } }
Gets list of space level IDs that defines shortest path between two space levels,
or throws error if level does not exists.
Gets list of space level IDs that defines shortest path between two space levels or throws error if level does not exists .
&self
from
ID
to
ID
&self
from
ID
to
ID
examples
```
use quantized_density_fields::LOD.


` ` ` use quantized_density_fields :: LOD .