pub struct Line1D { /* private fields */ }Expand description
Concrete 1D line implementation backed by point ids and a shared point table.
Implementations§
Source§impl Line1D
impl Line1D
Sourcepub fn new(
head_id: PointId,
tail_id: PointId,
vertex_table: SharedGeometryTable<PointId, CoordinateVector1D>,
) -> Self
pub fn new( head_id: PointId, tail_id: PointId, vertex_table: SharedGeometryTable<PointId, CoordinateVector1D>, ) -> Self
Creates a line from two point ids and a shared point table.
Trait Implementations§
impl Eq for Line1D
impl GeometricPrimitive for Line1D
Source§impl<'a> HasVertices<'a> for Line1D
impl<'a> HasVertices<'a> for Line1D
Source§type Vertex = CoordinateVector1D
type Vertex = CoordinateVector1D
Point primitive stored in the vertex table.
Source§type VertexTable = Rc<RefCell<HashGeometryTable<PointId, CoordinateVector1D>>>
type VertexTable = Rc<RefCell<HashGeometryTable<PointId, CoordinateVector1D>>>
Borrowed point-table type.
Source§fn vertex_table(&self) -> &Self::VertexTable
fn vertex_table(&self) -> &Self::VertexTable
Returns an immutable reference to the vertex table.
Source§fn vertex_table_mut(&mut self) -> &mut Self::VertexTable
fn vertex_table_mut(&mut self) -> &mut Self::VertexTable
Returns a mutable reference to the vertex table.
Source§fn set_vertex_table(&mut self, table: &'a mut Self::VertexTable)
fn set_vertex_table(&mut self, table: &'a mut Self::VertexTable)
Rebinds the implementor to a different borrowed vertex table.
Source§fn vertex_table_size(&self) -> usize
fn vertex_table_size(&self) -> usize
Returns the number of entries in the vertex table.
Source§fn contains_vertex(&self, id: &PointId) -> bool
fn contains_vertex(&self, id: &PointId) -> bool
Returns
true if the vertex table contains id.Source§impl<'a> IsLine<'a, CoordinateVector1D> for Line1D
impl<'a> IsLine<'a, CoordinateVector1D> for Line1D
Source§fn 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.
Source§fn 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.
Source§fn length(&self) -> GeometryMeasure
fn length(&self) -> GeometryMeasure
Returns the Euclidean length of the line.
Source§fn midpoint(&self) -> Option<CoordinateVector1D>
fn midpoint(&self) -> Option<CoordinateVector1D>
Returns the midpoint of the line, if it can be derived from the point table.
Source§fn direction(&self) -> impl IsUnitVector
fn direction(&self) -> impl IsUnitVector
Returns the line direction as a unit vector.
Auto Trait Implementations§
impl !RefUnwindSafe for Line1D
impl !Send for Line1D
impl !Sync for Line1D
impl !UnwindSafe for Line1D
impl Freeze for Line1D
impl Unpin for Line1D
impl UnsafeUnpin for Line1D
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more