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