add txt to gallery
[PyX.git] / manual / connector.tex
blob114dde30f6fca03059a7663ffafb4521f17b2727
1 \chapter{Module \module{connector}}
2 \label{connector}
4 This module provides classes for connecting two \class{box}-instances with
5 lines, arcs or curves. All constructors of the following connector-classes take
6 two \class{box}-instances as the two first arguments. They return a connecting
7 path from the first to the second box. The overall geometry of the path is such
8 that is starts/ends at the boxes' centers. It is then cut by the boxes'
9 outlines. The resulting \class{connector} will additionally be shortened by
10 lengths given in the \keyword{boxdists}-keyword (a list of two lengths, default
11 \code{[0,0]}).
13 Angle keywords can be either absolute or relative. The absolute angles refer to
14 the angle between x-axis and the running tangent of the connector, while the
15 relative angles are between the direct connecting line of the box-centers and
16 the running tangent (see figure.~\ref{fig:connector}).
18 The bulge-keywords parameterize the deviation of the connector from the
19 connecting line. It has different meanings for different connectors (see
20 figure.~\ref{fig:connector}).
22 \section{Class \class{line}}
24 The constructor of the \class{line} class accepts only boxes and the
25 \keyword{boxdists}-keyword.
27 \section{Class \class{arc}}
29 The constructor takes either the \keyword{relangle}-keyword or a
30 combination of \keyword{relbulge} and \keyword{absbulge}. The ``bulge'' is
31 meant to be a hint for the greatest distance between the connecting arc and the
32 straight connection between the box-centers. (Default: \code{relangle=45},
33 \code{relbulge=None}, \code{absbulge=None})\smallskip
35 Note that the bulge-keywords override the angle-keyword.
37 If both \keyword{relbulge} and \keyword{absbulge} are given, they will be
38 added.
40 \section{Class \class{curve}}
42 The constructor takes both angle- and bulge-keywords. Here, the bulges are
43 used as distances between the control points of the cubic Bezi\'er-curve.
44 For the signs of the angle- and bulge-keywords refer to figure~\ref{fig:connector}.
46 \keyword{absangle1} or \keyword{relangle1}\\
47 \keyword{absangle2} or \keyword{relangle2}, where the absolute angle overrides the
48 relative if both are given. (Default: \code{relangle1=45},
49 \code{relangle2=45}, \code{absangle1=None}, \code{absangle2=None})\medskip
51 \keyword{absbulge} and \keyword{relbulge}, where they will be added if both are
52 given.\\ (Default: \code{absbulge=None}, \code{relbulge=0.39}; these default
53 values produce output similar to the defaults of \class{arc}.)\medskip
56 \begin{figure}[hbt]
57 \centerline{
58 \includegraphics{connector}
60 \caption{The angle-parameters of the connector.arc (left panel) and the
61 connector.curve (right panel) classes.}
62 \label{fig:connector}
63 \end{figure}
65 \section{Class \class{twolines}}
67 This class returns two connected straight lines. There is a vast variety of
68 combinations for angle- and length-keywords. The user has to make sure to
69 provide a non-ambiguous set of keywords:\medskip
71 \keyword{absangle1} or \keyword{relangle1} for the first angle,\\
72 \keyword{relangleM} for the middle angle and\\
73 \keyword{absangle2} or \keyword{relangle2} for the ending angle.
74 Again, the absolute angle overrides the relative if both are given. (Default:
75 all five angles are \code{None})\medskip
77 \keyword{length1} and \keyword{length2} for the lengths of the connecting lines.
78 (Default: \code{None})