Skip to main content

IsLine

Trait IsLine 

Source
pub trait IsLine<'a, T: IsPoint>: GeometricPrimitive + HasVertices<'a, Vertex = T> {
    // Required methods
    fn head_id(&self) -> PointId;
    fn set_head_id(&mut self, point_id: PointId) -> Result<(), ErrorsJSL>;
    fn tail_id(&self) -> PointId;
    fn set_tail_id(&mut self, point_id: PointId) -> Result<(), ErrorsJSL>;
    fn length(&self) -> GeometryMeasure;
    fn midpoint(&self) -> Option<T>;
    fn direction(&self) -> impl IsUnitVector;

    // Provided methods
    fn head(&self) -> Option<T> { ... }
    fn tail(&self) -> Option<T> { ... }
}
Expand description

A line primitive that resolves its endpoints through point identifiers.

Required Methods§

Source

fn head_id(&self) -> PointId

Returns the point-table id of the first endpoint.

Source

fn set_head_id(&mut self, point_id: PointId) -> Result<(), ErrorsJSL>

Sets the point-table id of the first endpoint.

Source

fn tail_id(&self) -> PointId

Returns the point-table id of the second endpoint.

Source

fn set_tail_id(&mut self, point_id: PointId) -> Result<(), ErrorsJSL>

Sets the point-table id of the second endpoint.

Source

fn length(&self) -> GeometryMeasure

Returns the Euclidean length of the line.

Source

fn midpoint(&self) -> Option<T>

Returns the midpoint of the line, if it can be derived from the point table.

Source

fn direction(&self) -> impl IsUnitVector

Returns the line direction as a unit vector.

Provided Methods§

Source

fn head(&self) -> Option<T>

Resolves and returns the first endpoint from the point table.

Source

fn tail(&self) -> Option<T>

Resolves and returns the second endpoint from the point table.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§