]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/molecule.hh
a95c3bff5c2b3b8983ccf831580dbf54ee5bfebb
[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 //#define ATOM_SMOB
20
21 /** a group of individually translated symbols. You can add molecules
22     to the top, to the right, etc.  */
23 class Molecule {
24 #ifdef ATOM_SMOB
25   SCM atom_list_;
26 #else
27   //  Protected_scm atom_list_; // change to List<Atom>?
28   Cons<Atom> *atom_list_;
29 #endif
30   friend class Paper_outputter;
31 public:
32   Box dim_;
33
34   Molecule();
35   ~Molecule();
36
37   void add_at_edge (Axis a, Direction d, const Molecule &m, Real padding);
38   
39   void add_molecule (Molecule const &m);
40   void translate (Offset);
41   void do_center (Axis);
42   void translate_axis (Real,Axis);
43   
44   void add_atom (Atom const *a);
45   /// how big is #this#? 
46   Box extent() const;
47   Interval extent (Axis) const;
48
49   Molecule (const Molecule&s);
50   void print() const;
51   void operator=(const Molecule&);  
52 };
53 #endif