Struct Path2D

Source
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>,
}
Expand description

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>

Implementations§

Source§

impl Path2D

Source

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

Trait Implementations§

Source§

impl Clone for Path2D

Source§

fn clone(&self) -> Path2D

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Path2D

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Path2D

Source§

fn default() -> Path2D

Returns the “default value” for a type. Read more
Source§

impl PartialEq for Path2D

Source§

fn eq(&self, other: &Path2D) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Path2D

Auto Trait Implementations§

§

impl Freeze for Path2D

§

impl RefUnwindSafe for Path2D

§

impl Send for Path2D

§

impl Sync for Path2D

§

impl Unpin for Path2D

§

impl UnwindSafe for Path2D

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.