PolyLine

Core::Diagram::PolyLine

Overview

Concrete Class

A curve that consists of one or more chained straight sections.

(Fullscreen Diagram)

GraphicalElementGraphicalPrimitivePolyLinePoints :Point [2..*] {ordered}Stroke :Stroke

Supertypes

Members

Data Properties

Name

Multiplicity

Type

Ordered

Unique

Points

2..*

Point

yes

no

The points of the PolyLine.

Stroke

1

Stroke

no

no

The stroke of the PolyLine.

Geometry

The first straight section of a PolyLine starts at its first Point, i.e., Points[0], and ends at its second Point. For each further Point, another section is drawn that starts at the preceding Point.

Example

We consider a PolyLine with 3 Points:

  • (-30, 40),

  • (50, 40), and

  • (-10, -60).

The PolyLine will look like this:

../../../_images/img6.svg

Mapping to SVG

A PolyLine corresponds to an svg:polyline with these attributes:

  • points contains the Points of the PolyLine.

    Each Point \(i\) with position \(x_i\) and \(y_i\) is converted to a string as str(\(x_i\)) + , + str(\(y_i\)). Finally, the points attribute is set to a single string that contains all positions, separated by spaces.

  • stroke, stroke-dasharray, stroke-dashoffset and stroke-width are set according to the SVG mapping rules for the Stroke of the PolyLine (see Stroke).

  • stroke-linecap = "round" and stroke-linejoin = "round" reflect the heuristic for line caps and line joins.

  • vector-effect = "non-scaling-stroke" reflects the heuristic for scaled symbols.

  • fill = "none" is required to avoid that the svg:polyline is filled.

Example

We assume that the Stroke of the PolyLine above is 2mm #007fff solid.

{PolyLineSolidSvgCode}
../../../_images/img7.svg

Example

We consider the same PolyLine as in the previous example, except that the Stroke is 2mm #007fff Dash.

{PolyLineDashSvgCode}
../../../_images/img8.svg

Points

Data Property

The points of the PolyLine.

Type: Point

Multiplicity: 2..*

Ordered: yes

Unique: no

Example

[

     Point(

          X = 3.5,

          Y = 5.5),

     Point(

          X = 5.5,

          Y = 7.5)

]

Stroke

Data Property

The stroke of the PolyLine.

Type: Stroke

Multiplicity: 1

Ordered: no

Unique: no

Example

Stroke(

     Color = Color(

          B = 0,

          G = 0,

          R = 128),

     DashStyle = Solid,

     Width = 0.3)

Example in DEXPI XML

<Object type="Core/Diagram.PolyLine">
  <Data property="Points">
    <AggregatedDataValue type="Core/Diagram.Point">
      <Data property="X">
        <Double>3.5</Double>
      </Data>
      <Data property="Y">
        <Double>5.5</Double>
      </Data>
    </AggregatedDataValue>
    <AggregatedDataValue type="Core/Diagram.Point">
      <Data property="X">
        <Double>5.5</Double>
      </Data>
      <Data property="Y">
        <Double>7.5</Double>
      </Data>
    </AggregatedDataValue>
  </Data>
  <Data property="Stroke">
    <AggregatedDataValue type="Core/Diagram.Stroke">
      <Data property="Color">
        <AggregatedDataValue type="Core/Diagram.Color">
          <Data property="B">
            <Integer>0</Integer>
          </Data>
          <Data property="G">
            <Integer>0</Integer>
          </Data>
          <Data property="R">
            <Integer>128</Integer>
          </Data>
        </AggregatedDataValue>
      </Data>
      <Data property="DashStyle">
        <DataReference data="Core/Diagram.DashStyle.Solid"/>
      </Data>
      <Data property="Width">
        <Double>0.3</Double>
      </Data>
    </AggregatedDataValue>
  </Data>
</Object>