pub struct Line3D { /* private fields */ }Expand description
Concrete 3D line implementation backed by point ids and a shared point table.
Implementations§
Source§impl Line3D
impl Line3D
Sourcepub fn new(
head_id: PointId,
tail_id: PointId,
vertex_table: SharedGeometryTable<PointId, CoordinateVector3D>,
) -> Self
pub fn new( head_id: PointId, tail_id: PointId, vertex_table: SharedGeometryTable<PointId, CoordinateVector3D>, ) -> Self
Creates a line from two point ids and a shared point table.
The ids are interpreted against vertex_table whenever the line resolves its endpoints,
length, midpoint, or direction.
Trait Implementations§
impl Eq for Line3D
impl GeometricPrimitive for Line3D
impl GeometricPrimitive3D for Line3D
Source§impl<'a> HasVertices<'a> for Line3D
impl<'a> HasVertices<'a> for Line3D
Source§type Vertex = CoordinateVector3D
type Vertex = CoordinateVector3D
Point primitive stored in the vertex table.
Source§type VertexTable = Rc<RefCell<HashGeometryTable<PointId, CoordinateVector3D>>>
type VertexTable = Rc<RefCell<HashGeometryTable<PointId, CoordinateVector3D>>>
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, CoordinateVector3D> for Line3D
impl<'a> IsLine<'a, CoordinateVector3D> for Line3D
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<CoordinateVector3D>
fn midpoint(&self) -> Option<CoordinateVector3D>
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 Line3D
impl !Send for Line3D
impl !Sync for Line3D
impl !UnwindSafe for Line3D
impl Freeze for Line3D
impl Unpin for Line3D
impl UnsafeUnpin for Line3D
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