]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/include/score-element.hh
release: 1.2.13
[lilypond.git] / lily / include / score-element.hh
index 723cf5a2836da9079507fb18d35347677107019d..af9b484faa5f19e137d0223565779be05721d9ef 100644 (file)
@@ -9,7 +9,6 @@
 
 #include "parray.hh"
 #include "virtual-methods.hh"
-#include "directed-graph.hh"
 #include "graphical-element.hh"
 #include "lily-guile.hh"
 
@@ -106,6 +105,8 @@ public:
    */
   void calculate_dependencies (int final, int busy, Score_element_method_pointer funcptr);
 
+
+  virtual Score_element *find_broken_piece (Line_of_score*) const;
 protected:
   Score_element* dependency (int) const;
   int dependency_size () const;
@@ -113,7 +114,8 @@ protected:
   virtual void output_processing ();
   virtual Interval do_height () const;
   virtual Interval do_width () const;
-    
+
+
   /// do printing of derived info.
   virtual void do_print () const;
   /// generate the molecule    
@@ -126,6 +128,9 @@ protected:
   /// generate rods & springs
   virtual void do_space_processing ();
 
+  /// do postbreak substs on array of pointers.
+  virtual void do_substitute_arrays ();
+
   virtual void do_breakable_col_processing ();
   /// do calculations after determining horizontal spacing
   virtual void do_post_processing ();
@@ -142,5 +147,26 @@ protected:
 };
 
 
+template<class T>
+void
+substitute_element_array (Link_array<T> &arr, Line_of_score * to)
+{
+  Link_array<T> newarr;
+  for (int i =0; i < arr.size (); i++)
+    {
+      T * t = arr[i];
+      if (t->line_l () != to)
+       {
+         t = dynamic_cast<T*> (t->find_broken_piece (to));
+       }
+      
+      if (t)
+       newarr.push (t);
+    }
+  arr = newarr;
+}
+
+
+
 #endif // STAFFELEM_HH