Mercurial > hg > svcore
comparison data/model/AlignmentModel.cpp @ 1696:187c76c40c6f single-point
Ensure a self-alignment is always reported as complete, since there is nothing to calculate
author | Chris Cannam |
---|---|
date | Wed, 01 May 2019 11:45:28 +0100 |
parents | d08b560102a1 |
children | 28f9ff7864c6 |
comparison
equal
deleted
inserted
replaced
1695:cd6be949a16a | 1696:187c76c40c6f |
---|---|
46 } | 46 } |
47 | 47 |
48 if (m_rawPath && m_rawPath->isReady()) { | 48 if (m_rawPath && m_rawPath->isReady()) { |
49 pathCompletionChanged(); | 49 pathCompletionChanged(); |
50 } | 50 } |
51 | |
52 if (m_reference == m_aligned) { | |
53 // Trivial alignment, e.g. of main model to itself, which we | |
54 // record so that we can distinguish the reference model for | |
55 // alignments from an unaligned model. No path required | |
56 m_pathComplete = true; | |
57 } | |
51 } | 58 } |
52 | 59 |
53 AlignmentModel::~AlignmentModel() | 60 AlignmentModel::~AlignmentModel() |
54 { | 61 { |
55 #ifdef DEBUG_ALIGNMENT_MODEL | 62 #ifdef DEBUG_ALIGNMENT_MODEL |
99 AlignmentModel::isReady(int *completion) const | 106 AlignmentModel::isReady(int *completion) const |
100 { | 107 { |
101 if (!m_pathBegun && m_rawPath) { | 108 if (!m_pathBegun && m_rawPath) { |
102 if (completion) *completion = 0; | 109 if (completion) *completion = 0; |
103 #ifdef DEBUG_ALIGNMENT_MODEL | 110 #ifdef DEBUG_ALIGNMENT_MODEL |
104 SVDEBUG << "AlignmentModel::isReady: path not begun" << endl; | 111 SVCERR << "AlignmentModel::isReady: path not begun" << endl; |
105 #endif | 112 #endif |
106 return false; | 113 return false; |
107 } | 114 } |
108 if (m_pathComplete) { | 115 if (m_pathComplete) { |
109 if (completion) *completion = 100; | 116 if (completion) *completion = 100; |
110 #ifdef DEBUG_ALIGNMENT_MODEL | 117 #ifdef DEBUG_ALIGNMENT_MODEL |
111 SVDEBUG << "AlignmentModel::isReady: path complete" << endl; | 118 SVCERR << "AlignmentModel::isReady: path complete" << endl; |
112 #endif | 119 #endif |
113 return true; | 120 return true; |
114 } | 121 } |
115 if (!m_rawPath) { | 122 if (!m_rawPath) { |
116 // lack of raw path could mean path is complete (in which case | 123 // lack of raw path could mean path is complete (in which case |
117 // m_pathComplete true above) or else no alignment has been | 124 // m_pathComplete true above) or else no alignment has been |
118 // set at all yet (this case) | 125 // set at all yet (this case) |
119 if (completion) *completion = 0; | 126 if (completion) *completion = 0; |
120 #ifdef DEBUG_ALIGNMENT_MODEL | 127 #ifdef DEBUG_ALIGNMENT_MODEL |
121 SVDEBUG << "AlignmentModel::isReady: no raw path" << endl; | 128 SVCERR << "AlignmentModel::isReady: no raw path" << endl; |
122 #endif | 129 #endif |
123 return false; | 130 return false; |
124 } | 131 } |
125 return m_rawPath->isReady(completion); | 132 return m_rawPath->isReady(completion); |
126 } | 133 } |