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

pub struct Drawing<'a, T, S = Default> where
    T: IntoDrawn<S>,
    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
    T: IntoDrawn<S>,
    S: BaseFloat
[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.

Complete the drawing and return its unique identifier.

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

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: IntoDrawn<S> + SetColor<ColorScalar> + Into<Primitive<S>>,
    Primitive<S>: Into<Option<T>>,
    S: BaseFloat
[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.

Specify the color via red, green and blue channels.

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

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.

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.

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.

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.

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

Set the length along the x axis.

Set the length along the y axis.

Set the length along the z axis.

Set the absolute width for the node.

Set the absolute height for the node.

Set the absolute depth for the node.

Short-hand for the width method.

Short-hand for the height method.

Short-hand for the depth method.

Set the x and y dimensions for the node.

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

Set the width and height for the node.

Set the width and height for the node.

Some relative dimension along the x axis.

Some relative dimension along the y axis.

Some relative dimension along the z axis.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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: IntoDrawn<S> + SetPosition<S> + Into<Primitive<S>>,
    Primitive<S>: Into<Option<T>>,
    S: BaseFloat
[src]

Build with the given Position along the x axis.

Build with the given Position along the y axis.

Build with the given Position along the z axis.

Build with the given Absolute Position along the x axis.

Build with the given Absolute Position along the y axis.

Build with the given Absolute Position along the z axis.

Set the Position with some two-dimensional point.

Set the Position with some three-dimensional point.

Set the Position with x y coordinates.

Set the Position with x y z coordinates.

Set the x Position Relative to the previous node.

Set the y Position Relative to the previous node.

Set the z Position Relative to the previous node.

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

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

Set the x Position Relative to the given node.

Set the y Position Relative to the given node.

Set the y Position Relative to the given node.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Build with the Position as some distance below another node.

Build with the Position as some distance above another node.

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

Build with the Position as some distance behind another node.

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

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

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

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

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

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

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

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

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

Align the Position of the node along the x axis.

Align the Position of the node along the y axis.

Align the Position of the node along the z axis.

Align the position to the left.

Align the position to the left.

Align the position to the middle.

Align the position to the right.

Align the position to the right.

Align the position to the bottom.

Align the position to the bottom.

Align the position to the middle.

Align the position to the top.

Align the position to the top.

Align the position to the front.

Align the position to the front.

Align the position to the middle.

Align the position to the back.

Align the position to the back.

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

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

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

Align the position to the left.

Align the position to the left.

Align the position to the middle.

Align the position to the right.

Align the position to the right.

Align the position to the bottom.

Align the position to the bottom.

Align the position to the middle.

Align the position to the top.

Align the position to the top.

Align the position to the front.

Align the position to the front.

Align the position to the middle.

Align the position to the back.

Align the position to the back.

Align the node to the middle of the last node.

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

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

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

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

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

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

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

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

Align the node in the middle of the given Node.

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

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

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

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

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

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

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

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

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

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

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

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

Build with the given Orientation along the x axis.

Build with the given Orientation along the y axis.

Build with the given Orientation along the z axis.

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

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

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

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

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

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

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

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

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

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).

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).

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).

Specify the orientation with the given Euler.

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

Specify the orientation with the given Quaternion.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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)

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)

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)

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)

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)

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)

Specify a relative orientation with the given Euler.

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

Specify a relative orientation with the given Euler.

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

Specify the "pitch" of the orientation in radians.

This has the same effect as calling x_radians.

Specify the "yaw" of the orientation in radians.

This has the same effect as calling y_radians.

Specify the "roll" of the orientation in radians.

This has the same effect as calling z_radians.

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, S> Drawing<'a, Ellipse<S>, S> where
    S: BaseFloat
[src]

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

The number of sides used to draw the ellipse.

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

Specify the thickness of the Line.

Specify half the thickness of the Line.

As the half-thickness is used more commonly within Line geometric calculations, this can be slightly more efficient than the full thickness method.

Specify the start point for the line.

Specify the end point for the line.

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

Draw rounded caps on the ends of the line.

The radius of the semi-circle is equal to the line's half_thickness.

Draw rounded caps on the ends of the line.

The radius of the semi-circle is equal to the line's half_thickness.

Draw squared caps on the ends of the line.

The length of the protrusion is equal to the line's half_thickness.

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

Describe the mesh with the given sequence of triangles.

Describe the mesh with the given sequence of indexed vertices.

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

Describe the polygon's edges with the given list of consecutive vertices that join them.

Describe the polygon's edges with the given list of consecutive vertices that join them.

Each vertex may be colored uniquely.

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

Describe the polyline with some "half_thickness" of the line and the given sequence of vertices.

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

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

impl<'a, S> Drawing<'a, Tri<S>, S> where
    S: BaseFloat
[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
    T: IntoDrawn<S>,
    S: 'a + BaseFloat
[src]

Formats the value using the given formatter. Read more

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

Executes the destructor for this type. Read more

Auto Trait Implementations

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

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