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§
Required Methods§
Sourcefn validate(
&self,
source_index: usize,
source_data: &Self::PointData,
candidate: &NeighborCandidate<F>,
candidate_data: &Self::PointData,
) -> Option<(NeighborDirection, F)>
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.