2 molecule.cc -- implement Molecule
4 source file of the GNU LilyPond music typesetter
6 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
12 #include "molecule.hh"
21 Molecule::TeX_string() const
24 for(iter_top(ats,c); c.ok(); c++)
30 Molecule::extent() const
33 for(iter_top(ats,c); c.ok(); c++)
39 Molecule::translate(Offset o)
41 for (iter_top(ats,c); c.ok(); c++)
46 Molecule::translate_x(Real x)
48 translate(Offset(x,0));
52 Molecule::translate_y(Real y)
54 translate(Offset(0,y));
58 Molecule::add(Molecule const &m)
60 for (iter_top(m.ats,c); c.ok(); c++) {
66 Molecule::add_right(Molecule const &m)
72 Real xof=extent().x.right - m.extent().x.left;
74 toadd.translate(Offset(xof, 0.0));
79 Molecule::add_left(Molecule const &m)
85 Real xof=extent().x.left - m.extent().x.right;
87 toadd.translate(Offset(xof, 0.0));
93 Molecule::add_top(Molecule const &m)
99 Real yof=extent().y.right - m.extent().y.left;
101 toadd.translate_y(yof);
106 Molecule::add_bottom(Molecule const &m)
112 Real yof=extent().y.left- m.extent().y.right;
114 toadd.translate_y(yof);
119 Molecule::operator = (Molecule const &)
124 Molecule::Molecule(Molecule const &s)
130 Molecule::print() const
132 for (iter_top(ats,c); c.ok(); c++)
137 Molecule::add(Atom const &a)
139 ats.bottom().add(new Atom(a));