Difference between revisions of "Hatch drawing definition"
Jan.Gajdosik (talk | contribs) |
Jan.Gajdosik (talk | contribs) |
||
Line 10: | Line 10: | ||
|Type | |Type | ||
|<sup>[[Legend of XML elements|[A]]]</sup> <code>Type</code> | |<sup>[[Legend of XML elements|[A]]]</sup> <code>Type</code> | ||
|Type of hatch, possible values <code>StandardFill</code>, <code>LineFill</code> or <code>CompositeFill</code> | |Type of hatch, possible values <code>[[StandardFill]]</code>, <code>[[LineFill]]</code> or <code>[[CompositeFill]]</code> | ||
|(empty) | |(empty) | ||
|} | |} | ||
===== StandardFill ===== | ===== StandardFill ===== | ||
Area filled with solid color. | |||
{| class="wikitable" | {| class="wikitable" | ||
!Property | !Property | ||
Line 26: | Line 27: | ||
|<code>clDefault</code> | |<code>clDefault</code> | ||
|} | |} | ||
'''Example of Data XML''' | |||
<code><HatchDefinition Type="StandardFill" Color="clFill"></code> | |||
===== LineFill ===== | ===== LineFill ===== | ||
Area filled with sequence of lines separated by distance. All lines are oriented in one direction. | |||
{| class="wikitable" | {| class="wikitable" | ||
!Property | !Property | ||
Line 76: | Line 81: | ||
<code></HatchDefinition></code> | <code></HatchDefinition></code> | ||
===== CompositeFill ===== | |||
Area filled with sequence of lines separated by distance. All lines are oriented in one direction. | |||
{| class="wikitable" | |||
!Property | |||
!XML | |||
!Description | |||
!Default | |||
|- | |||
|Line direction | |||
|<sup>[[Legend of XML elements|[A]]]</sup> <code>Direction</code> | |||
|Direction of line [deg] | |||
|(empty) | |||
|- | |||
|Line origin | |||
|<sup>[[Legend of XML elements|[E]]]</sup> <code>Origin</code> | |||
|Origin of line X, Y value in [mm] | |||
|0, 0 | |||
|- | |||
|Line distance | |||
|<sup>[[Legend of XML elements|[A]]]</sup> <code>Background</code> | |||
|Distance of parallel lines [mm] | |||
|(empty) | |||
|- | |||
|Line shift | |||
|<sup>[[Legend of XML elements|[A]]]</sup> <code>Shift</code> | |||
|Shift of next line (in direction of line) [mm] | |||
|(empty) | |||
|- | |||
|Line definition | |||
|<sup>[[Legend of XML elements|[E]]]</sup> <code>Line</code> | |||
|Definition of the [[Line definition|line]], if there is more than 1 line definition, lines are drawn in sequence Line1->Distance->Line2->Distance->...->Line1->... | |||
|(empty) | |||
|} | |||
'''Example of Data XML - Multiple line hatch''' | '''Example of Data XML - Multiple line hatch''' |
Revision as of 08:19, 1 June 2022
Used to store hatch definition.
Data XML definition
Property | XML | Description | Default |
---|---|---|---|
Type | [A] Type
|
Type of hatch, possible values StandardFill , LineFill or CompositeFill
|
(empty) |
StandardFill
Area filled with solid color.
Property | XML | Description | Default |
---|---|---|---|
Color | [A] Color
|
Color of fill | clDefault
|
Example of Data XML
<HatchDefinition Type="StandardFill" Color="clFill">
LineFill
Area filled with sequence of lines separated by distance. All lines are oriented in one direction.
Property | XML | Description | Default |
---|---|---|---|
Line direction | [A] Direction
|
Direction of line [deg] | (empty) |
Line origin | [E] Origin
|
Origin of line X, Y value in [mm] | 0, 0 |
Line distance | [A] Background
|
Distance of parallel lines [mm] | (empty) |
Line shift | [A] Shift
|
Shift of next line (in direction of line) [mm] | (empty) |
Line definition | [E] Line
|
Definition of the line, if there is more than 1 line definition, lines are drawn in sequence Line1->Distance->Line2->Distance->...->Line1->... | (empty) |
Example of Data XML
<HatchDefinition Direction="0" Distance="2" Shift="4">
<Line Type="ElemLine">
<Elem Kind="Line" DX="2" DY="0" />
<Elem Kind="Move" DX="-1" DY="1" />
<Elem Kind="Line" DX="0" DY="-2" />
<Elem Kind="Move" DX="7" DY="0" />
</Line>
</HatchDefinition>
CompositeFill
Area filled with sequence of lines separated by distance. All lines are oriented in one direction.
Property | XML | Description | Default |
---|---|---|---|
Line direction | [A] Direction
|
Direction of line [deg] | (empty) |
Line origin | [E] Origin
|
Origin of line X, Y value in [mm] | 0, 0 |
Line distance | [A] Background
|
Distance of parallel lines [mm] | (empty) |
Line shift | [A] Shift
|
Shift of next line (in direction of line) [mm] | (empty) |
Line definition | [E] Line
|
Definition of the line, if there is more than 1 line definition, lines are drawn in sequence Line1->Distance->Line2->Distance->...->Line1->... | (empty) |
Example of Data XML - Multiple line hatch
<HatchDefinition Type="CompositeFill">
<Fill Type="StandardFill" />
<Fill Type="CompositeFill">
<Fill Type="LineFill" Direction="0" Distance="9" Color="clFill">
<Line Type="ElemLine">
<Elem Kind="Move" DX="1.5" DY="0" />
<Elem Kind="Polygon" ShapeFilled="true">
<Pt X="0" Y="0" />
<Pt X="-0.75" Y="1.25" />
<Pt X="-0.75" Y="2.25" />
<Pt X="-0.25" Y="2.5" />
<Pt X="1.75" Y="2.25" />
<Pt X="2" Y="1" />
<Pt X="2.25" Y="0.75" />
<Pt X="1.5" Y="0" />
</Elem>
<Elem Kind="Move" DX="3.75" DY="0" />
<Elem Kind="Polygon" ShapeFilled="true">
<Pt X="0" Y="0.25" />
<Pt X="-0.25" Y="1.25" />
<Pt X="0.5" Y="1.5" />
<Pt X="0.75" Y="1.25" />
<Pt X="0.75" Y="0.5" />
<Pt X="0.5" Y="0.25" />
</Elem>
<Elem Kind="Move" DX="1.25" DY="0" />
<Elem Kind="Polygon" ShapeFilled="true">
<Pt X="0" Y="2" />
<Pt X="0.25" Y="2.75" />
<Pt X="1" Y="3" />
<Pt X="1.75" Y="2.75" />
<Pt X="2.25" Y="2" />
<Pt X="2.25" Y="1.25" />
<Pt X="1.5" Y="0.75" />
<Pt X="1" Y="0.75" />
<Pt X="0.25" Y="1.25" />
</Elem>
<Elem Kind="Move" DX="2.5" DY="0" />
</Line>
</Fill>
<Fill Type="LineFill" Direction="0" Distance="9" Color="clFill">
<Origin X="0" Y="3.25" />
<Line Type="ElemLine">
<Elem Kind="Polygon" ShapeFilled="true">
<Pt X="0" Y="0.25" />
<Pt X="0" Y="1.75" />
<Pt X="1" Y="1.25" />
<Pt X="1.25" Y="0.5" />
<Pt X="0.5" Y="0" />
</Elem>
<Elem Kind="Move" DX="1.5" DY="0" />
<Elem Kind="Polygon" ShapeFilled="true">
<Pt X="0" Y="2.75" />
<Pt X="0" Y="3.5" />
<Pt X="1" Y="4" />
<Pt X="1.75" Y="3.75" />
<Pt X="2.5" Y="3.75" />
<Pt X="4" Y="3" />
<Pt X="4.5" Y="2.25" />
<Pt X="4" Y="1.5" />
<Pt X="2.5" Y="1" />
<Pt X="1.75" Y="1.25" />
<Pt X="1.5" Y="1.75" />
<Pt X="0.5" Y="2.25" />
</Elem>
<Elem Kind="Move" DX="4" DY="0" />
<Elem Kind="Polygon" ShapeFilled="true">
<Pt X="0" Y="0.25" />
<Pt X="0.125" Y="1" />
<Pt X="1.25" Y="1.25" />
<Pt X="1.75" Y="0.75" />
<Pt X="1.25" Y="0.375" />
<Pt X="0.75" Y="0" />
</Elem>
<Elem Kind="Move" DX="3.5" DY="0" />
</Line>
</Fill>
<Fill Type="LineFill" Direction="0" Distance="9" Color="clFill">
<Origin X="0" Y="6.25" />
<Line Type="ElemLine">
<Elem Kind="Move" DX="0.25" DY="0" />
<Elem Kind="Polygon" ShapeFilled="true">
<Pt X="0" Y="2" />
<Pt X="0.25" Y="2.5" />
<Pt X="1" Y="2" />
<Pt X="1" Y="1.75" />
<Pt X="0.625" Y="1.5" />
<Pt X="0.25" Y="1.75" />
</Elem>
<Elem Kind="Move" DX="3.75" DY="0" />
<Elem Kind="Polygon" ShapeFilled="true">
<Pt X="0" Y="2" />
<Pt X="0.25" Y="2.25" />
<Pt X="0.75" Y="2" />
<Pt X="0.75" Y="1.5" />
<Pt X="0.25" Y="1.5" />
</Elem>
<Elem Kind="Move" DX="1.25" DY="0" />
<Elem Kind="Polygon" ShapeFilled="true">
<Pt X="0" Y="1" />
<Pt X="0" Y="1.5" />
<Pt X="0.25" Y="1.75" />
<Pt X="0.75" Y="1.75" />
<Pt X="0.75" Y="1.25" />
<Pt X="0.75" Y="1" />
<Pt X="0.375" Y="0.75" />
</Elem>
<Elem Kind="Move" DX="1.75" DY="0" />
<Elem Kind="Polygon" ShapeFilled="true">
<Pt X="0" Y="0.5" />
<Pt X="0" Y="2.5" />
<Pt X="0.5" Y="3" />
<Pt X="1.5" Y="2.75" />
<Pt X="1.75" Y="1.5" />
<Pt X="2.25" Y="1" />
<Pt X="1.75" Y="0.25" />
<Pt X="1" Y="0" />
<Pt X="0.5" Y="0.25" />
</Elem>
<Elem Kind="Move" DX="2" DY="0" />
</Line>
</Fill>
</Fill>
</HatchDefinition>
FDirection : Double; // smer vedeni car
FOrigin : TUnitsPt; // pocatek prvni cary
FDistance : TE2RandomUnitsSize; // vzdalenost mezi carami
FShift : TE2RandomUnitsSize; // posun pocatku car
FLines : TBsFastObjectList; // seznam car
FWidth : PUnitsSize; // tloustka car vyplne (NIL = pouziti DefaultPen)
FColor : TColor; // barva carove vyplne (clDefault = pouziti DefaultPen/DefaultBrush)