Skip to main content

NeighborValidator

Trait NeighborValidator 

Source
pub trait NeighborValidator<F: Float = f32> {
    type PointData;

    // Required method
    fn validate(
        &self,
        source_index: usize,
        source_data: &Self::PointData,
        candidate: &NeighborCandidate<F>,
        candidate_data: &Self::PointData,
    ) -> Option<(NeighborDirection, F)>;
}
Expand description

Extension point for pattern-specific neighbor validation.

Implementors decide whether a spatially close point is a valid grid neighbor, and if so, assign it a direction and quality score.

Required Associated Types§

Source

type PointData

Per-point data beyond position (e.g., orientation, cluster label). Use () if no extra data is needed.

Required Methods§

Source

fn validate( &self, source_index: usize, source_data: &Self::PointData, candidate: &NeighborCandidate<F>, candidate_data: &Self::PointData, ) -> Option<(NeighborDirection, F)>

Validate whether candidate is a valid grid neighbor of the point at source_index. Returns (direction, score) where lower score is better, or None to reject.

Implementors§