2 molecule.cc -- implement Molecule
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
11 #include "molecule.hh"
16 Molecule::extent() const
19 for (iter_top (atoms_,c); c.ok(); c++)
20 b.unite (c->extent());
25 Molecule::extent(Axis a) const
28 for (iter_top (atoms_,c); c.ok(); c++)
29 i.unite (c->extent(a));
34 Molecule::translate (Offset o)
36 for (iter_top (atoms_,c); c.ok(); c++)
41 Molecule::translate_axis (Real x,Axis a)
43 for (iter_top (atoms_,c); c.ok(); c++)
44 c->translate_axis (x,a);
48 Molecule::add_molecule (Molecule const &m)
50 for (iter_top (m.atoms_,c); c.ok(); c++)
58 Molecule::add_at_edge (Axis a, Direction d, Molecule const &m, Real padding)
60 Real my_extent= atoms_.size()
64 Real offset = my_extent - m.extent ()[a][-d];
66 toadd.translate_axis (offset + d * padding, a);
73 Molecule::operator = (Molecule const &)
78 Molecule::Molecule (Molecule const &s)
84 Molecule::print() const
89 for (iter_top (atoms_,c); c.ok(); c++)
95 Molecule::add_atom (Atom const &a)
97 atoms_.bottom().add (new Atom (a));
100 Molecule::Molecule (Atom const &a)