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"
18 Molecule::TeX_string() const
21 for(iter_top(ats,c); c.ok(); c++)
27 Molecule::extent() const
30 for(iter_top(ats,c); c.ok(); c++)
36 Molecule::translate(Offset o)
38 for (iter_top(ats,c); c.ok(); c++)
43 Molecule::translate(Real x,Axis a)
45 for (iter_top(ats,c); c.ok(); c++)
50 Molecule::add(Molecule const &m)
52 for (iter_top(m.ats,c); c.ok(); c++) {
58 Molecule::add_right(Molecule const &m)
64 Real xof=extent().x().right - m.extent().x().left;
68 toadd.translate(Offset(xof, 0.0));
73 Molecule::add_left(Molecule const &m)
79 Real xof=extent().x().left - m.extent().x().right;
82 toadd.translate(Offset(xof, 0.0));
88 Molecule::add_top(Molecule const &m)
94 Real yof=extent().y().right - m.extent().y().left;
97 toadd.translate(yof, Y_AXIS);
102 Molecule::add_bottom(Molecule const &m)
108 Real yof=extent().y().left- m.extent().y().right;
110 toadd.translate(yof, Y_AXIS);
115 Molecule::operator = (Molecule const &)
120 Molecule::Molecule(Molecule const &s)
126 Molecule::print() const
131 for (iter_top(ats,c); c.ok(); c++)
137 Molecule::add(Atom const &a)
139 ats.bottom().add(new Atom(a));