X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Finclude%2Fslur-scoring.hh;h=1ae187477b28c9979f9377f325a4c77555cc9764;hb=47db9a3883d726ca53e2133a3b2298f78dd6a32e;hp=8f4c6494dd96b47658a0d27f60bf852ce0c4bf30;hpb=46a7d3d3e83e0cfa9a93713f81daba66aa3427eb;p=lilypond.git diff --git a/lily/include/slur-scoring.hh b/lily/include/slur-scoring.hh index 8f4c6494dd..1ae187477b 100644 --- a/lily/include/slur-scoring.hh +++ b/lily/include/slur-scoring.hh @@ -1,70 +1,42 @@ -/* - slur-scoring.hh -- declare Slur_score_parameters - - source file of the GNU LilyPond music typesetter - - (c) 2004 Han-Wen Nienhuys - +/* + This file is part of LilyPond, the GNU music typesetter. + + Copyright (C) 2004--2015 Han-Wen Nienhuys + + LilyPond is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + LilyPond is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with LilyPond. If not, see . */ #ifndef SLUR_SCORING_HH #define SLUR_SCORING_HH #include "box.hh" -#include "lily-proto.hh" -#include "parray.hh" - -struct Slur_score_parameters -{ - int region_size_; - Real head_encompass_penalty_; - Real stem_encompass_penalty_; - Real closeness_factor_; - Real edge_attraction_factor_; - Real same_slope_penalty_; - Real steeper_slope_factor_; - Real non_horizontal_penalty_; - Real max_slope_; - Real max_slope_factor_; - Real extra_object_collision_; - Real accidental_collision_; - Real free_slur_distance_; - Real free_head_distance_; - Real extra_encompass_free_distance_; - Real absolute_closeness_measure_; - Real edge_slope_exponent_; - Real head_slur_distance_max_ratio_; - Real head_slur_distance_factor_; - - void fill (Grob *him); -}; - - +#include "std-vector.hh" +#include "lily-guile.hh" +#include "slur-score-parameters.hh" struct Extra_collision_info { Real idx_; Box extents_; Real penalty_; - Grob * grob_; + Grob *grob_; + SCM type_; - Extra_collision_info (Grob *g, Real idx, Interval x, Interval y, Real p) - { - idx_ = idx; - extents_[X_AXIS] = x; - extents_[Y_AXIS] = y; - penalty_ = p; - grob_ = g; - } - Extra_collision_info () - { - idx_ = 0.0; - penalty_ = 0.; - grob_ = 0; - } + Extra_collision_info (Grob *g, Real idx, Interval x, Interval y, Real p); + Extra_collision_info (); }; - struct Encompass_info { Real x_; @@ -94,7 +66,8 @@ struct Bound_info Grob *slur_head_; Grob *staff_; Grob *stem_; - Interval slur_head_extent_; + Grob *flag_; + Interval slur_head_x_extent_; Real staff_space_; Bound_info () @@ -115,36 +88,41 @@ struct Slur_score_state bool edge_has_beams_; bool is_broken_; bool has_same_beam_; - + Real musical_dy_; - Link_array columns_; - Array encompass_infos_; - Array extra_encompass_infos_; - + vector columns_; + vector encompass_infos_; + vector extra_encompass_infos_; + Direction dir_; Slur_score_parameters parameters_; Drul_array extremes_; Drul_array base_attachments_; - Link_array configurations_; + vector configurations_; Real staff_space_; + Real line_thickness_; Real thickness_; - - Slur_score_state(); - ~Slur_score_state(); - - Bezier get_best_curve (); - void fill (Grob*); - void set_next_direction (); - + + Slur_score_state (); + ~Slur_score_state (); + + Slur_configuration *get_forced_configuration (Interval ys) const; + Slur_configuration *get_best_curve () const; + void fill (Grob *); + Direction slur_direction () const; + + vector generate_avoid_offsets () const; Drul_array get_bound_info () const; - void generate_curves () const; - Link_array enumerate_attachments (Drul_array end_ys) const; - Drul_array get_base_attachments() const; - Drul_array get_y_attachment_range() const; + void generate_curves () const; + vector enumerate_attachments (Drul_array end_ys) const; + Drul_array get_base_attachments () const; + Drul_array get_y_attachment_range () const; Encompass_info get_encompass_info (Grob *col) const; - Array get_extra_encompass_infos () const; -}; + vector get_extra_encompass_infos () const; + Real move_away_from_staffline (Real y, Grob *on_staff) const; + Interval breakable_bound_extent (Direction) const; +}; void set_slur_control_points (Grob *me);