Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(407)

Delta Between Two Patch Sets: lily/include/skyline.hh

Issue 5626052: Gets vertical skylines from grob stencils (Closed)
Left Patch Set: Uses coarser quanting to speed up skyline calculations. Created 13 years ago
Right Patch Set: Run astyle on c++ files Created 12 years, 6 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
LEFTRIGHT
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 14 matching lines...) Expand all
25 #include "box.hh" 25 #include "box.hh"
26 #include "interval.hh" 26 #include "interval.hh"
27 #include "direction.hh" 27 #include "direction.hh"
28 #include "std-vector.hh" 28 #include "std-vector.hh"
29 #include "smobs.hh" 29 #include "smobs.hh"
30 30
31 #include <list> 31 #include <list>
32 32
33 struct Building 33 struct Building
34 { 34 {
35 Real start_;
35 Real end_; 36 Real end_;
36 Real y_intercept_; 37 Real y_intercept_;
37 Real slope_; 38 Real slope_;
38 39
39 void precompute (Real start, Real start_height, Real end_height, Real end); 40 void precompute (Real start, Real start_height, Real end_height, Real end);
40 Building (Real start, Real start_height, Real end_height, Real end); 41 Building (Real start, Real start_height, Real end_height, Real end);
41 Building (Box const &b, Real horizon_padding, Axis a, Direction d); 42 Building (Box const &b, Axis a, Direction d);
42 void print () const; 43 void print () const;
43 44
44 Real height (Real x) const; 45 Real height (Real x) const;
45 Real intersection_x (Building const &other) const; 46 Real intersection_x (Building const &other) const;
46 void leading_part (Real chop); 47 void leading_part (Real chop);
47 bool conceals (Building const &other, Real x) const; 48 bool conceals (Building const &other, Real x) const;
48 Building sloped_neighbour (Real start, Real horizon_padding, Direction d) cons t; 49 Real shift_to_intersect (Real x, Real y) const;
50 Interval overlapping_shift_interval (Building const &other) const;
49 }; 51 };
50 52
51 class Skyline 53 class Skyline
52 { 54 {
53 private: 55 private:
54 list<Building> buildings_; 56 list<Building> buildings_;
55 Direction sky_; 57 Direction sky_;
56 58
57 void internal_merge_skyline (list<Building>*, list<Building>*, 59 void internal_merge_skyline (list<Building> *, list<Building> *,
58 list<Building> *const result); 60 list<Building> *const result) const;
59 list<Building> internal_build_skyline (list<Box>*, Real, Axis, Direction); 61 list<Building> internal_build_skyline (list<Building> *) const;
60 list<Building> internal_build_skyline_from_buildings (list<Drul_array<Offset> >*, Real, Axis, Direction); 62 Real internal_distance (Skyline const &, Real horizon_padding, Real *touch_poi nt) const;
61 void shared_building_constructor (vector<Drul_array<Offset> > const &bldgs, Re al horizon_padding, Axis a, Direction sky); 63 Real internal_distance (Skyline const &, Real *touch_point) const;
64 void normalize ();
62 65
63 DECLARE_SIMPLE_SMOBS (Skyline); 66 DECLARE_SIMPLE_SMOBS (Skyline);
64 67
65 public: 68 public:
66 Skyline (); 69 Skyline ();
67 Skyline (Skyline const &src); 70 Skyline (Skyline const &src);
68 Skyline (Skyline const &src, Real horizon_padding, Axis a);
69 Skyline (Direction sky); 71 Skyline (Direction sky);
70 Skyline (vector<Box> const &bldgs, Real horizon_padding, Axis a, Direction sky ); 72 Skyline (vector<Box> const &bldgs, Axis a, Direction sky);
71 Skyline (vector<Drul_array<Offset> > const &bldgs, Real horizon_padding, Axis a, Direction sky); 73 Skyline (vector<Drul_array<Offset> > const &bldgs, Axis a, Direction sky);
72 Skyline (vector<Skyline_pair> const &skypairs, Real horizon_padding, Axis a, D irection sky); 74 Skyline (vector<Skyline_pair> const &skypairs, Direction sky);
73 Skyline (Box const &b, Real horizon_padding, Axis a, Direction sky); 75 Skyline (Box const &b, Axis a, Direction sky);
74 76
75 vector<Offset> to_points (Axis) const; 77 vector<Offset> to_points (Axis) const;
78 void deholify ();
76 void merge (Skyline const &); 79 void merge (Skyline const &);
77 void insert (Box const &, Real horizon_padding, Axis); 80 void insert (Box const &, Axis);
78 void print () const; 81 void print () const;
79 void print_points () const; 82 void print_points () const;
80 void raise (Real); 83 void raise (Real);
81 void shift (Real); 84 void shift (Real);
85 void invert ();
82 Real distance (Skyline const &, Real horizon_padding = 0) const; 86 Real distance (Skyline const &, Real horizon_padding = 0) const;
87 Real smallest_shift (Skyline const &, Direction d,
88 Real horizon_padding = 0,
89 Real vertical_padding = 0) const;
83 Real touching_point (Skyline const &, Real horizon_padding = 0) const; 90 Real touching_point (Skyline const &, Real horizon_padding = 0) const;
91 Real shift_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);
93 Drul_array<Real> shifts_to_avoid_intersection (Skyline const &, Real horizon_p adding = 0) const;
94 Interval raises_to_avoid_intersection (Skyline const &, Real horizon_padding = 0) const;
84 Real height (Real airplane) const; 95 Real height (Real airplane) const;
85 Real max_height () const; 96 Real max_height () const;
86 Real max_height_position () const; 97 Real max_height_position () const;
87 void set_minimum_height (Real height); 98 void set_minimum_height (Real height);
88 void clear (); 99 void clear ();
89 bool is_empty () const; 100 bool is_empty () const;
101 bool is_singleton () const;
90 Real left () const; 102 Real left () const;
91 Real right () const; 103 Real right () const;
104 Skyline padded (Real horizon_padding) const;
92 105
93 DECLARE_SCHEME_CALLBACK (get_touching_point, (SCM, SCM, SCM)); 106 DECLARE_SCHEME_CALLBACK (get_touching_point, (SCM, SCM, SCM));
94 DECLARE_SCHEME_CALLBACK (get_distance, (SCM, SCM, SCM)); 107 DECLARE_SCHEME_CALLBACK (get_distance, (SCM, SCM, SCM));
95 DECLARE_SCHEME_CALLBACK (get_max_height, (SCM)); 108 DECLARE_SCHEME_CALLBACK (get_max_height, (SCM));
96 DECLARE_SCHEME_CALLBACK (get_max_height_position, (SCM)); 109 DECLARE_SCHEME_CALLBACK (get_max_height_position, (SCM));
97 DECLARE_SCHEME_CALLBACK (get_height, (SCM, SCM)); 110 DECLARE_SCHEME_CALLBACK (get_height, (SCM, SCM));
98
99 protected:
100 Real internal_distance (Skyline const &, Real horizon_padding, Real *touch_poi nt) const;
101 }; 111 };
102 112
103 extern bool debug_skylines; 113 extern bool debug_skylines;
104 114
105 #endif /* SKYLINE_HH */ 115 #endif /* SKYLINE_HH */
106 116
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b