Ignore:
Timestamp:
05/21/12 15:28:50 (7 years ago)
Author:
svonolfe
Message:

Added color palette (#1177)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/VRP/HeuristicLab.Problems.VehicleRouting.Views/3.4/CVRPPDTWView.cs

    r6851 r7858  
    4242      IntArray pickupDeliveryLocation = Content.PickupDeliveryLocation;
    4343
    44       Pen[] pens = {new Pen(Color.FromArgb(92,20,237)), new Pen(Color.FromArgb(237,183,20)), new Pen(Color.FromArgb(237,20,219)), new Pen(Color.FromArgb(20,237,76)),
    45                     new Pen(Color.FromArgb(237,61,20)), new Pen(Color.FromArgb(115,78,26)), new Pen(Color.FromArgb(20,237,229)), new Pen(Color.FromArgb(39,101,19)),
    46                     new Pen(Color.FromArgb(230,170,229)), new Pen(Color.FromArgb(142,136,89)), new Pen(Color.FromArgb(157,217,166)), new Pen(Color.FromArgb(31,19,101)),
    47                     new Pen(Color.FromArgb(173,237,20)), new Pen(Color.FromArgb(230,231,161)), new Pen(Color.FromArgb(142,89,89)), new Pen(Color.FromArgb(93,89,142)),
    48                     new Pen(Color.FromArgb(146,203,217)), new Pen(Color.FromArgb(101,19,75)), new Pen(Color.FromArgb(198,20,237)), new Pen(Color.FromArgb(185,185,185)),
    49                     new Pen(Color.FromArgb(179,32,32)), new Pen(Color.FromArgb(18,119,115)), new Pen(Color.FromArgb(104,158,239)), new Pen(Color.Black)};
    50 
    5144      Pen flowPen = new Pen(Brushes.Red, 3);
    5245      flowPen.EndCap = System.Drawing.Drawing2D.LineCap.ArrowAnchor;
     
    6962          if (Solution != null) {
    7063            int currentTour = 0;
    71             foreach (Tour tour in Solution.GetTours()) {
     64
     65            List<Tour> tours = Solution.GetTours();
     66            List<Pen> pens = GetColors(tours.Count);
     67
     68            foreach (Tour tour in tours) {
    7269              double t = 0.0;
    7370              Point[] tourPoints = new Point[tour.Stops.Count + 2];
     
    122119
    123120              if (!drawFlow)
    124                 graphics.DrawPolygon(pens[((currentTour >= pens.Length) ? (pens.Length - 1) : (currentTour))], tourPoints);
     121                graphics.DrawPolygon(pens[currentTour], tourPoints);
    125122
    126123              for (int i = 0; i < tour.Stops.Count; i++) {
     
    142139              currentTour++;
    143140            }
     141
     142            for (int i = 0; i < pens.Count; i++)
     143              pens[i].Dispose();
    144144          } else {
    145145            {
     
    170170      }
    171171
    172       for (int i = 0; i < pens.Length; i++)
    173         pens[i].Dispose();
    174 
    175172      flowPen.Dispose();
    176173    }
Note: See TracChangeset for help on using the changeset viewer.