Mercurial > hg > svcore
comparison data/model/AlignmentModel.cpp @ 1869:cb9209ef373a startup-timing
Merge from default branch
author | Chris Cannam |
---|---|
date | Tue, 16 Jun 2020 17:44:06 +0100 |
parents | 3072aa267248 |
children |
comparison
equal
deleted
inserted
replaced
1865:7b6e18380e8f | 1869:cb9209ef373a |
---|---|
27 m_pathSource(pathSource), | 27 m_pathSource(pathSource), |
28 m_path(nullptr), | 28 m_path(nullptr), |
29 m_reversePath(nullptr), | 29 m_reversePath(nullptr), |
30 m_pathBegun(false), | 30 m_pathBegun(false), |
31 m_pathComplete(false), | 31 m_pathComplete(false), |
32 m_relativePitch(0) | 32 m_relativePitch(0), |
33 m_explicitlySetCompletion(-1) | |
33 { | 34 { |
34 setPathFrom(pathSource); | 35 setPathFrom(pathSource); |
35 | 36 |
36 if (m_reference == m_aligned) { | 37 if (m_reference == m_aligned) { |
37 // Trivial alignment, e.g. of main model to itself, which we | 38 // Trivial alignment, e.g. of main model to itself, which we |
103 } | 104 } |
104 | 105 |
105 bool | 106 bool |
106 AlignmentModel::isReady(int *completion) const | 107 AlignmentModel::isReady(int *completion) const |
107 { | 108 { |
109 if (m_explicitlySetCompletion != -1) { | |
110 if (completion) *completion = m_explicitlySetCompletion; | |
111 return (m_explicitlySetCompletion == 100); | |
112 } | |
108 if (!m_pathBegun && !m_pathSource.isNone()) { | 113 if (!m_pathBegun && !m_pathSource.isNone()) { |
109 if (completion) *completion = 0; | 114 if (completion) *completion = 0; |
110 #ifdef DEBUG_ALIGNMENT_MODEL | 115 #ifdef DEBUG_ALIGNMENT_MODEL |
111 SVCERR << "AlignmentModel::isReady: path not begun" << endl; | 116 SVCERR << "AlignmentModel::isReady: path not begun" << endl; |
112 #endif | 117 #endif |
152 | 157 |
153 ModelId | 158 ModelId |
154 AlignmentModel::getAlignedModel() const | 159 AlignmentModel::getAlignedModel() const |
155 { | 160 { |
156 return m_aligned; | 161 return m_aligned; |
162 } | |
163 | |
164 void | |
165 AlignmentModel::setCompletion(int completion) | |
166 { | |
167 m_explicitlySetCompletion = completion; | |
168 emit completionChanged(getId()); | |
157 } | 169 } |
158 | 170 |
159 sv_frame_t | 171 sv_frame_t |
160 AlignmentModel::toReference(sv_frame_t frame) const | 172 AlignmentModel::toReference(sv_frame_t frame) const |
161 { | 173 { |
308 | 320 |
309 sv_frame_t | 321 sv_frame_t |
310 AlignmentModel::performAlignment(const Path &path, sv_frame_t frame) const | 322 AlignmentModel::performAlignment(const Path &path, sv_frame_t frame) const |
311 { | 323 { |
312 // The path consists of a series of points, each with frame equal | 324 // The path consists of a series of points, each with frame equal |
313 // to the frame on the source model and mapframe equal to the | 325 // to the frame on the source model (aligned model) and mapframe |
314 // frame on the target model. Both should be monotonically | 326 // equal to the frame on the target model (reference model). Both |
315 // increasing. | 327 // should be monotonically increasing. |
316 | 328 |
317 const Path::Points &points = path.getPoints(); | 329 const Path::Points &points = path.getPoints(); |
318 | 330 |
319 if (points.empty()) { | 331 if (points.empty()) { |
320 #ifdef DEBUG_ALIGNMENT_MODEL | 332 #ifdef DEBUG_ALIGNMENT_MODEL |