]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/molecule.hh
release: 1.1.31
[lilypond.git] / lily / include / molecule.hh
1 /*
2   molecule.hh -- declare Molecule
3
4   source file of the GNU LilyPond music typesetter
5
6   (c)  1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8 #ifndef MOLECULE_HH
9 #define MOLECULE_HH
10
11 #include "lily-proto.hh"
12 #include "plist.hh"
13 #include "box.hh"
14 #include "axes.hh"
15 #include "direction.hh"
16 #include "protected-scm.hh"
17 #include "cons.hh"
18
19 /** a group of individually translated symbols. You can add molecules
20     to the top, to the right, etc.  */
21 class Molecule {
22 #ifdef ATOM_SMOB
23   SCM atom_list_;
24 #else
25   //  Protected_scm atom_list_; // change to List<Atom>?
26   Cons<Atom> *atom_list_;
27 #endif
28   friend class Paper_outputter;
29 public:
30   Box dim_;
31
32   Molecule();
33   ~Molecule();
34
35   void add_at_edge (Axis a, Direction d, const Molecule &m, Real padding);
36   
37   void add_molecule (Molecule const &m);
38   void translate (Offset);
39   void do_center (Axis);
40   void translate_axis (Real,Axis);
41   
42   void add_atom (Atom const *a);
43   /// how big is #this#? 
44   Box extent() const;
45   Interval extent (Axis) const;
46
47   Molecule (const Molecule&s);
48   void print() const;
49   void operator=(const Molecule&);  
50 };
51 #endif