diff --git a/src/app.rs b/src/app.rs index 860b6ab..b99bee9 100644 --- a/src/app.rs +++ b/src/app.rs @@ -1,3 +1,5 @@ +//! Main application state and options. + use std::collections::{BTreeMap, HashMap}; use std::path::absolute; use std::vec::Vec; @@ -47,6 +49,7 @@ pub enum ActiveTool { Measure, } +/// Contains all configurable options of the application. #[derive(Debug, Default, Serialize, Deserialize)] pub struct AppOptions { pub version: String, @@ -85,6 +88,7 @@ pub struct SessionData { pub grid_lenses: HashMap, } +/// Main application state, implements the `eframe::App` trait. #[derive(Default)] pub struct AppState { pub options: AppOptions, diff --git a/src/lib.rs b/src/lib.rs index 3b88d2a..b60ee02 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,3 +1,10 @@ +//! Library target of the `maps` app. +//! +//! The public components listed here can be reused in external applications. +//! +//! Note that public API is not the main focus of this app crate. +//! But feel free to use parts of it as you see fit. + pub mod app; mod app_impl; mod draw_order; diff --git a/src/map_pose.rs b/src/map_pose.rs index 33e1131..31a526d 100644 --- a/src/map_pose.rs +++ b/src/map_pose.rs @@ -1,3 +1,5 @@ +//! Pose utilities for map alignment. + use std::path::PathBuf; use eframe::emath; diff --git a/src/meta.rs b/src/meta.rs index 6c06762..9aae1d1 100644 --- a/src/meta.rs +++ b/src/meta.rs @@ -1,3 +1,5 @@ +//! Map metadata. + use eframe::emath; use log::debug; use serde::{Deserialize, Serialize}; diff --git a/src/value_colormap.rs b/src/value_colormap.rs index 1be3ba3..9f4632d 100644 --- a/src/value_colormap.rs +++ b/src/value_colormap.rs @@ -1,9 +1,11 @@ +//! Color map implementations. + use image::Rgba; use lazy_static::lazy_static; use serde::{Deserialize, Serialize}; use strum_macros::Display; -/// Color mapping from cell values to RGBA colors. +/// Trait for color mapping from cell values to RGBA colors. pub trait ValueColorMap { fn map(&self, value: u8) -> Rgba; } @@ -27,7 +29,8 @@ pub enum ColorMap { } impl ColorMap { - /// Gives access to the corresponding color map implementation. + /// Gives access to the corresponding color map trait implementations + /// that are implemented in this module. pub fn get(&self) -> &dyn ValueColorMap { match self { ColorMap::RvizMap => &*RVIZ_MAP, diff --git a/src/value_interpretation.rs b/src/value_interpretation.rs index 05243a4..4574592 100644 --- a/src/value_interpretation.rs +++ b/src/value_interpretation.rs @@ -1,6 +1,6 @@ //! Value thresholding options. //! Mostly follows ROS: wiki.ros.org/map_server#Value_Interpretation -//! +//! //! Since the nav map_server slightly deviates from that documentation, //! it's also possible to mimic its behavior.