Exemple #1
0
 /// <summary>
 /// Converts a Label to a Line label (that is, one with no side Locations).
 /// </summary>
 /// <param name="label">Label to convert.</param>
 /// <returns>Label as Line label.</returns>
 public static Label ToLineLabel(Label label)
 {
     Label lineLabel = new Label(Locations.Null);
     for (int i = 0; i < 2; i++) 
         lineLabel.SetLocation(i, label.GetLocation(i));            
     return lineLabel;
 }
        /// <summary> 
        /// Compute the labelling for all dirEdges in this star, as well
        /// as the overall labelling.
        /// </summary>
        /// <param name="geom"></param>
        public override void ComputeLabelling(GeometryGraph[] geom)
        {        
            base.ComputeLabelling(geom);

            // determine the overall labelling for this DirectedEdgeStar
            // (i.e. for the node it is based at)
            _label = new Label(Locations.Null);
            IEnumerator it = GetEnumerator();
            while(it.MoveNext()) 
            {
                EdgeEnd ee = (EdgeEnd)it.Current;
                Edge e = ee.Edge;
                Label eLabel = e.Label;
                for (int i = 0; i < 2; i++) 
                {
                    Locations eLoc = eLabel.GetLocation(i);
                    if (eLoc == Locations.Interior || eLoc == Locations.Boundary)
                        _label.SetLocation(i, Locations.Interior);
                }
            }        
        }