]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/skyline.cc
* scm/define-grobs.scm (all-grob-descriptions): set
[lilypond.git] / lily / skyline.cc
index 09ff410cda734189ad1c07f2536a8a7f475bb4e1..f72ea5b2f6d5fcbf8c6cdf229d62077373b90c39 100644 (file)
@@ -42,7 +42,7 @@ const Real EPS = 1e-12;
   binsearch.
 */
 void
-insert_extent_into_skyline (std::vector<Skyline_entry> *line, Box b, Axis line_axis,
+insert_extent_into_skyline (vector<Skyline_entry> *line, Box b, Axis line_axis,
                            Direction d)
 {
   Interval extent = b[line_axis];
@@ -56,35 +56,35 @@ insert_extent_into_skyline (std::vector<Skyline_entry> *line, Box b, Axis line_a
   */
   for (vsize i = line->size (); i--;)
     {
-      Interval w = line->elem (i).width_;
+      Interval w = line->at (i).width_;
       w.intersect (extent);
 
       if (extent[LEFT] >= w[RIGHT])
        break;
 
-      Real my_height = line->elem (i).height_;
+      Real my_height = line->at (i).height_;
 
       if (!w.is_empty ()
          && w.length () > EPS
          && d * (my_height - stick_out) < 0)
        {
-         Interval e1 (line->elem (i).width_[LEFT], extent[LEFT]);
-         Interval e3 (extent[RIGHT], line->elem (i).width_[RIGHT]);
+         Interval e1 (line->at (i).width_[LEFT], extent[LEFT]);
+         Interval e3 (extent[RIGHT], line->at (i).width_[RIGHT]);
 
          if (!e3.is_empty () && e3.length () > EPS)
-           line->insert (Skyline_entry (e3, my_height), i + 1);
+           line->insert (line->begin () + i + 1, Skyline_entry (e3, my_height));
 
-         line->elem_ref (i).height_ = stick_out;
-         line->elem_ref (i).width_ = w;
+         line->at (i).height_ = stick_out;
+         line->at (i).width_ = w;
          if (!e1.is_empty () && e1.length () > EPS)
-           line->insert (Skyline_entry (e1, my_height), i);
+           line->insert (line->begin () + i, Skyline_entry (e1, my_height));
        }
     }
 }
 
 void
-merge_skyline (std::vector<Skyline_entry> *a1,
-              std::vector<Skyline_entry> const &a2,
+merge_skyline (vector<Skyline_entry> *a1,
+              vector<Skyline_entry> const &a2,
               Direction dir)
 {
   for (vsize i = 0; i < a2.size (); i++)
@@ -98,10 +98,10 @@ merge_skyline (std::vector<Skyline_entry> *a1,
     }
 }
 
-std::vector<Skyline_entry>
+vector<Skyline_entry>
 empty_skyline (Direction d)
 {
-  std::vector<Skyline_entry> skyline;
+  vector<Skyline_entry> skyline;
 
   Interval i;
   i.set_empty ();
@@ -113,11 +113,11 @@ empty_skyline (Direction d)
   return skyline;
 }
 
-std::vector<Skyline_entry>
-extents_to_skyline (std::vector<Box> const &extents, Axis a, Direction d)
+vector<Skyline_entry>
+extents_to_skyline (vector<Box> const &extents, Axis a, Direction d)
 {
 
-  std::vector<Skyline_entry> skyline = empty_skyline (d);
+  vector<Skyline_entry> skyline = empty_skyline (d);
 
   /*
     This makes a cubic algorithm (array  insertion is O (n),
@@ -139,8 +139,8 @@ extents_to_skyline (std::vector<Box> const &extents, Axis a, Direction d)
   This is an O (n) algorithm.
 */
 Real
-skyline_meshing_distance (std::vector<Skyline_entry> const &buildings,
-                         std::vector<Skyline_entry> const &clouds)
+skyline_meshing_distance (vector<Skyline_entry> const &buildings,
+                         vector<Skyline_entry> const &clouds)
 {
   int i = buildings.size () -1;
   int j = clouds.size () -1;
@@ -176,14 +176,14 @@ Skyline_entry::Skyline_entry (Interval i, Real r)
 }
 
 void
-heighten_skyline (std::vector<Skyline_entry> *buildings, Real ground)
+heighten_skyline (vector<Skyline_entry> *buildings, Real ground)
 {
   for (vsize i = 0; i < buildings->size (); i++)
-    buildings->elem_ref (i).height_ += ground;
+    buildings->at (i).height_ += ground;
 }
 
 Real
-skyline_height (std::vector<Skyline_entry> const &buildings,
+skyline_height (vector<Skyline_entry> const &buildings,
                Real airplane,
                Direction sky_dir)
 {