2 atom.cc -- implement Atom
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
11 #include "interval.hh"
15 #include "dimensions.hh"
20 Atom::check_infinity_b ()const
22 bool ridiculous = false;
25 /* infinity checks. */
26 for (int a = X_AXIS; a < NO_AXES; a++)
29 if (abs (off_[ax]) >= 100 CM)
31 warning (_f ("ridiculous dimension: %s, %s", axis_name_str (ax),
32 global_lookup_l->print_dimen (off_[ax])));
34 if (experimental_features_global_b)
37 ( (Atom*)this)->off_[ax] = 0.0;
50 DOUT << "string: " << str_ << '\n';
53 for (Axis i=X_AXIS; i < NO_AXES; incr (i))
54 DOUT << axis_name_str (i) << " = " << dim_[i].str ();
56 DOUT << "\noffset: " << off_.str ();
70 : dim_ (Interval (0,0),Interval (0,0))
74 We should probably make Atom an abstract base class to
75 derive Ps_atom and Tex_atom from.
76 But Atom is used as a simple type *everywhere*,
77 and we don't have virtual contructors.
80 str_ = global_lookup_l->unknown_str ();
83 Atom::Atom (String s, Box b)
94 return String ("Atom (\'") + str_ + "\', (" + dim_.x ().str () + ", "
95 + dim_.y ().str () + "))";
107 Atom::translate_axis (Real r, Axis a)
114 Atom::translate (Offset o)
123 return (dim_.y().length() == 0);