[−][src]Struct svgbob::Cell
0 1 2 3 4 B C D
0┌─┬─┬─┬─┐ A┌─┬─┬─┬─┐E
1├─┼─┼─┼─┤ │ │ │ │ │
2├─┼─┼─┼─┤ F├─G─H─I─┤J
3├─┼─┼─┼─┤ │ │ │ │ │
4├─┼─┼─┼─┤ K├─L─M─N─┤O
5├─┼─┼─┼─┤ │ │ │ │ │
6├─┼─┼─┼─┤ P├─Q─R─S─┤T
7├─┼─┼─┼─┤ │ │ │ │ │
8└─┴─┴─┴─┘ U└─┴─┴─┴─┘Y
``` V W X
A single element in the terminal that
can fit 1 character.
Describe the exact location of a point/subcell in a grid.
Fields
x: i32
y: i32
Methods
impl Cell
[src]
pub fn a(&self) -> Point
[src]
The point at sepcific cell grid of this cell
pub fn b(&self) -> Point
[src]
pub fn c(&self) -> Point
[src]
pub fn d(&self) -> Point
[src]
pub fn e(&self) -> Point
[src]
pub fn f(&self) -> Point
[src]
pub fn g(&self) -> Point
[src]
pub fn h(&self) -> Point
[src]
pub fn i(&self) -> Point
[src]
pub fn j(&self) -> Point
[src]
pub fn k(&self) -> Point
[src]
pub fn l(&self) -> Point
[src]
pub fn m(&self) -> Point
[src]
pub fn n(&self) -> Point
[src]
pub fn o(&self) -> Point
[src]
pub fn p(&self) -> Point
[src]
pub fn q(&self) -> Point
[src]
pub fn r(&self) -> Point
[src]
pub fn s(&self) -> Point
[src]
pub fn t(&self) -> Point
[src]
pub fn u(&self) -> Point
[src]
pub fn v(&self) -> Point
[src]
pub fn w(&self) -> Point
[src]
pub fn x(&self) -> Point
[src]
pub fn y(&self) -> Point
[src]
pub fn new(x: i32, y: i32) -> Self
[src]
pub fn is_adjacent(&self, other: &Self) -> bool
[src]
returns true if the other cell is at: top_left, top, top_right, left, right, bottom_left, bottom, bottom_right of self
pub fn snap_point(point: Point) -> (Self, Point)
[src]
Derive which cell this points falls into and snap the point closes to any intersection in the cell grid. FIXME: need to find a way to snap a group of point that lies in boundaries to snap together to a common cell.
pub fn snap_group(points: &[Point]) -> Self
[src]
pub fn top_left_most(&self) -> Point
[src]
The point at the top right of this cell
pub fn bottom_right_most(&self) -> Point
[src]
pub fn localize_point(&self, point: Point) -> Point
[src]
turn point into relative distance from the top-left of this cell by simply deducting the point p with this cell's top_left_most point
pub fn localize_cell(&self, cell: Cell) -> Cell
[src]
pub fn width() -> f32
[src]
pub fn height() -> f32
[src]
pub fn unit(l: i32) -> f32
[src]
pub fn is_intersected(&self, start: Point, end: Point) -> bool
[src]
test whether this cell is intersected with the line segment
with point start
and end
pub fn is_bounded(&self, bound1: Cell, bound2: Cell) -> bool
[src]
check if this cell is bounded by the lower bound and upper bound
pub fn snap(p: Point) -> Point
[src]
snap point to a closest intersection of this cellgrid
pub fn clip_line_snap(&self, start: Point, end: Point) -> Option<(Point, Point)>
[src]
pub fn clip_line_localize(
&self,
start: Point,
end: Point
) -> Option<(Point, Point)>
[src]
&self,
start: Point,
end: Point
) -> Option<(Point, Point)>
clip line then localize the points and snap to the nearest cell grid intersection
pub fn top_left(&self) -> Self
[src]
The cell at the top left of this cell
pub fn top(&self) -> Self
[src]
pub fn top_right(&self) -> Self
[src]
pub fn left(&self) -> Self
[src]
The cell at the left of this cell
pub fn right(&self) -> Self
[src]
pub fn bottom_left(&self) -> Self
[src]
pub fn bottom(&self) -> Self
[src]
pub fn bottom_right(&self) -> Self
[src]
Trait Implementations
impl Clone for Cell
[src]
impl Copy for Cell
[src]
impl Debug for Cell
[src]
impl Display for Cell
[src]
impl Eq for Cell
[src]
impl Hash for Cell
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for Cell
[src]
fn cmp(&self, other: &Self) -> Ordering
[src]
#[must_use]
fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]
fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]
fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<Cell> for Cell
[src]
impl PartialOrd<Cell> for Cell
[src]
fn partial_cmp(&self, other: &Cell) -> Option<Ordering>
[src]
fn lt(&self, other: &Cell) -> bool
[src]
fn le(&self, other: &Cell) -> bool
[src]
fn gt(&self, other: &Cell) -> bool
[src]
fn ge(&self, other: &Cell) -> bool
[src]
impl StructuralPartialEq for Cell
[src]
Auto Trait Implementations
impl RefUnwindSafe for Cell
impl Send for Cell
impl Sync for Cell
impl Unpin for Cell
impl UnwindSafe for Cell
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Downcast for T where
T: Any,
T: Any,
fn into_any(self: Box<T>) -> Box<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn as_any(&self) -> &(dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
impl<T> DowncastSync for T where
T: Send + Sync + Any,
T: Send + Sync + Any,
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<N> NodeTrait for N where
N: Copy + Ord + Hash,
[src]
N: Copy + Ord + Hash,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> Scalar for T where
T: PartialEq<T> + Copy + Any + Debug,
[src]
T: PartialEq<T> + Copy + Any + Debug,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn is_in_subset(&self) -> bool
unsafe fn to_subset_unchecked(&self) -> SS
fn from_subset(element: &SS) -> SP
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,