PointGenerator3

Trait PointGenerator3 

Source
pub trait PointGenerator3 {
    // Required method
    fn for_each_point<Callback>(
        &self,
        bounding_box: &BoundingBox3D,
        spacing: f64,
        callback: &mut Callback,
    )
       where Callback: FnMut(&Vector3D) -> bool;

    // Provided method
    fn generate(
        &self,
        bounding_box: &BoundingBox3D,
        spacing: f64,
        points: &mut Vec<Vector3D>,
    ) { ... }
}
Expand description

§Abstract base class for 3-D point generator.

This class provides interface for 3-D point generator. For given bounding box and point spacing, the inherited classes generates points with specified pattern.

Required Methods§

Source

fn for_each_point<Callback>( &self, bounding_box: &BoundingBox3D, spacing: f64, callback: &mut Callback, )
where Callback: FnMut(&Vector3D) -> bool,

Iterates every point within the bounding box with specified point pattern and invokes the callback function.

This function iterates every point within the bounding box and invokes the callback function. The position of the point is specified by the actual implementation. The suggested spacing between the points are given by \p spacing. The input parameter of the callback function is the position of the point and the return value tells whether the iteration should stop or not.

Provided Methods§

Source

fn generate( &self, bounding_box: &BoundingBox3D, spacing: f64, points: &mut Vec<Vector3D>, )

Generates points to output array \p points inside given \p boundingBox with target point \p spacing.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§