Let the other namespaces in!
[shapes.git] / doc / parts / extensions / Shapes-Graphics-metapostarrow.sxml
blob18372d0c0f57f985e804a3efb04c5bfc8672e9a2
1 <?xml version="1.0" encoding="UTF-8"?>
2 <?xml-stylesheet type="text/xsl" href="formats/html.xsl"?>
4 <!-- This file is part of Shapes. -->
5 <!-- -->
6 <!-- Shapes is free software: you can redistribute it and/or modify -->
7 <!-- it under the terms of the GNU General Public License as published by -->
8 <!-- the Free Software Foundation, either version 3 of the License, or -->
9 <!-- any later version. -->
10 <!-- -->
11 <!-- Shapes is distributed in the hope that it will be useful, -->
12 <!-- but WITHOUT ANY WARRANTY; without even the implied warranty of -->
13 <!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -->
14 <!-- GNU General Public License for more details. -->
15 <!-- -->
16 <!-- You should have received a copy of the GNU General Public License -->
17 <!-- along with Shapes. If not, see <http://www.gnu.org/licenses/>. -->
18 <!-- -->
19 <!-- Copyright 2008, 2014, 2015 Henrik Tidefelt -->
22 <book>
23 <namespace>..Shapes..Graphics</namespace>
24 <extension>metapostarrow</extension>
25 <description>
26 <p>Arrowheads available through the prelude.</p>
27 </description>
28 <prelude />
29 <needs></needs>
31 <title><self /></title>
32 <meta-selflink><self-href /></meta-selflink>
33 <up-link><parent-namespace /></up-link>
34 <base href=<!--#expand-next-string-->"$(BASE)" />
35 <examples-home href=<!--#expand-next-string-->"$(EXAMPLES)" />
36 <shapes-version number=<!--#expand-next-string-->"$(SHAPES_VERSION)" />
37 <external>
38 <!--#include virtual="^/toc.xml" -->
39 </external>
41 <top>
42 <alphabetical-index/>
43 <p>Please refer to <a extension="arrowheads" /> for an introduction to arrowheads.</p>
44 </top>
46 <section id="extensions/arrowheads/2D">
47 <title>Arrowheads in <str-2D /></title>
48 <body>
49 <p>This arrowhead is for use in <str-2D />.</p>
51 <system-binding name="MetaPostArrow">
52 <function>
53 <case>
54 <arguments>
55 <arg identifier="p">
56 <type><named-type name="Path" /></type>
57 </arg>
58 <arg identifier="ahLength">
59 <type><named-type name="Length" /></type>
60 <default><value name="void" /></default>
61 </arg>
62 <arg identifier="ahAngle">
63 <type><named-type name="Float" /></type>
64 <default><eq>30°</eq></default>
65 </arg>
66 <arg identifier="fillAsStroking">
67 <type><named-type name="Boolean" /></type>
68 <default><eq><const-true /></eq></default>
69 </arg>
70 </arguments>
71 <result>
72 <type>
73 <structure-type>
74 <field name="picture"><type><named-type name="Drawable" /></type></field>
75 <field name="cut"><type><named-type name="Length" /></type></field>
76 </structure-type>
77 </type>
78 </result>
79 <dynamic-references>Whole graphics state</dynamic-references>
80 <description>
81 <p>As the name of this function indicates, this arrowhead design is borrowed from <str-MetaPost />, although there are differences. The main idea with the design is that the arrowhead should bend with the path, please refer to the canonical illustration on the <str-MetaPost /> <a href="http://ect.bell-labs.com/who/hobby/MetaPost.html">home page</a>. The argument <arg name="ahLength" /> suggests how long the arrowhead should be (this will only be overridden in exceptional cases when the path is too short). If it is not provided, its value will be computed based on the width of the stroke and <arg name="ahAngle" /> — exactly how will remain subject to change for some time. <arg name="ahAngle" /> is the angle at the tip of the arrowhead. When <arg name="fillAsStroking" /> is true, the fill color of the arrowhead will be <dynamic name="stroking" /> instead of <dynamic name="nonstroking" />.</p>
82 </description>
83 </case>
84 </function>
85 </system-binding>
87 </body>
88 </section> <!-- End of -->
91 <section id="extensions/arrowheads/3D">
92 <title>Arrowheads in <str-3D /></title>
93 <body>
94 <p>This arrowhead is for use in <str-3D />.</p>
96 <system-binding name="MetaPostArrow3D">
97 <function>
98 <case>
99 <arguments>
100 <arg identifier="normal">
101 <type><named-type name="FloatTriple" /></type>
102 </arg>
103 <arg identifier="p">
104 <type><named-type name="Path3D" /></type>
105 </arg>
106 <arg identifier="ahLength">
107 <type><named-type name="Length" /></type>
108 <default><value name="void" /></default>
109 </arg>
110 <arg identifier="ahAngle">
111 <type><named-type name="Float" /></type>
112 <default><eq>30°</eq></default>
113 </arg>
114 <arg identifier="fillAsStroking">
115 <type><named-type name="Boolean" /></type>
116 <default><eq><const-true /></eq></default>
117 </arg>
118 </arguments>
119 <result>
120 <type>
121 <structure-type>
122 <field name="picture"><type><named-type name="Drawable3D" /></type></field>
123 <field name="cut"><type><named-type name="Length" /></type></field>
124 </structure-type>
125 </type>
126 </result>
127 <dynamic-references>Whole graphics state</dynamic-references>
128 <description>
129 <p>This is a generalization of <value name="MetaPostArrow" /> to <str-3D /> (let us not look closer at what this really means). Note that the mandatory <arg name="normal" /> means that this function is not a <named-type name="ArrowHead3D" /> until this argument has been bound.</p>
130 <p>Please refer to the discussion about <str-3D /> arrowheads in <a extension="arrowheads" id="extensions/arrowheads/3D"/> for ways to avoid the need to specify the surface normal.</p>
131 </description>
132 </case>
133 </function>
134 </system-binding>
136 </body>
137 </section> <!-- End of -->
139 </book>