2 atom.cc -- implement Atom
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--1998 Han-Wen Nienhuys <hanwen@stack.nl>
10 #include "interval.hh"
20 DOUT << "texstring: " <<tex_<<"\n";
23 for (Axis i=X_AXIS; i < NO_AXES; incr(i))
24 DOUT << axis_name_str(i) << " = " << dim_[i].str();
26 DOUT << "\noffset: " << off_.str ();
40 : dim_ (Interval (0,0),Interval (0,0))
45 Atom::Atom (String s, Box b)
55 return "Atom (\'"+tex_+"\', (" + dim_.x().str () + ", "
56 + dim_.y ().str () + "))";
61 Atom::check_infinity_b ()const
63 bool ridiculous = false;
66 /* infinity checks. */
67 for (int a = X_AXIS; a < NO_AXES; a++)
70 if (abs (off_[ax]) >= 100 CM)
72 warning (_("ridiculous dimension ") + axis_name_str (ax) + ", "
73 +print_dimen(off_[ax]));
74 ((Atom*)this)->off_[ax] = 0.0;
82 Atom::TeX_string() const
84 String tex_str = tex_;
85 if (check_infinity_b ())
86 tex_str += "\errormark";
88 // whugh.. Hard coded...
89 String s ("\\placebox{");
90 s += print_dimen (off_[Y_AXIS])+"}{";
91 s += print_dimen (off_[X_AXIS]) + "}{";
97 Atom::translate_axis (Real r, Axis a)
104 Atom::translate (Offset o)