LEFT | RIGHT |
1 /* | 1 /* |
2 This file is part of LilyPond, the GNU music typesetter. | 2 This file is part of LilyPond, the GNU music typesetter. |
3 | 3 |
4 Copyright (C) 2006--2012 Joe Neeman <joeneeman@gmail.com> | 4 Copyright (C) 2006--2012 Joe Neeman <joeneeman@gmail.com> |
5 | 5 |
6 LilyPond is free software: you can redistribute it and/or modify | 6 LilyPond is free software: you can redistribute it and/or modify |
7 it under the terms of the GNU General Public License as published by | 7 it under the terms of the GNU General Public License as published by |
8 the Free Software Foundation, either version 3 of the License, or | 8 the Free Software Foundation, either version 3 of the License, or |
9 (at your option) any later version. | 9 (at your option) any later version. |
10 | 10 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 void print () const; | 43 void print () const; |
44 | 44 |
45 Real height (Real x) const; | 45 Real height (Real x) const; |
46 Real intersection_x (Building const &other) const; | 46 Real intersection_x (Building const &other) const; |
47 void leading_part (Real chop); | 47 void leading_part (Real chop); |
48 bool conceals (Building const &other, Real x) const; | 48 bool conceals (Building const &other, Real x) const; |
49 Real shift_to_intersect (Real x, Real y) const; | 49 Real shift_to_intersect (Real x, Real y) const; |
50 Interval overlapping_shift_interval (Building const &other) const; | 50 Interval overlapping_shift_interval (Building const &other) const; |
51 }; | 51 }; |
52 | 52 |
53 enum Skyline_intersection_info | |
54 { | |
55 INTERSECTS, | |
56 ALWAYS_GREATER, | |
57 ALWAYS_LESS, | |
58 NOT_ENOUGH_INFO | |
59 }; | |
60 | |
61 class Skyline | 53 class Skyline |
62 { | 54 { |
63 private: | 55 private: |
64 list<Building> buildings_; | 56 list<Building> buildings_; |
65 Direction sky_; | 57 Direction sky_; |
66 | 58 |
67 void internal_merge_skyline (list<Building>*, list<Building>*, | 59 void internal_merge_skyline (list<Building> *, list<Building> *, |
68 list<Building> *const result) const; | 60 list<Building> *const result) const; |
69 list<Building> internal_build_skyline (list<Building>*) const; | 61 list<Building> internal_build_skyline (list<Building> *) const; |
70 Real internal_distance (Skyline const &, Real horizon_padding, Real *touch_poi
nt) const; | 62 Real internal_distance (Skyline const &, Real horizon_padding, Real *touch_poi
nt) const; |
71 Real internal_distance (Skyline const &, Real *touch_point) const; | 63 Real internal_distance (Skyline const &, Real *touch_point) const; |
72 void normalize (); | 64 void normalize (); |
73 | 65 |
74 DECLARE_SIMPLE_SMOBS (Skyline); | 66 DECLARE_SIMPLE_SMOBS (Skyline); |
75 | 67 |
76 public: | 68 public: |
77 Skyline (); | 69 Skyline (); |
78 Skyline (Skyline const &src); | 70 Skyline (Skyline const &src); |
79 Skyline (Direction sky); | 71 Skyline (Direction sky); |
80 Skyline (vector<Box> const &bldgs, Axis a, Direction sky); | 72 Skyline (vector<Box> const &bldgs, Axis a, Direction sky); |
81 Skyline (vector<Drul_array<Offset> > const &bldgs, Axis a, Direction sky); | 73 Skyline (vector<Drul_array<Offset> > const &bldgs, Axis a, Direction sky); |
82 Skyline (vector<Skyline_pair> const &skypairs, Direction sky); | 74 Skyline (vector<Skyline_pair> const &skypairs, Direction sky); |
83 Skyline (Box const &b, Axis a, Direction sky); | 75 Skyline (Box const &b, Axis a, Direction sky); |
84 | 76 |
85 vector<Offset> to_points (Axis) const; | 77 vector<Offset> to_points (Axis) const; |
86 void deholify (); | 78 void deholify (); |
87 void merge (Skyline const &); | 79 void merge (Skyline const &); |
88 void insert (Box const &, Axis); | 80 void insert (Box const &, Axis); |
89 void print () const; | 81 void print () const; |
90 void print_points () const; | 82 void print_points () const; |
91 void raise (Real); | 83 void raise (Real); |
92 void shift (Real); | 84 void shift (Real); |
93 void invert (); | 85 void invert (); |
94 Skyline_intersection_info intersects (Skyline const &) const; | |
95 Real distance (Skyline const &, Real horizon_padding = 0) const; | 86 Real distance (Skyline const &, Real horizon_padding = 0) const; |
96 Real smallest_shift (Skyline const &, Direction d, | 87 Real smallest_shift (Skyline const &, Direction d, |
97 Real horizon_padding = 0, | 88 Real horizon_padding = 0, |
98 Real vertical_padding = 0) const; | 89 Real vertical_padding = 0) const; |
99 Real touching_point (Skyline const &, Real horizon_padding = 0) const; | 90 Real touching_point (Skyline const &, Real horizon_padding = 0) const; |
100 Real shift_to_avoid (Skyline const &other, Real, Direction d, Real horizon_pad
ding = 0); | 91 Real shift_to_avoid (Skyline const &other, Real, Direction d, Real horizon_pad
ding = 0); |
101 Real raise_to_avoid (Skyline const &other, Real, Direction d, Real horizon_pad
ding = 0); | 92 Real raise_to_avoid (Skyline const &other, Real, Direction d, Real horizon_pad
ding = 0); |
102 Drul_array<Real> shifts_to_avoid_intersection (Skyline const &, Real horizon_p
adding = 0) const; | 93 Drul_array<Real> shifts_to_avoid_intersection (Skyline const &, Real horizon_p
adding = 0) const; |
103 Interval raises_to_avoid_intersection (Skyline const &, Real horizon_padding =
0) const; | 94 Interval raises_to_avoid_intersection (Skyline const &, Real horizon_padding =
0) const; |
104 Real height (Real airplane) const; | 95 Real height (Real airplane) const; |
105 Real max_height () const; | 96 Real max_height () const; |
106 Real max_height_position () const; | 97 Real max_height_position () const; |
107 void set_minimum_height (Real height); | 98 void set_minimum_height (Real height); |
108 void clear (); | 99 void clear (); |
109 bool is_empty () const; | 100 bool is_empty () const; |
110 bool is_singleton () const; | 101 bool is_singleton () const; |
111 Real left () const; | 102 Real left () const; |
112 Real right () const; | 103 Real right () const; |
113 Skyline padded (Real horizon_padding) const; | 104 Skyline padded (Real horizon_padding) const; |
114 | 105 |
115 static string intersection_info_to_string (Skyline_intersection_info); | |
116 static Direction intersection_info_to_direction (Skyline_intersection_info); | |
117 | |
118 DECLARE_SCHEME_CALLBACK (get_touching_point, (SCM, SCM, SCM)); | 106 DECLARE_SCHEME_CALLBACK (get_touching_point, (SCM, SCM, SCM)); |
119 DECLARE_SCHEME_CALLBACK (get_distance, (SCM, SCM, SCM)); | 107 DECLARE_SCHEME_CALLBACK (get_distance, (SCM, SCM, SCM)); |
120 DECLARE_SCHEME_CALLBACK (get_max_height, (SCM)); | 108 DECLARE_SCHEME_CALLBACK (get_max_height, (SCM)); |
121 DECLARE_SCHEME_CALLBACK (get_max_height_position, (SCM)); | 109 DECLARE_SCHEME_CALLBACK (get_max_height_position, (SCM)); |
122 DECLARE_SCHEME_CALLBACK (get_height, (SCM, SCM)); | 110 DECLARE_SCHEME_CALLBACK (get_height, (SCM, SCM)); |
123 }; | 111 }; |
124 | 112 |
125 extern bool debug_skylines; | 113 extern bool debug_skylines; |
126 | 114 |
127 #endif /* SKYLINE_HH */ | 115 #endif /* SKYLINE_HH */ |
128 | 116 |
LEFT | RIGHT |