001package jmri.jmrit.display.layoutEditor;
002
003import javax.annotation.Nonnull;
004
005/**
006 * A LayoutXOver corresponds to a crossover (connection between parallel tracks) on the layout. 
007 * <p>
008 * Three types are supported: double crossover,
009 * right-handed single crossover, and left-handed single crossover. 
010 * <p>
011 * A LayoutXOver has four connection points, designated A, B, C, and
012 * D. The A-B and C-D routes are a straight segment (continuing
013 * route). A-C and B-D are the diverging routes. B-C and A-D illegal conditions.
014 * <br>
015 * <pre>
016 *           Crossovers
017 * Right-hand            left-hand
018 * A ==**===== B      A ====**== B
019 *      \\                 //
020 *       \\               //
021 *  D ====**== C     D ==**===== C
022 *
023 *             Double
024 *        A ==**==**== B
025 *             \\//
026 *              XX
027 *             //\\
028 *        D ==**==**== C
029 * </pre>
030 * <p>
031 * A LayoutXOver carries Block information. A block border may
032 * occur at any connection (A,B,C,D). For a double crossover turnout, up to four
033 * blocks may be assigned, one for each connection point, but if only one block
034 * is assigned, that block applies to the entire turnout.
035 * <p>
036 * For drawing purposes, each LayoutXOver carries a center point and
037 * displacements for B and C. 
038 * For double crossovers, the center point is at the center of the turnout, and
039 * the displacement for A = - the displacement for C and the displacement for D
040 * = - the displacement for B. The center point and these displacements may be
041 * adjusted by the user when in edit mode. For double crossovers, AB and BC are
042 * constrained to remain perpendicular. For single crossovers, AB and CD are
043 * constrained to remain parallel, and AC and BD are constrained to remain
044 * parallel.
045 * <p>
046 * When LayoutXOvers are first created, a rotation (degrees) is provided. For
047 * 0.0 rotation, the turnout lies on the east-west line with A facing east.
048 * Rotations are performed in a clockwise direction.
049 * <p>
050 * When LayoutXOvers are first created, there are no connections. Block
051 * information and connections may be added when available.
052 * <p>
053 * When a LayoutXOvers is first created, it is enabled for control of an
054 * assigned actual turnout. Clicking on the turnout center point will toggle the
055 * turnout. This can be disabled via the popup menu.
056 * <p>
057 * Signal Head names are saved here to keep track of where signals are.
058 * LayoutTurnout only serves as a storage place for signal head names. The names
059 * are placed here by tools, e.g., Set Signals at Turnout, and Set Signals at
060 * Double Crossover. Each connection point can have up to three SignalHeads and one SignalMast.
061 *
062 * @author Dave Duchamp Copyright (c) 2004-2007
063 * @author George Warner Copyright (c) 2017-2019
064 */
065abstract public class LayoutXOver extends LayoutTurnout {
066
067    public LayoutXOver(@Nonnull String id, TurnoutType t, 
068            @Nonnull LayoutEditor layoutEditor, 
069            int v) {
070        super(id, t, layoutEditor, 1);
071    }
072    
073    // private final static org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(LayoutXOver.class);
074}