pub mod orientation {
pub use crate::cluster::{
angular_dist_pi, cluster_axes, wrap_pi, AxisAssignment, AxisClusterCenters,
AxisClusterDebug, AxisFeature, AxisObservation, ClusterParams,
};
pub use crate::orient::{
synthesize_oriented2, synthesize_oriented2_from_oriented1, synthesize_oriented3,
};
}
pub mod geometry {
pub use crate::geometry::*;
}
pub mod lattice {
use crate::GridEntry;
pub use crate::lattice::{
predict_grid_position, GridTransform, Hex, Lattice, PredictedPosition, Square,
D4_TRANSFORMS, D6_TRANSFORMS, HEX_AXIAL_OFFSETS, SQUARE_CARDINAL_OFFSETS,
};
pub fn normalize_square_entries(entries: Vec<GridEntry>) -> Vec<GridEntry> {
crate::result::LabelledGrid::normalized_square_entries(entries)
}
}
pub mod square {
use crate::{Coord, GridError, OrientedFeature};
use super::TopologicalParams;
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[non_exhaustive]
pub struct ComponentEntry {
coord: Coord,
source_index: usize,
}
impl ComponentEntry {
pub fn coord(&self) -> Coord {
self.coord
}
pub fn source_index(&self) -> usize {
self.source_index
}
}
#[derive(Clone, Debug, PartialEq, Eq)]
#[non_exhaustive]
pub struct Component {
entries: Vec<ComponentEntry>,
}
impl Component {
pub fn entries(&self) -> &[ComponentEntry] {
&self.entries
}
}
pub fn assemble_oriented2_components(
features: &[OrientedFeature<2>],
params: &TopologicalParams,
) -> Result<Vec<Component>, GridError> {
crate::topological::assemble_square_oriented2_components(features, params).map(
|components| {
components
.into_iter()
.map(|component| {
let mut entries: Vec<ComponentEntry> = component
.into_iter()
.map(|(coord, feature_index)| ComponentEntry {
coord,
source_index: features[feature_index].point.source_index,
})
.collect();
entries.sort_by_key(|entry| {
(entry.coord.v, entry.coord.u, entry.source_index)
});
Component { entries }
})
.collect()
},
)
}
}
pub mod component {
pub use crate::shared::merge::{merge_components_local, LocalMergeParams};
}
pub mod attachment {
pub use crate::shared::grow::{
Admit, FillEdgeCtx, GrowResult, LabelledNeighbour, SquareAttachPolicy,
};
}
pub mod fill {
pub use crate::shared::fill::{fill_grid_holes, FillParams, FillStats};
}
pub mod validation {
pub use crate::shared::validate::{
validate, LabelledEntry, ValidationParams, ValidationResult,
};
pub mod wrong_label_filters {
pub use crate::shared::validate::wrong_label_filters::{drop_set, DropSet};
}
}
pub use crate::detect::DetectionTuning;
pub use crate::shared::recovery_schedule::{RecoveryParams, RecoverySchedule};
pub use crate::topological::TopologicalParams;