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>
10 #include "dimension.hh"
12 #include "molecule.hh"
18 Molecule::extent() const
21 for (iter_top (atoms_,c); c.ok(); c++)
22 b.unite (c->extent());
27 Molecule::translate (Offset o)
29 for (iter_top (atoms_,c); c.ok(); c++)
34 Molecule::translate_axis (Real x,Axis a)
36 for (iter_top (atoms_,c); c.ok(); c++)
37 c->translate_axis (x,a);
41 Molecule::add_molecule (Molecule const &m)
43 for (iter_top (m.atoms_,c); c.ok(); c++)
51 Molecule::add_at_edge (Axis a, Direction d, Molecule const &m)
58 Real offset = extent ()[a][d] - m.extent ()[a][-d];
60 toadd.translate_axis (offset, a);
67 Molecule::operator = (Molecule const &)
72 Molecule::Molecule (Molecule const &s)
78 Molecule::print() const
83 for (iter_top (atoms_,c); c.ok(); c++)
89 Molecule::add_atom (Atom const &a)
91 atoms_.bottom().add (new Atom (a));
94 Molecule::Molecule (Atom const &a)