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§
Sourcefn set_head_id(&mut self, point_id: PointId) -> Result<(), ErrorsJSL>
fn set_head_id(&mut self, point_id: PointId) -> Result<(), ErrorsJSL>
Sets the point-table id of the first endpoint.
Sourcefn set_tail_id(&mut self, point_id: PointId) -> Result<(), ErrorsJSL>
fn set_tail_id(&mut self, point_id: PointId) -> Result<(), ErrorsJSL>
Sets the point-table id of the second endpoint.
Sourcefn length(&self) -> GeometryMeasure
fn length(&self) -> GeometryMeasure
Returns the Euclidean length of the line.
Sourcefn midpoint(&self) -> Option<T>
fn midpoint(&self) -> Option<T>
Returns the midpoint of the line, if it can be derived from the point table.
Sourcefn direction(&self) -> impl IsUnitVector
fn direction(&self) -> impl IsUnitVector
Returns the line direction as a unit vector.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".