Free cookie consent management tool by TermsFeed Policy Generator

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

Added color palette (#1177)

File:
1 edited

Legend:

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

    r6851 r7858  
    2828      BoolValue useDistanceMatrix = Content.UseDistanceMatrix;
    2929
    30       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)),
    31                     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)),
    32                     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)),
    33                     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)),
    34                     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)),
    35                     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)};
    36 
    37 
    3830      if ((coordinates != null) && (coordinates.Rows > 0) && (coordinates.Columns == 2)) {
    3931        double xMin = double.MaxValue, yMin = double.MaxValue, xMax = double.MinValue, yMax = double.MinValue;
     
    5850
    5951            int currentTour = 0;
    60             foreach (Tour tour in Solution.GetTours()) {
     52
     53            List<Tour> tours = Solution.GetTours();
     54            List<Pen> pens = GetColors(tours.Count);
     55
     56            foreach (Tour tour in tours) {
    6157              Point[] tourPoints = new Point[tour.Stops.Count + 2];
    6258              Brush[] customerBrushes = new Brush[tour.Stops.Count];
     
    9389              }
    9490
    95               graphics.DrawPolygon(pens[((currentTour >= pens.Length) ? (pens.Length - 1) : (currentTour))], tourPoints);
     91              graphics.DrawPolygon(pens[currentTour], tourPoints);
    9692
    9793              for (int i = 0; i < tour.Stops.Count; i++) {
     
    10399              currentTour++;
    104100            }
     101
     102            for (int i = 0; i < pens.Count; i++)
     103              pens[i].Dispose();
    105104          } else {
    106105            Point locationPoint;
     
    121120        }
    122121      }
    123 
    124       for (int i = 0; i < pens.Length; i++)
    125         pens[i].Dispose();
    126122    }
    127123  }
Note: See TracChangeset for help on using the changeset viewer.