Struct nannou::ui::prelude::widget::triangles::Triangle
[−]
[src]
pub struct Triangle<V>(pub [V; 3])
where
V: Vertex;
A single triangle described by three vertices.
Methods
impl<V> Triangle<V> where
V: Vertex,
[src]
V: Vertex,
fn add(self, amount: [f64; 2]) -> Triangle<V>
[src]
Shift the triangle by the given amount by adding it onto the position of each point.
fn points(self) -> [[f64; 2]; 3]
[src]
The three points that make up the triangle.
impl Triangle<[f64; 2]>
[src]
fn color(self, a: Rgba, b: Rgba, c: Rgba) -> Triangle<([f64; 2], Rgba)>
[src]
Convert the Triangle<Point>
to a Triangle<ColoredPoint>
.
fn color_all(self, color: Rgba) -> Triangle<([f64; 2], Rgba)>
[src]
Convert the Triangle<Point>
to a Triangle<ColoredPoint>
using the given color.
Trait Implementations
impl<V> Copy for Triangle<V> where
V: Copy + Vertex,
[src]
V: Copy + Vertex,
impl<V> Clone for Triangle<V> where
V: Clone + Vertex,
[src]
V: Clone + Vertex,
fn clone(&self) -> Triangle<V>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<V> From<(V, V, V)> for Triangle<V> where
V: Vertex,
[src]
V: Vertex,
impl<V> From<[V; 3]> for Triangle<V> where
V: Vertex,
[src]
V: Vertex,
impl<V> PartialEq<Triangle<V>> for Triangle<V> where
V: PartialEq<V> + Vertex,
[src]
V: PartialEq<V> + Vertex,
fn eq(&self, __arg_0: &Triangle<V>) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Triangle<V>) -> bool
[src]
This method tests for !=
.
impl<V> Debug for Triangle<V> where
V: Debug + Vertex,
[src]
V: Debug + Vertex,
fn fmt(&self, __arg_0: &mut Formatter) -> Result<(), Error>
[src]
Formats the value using the given formatter.
impl<V> Into<[V; 3]> for Triangle<V> where
V: Vertex,
[src]
V: Vertex,
impl<V> Into<(V, V, V)> for Triangle<V> where
V: Vertex,
[src]
V: Vertex,
impl<V> Deref for Triangle<V> where
V: Vertex,
[src]
V: Vertex,
type Target = [V; 3]
The resulting type after dereferencing.
fn deref(&self) -> &<Triangle<V> as Deref>::Target
[src]
Dereferences the value.
impl<V> AsRef<Triangle<V>> for Triangle<V> where
V: Vertex,
[src]
V: Vertex,