just some code cosmetics
[PyX/mjg.git] / manual / connector.tex
blob696def41f6a554d9efd60039adcf4080ba285b2c
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.
6 All constructors of the following connector-classes take two
7 \class{box}-instances as first arguments. They return a
8 \class{normpath}-instance from the first to the second box, starting/ending at
9 the boxes' outline. The behaviour of the path is determined by the
10 boxes' center and some angle- and distance-keywords. The resulting \class{connector} will
11 additionally be shortened by lengths given in the \keyword{boxdists}-keyword (a
12 list of two lengths, default \code{[0,0]}).
14 \section{Class \class{line}}
16 The constructor of the \class{line} class accepts only boxes and the
17 \keyword{boxdists}-keyword.
19 \section{Class \class{arc}}
21 The constructor also takes either the \keyword{relangle}-keyword or a
22 combination of \keyword{relbulge} and \keyword{absbulge}. The ``bulge'' is the
23 meant to be a hint of the greatest distance between the connecting arc and the
24 straight connecting line. (Default: \code{relangle=45},
25 \code{relbulge=None}, \code{absbulge=None})\medskip
27 Note that the bulge-keywords override the angle-keyword. When both
28 \keyword{relbulge} and \keyword{absbulge} are given they will be added.
30 \section{Class \class{curve}}
32 The constructor takes both angle- and bulge-keywords. Here, the bulges are
33 used as distances between bezier-curve control points:\medskip
35 \keyword{absangle1} or \keyword{relangle1}\\
36 \keyword{absangle2} or \keyword{relangle2}, where the absolute angle overrides the
37 relative if both are given. (Default: \code{relangle1=45},
38 \code{relangle2=45}, \code{absangle1=None}, \code{absangle2=None})\medskip
40 \keyword{absbulge} and \keyword{relbulge}, where they will be added if both are
41 given.\\ (Default: \code{absbulge=None}, \code{relbulge=0.39}; these default
42 values produce output similar to the defaults of \class{arc}.)\medskip
44 Note that relative angle-keywords are counted in the following way:
45 \keyword{relangle1} is counted in negative direction, starting at the straight
46 connector line, and \keyword{relangle2} is counted in positive direction.
47 Therefore, the outcome with two positive relative angles will always leave the
48 straight connector at its left and will not cross it.
50 \section{Class \class{twolines}}
52 This class returns two connected straight lines. There is a vast variety of
53 combinations for angle- and length-keywords. The user has to make sure to
54 provide a non-ambiguous set of keywords:\medskip
56 \keyword{absangle1} or \keyword{relangle1} for the first angle,\\
57 \keyword{relangleM} for the middle angle and\\
58 \keyword{absangle2} or \keyword{relangle2} for the ending angle.
59 Again, the absolute angle overrides the relative if both are given. (Default:
60 all five angles are \code{None})\medskip
62 \keyword{length1} and \keyword{length2} for the lengths of the connecting lines.
63 (Default: \code{None})