[][src]Struct oox::shared::drawingml::shapedefs::Path2D

pub struct Path2D {
    pub width: Option<PositiveCoordinate>,
    pub height: Option<PositiveCoordinate>,
    pub fill_mode: Option<PathFillMode>,
    pub stroke: Option<bool>,
    pub extrusion_ok: Option<bool>,
    pub commands: Vec<Path2DCommand>,
}

This element specifies a creation path consisting of a series of moves, lines and curves that when combined forms a geometric shape. This element is only utilized if a custom geometry is specified.

Note

Since multiple paths are allowed the rules for drawing are that the path specified later in the pathLst is drawn on top of all previous paths.

Xml example

<a:custGeom>
  <a:pathLst>
    <a:path w="2824222" h="590309">
      <a:moveTo>
        <a:pt x="0" y="428263"/>
      </a:moveTo>
      <a:lnTo>
        <a:pt x="1620455" y="590309"/>
      </a:lnTo>
      <a:lnTo>
        <a:pt x="2824222" y="173620"/>
      </a:lnTo>
      <a:lnTo>
        <a:pt x="1562582" y="0"/>
      </a:lnTo>
      <a:close/>
    </a:path>
  </a:pathLst>
</a:custGeom>

In the above example there is specified a four sided geometric shape that has all straight sides. While we only see three lines being drawn via the lnTo element there are actually four sides because the last point of (x=1562585, y=0) is connected to the first point in the creation path via a lnTo element

Fields

width: Option<PositiveCoordinate>

Specifies the width, or maximum x coordinate that should be used for within the path coordinate system. This value determines the horizontal placement of all points within the corresponding path as they are all calculated using this width attribute as the max x coordinate.

Defaults to 0

height: Option<PositiveCoordinate>

Specifies the height, or maximum y coordinate that should be used for within the path coordinate system. This value determines the vertical placement of all points within the corresponding path as they are all calculated using this height attribute as the max y coordinate.

Defaults to 0

fill_mode: Option<PathFillMode>

Specifies how the corresponding path should be filled. If this attribute is omitted, a value of "norm" is assumed.

Defaults to PathFillMode::Norm

stroke: Option<bool>

Specifies if the corresponding path should have a path stroke shown. This is a boolean value that affect the outline of the path. If this attribute is omitted, a value of true is assumed.

Defaults to true

extrusion_ok: Option<bool>

Specifies that the use of 3D extrusions are possible on this path. This allows the generating application to know whether 3D extrusion can be applied in any form. If this attribute is omitted then a value of 0, or false is assumed.

Defaults to true

commands: Vec<Path2DCommand>

Methods

impl Path2D[src]

pub fn from_xml_element(xml_node: &XmlNode) -> Result<Self>[src]

Trait Implementations

impl Clone for Path2D[src]

impl Debug for Path2D[src]

impl Default for Path2D[src]

impl PartialEq<Path2D> for Path2D[src]

impl StructuralPartialEq for Path2D[src]

Auto Trait Implementations

impl RefUnwindSafe for Path2D

impl Send for Path2D

impl Sync for Path2D

impl Unpin for Path2D

impl UnwindSafe for Path2D

Blanket Implementations

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> From<T> for T[src]

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.