[][src]Struct nannou::draw::Drawing

pub struct Drawing<'a, T, S = Default> where
    S: 'a + BaseFloat
{ /* fields omitted */ }

A Drawing in progress.

Drawing provides a way of chaining together method calls describing properties of the thing that we are drawing. Drawing ends when the instance is Dropped, at which point the properties of the drawing are inserted into the Draw type.

When a Drawing begins, a node is immediately created for the drawing within the Draw's inner geom::Graph. This ensures the correct instantiation order is maintained within the graph. As a result, each Drawing is associated with a single, unique node. Thus a Drawing can be thought of as a way of specifying properties for a node.

Methods

impl<'a, T, S> Drawing<'a, T, S> where
    S: BaseFloat
[src]

pub fn finish(self) -> Result<(), WouldCycle<S>>[src]

Complete the drawing and insert it into the parent Draw instance.

This will be called when the Drawing is Dropped if it has not yet been called.

pub fn id(self) -> Index[src]

Complete the drawing and return its unique identifier.

Panics if adding the edge would cause a cycle in the graph.

pub fn map_ty<F, T2>(self, map: F) -> Drawing<'a, T2, S> where
    F: FnOnce(T) -> T2,
    T2: Into<Primitive<S>>,
    Primitive<S>: Into<Option<T>>, 
[src]

Apply the given function to the type stored within Draw.

The function is only applied if the node has not yet been Drawn.

Panics if the primitive does not contain type T.

impl<'a, T, S> Drawing<'a, T, S> where
    T: SetColor<ColorScalar> + Into<Primitive<S>>,
    Primitive<S>: Into<Option<T>>,
    S: BaseFloat
[src]

pub fn color<C>(self, color: C) -> Self where
    C: IntoLinSrgba<ColorScalar>, 
[src]

Specify a color.

This method supports any color type that can be converted into RGBA.

Colors that have no alpha channel will be given an opaque alpha channel value 1.0.

pub fn rgb(self, r: ColorScalar, g: ColorScalar, b: ColorScalar) -> Self[src]

Specify the color via red, green and blue channels.

pub fn rgb8(self, r: u8, g: u8, b: u8) -> Self[src]

Specify the color via red, green and blue channels as bytes

pub fn rgba(
    self,
    r: ColorScalar,
    g: ColorScalar,
    b: ColorScalar,
    a: ColorScalar
) -> Self
[src]

Specify the color via red, green, blue and alpha channels.

pub fn rgba8(self, r: u8, g: u8, b: u8, a: u8) -> Self[src]

Specify the color via red, green, blue and alpha channels as bytes.

pub fn hsl(self, h: ColorScalar, s: ColorScalar, l: ColorScalar) -> Self[src]

Specify the color via hue, saturation and luminance.

If you're looking for HSVA or HSBA, use the hsva method instead.

The given hue expects a value between 0.0 and 1.0 where 0.0 is 0 degress and 1.0 is 360 degrees (or 2 PI radians).

See the wikipedia entry for more details on this color space.

pub fn hsla(
    self,
    h: ColorScalar,
    s: ColorScalar,
    l: ColorScalar,
    a: ColorScalar
) -> Self
[src]

Specify the color via hue, saturation, luminance and an alpha channel.

If you're looking for HSVA or HSBA, use the hsva method instead.

The given hue expects a value between 0.0 and 1.0 where 0.0 is 0 degress and 1.0 is 360 degrees (or 2 PI radians).

See the wikipedia entry for more details on this color space.

pub fn hsv(self, h: ColorScalar, s: ColorScalar, v: ColorScalar) -> Self[src]

Specify the color via hue, saturation and value (brightness).

This is sometimes also known as "hsb".

The given hue expects a value between 0.0 and 1.0 where 0.0 is 0 degress and 1.0 is 360 degrees (or 2 PI radians).

See the wikipedia entry for more details on this color space.

pub fn hsva(
    self,
    h: ColorScalar,
    s: ColorScalar,
    v: ColorScalar,
    a: ColorScalar
) -> Self
[src]

Specify the color via hue, saturation, value (brightness) and an alpha channel.

This is sometimes also known as "hsba".

The given hue expects a value between 0.0 and 1.0 where 0.0 is 0 degress and 1.0 is 360 degrees (or 2 PI radians).

See the wikipedia entry for more details on this color space.

pub fn gray(self, g: ColorScalar) -> Self[src]

Specify the color as gray scale

The given g expects a value between 0.0 and 1.0 where 0.0 is black and 1.0 is white

impl<'a, T, S> Drawing<'a, T, S> where
    T: SetDimensions<S> + Into<Primitive<S>>,
    Primitive<S>: Into<Option<T>>,
    S: BaseFloat
[src]

pub fn x_dimension(self, x: Dimension<S>) -> Self[src]

Set the length along the x axis.

pub fn y_dimension(self, y: Dimension<S>) -> Self[src]

Set the length along the y axis.

pub fn z_dimension(self, z: Dimension<S>) -> Self[src]

Set the length along the z axis.

pub fn width(self, w: S) -> Self[src]

Set the absolute width for the node.

pub fn height(self, h: S) -> Self[src]

Set the absolute height for the node.

pub fn depth(self, d: S) -> Self[src]

Set the absolute depth for the node.

pub fn w(self, w: S) -> Self[src]

Short-hand for the width method.

pub fn h(self, h: S) -> Self[src]

Short-hand for the height method.

pub fn d(self, d: S) -> Self[src]

Short-hand for the depth method.

pub fn wh(self, v: Vector2<S>) -> Self[src]

Set the x and y dimensions for the node.

pub fn whd(self, v: Vector3<S>) -> Self[src]

Set the x, y and z dimensions for the node.

pub fn w_h(self, x: S, y: S) -> Self[src]

Set the width and height for the node.

pub fn w_h_d(self, x: S, y: S, z: S) -> Self[src]

Set the width and height for the node.

pub fn x_dimension_relative(self, other: Index, x: Relative<S>) -> Self[src]

Some relative dimension along the x axis.

pub fn y_dimension_relative(self, other: Index, y: Relative<S>) -> Self[src]

Some relative dimension along the y axis.

pub fn z_dimension_relative(self, other: Index, z: Relative<S>) -> Self[src]

Some relative dimension along the z axis.

pub fn w_of(self, other: Index) -> Self[src]

Set the x-axis dimension as the width of the node at the given index.

pub fn h_of(self, other: Index) -> Self[src]

Set the y-axis dimension as the height of the node at the given index.

pub fn d_of(self, other: Index) -> Self[src]

Set the z-axis dimension as the depth of the node at the given index.

pub fn wh_of(self, other: Index) -> Self[src]

Set the dimensions as the dimensions of the node at the given index.

pub fn whd_of(self, other: Index) -> Self[src]

Set the dimensions as the dimensions of the node at the given index.

pub fn padded_w_of(self, other: Index, pad: S) -> Self[src]

Set the width as the width of the node at the given index padded at both ends by the given Scalar.

pub fn padded_h_of(self, other: Index, pad: S) -> Self[src]

Set the height as the height of the node at the given index padded at both ends by the given Scalar.

pub fn padded_d_of(self, other: Index, pad: S) -> Self[src]

Set the depth as the depth of the node at the given index padded at both ends by the given Scalar.

pub fn padded_wh_of(self, other: Index, pad: S) -> Self where
    S: Clone
[src]

Set the dimensions as the dimensions of the node at the given index with each dimension padded by the given scalar.

pub fn padded_whd_of(self, other: Index, pad: S) -> Self where
    S: Clone
[src]

Set the dimensions as the dimensions of the node at the given index with each dimension padded by the given scalar.

pub fn scaled_w_of(self, other: Index, scale: S) -> Self[src]

Set the width as the width of the node at the given index multiplied by the given scale Scalar value.

pub fn scaled_h_of(self, other: Index, scale: S) -> Self[src]

Set the height as the height of the node at the given index multiplied by the given scale Scalar value.

pub fn scaled_d_of(self, other: Index, scale: S) -> Self[src]

Set the depth as the depth of the node at the given index multiplied by the given scale Scalar value.

pub fn scaled_wh_of(self, other: Index, scale: S) -> Self where
    S: Clone
[src]

Set the dimensions as the dimensions of the node at the given index multiplied by the given scale Scalar value.

pub fn scaled_whd_of(self, other: Index, scale: S) -> Self where
    S: Clone
[src]

Set the dimensions as the dimensions of the node at the given index multiplied by the given scale Scalar value.

impl<'a, T, S> Drawing<'a, T, S> where
    T: SetPosition<S> + Into<Primitive<S>>,
    Primitive<S>: Into<Option<T>>,
    S: BaseFloat
[src]

pub fn x_position(self, position: Position<S>) -> Self[src]

Build with the given Position along the x axis.

pub fn y_position(self, position: Position<S>) -> Self[src]

Build with the given Position along the y axis.

pub fn z_position(self, position: Position<S>) -> Self[src]

Build with the given Position along the z axis.

pub fn x(self, x: S) -> Self[src]

Build with the given Absolute Position along the x axis.

pub fn y(self, y: S) -> Self[src]

Build with the given Absolute Position along the y axis.

pub fn z(self, z: S) -> Self[src]

Build with the given Absolute Position along the z axis.

pub fn xy(self, p: Point2<S>) -> Self[src]

Set the Position with some two-dimensional point.

pub fn xyz(self, p: Point3<S>) -> Self[src]

Set the Position with some three-dimensional point.

pub fn x_y(self, x: S, y: S) -> Self[src]

Set the Position with x y coordinates.

pub fn x_y_z(self, x: S, y: S, z: S) -> Self[src]

Set the Position with x y z coordinates.

pub fn x_position_relative(self, x: Relative<S>) -> Self[src]

Set the x Position Relative to the previous node.

pub fn y_position_relative(self, y: Relative<S>) -> Self[src]

Set the y Position Relative to the previous node.

pub fn z_position_relative(self, z: Relative<S>) -> Self[src]

Set the z Position Relative to the previous node.

pub fn x_y_position_relative(self, x: Relative<S>, y: Relative<S>) -> Self[src]

Set the x and y Positions Relative to the previous node.

pub fn x_y_z_position_relative(
    self,
    x: Relative<S>,
    y: Relative<S>,
    z: Relative<S>
) -> Self
[src]

Set the x, y and z Positions Relative to the previous node.

pub fn x_position_relative_to(self, other: Index, x: Relative<S>) -> Self[src]

Set the x Position Relative to the given node.

pub fn y_position_relative_to(self, other: Index, y: Relative<S>) -> Self[src]

Set the y Position Relative to the given node.

pub fn z_position_relative_to(self, other: Index, z: Relative<S>) -> Self[src]

Set the y Position Relative to the given node.

pub fn x_y_position_relative_to(
    self,
    other: Index,
    x: Relative<S>,
    y: Relative<S>
) -> Self
[src]

Set the x and y Positions Relative to the given node.

pub fn x_y_z_position_relative_to(
    self,
    other: Index,
    x: Relative<S>,
    y: Relative<S>,
    z: Relative<S>
) -> Self
[src]

Set the x, y and z Positions Relative to the given node.

pub fn x_relative(self, x: S) -> Self[src]

Set the Position as a Scalar along the x axis Relative to the middle of previous node.

pub fn y_relative(self, y: S) -> Self[src]

Set the Position as a Scalar along the y axis Relative to the middle of previous node.

pub fn z_relative(self, z: S) -> Self[src]

Set the Position as a Scalar along the z axis Relative to the middle of previous node.

pub fn xy_relative(self, p: Point2<S>) -> Self[src]

Set the Position as a Point Relative to the middle of the previous node.

pub fn xyz_relative(self, p: Point3<S>) -> Self[src]

Set the Position as a Point Relative to the middle of the previous node.

pub fn x_y_relative(self, x: S, y: S) -> Self[src]

Set the Position as Scalars along the x and y axes Relative to the middle of the previous node.

pub fn x_y_z_relative(self, x: S, y: S, z: S) -> Self[src]

Set the Position as Scalars along the x, y and z axes Relative to the middle of the previous node.

pub fn x_relative_to(self, other: Index, x: S) -> Self[src]

Set the position relative to the node with the given node::Index.

pub fn y_relative_to(self, other: Index, y: S) -> Self[src]

Set the position relative to the node with the given node::Index.

pub fn z_relative_to(self, other: Index, z: S) -> Self[src]

Set the position relative to the node with the given node::Index.

pub fn xy_relative_to(self, other: Index, p: Point2<S>) -> Self[src]

Set the position relative to the node with the given node::Index.

pub fn xyz_relative_to(self, other: Index, p: Point3<S>) -> Self[src]

Set the position relative to the node with the given node::Index.

pub fn x_y_relative_to(self, other: Index, x: S, y: S) -> Self[src]

Set the position relative to the node with the given node::Index.

pub fn x_y_z_relative_to(self, other: Index, x: S, y: S, z: S) -> Self[src]

Set the position relative to the node with the given node::Index.

pub fn x_direction(self, direction: Direction, x: S) -> Self[src]

Build with the Position along the x axis as some distance from another node.

pub fn y_direction(self, direction: Direction, y: S) -> Self[src]

Build with the Position along the y axis as some distance from another node.

pub fn z_direction(self, direction: Direction, z: S) -> Self[src]

Build with the Position along the z axis as some distance from another node.

pub fn left(self, x: S) -> Self[src]

Build with the Position as some distance to the left of another node.

pub fn right(self, x: S) -> Self[src]

Build with the Position as some distance to the right of another node.

pub fn down(self, y: S) -> Self[src]

Build with the Position as some distance below another node.

pub fn up(self, y: S) -> Self[src]

Build with the Position as some distance above another node.

pub fn backwards(self, z: S) -> Self[src]

Build with the Position as some distance in front of another node.

pub fn forwards(self, z: S) -> Self[src]

Build with the Position as some distance behind another node.

pub fn x_direction_from(self, other: Index, direction: Direction, x: S) -> Self[src]

Build with the Position along the x axis as some distance from the given node.

pub fn y_direction_from(self, other: Index, direction: Direction, y: S) -> Self[src]

Build with the Position along the y axis as some distance from the given node.

pub fn z_direction_from(self, other: Index, direction: Direction, z: S) -> Self[src]

Build with the Position along the z axis as some distance from the given node.

pub fn left_from(self, other: Index, x: S) -> Self[src]

Build with the Position as some distance to the left of the given node.

pub fn right_from(self, other: Index, x: S) -> Self[src]

Build with the Position as some distance to the right of the given node.

pub fn down_from(self, other: Index, y: S) -> Self[src]

Build with the Position as some distance below the given node.

pub fn up_from(self, other: Index, y: S) -> Self[src]

Build with the Position as some distance above the given node.

pub fn backwards_from(self, other: Index, z: S) -> Self[src]

Build with the Position as some distance in front of the given node.

pub fn forwards_from(self, other: Index, z: S) -> Self[src]

Build with the Position as some distance above the given node.

pub fn x_align(self, align: Align<S>) -> Self[src]

Align the Position of the node along the x axis.

pub fn y_align(self, align: Align<S>) -> Self[src]

Align the Position of the node along the y axis.

pub fn z_align(self, align: Align<S>) -> Self[src]

Align the Position of the node along the z axis.

pub fn align_left(self) -> Self[src]

Align the position to the left.

pub fn align_left_with_margin(self, margin: S) -> Self[src]

Align the position to the left.

pub fn align_middle_x(self) -> Self[src]

Align the position to the middle.

pub fn align_right(self) -> Self[src]

Align the position to the right.

pub fn align_right_with_margin(self, margin: S) -> Self[src]

Align the position to the right.

pub fn align_bottom(self) -> Self[src]

Align the position to the bottom.

pub fn align_bottom_with_margin(self, margin: S) -> Self[src]

Align the position to the bottom.

pub fn align_middle_y(self) -> Self[src]

Align the position to the middle.

pub fn align_top(self) -> Self[src]

Align the position to the top.

pub fn align_top_with_margin(self, margin: S) -> Self[src]

Align the position to the top.

pub fn align_front(self) -> Self[src]

Align the position to the front.

pub fn align_front_with_margin(self, margin: S) -> Self[src]

Align the position to the front.

pub fn align_middle_z(self) -> Self[src]

Align the position to the middle.

pub fn align_back(self) -> Self[src]

Align the position to the back.

pub fn align_back_with_margin(self, margin: S) -> Self[src]

Align the position to the back.

pub fn x_align_to(self, other: Index, align: Align<S>) -> Self[src]

Align the Position of the node with the given node along the x axis.

pub fn y_align_to(self, other: Index, align: Align<S>) -> Self[src]

Align the Position of the node with the given node along the y axis.

pub fn z_align_to(self, other: Index, align: Align<S>) -> Self[src]

Align the Position of the node with the given node along the z axis.

pub fn align_left_of(self, other: Index) -> Self[src]

Align the position to the left.

pub fn align_left_of_with_margin(self, other: Index, margin: S) -> Self[src]

Align the position to the left.

pub fn align_middle_x_of(self, other: Index) -> Self[src]

Align the position to the middle.

pub fn align_right_of(self, other: Index) -> Self[src]

Align the position to the right.

pub fn align_right_of_with_margin(self, other: Index, margin: S) -> Self[src]

Align the position to the right.

pub fn align_bottom_of(self, other: Index) -> Self[src]

Align the position to the bottom.

pub fn align_bottom_of_with_margin(self, other: Index, margin: S) -> Self[src]

Align the position to the bottom.

pub fn align_middle_y_of(self, other: Index) -> Self[src]

Align the position to the middle.

pub fn align_top_of(self, other: Index) -> Self[src]

Align the position to the top.

pub fn align_top_of_with_margin(self, other: Index, margin: S) -> Self[src]

Align the position to the top.

pub fn align_front_of(self, other: Index) -> Self[src]

Align the position to the front.

pub fn align_front_of_with_margin(self, other: Index, margin: S) -> Self[src]

Align the position to the front.

pub fn align_middle_z_of(self, other: Index) -> Self[src]

Align the position to the middle.

pub fn align_back_of(self, other: Index) -> Self[src]

Align the position to the back.

pub fn align_back_of_with_margin(self, other: Index, margin: S) -> Self[src]

Align the position to the back.

pub fn middle(self) -> Self[src]

Align the node to the middle of the last node.

pub fn bottom_left(self) -> Self[src]

Align the node to the bottom left of the last node.

pub fn mid_left(self) -> Self[src]

Align the node to the middle left of the last node.

pub fn top_left(self) -> Self[src]

Align the node to the top left of the last node.

pub fn mid_top(self) -> Self[src]

Align the node to the middle top of the last node.

pub fn top_right(self) -> Self[src]

Align the node to the top right of the last node.

pub fn mid_right(self) -> Self[src]

Align the node to the middle right of the last node.

pub fn bottom_right(self) -> Self[src]

Align the node to the bottom right of the last node.

pub fn mid_bottom(self) -> Self[src]

Align the node to the middle bottom of the last node.

pub fn middle_of(self, other: Index) -> Self[src]

Align the node in the middle of the given Node.

pub fn bottom_left_of(self, other: Index) -> Self[src]

Align the node to the bottom left of the given Node.

pub fn mid_left_of(self, other: Index) -> Self[src]

Align the node to the middle left of the given Node.

pub fn top_left_of(self, other: Index) -> Self[src]

Align the node to the top left of the given Node.

pub fn mid_top_of(self, other: Index) -> Self[src]

Align the node to the middle top of the given Node.

pub fn top_right_of(self, other: Index) -> Self[src]

Align the node to the top right of the given Node.

pub fn mid_right_of(self, other: Index) -> Self[src]

Align the node to the middle right of the given Node.

pub fn bottom_right_of(self, other: Index) -> Self[src]

Align the node to the bottom right of the given Node.

pub fn mid_bottom_of(self, other: Index) -> Self[src]

Align the node to the middle bottom of the given Node.

impl<'a, T, S> Drawing<'a, T, S> where
    T: SetOrientation<S> + Into<Primitive<S>>,
    Primitive<S>: Into<Option<T>>,
    S: BaseFloat
[src]

pub fn look_at(self, target: LookAt<S>) -> Self[src]

Describe orientation via the vector that points to the given target.

pub fn look_at_node(self, node: Index) -> Self[src]

Describe orientation via the vector that points to the given node.

pub fn look_at_point(self, point: Point3<S>) -> Self[src]

Describe orientation via the vector that points to the given point.

pub fn x_orientation(self, orientation: Orientation<S>) -> Self[src]

Build with the given Orientation along the x axis.

pub fn y_orientation(self, orientation: Orientation<S>) -> Self[src]

Build with the given Orientation along the y axis.

pub fn z_orientation(self, orientation: Orientation<S>) -> Self[src]

Build with the given Orientation along the z axis.

pub fn x_radians(self, x: S) -> Self[src]

Specify the orientation around the x axis as an absolute value in radians.

pub fn y_radians(self, y: S) -> Self[src]

Specify the orientation around the y axis as an absolute value in radians.

pub fn z_radians(self, z: S) -> Self[src]

Specify the orientation around the z axis as an absolute value in radians.

pub fn x_degrees(self, x: S) -> Self where
    S: BaseFloat
[src]

Specify the orientation around the x axis as an absolute value in radians.

pub fn y_degrees(self, y: S) -> Self where
    S: BaseFloat
[src]

Specify the orientation around the y axis as an absolute value in radians.

pub fn z_degrees(self, z: S) -> Self where
    S: BaseFloat
[src]

Specify the orientation around the z axis as an absolute value in radians.

pub fn x_turns(self, x: S) -> Self where
    S: BaseFloat
[src]

Specify the orientation around the x axis as a number of turns around the axis.

pub fn y_turns(self, y: S) -> Self where
    S: BaseFloat
[src]

Specify the orientation around the y axis as a number of turns around the axis.

pub fn z_turns(self, z: S) -> Self where
    S: BaseFloat
[src]

Specify the orientation around the z axis as a number of turns around the axis.

pub fn radians(self, v: Vector3<S>) -> Self[src]

Specify the orientation along each axis with the given Vector of radians.

This has the same affect as calling self.x_radians(v.x).y_radians(v.y).z_radians(v.z).

pub fn degrees(self, v: Vector3<S>) -> Self where
    S: BaseFloat
[src]

Specify the orientation along each axis with the given Vector of degrees.

This has the same affect as calling self.x_degrees(v.x).y_degrees(v.y).z_degrees(v.z).

pub fn turns(self, v: Vector3<S>) -> Self where
    S: BaseFloat
[src]

Specify the orientation along each axis with the given Vector of "turns".

This has the same affect as calling self.x_turns(v.x).y_turns(v.y).z_turns(v.z).

pub fn euler<A>(self, e: Euler<A>) -> Self where
    S: BaseFloat,
    A: Angle + Into<Rad<S>>, 
[src]

Specify the orientation with the given Euler.

The euler can be specified in either radians (via Rad) or degrees (via Deg).

pub fn quaternion(self, q: Quaternion<S>) -> Self where
    S: BaseFloat
[src]

Specify the orientation with the given Quaternion.

pub fn x_radians_relative(self, x: S) -> Self[src]

Specify the orientation around the x axis as a relative value in radians.

pub fn y_radians_relative(self, y: S) -> Self[src]

Specify the orientation around the y axis as a relative value in radians.

pub fn z_radians_relative(self, z: S) -> Self[src]

Specify the orientation around the z axis as a relative value in radians.

pub fn x_radians_relative_to(self, other: Index, x: S) -> Self[src]

Specify the orientation around the x axis as a relative value in radians.

pub fn y_radians_relative_to(self, other: Index, y: S) -> Self[src]

Specify the orientation around the y axis as a relative value in radians.

pub fn z_radians_relative_to(self, other: Index, z: S) -> Self[src]

Specify the orientation around the z axis as a relative value in radians.

pub fn x_degrees_relative(self, x: S) -> Self where
    S: BaseFloat
[src]

Specify the orientation around the x axis as a relative value in degrees.

pub fn y_degrees_relative(self, y: S) -> Self where
    S: BaseFloat
[src]

Specify the orientation around the y axis as a relative value in degrees.

pub fn z_degrees_relative(self, z: S) -> Self where
    S: BaseFloat
[src]

Specify the orientation around the z axis as a relative value in degrees.

pub fn x_degrees_relative_to(self, other: Index, x: S) -> Self where
    S: BaseFloat
[src]

Specify the orientation around the x axis as a relative value in degrees.

pub fn y_degrees_relative_to(self, other: Index, y: S) -> Self where
    S: BaseFloat
[src]

Specify the orientation around the y axis as a relative value in degrees.

pub fn z_degrees_relative_to(self, other: Index, z: S) -> Self where
    S: BaseFloat
[src]

Specify the orientation around the z axis as a relative value in degrees.

pub fn x_turns_relative(self, x: S) -> Self where
    S: BaseFloat
[src]

Specify the relative orientation around the x axis as a number of turns around the axis.

pub fn y_turns_relative(self, y: S) -> Self where
    S: BaseFloat
[src]

Specify the relative orientation around the y axis as a number of turns around the axis.

pub fn z_turns_relative(self, z: S) -> Self where
    S: BaseFloat
[src]

Specify the relative orientation around the z axis as a number of turns around the axis.

pub fn x_turns_relative_to(self, other: Index, x: S) -> Self where
    S: BaseFloat
[src]

Specify the relative orientation around the x axis as a number of turns around the axis.

pub fn y_turns_relative_to(self, other: Index, y: S) -> Self where
    S: BaseFloat
[src]

Specify the relative orientation around the y axis as a number of turns around the axis.

pub fn z_turns_relative_to(self, other: Index, z: S) -> Self where
    S: BaseFloat
[src]

Specify the relative orientation around the z axis as a number of turns around the axis.

pub fn radians_relative(self, v: Vector3<S>) -> Self[src]

Specify a relative orientation along each axis with the given Vector of radians.

This has the same affect as the following:

This example is not tested
self.x_radians_relative(v.x)
    .y_radians_relative(v.y)
    .z_radians_relative(v.z)

pub fn radians_relative_to(self, other: Index, v: Vector3<S>) -> Self[src]

Specify a relative orientation along each axis with the given Vector of radians.

This has the same affect as the following:

This example is not tested
self.x_radians_relative_to(other, v.x)
    .y_radians_relative_to(other, v.y)
    .z_radians_relative_to(other, v.z)

pub fn degrees_relative(self, v: Vector3<S>) -> Self where
    S: BaseFloat
[src]

Specify a relative orientation along each axis with the given Vector of degrees.

This has the same affect as the following:

This example is not tested
self.x_degrees_relative(v.x)
    .y_degrees_relative(v.y)
    .z_degrees_relative(v.z)

pub fn degrees_relative_to(self, other: Index, v: Vector3<S>) -> Self where
    S: BaseFloat
[src]

Specify a relative orientation along each axis with the given Vector of degrees.

This has the same affect as the following:

This example is not tested
self.x_degrees_relative_to(other, v.x)
    .y_degrees_relative_to(other, v.y)
    .z_degrees_relative_to(other, v.z)

pub fn turns_relative(self, v: Vector3<S>) -> Self where
    S: BaseFloat
[src]

Specify a relative orientation along each axis with the given Vector of "turns".

This has the same affect as the following:

This example is not tested
self.x_turns_relative(v.x)
    .y_turns_relative(v.y)
    .z_turns_relative(v.z)

pub fn turns_relative_to(self, other: Index, v: Vector3<S>) -> Self where
    S: BaseFloat
[src]

Specify a relative orientation along each axis with the given Vector of "turns".

This has the same affect as the following:

This example is not tested
self.x_turns_relative_to(other, v.x)
    .y_turns_relative_to(other, v.y)
    .z_turns_relative_to(other, v.z)

pub fn euler_relative<A>(self, e: Euler<A>) -> Self where
    S: BaseFloat,
    A: Angle + Into<Rad<S>>, 
[src]

Specify a relative orientation with the given Euler.

The euler can be specified in either radians (via Rad) or degrees (via Deg).

pub fn euler_relative_to<A>(self, other: Index, e: Euler<A>) -> Self where
    S: BaseFloat,
    A: Angle + Into<Rad<S>>, 
[src]

Specify a relative orientation with the given Euler.

The euler can be specified in either radians (via Rad) or degrees (via Deg).

pub fn pitch(self, pitch: S) -> Self[src]

Specify the "pitch" of the orientation in radians.

This has the same effect as calling x_radians.

pub fn yaw(self, yaw: S) -> Self[src]

Specify the "yaw" of the orientation in radians.

This has the same effect as calling y_radians.

pub fn roll(self, roll: S) -> Self[src]

Specify the "roll" of the orientation in radians.

This has the same effect as calling z_radians.

pub fn rotate(self, radians: S) -> Self[src]

Assuming we're looking at a 2D plane, positive values cause a clockwise rotation where the given value is specified in radians.

This is equivalent to calling the z_radians or roll methods.

impl<'a, T, S> Drawing<'a, T, S> where
    T: SetFill + Into<Primitive<S>>,
    Primitive<S>: Into<Option<T>>,
    S: BaseFloat
[src]

pub fn fill_opts(self, opts: FillOptions) -> Self[src]

Specify the whole set of fill tessellation options.

pub fn fill_tolerance(self, tolerance: f32) -> Self[src]

Maximum allowed distance to the path when building an approximation.

pub fn fill_rule(self, rule: FillRule) -> Self[src]

Specify the rule used to determine what is inside and what is outside of the shape.

Currently, only the EvenOdd rule is implemented.

pub fn assume_no_intersections(self, b: bool) -> Self[src]

A fast path to avoid some expensive operations if the path is known to not have any self-intesections.

Do not set this to true if the path may have intersecting edges else the tessellator may panic or produce incorrect results. In doubt, do not change the default value.

Default value: false.

impl<'a, T, S> Drawing<'a, T, S> where
    T: SetStroke + Into<Primitive<S>>,
    Primitive<S>: Into<Option<T>>,
    S: BaseFloat
[src]

pub fn start_cap(self, cap: LineCap) -> Self[src]

The start line cap as specified by the SVG spec.

pub fn end_cap(self, cap: LineCap) -> Self[src]

The end line cap as specified by the SVG spec.

pub fn caps(self, cap: LineCap) -> Self[src]

The start and end line cap as specified by the SVG spec.

pub fn start_cap_butt(self) -> Self[src]

The stroke for each sub-path does not extend beyond its two endpoints. A zero length sub-path will therefore not have any stroke.

pub fn start_cap_square(self) -> Self[src]

At the end of each sub-path, the shape representing the stroke will be extended by a rectangle with the same width as the stroke width and whose length is half of the stroke width. If a sub-path has zero length, then the resulting effect is that the stroke for that sub-path consists solely of a square with side length equal to the stroke width, centered at the sub-path's point.

pub fn start_cap_round(self) -> Self[src]

At each end of each sub-path, the shape representing the stroke will be extended by a half circle with a radius equal to the stroke width. If a sub-path has zero length, then the resulting effect is that the stroke for that sub-path consists solely of a full circle centered at the sub-path's point.

pub fn end_cap_butt(self) -> Self[src]

The stroke for each sub-path does not extend beyond its two endpoints. A zero length sub-path will therefore not have any stroke.

pub fn end_cap_square(self) -> Self[src]

At the end of each sub-path, the shape representing the stroke will be extended by a rectangle with the same width as the stroke width and whose length is half of the stroke width. If a sub-path has zero length, then the resulting effect is that the stroke for that sub-path consists solely of a square with side length equal to the stroke width, centered at the sub-path's point.

pub fn end_cap_round(self) -> Self[src]

At each end of each sub-path, the shape representing the stroke will be extended by a half circle with a radius equal to the stroke width. If a sub-path has zero length, then the resulting effect is that the stroke for that sub-path consists solely of a full circle centered at the sub-path's point.

pub fn caps_butt(self) -> Self[src]

The stroke for each sub-path does not extend beyond its two endpoints. A zero length sub-path will therefore not have any stroke.

pub fn caps_square(self) -> Self[src]

At the end of each sub-path, the shape representing the stroke will be extended by a rectangle with the same width as the stroke width and whose length is half of the stroke width. If a sub-path has zero length, then the resulting effect is that the stroke for that sub-path consists solely of a square with side length equal to the stroke width, centered at the sub-path's point.

pub fn caps_round(self) -> Self[src]

At each end of each sub-path, the shape representing the stroke will be extended by a half circle with a radius equal to the stroke width. If a sub-path has zero length, then the resulting effect is that the stroke for that sub-path consists solely of a full circle centered at the sub-path's point.

pub fn join(self, join: LineJoin) -> Self[src]

The way in which lines are joined at the vertices, matching the SVG spec.

Default value is MiterClip.

pub fn join_miter(self) -> Self[src]

A sharp corner is to be used to join path segments.

pub fn join_miter_clip(self) -> Self[src]

Same as a join_miter, but if the miter limit is exceeded, the miter is clipped at a miter length equal to the miter limit value multiplied by the stroke width.

pub fn join_round(self) -> Self[src]

A round corner is to be used to join path segments.

pub fn join_bevel(self) -> Self[src]

A bevelled corner is to be used to join path segments. The bevel shape is a triangle that fills the area between the two stroked segments.

pub fn stroke_weight(self, stroke_weight: f32) -> Self[src]

The total stroke_weight (aka width) of the line.

pub fn miter_limit(self, limit: f32) -> Self[src]

Describes the limit before miter lines will clip, as described in the SVG spec.

Must be greater than or equal to 1.0.

pub fn stroke_tolerance(self, tolerance: f32) -> Self[src]

Maximum allowed distance to the path when building an approximation.

pub fn stroke_opts(self, opts: StrokeOptions) -> Self[src]

Specify the full set of stroke options for the path tessellation.

impl<'a, S> Drawing<'a, Ellipse<S>, S> where
    S: BaseFloat
[src]

pub fn stroke<C>(self, color: C) -> Self where
    C: IntoLinSrgba<ColorScalar>, 
[src]

Stroke the outline with the given color.

pub fn radius(self, radius: S) -> Self[src]

Specify the width and height of the Ellipse via a given radius.

pub fn resolution(self, resolution: usize) -> Self[src]

The number of sides used to draw the ellipse.

impl<'a, S> Drawing<'a, Line<S>, S> where
    S: BaseFloat
[src]

pub fn weight(self, weight: f32) -> Self[src]

Short-hand for the stroke_weight method.

pub fn tolerance(self, tolerance: f32) -> Self[src]

Short-hand for the stroke_tolerance method.

pub fn start(self, start: Point2<S>) -> Self[src]

Specify the start point of the line.

pub fn end(self, end: Point2<S>) -> Self[src]

Specify the end point of the line.

pub fn points(self, start: Point2<S>, end: Point2<S>) -> Self[src]

Specify the start and end points of the line.

impl<'a, S> Drawing<'a, Vertexless, S> where
    S: BaseFloat
[src]

pub fn tris<I, V>(self, tris: I) -> Drawing<'a, Mesh<S>, S> where
    I: IntoIterator<Item = Tri<V>>,
    V: Vertex + IntoVertex<S>, 
[src]

Describe the mesh with the given sequence of triangles.

pub fn indexed<V, I>(self, vertices: V, indices: I) -> Drawing<'a, Mesh<S>, S> where
    V: IntoIterator,
    V::Item: IntoVertex<S>,
    I: IntoIterator<Item = [usize; 3]>, 
[src]

Describe the mesh with the given sequence of indexed vertices.

impl<'a, S> Drawing<'a, PathInit<S>, S> where
    S: BaseFloat
[src]

pub fn fill(self) -> DrawingPathFill<'a, S>[src]

Specify that we want to use fill tessellation for the path.

The returned building context allows for specifying the fill tessellation options.

pub fn stroke(self) -> DrawingPathStroke<'a, S>[src]

Specify that we want to use stroke tessellation for the path.

The returned building context allows for specifying the stroke tessellation options.

impl<'a, S> Drawing<'a, PathOptions<FillOptions, S>, S> where
    S: BaseFloat
[src]

pub fn tolerance(self, tolerance: f32) -> Self[src]

Maximum allowed distance to the path when building an approximation.

pub fn rule(self, rule: FillRule) -> Self[src]

Specify the rule used to determine what is inside and what is outside of the shape.

Currently, only the EvenOdd rule is implemented.

impl<'a, S> Drawing<'a, PathOptions<StrokeOptions, S>, S> where
    S: BaseFloat
[src]

pub fn weight(self, weight: f32) -> Self[src]

Short-hand for the stroke_weight method.

pub fn tolerance(self, tolerance: f32) -> Self[src]

Short-hand for the stroke_tolerance method.

pub fn colored_points<I>(self, points: I) -> DrawingPath<'a, S> where
    S: BaseFloat,
    I: IntoIterator,
    I::Item: Into<ColoredPoint2<S>>, 
[src]

Submit path events as a polyline of colored points.

pub fn colored_points_closed<I>(self, points: I) -> DrawingPath<'a, S> where
    S: BaseFloat,
    I: IntoIterator,
    I::Item: Into<ColoredPoint2<S>>, 
[src]

Submit path events as a polyline of colored points.

The path with automatically close from the end point to the start point.

impl<'a, T, S> Drawing<'a, PathOptions<T, S>, S> where
    S: BaseFloat,
    T: TessellationOptions,
    PathOptions<T, S>: Into<Primitive<S>>,
    Primitive<S>: Into<Option<PathOptions<T, S>>>,
    PathGeometryBuilder<'b, 'ctxt, S>: GeometryBuilder<T::VertexInput>, 
[src]

pub fn events<I>(self, events: I) -> DrawingPath<'a, S> where
    I: IntoIterator<Item = PathEvent>, 
[src]

Submit the path events to be tessellated.

pub fn points<I>(self, points: I) -> DrawingPath<'a, S> where
    I: IntoIterator,
    I::Item: Into<Point2<S>>, 
[src]

Submit the path events as a polyline of points.

pub fn points_closed<I>(self, points: I) -> DrawingPath<'a, S> where
    I: IntoIterator,
    I::Item: Into<Point2<S>>, 
[src]

Submit the path events as a polyline of points.

An event will be generated that closes the start and end points.

impl<'a, S, T> Drawing<'a, T, S> where
    S: BaseFloat,
    T: SetPolygon<S> + Into<Primitive<S>>,
    Primitive<S>: Into<Option<T>>, 
[src]

pub fn no_fill(self) -> Self[src]

Specify no fill color and in turn no fill tessellation for the polygon.

pub fn stroke_color<C>(self, color: C) -> Self where
    C: IntoLinSrgba<ColorScalar>, 
[src]

Specify a color to use for stroke tessellation.

Stroke tessellation will only be performed if this method or one of the SetStroke methods are called.

pub fn polygon_options(self, opts: PolygonOptions<S>) -> Self[src]

Specify the whole set of polygon options.

impl<'a, S> Drawing<'a, PolygonInit<S>, S> where
    S: BaseFloat
[src]

pub fn stroke<C>(self, color: C) -> Self where
    C: IntoLinSrgba<ColorScalar>, 
[src]

Stroke the outline with the given color.

pub fn events<I>(self, events: I) -> DrawingPolygon<'a, S> where
    S: BaseFloat,
    I: IntoIterator<Item = PathEvent>, 
[src]

Describe the polygon with a sequence of path events.

pub fn points<I>(self, points: I) -> DrawingPolygon<'a, S> where
    S: BaseFloat,
    I: IntoIterator,
    I::Item: Into<Point2<S>>, 
[src]

Describe the polygon with a sequence of points.

impl<'a, S> Drawing<'a, Quad<S>, S> where
    S: BaseFloat
[src]

pub fn points<P>(self, a: P, b: P, c: P, d: P) -> Self where
    P: Into<Point2<S>>, 
[src]

Use the given points as the vertices (corners) of the quad.

impl<'a, S> Drawing<'a, Rect<S>, S> where
    S: BaseFloat
[src]

pub fn stroke<C>(self, color: C) -> Self where
    C: IntoLinSrgba<ColorScalar>, 
[src]

Stroke the outline with the given color.

impl<'a, S> Drawing<'a, Text<S>, S> where
    S: BaseFloat
[src]

pub fn font_size(self, size: FontSize) -> Self[src]

The font size to use for the text.

pub fn no_line_wrap(self) -> Self[src]

Specify that the Text should not wrap lines around the width.

pub fn wrap_by_word(self) -> Self[src]

Line wrap the Text at the beginning of the first word that exceeds the width.

pub fn wrap_by_character(self) -> Self[src]

Line wrap the Text at the beginning of the first character that exceeds the width.

pub fn font(self, font: Font) -> Self[src]

A method for specifying the Font used for displaying the Text.

pub fn with_style(self, style: Style) -> Self[src]

Build the Text with the given Style.

pub fn justify(self, justify: Justify) -> Self[src]

Describe the end along the x axis to which the text should be aligned.

pub fn left_justify(self) -> Self[src]

Align the text to the left of its bounding Rect's x axis range.

pub fn center_justify(self) -> Self[src]

Align the text to the middle of its bounding Rect's x axis range.

pub fn right_justify(self) -> Self[src]

Align the text to the right of its bounding Rect's x axis range.

pub fn line_spacing(self, spacing: Scalar) -> Self[src]

Specify how much vertical space should separate each line of text.

pub fn y_align_text(self, align: Align) -> Self[src]

Specify how the whole text should be aligned along the y axis of its bounding rectangle

pub fn align_text_top(self) -> Self[src]

Align the top edge of the text with the top edge of its bounding rectangle.

pub fn align_text_middle_y(self) -> Self[src]

Align the middle of the text with the middle of the bounding rect along the y axis..

This is the default behaviour.

pub fn align_text_bottom(self) -> Self[src]

Align the bottom edge of the text with the bottom edge of its bounding rectangle.

pub fn layout(self, layout: &Layout) -> Self[src]

Set all the parameters via an existing Layout

impl<'a, S> Drawing<'a, Tri<S>, S> where
    S: BaseFloat
[src]

pub fn stroke<C>(self, color: C) -> Self where
    C: IntoLinSrgba<ColorScalar>, 
[src]

Stroke the outline with the given color.

pub fn points<P>(self, a: P, b: P, c: P) -> Self where
    P: Into<Point2<S>>, 
[src]

Use the given points as the vertices (corners) of the triangle.

Trait Implementations

impl<'a, T: Debug, S: Debug> Debug for Drawing<'a, T, S> where
    S: 'a + BaseFloat
[src]

impl<'a, T, S> Drop for Drawing<'a, T, S> where
    S: BaseFloat
[src]

Auto Trait Implementations

impl<'a, T, S = f32> !RefUnwindSafe for Drawing<'a, T, S>

impl<'a, T, S = f32> !Send for Drawing<'a, T, S>

impl<'a, T, S = f32> !Sync for Drawing<'a, T, S>

impl<'a, T, S> Unpin for Drawing<'a, T, S> where
    T: Unpin

impl<'a, T, S = f32> !UnwindSafe for Drawing<'a, T, S>

Blanket Implementations

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
    D: AdaptFrom<S, Swp, Dwp, T>,
    Dwp: WhitePoint,
    Swp: WhitePoint,
    T: Component + Float
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> ConvertInto<U> for T where
    U: ConvertFrom<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SetParameter for T

impl<T> SetParameter for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,