From e507b77c365b6e3eeda93e361200ca239eed471c Mon Sep 17 00:00:00 2001 From: fred Date: Fri, 1 Nov 1996 13:48:20 +0000 Subject: [PATCH] lilypond-0.0.9 --- hdr/molecule.hh | 52 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 hdr/molecule.hh diff --git a/hdr/molecule.hh b/hdr/molecule.hh new file mode 100644 index 0000000000..0c69f74040 --- /dev/null +++ b/hdr/molecule.hh @@ -0,0 +1,52 @@ +#ifndef MOLECULE_HH +#define MOLECULE_HH + +#include "plist.hh" +#include "boxes.hh" +#include "item.hh" +#include "symbol.hh" +/// a symbol which can be translated, and freely copied +struct Atom { + Offset off; + Symbol sym; + + void translate(Offset o) { + off += o; + } + + /// how big is #this#? + Box extent() const; + Atom(Symbol s); + + void print() const; + + String TeXstring() const; +}; + +/// a group of #Atom#s +struct Molecule { + PointerList ats; + + Molecule() { } + Molecule(Atom a) { add(a) ; } + + void add_right(const Molecule &m); + void add_left(const Molecule &m); + void add_top(const Molecule &m); + void add_bot(const Molecule &m); + void add(Molecule const &m); + void translate(Offset); + void add(Atom a) { ats.bottom().add(new Atom(a)); } + /// how big is #this#? + Box extent() const; + + String TeXstring() const; + + Molecule(const Molecule&s); + void print() const; +private: + void operator=(const Molecule&); +}; +/** a group of individually translated symbols. You can add molecules + to the top, to the right, etc. */ +#endif -- 2.39.5