X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Finclude%2Ftie-formatting-problem.hh;h=df24f2ccf4f66ab1023a2b2bcc823fe2bcc8005c;hb=c39d188d28fdc84cef8cbaea7b8d6e2fb718c30f;hp=befb430c5d51308f5cff9c5b2e7b6a85af7863b8;hpb=99242a027c2281ed7674772e9a0ae7fc86024be0;p=lilypond.git diff --git a/lily/include/tie-formatting-problem.hh b/lily/include/tie-formatting-problem.hh index befb430c5d..df24f2ccf4 100644 --- a/lily/include/tie-formatting-problem.hh +++ b/lily/include/tie-formatting-problem.hh @@ -1,97 +1,111 @@ /* - tie-formatting-problem.hh -- declare Tie_formatting_problem + This file is part of LilyPond, the GNU music typesetter. - source file of the GNU LilyPond music typesetter + Copyright (C) 2005--2014 Han-Wen Nienhuys - (c) 2005--2006 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 TIE_FORMATTING_PROBLEM_HH #define TIE_FORMATTING_PROBLEM_HH #include "drul-array.hh" -#include "std-vector.hh" #include "skyline.hh" -#include "lily-proto.hh" #include "tie-configuration.hh" #include "tie-details.hh" +#include "tie-specification.hh" +#include "tuple.hh" #include #include -typedef map< pair, Tie_configuration *> Tie_configuration_map; - -struct Tie_specification -{ - int position_; - Drul_array note_head_drul_; - - bool has_manual_position_; - bool has_manual_dir_; - - Real manual_position_; - Direction manual_dir_; - - Tie_specification (); -}; +typedef map< Tuple, Tie_configuration *> Tie_configuration_map; struct Tie_configuration_variation { - int index_; - Tie_configuration *suggestion_; - Tie_configuration_variation (); + vector > index_suggestion_pairs_; + void add_suggestion (int index, Tie_configuration *suggestion) + { + index_suggestion_pairs_.push_back (make_pair (index, suggestion)); + } }; +typedef map < Tuple, Skyline> Chord_outline_map; +typedef map < Tuple, Box> Column_extent_map; +typedef map Position_extent_map; + class Tie_formatting_problem { - Drul_array< vector > chord_outlines_; - Drul_array< Box > stem_extents_; - Drul_array< Box > head_extents_; + Chord_outline_map chord_outlines_; + Column_extent_map stem_extents_; + Column_extent_map head_extents_; + Position_extent_map head_positions_; + set dot_positions_; Interval dot_x_; vector specifications_; - + bool use_horizontal_spacing_; + Tie_configuration_map possibilities_; Grob *x_refpoint_; + Grob *y_refpoint_; + + Tie_configuration *get_configuration (int position, Direction dir, Drul_array cols, bool tune_y) const; + Tie_configuration *generate_configuration (int position, Direction dir, Drul_array cols, bool tune_y) const; - - Tie_configuration *get_configuration (int position, Direction dir) const; - Tie_configuration *generate_configuration (int position, Direction dir) const; vector generate_collision_variations (Ties_configuration const &ties) const; vector generate_extremal_tie_variations (Ties_configuration const &ties) const; + vector generate_single_tie_variations (Ties_configuration const &ties) const; void score_configuration (Tie_configuration *) const; Real score_aptitude (Tie_configuration *, Tie_specification const &, - Ties_configuration *, int) const; + Ties_configuration *, int) const; void score_ties_aptitude (Ties_configuration *ties) const; void score_ties_configuration (Ties_configuration *ties) const; void set_ties_config_standard_directions (Ties_configuration *tie_configs_ptr); void score_ties (Ties_configuration *) const; - + + Slice head_positions_slice (int) const; Ties_configuration generate_base_chord_configuration (); Ties_configuration find_best_variation (Ties_configuration const &base, - vector vars); + vector const &vars); public: Tie_details details_; void print_ties_configuration (Ties_configuration const *); + + Interval get_stem_extent (int, Direction, Axis) const; + Interval get_head_extent (int, Direction, Axis) const; + public: Tie_formatting_problem (); ~Tie_formatting_problem (); Tie_specification get_tie_specification (int) const; - Ties_configuration generate_optimal_chord_configuration (); + Ties_configuration generate_optimal_configuration (); Ties_configuration generate_ties_configuration (Ties_configuration const &); - Tie_configuration find_optimal_tie_configuration (Tie_specification const &) const; - void from_ties (vector const &ties); + + void from_ties (vector const &ties); void from_tie (Grob *tie); - void from_semi_ties (vector const &, Direction head_dir); - void set_chord_outline (vector, Direction); + void from_semi_ties (vector const &, Direction head_dir); + void set_chord_outline (vector, Direction); + void set_column_chord_outline (vector, Direction, int rank); void set_manual_tie_configuration (SCM); - Interval get_attachment (Real) const; + Interval get_attachment (Real, Drul_array) const; Grob *common_x_refpoint () const; + void set_debug_scoring (Ties_configuration const &); }; #endif /* TIE_FORMATTING_PROBLEM_HH */