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::translate (Offset o)
27 for (iter_top (atoms_,c); c.ok(); c++)
32 Molecule::translate_axis (Real x,Axis a)
34 for (iter_top (atoms_,c); c.ok(); c++)
35 c->translate_axis (x,a);
39 Molecule::add_molecule (Molecule const &m)
41 for (iter_top (m.atoms_,c); c.ok(); c++)
49 Molecule::add_at_edge (Axis a, Direction d, Molecule const &m)
56 Real offset = extent ()[a][d] - m.extent ()[a][-d];
58 toadd.translate_axis (offset, a);
65 Molecule::operator = (Molecule const &)
70 Molecule::Molecule (Molecule const &s)
76 Molecule::print() const
81 for (iter_top (atoms_,c); c.ok(); c++)
87 Molecule::add_atom (Atom const &a)
89 atoms_.bottom().add (new Atom (a));
92 Molecule::Molecule (Atom const &a)