]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/skyline.hh
trim duplicate headers.
[lilypond.git] / lily / include / skyline.hh
1 /*
2   skyline.hh -- declare Skyline class.
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 2006 Joe Neeman <joeneeman@gmail.com>
7 */
8
9 #ifndef SKYLINE_HH
10 #define SKYLINE_HH
11
12 #include <list>
13
14 #include "axis.hh"
15 #include "box.hh"
16 #include "interval.hh"
17 #include "direction.hh"
18 #include "std-vector.hh"
19 #include "stencil.hh"
20
21 struct Building
22 {
23   Interval iv_;
24   Real start_height_;
25   Real end_height_;
26   Real m_;
27   Real b_;
28
29   Building (Real start, Real start_height, Real end_height, Real end, Real max_slope);
30
31   Real height (Real x) const;
32   Real intersection (Building const &other) const;
33   void leading_part (Real chop, Real h);
34   bool obstructs (Building const &other) const;
35 };
36
37 class Skyline
38 {
39 private:
40   list<Building> buildings_;
41   Direction sky_;
42   Real max_slope_;
43   void internal_merge_skyline (list<Building>*, list<Building>*,
44                                list<Building> *const result);
45   void internal_build_skyline (list<Building>*,
46                                list<Building> *const result);
47   bool is_legal_skyline () const;
48
49 public:
50   Skyline ();
51   Skyline (Direction sky);
52   Skyline (vector<Box> const &bldgs, Axis a, Direction sky);
53
54   void merge (Skyline const &);
55   void insert (Box const &, Axis);
56   void raise (Real);
57   Real distance (Skyline const &) const;
58   Real height (Real airplane) const;
59   Real max_height () const;
60   void set_minimum_height (Real height);
61   Stencil stencil ();
62 };
63
64 #endif /* SKYLINE_HH */
65