void
Horizontal_vertical_group_item::do_print()const
{
- Horizontal_vertical_group::do_print();
+ Horizontal_vertical_group_element::do_print();
}
-IMPLEMENT_IS_TYPE_B2(Horizontal_vertical_group_item,Horizontal_vertical_group,Item);
+IMPLEMENT_IS_TYPE_B2(Horizontal_vertical_group_item,Horizontal_vertical_group_element,Item);
#include "p-col.hh"
#include "horizontal-group-item.hh"
-IMPLEMENT_IS_TYPE_B2(Horizontal_group_item, Horizontal_group, Item);
+IMPLEMENT_IS_TYPE_B2(Horizontal_group_item, Horizontal_group_element, Axis_group_item);
void
-Horizontal_group_item::OK() const
-{
- for (int i=0; i < elem_l_arr_.size(); i++) {
- Item * it_l = elem_l_arr_[i]->item();
-
- assert(it_l&& it_l->pcol_l_ == pcol_l_ );
- }
-}
-
-void
-Horizontal_group_item::do_breakable_col_processing()
-{
- if (!pcol_l_->breakable_b())
- return;
- OK();
- copy_breakable_items();
-
- Link_array<Score_elem> elems = elem_l_arr_;
-
- for (int i=0; i < elems.size(); i++) {
- Item* it_l = elems[i]->item();
- for ( int j=0; j < 2; j++) {
- Item *new_l = it_l->find_prebroken_piece(broken_to_a_[j]->pcol_l_);
- ((Horizontal_group_item*)broken_to_a_[j])->add_element( new_l );
- }
- }
+Horizontal_group_item::do_print() const
+{
+ Axis_group_item::do_print();
}
--- /dev/null
+/*
+ axis-item.hh -- declare Axis_group_item
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef AXIS_ITEM_HH
+#define AXIS_ITEM_HH
+
+#include "axis-group.hh"
+#include "item.hh"
+
+/**
+ A grouping item. Its special support is in do_breakable_col_processing().
+ */
+
+class Axis_group_item : public virtual Axis_group_element, public Item {
+protected:
+ virtual void do_breakable_col_processing();
+ void OK()const;
+ virtual void do_print() const;
+public:
+ DECLARE_MY_RUNTIME_TYPEINFO;
+
+};
+
+#endif // AXIS_ITEM_HH
#define BAR_HH
#include "item.hh"
/**
+ A vertical bar.
+
TODO: connections with pre and postbreak
*/
class Bar:public Item {
#ifndef ELEM_GROUP_ITEM_HH
#define ELEM_GROUP_ITEM_HH
+#include "axis-group-item.hh"
#include "elem-group.hh"
-#include "item.hh"
-class Horizontal_vertical_group_item : public Item, public Horizontal_vertical_group {
+
+/**
+ Treat a collection of items as a unity
+ */
+class Horizontal_vertical_group_item : public Axis_group_item, public Horizontal_vertical_group_element {
+protected:
+ virtual void do_print() const;
+ virtual void remove_all() { Horizontal_vertical_group_element::remove_all(); }
public:
+ virtual void add_element(Score_elem*e) { Horizontal_vertical_group_element::add_element(e); }
+ virtual void remove_element(Score_elem*e) { Horizontal_vertical_group_element::remove_element(e); }
+
DECLARE_MY_RUNTIME_TYPEINFO;
SCORE_ELEM_CLONE(Horizontal_vertical_group_item);
-protected:
- virtual void do_print() const;
+
+
};
#endif // ELEM_GROUP_ITEM_HH
#define HORIZONTAL_GROUP_ITEM_HH
#include "elem-group.hh"
-#include "item.hh"
+#include "axis-group-item.hh"
-class Horizontal_group_item : public Item, public Horizontal_group {
+class Horizontal_group_item : public Axis_group_item, public Horizontal_group_element {
+protected:
+ virtual void remove_all() { Horizontal_group_element::remove_all(); }
+ virtual void do_print() const;
+public:
+ virtual void add_element(Score_elem*e) { Horizontal_group_element::add_element(e); }
+ virtual void remove_element(Score_elem*e) { Horizontal_group_element::remove_element(e); }
DECLARE_MY_RUNTIME_TYPEINFO;
SCORE_ELEM_CLONE(Horizontal_group_item);
-protected:
- virtual void do_breakable_col_processing();
- void OK()const;
- virtual void do_print() const { Elbement_group::do_print(); }
+
+
};
#endif // HORIZONTAL_GROUP_ITEM_HH
#include "spanner.hh"
#include "elem-group.hh"
-class Spanner_elem_group : public Spanner, public Horizontal_vertical_group {
+class Spanner_elem_group : public Spanner, public Horizontal_vertical_group_element {
protected:
virtual Interval do_width()const;
#ifndef SPAN_VERTICAL_GROUP_HH
#define SPAN_VERTICAL_GROUP_HH
-#include "spanner.hh"
+#include "axis-group-spanner.hh"
#include "elem-group.hh"
-/** An element which groups a line. Due to technical problems, this
- cannot be used as a baseclass */
-class Vertical_group_spanner : public Spanner, public Vertical_group
+/** An element which groups a line.
+ */
+class Vertical_group_spanner : public Axis_group_spanner, public Vertical_group_element
{
protected:
- virtual void do_break_processing();
- virtual void do_print()const;
- VIRTUAL_COPY_CONS(Vertical_group_spanner, Score_elem);
-
-private:
- void remove_all();
- /// shouldn't be copied.
- Vertical_group_spanner(Vertical_group_spanner const&);
-
+ SCORE_ELEM_CLONE(Vertical_group_spanner);
+ virtual void remove_all() { Vertical_group_element::remove_all(); }
public:
- Vertical_group_spanner();
DECLARE_MY_RUNTIME_TYPEINFO;
+ virtual void add_element(Score_elem*e) { Vertical_group_element::add_element(e); }
+ virtual void remove_element(Score_elem*e) { Vertical_group_element::remove_element(e); }
+
};
#endif // SPAN_VERTICAL_GROUP_HH
-IMPLEMENT_IS_TYPE_B2(Spanner_elem_group,Spanner,Horizontal_vertical_group);
+IMPLEMENT_IS_TYPE_B2(Spanner_elem_group,Spanner,Horizontal_vertical_group_element);
Interval
Spanner_elem_group::do_width() const
{
#ifndef NPRINT
Spanner::do_print();
- Horizontal_vertical_group::do_print();
+ Horizontal_vertical_group_element::do_print();
#endif
}
Vertical_align_engraver::acknowledge_element(Score_elem_info i)
{
if ( i.origin_grav_l_arr_.size() == 2 &&
- i.elem_l_->is_type_b(Vertical_group::static_name()) &&
- !i.elem_l_->y_group_l_ ) {
+ i.elem_l_->is_type_b(Vertical_group_element::static_name()) &&
+ !i.elem_l_->axis_group_l_a_[Y_AXIS] ) {
assert( !valign_p_->contains_b( i.elem_l_) );
valign_p_->add ( i.elem_l_ );
#include "item.hh"
#include "p-col.hh"
-/**
- Uncouple all elements of this Vertical_group. Ugh!
- */
-void
-Vertical_group_spanner::remove_all()
-{
- for (int i=0; i < elem_l_arr_.size(); i++){
- elem_l_arr_[i]->y_group_l_ = 0;
- }
- elem_l_arr_.set_size(0);
- junk_dependencies();
-}
-
-void
-Vertical_group_spanner::do_break_processing()
-{
- set_my_columns();
- if ( line_l() ) {
- return;
- }
- break_into_pieces( false );
-
- Link_array<Score_elem> elem_l_arr = elem_l_arr_;
- remove_all();
-
-
-
- for (int i=0; i < elem_l_arr.size(); i++) {
- Score_elem * elt = elem_l_arr[i];
- Line_of_score *elt_line = elt->line_l();
-
- if ( elt-> y_group_l_ )
- continue;
-
- if ( ! elt_line ){
- if (elt->spanner()) {
- Spanner * sp = elt->spanner();
-
- for (int j =0; j < broken_into_l_arr_.size(); j++) {
- Vertical_group_spanner * my_broken_l
- = (Vertical_group_spanner*)broken_into_l_arr_[j];
-
- Spanner * broken_span_l
- = sp->find_broken_piece(my_broken_l->line_l());
-
- if (broken_span_l) {
- my_broken_l->add_element(broken_span_l );
- }
- }
- } else if (elt->item() && elt->item()->pcol_l_->breakpoint_b()
- && elt->item()->break_status_i() == 0) {
- for (int j =0; j < 2; j++) {
- Item * my_item = elt->item()->broken_to_a_[j];
- Line_of_score * item_line_l_ = my_item->line_l() ;
- if ( ! item_line_l_ )
- continue;
-
- Vertical_group_spanner * v
- = (Vertical_group_spanner*)find_broken_piece( item_line_l_);
- if (v) {
- v->add_element( my_item );
- }
- }
- }
- } else {
- Vertical_group_spanner * my_broken_l
- = (Vertical_group_spanner*)find_broken_piece( elt->line_l() );
- my_broken_l->add_element( elt );
- }
- }
- for (int j =0; j < broken_into_l_arr_.size(); j++)
- broken_into_l_arr_[j]->break_processing();
-}
-
-Vertical_group_spanner::Vertical_group_spanner()
-{
-}
-
-void
-Vertical_group_spanner::do_print() const
-{
- Vertical_group::do_print();
-}
-
-
-
-IMPLEMENT_IS_TYPE_B2(Vertical_group_spanner, Spanner, Vertical_group);
-
-Vertical_group_spanner::Vertical_group_spanner(Vertical_group_spanner const &s)
- : Spanner(s), Vertical_group(s)
-{
-}
+IMPLEMENT_IS_TYPE_B2(Vertical_group_spanner, Axis_group_spanner, Vertical_group_element);