comparison framework/Align.h @ 428:b23db4cef02f alignment_view

Emit a signal when alignment completes
author Chris Cannam
date Fri, 21 Nov 2014 13:15:57 +0000
parents f32a64149602
children 06db8f3ceb95
comparison
equal deleted inserted replaced
427:a67245dce0d4 428:b23db4cef02f
41 * calls -- you do not need to create a new Align object each 41 * calls -- you do not need to create a new Align object each
42 * time, nor to wait for an alignment to be complete before 42 * time, nor to wait for an alignment to be complete before
43 * starting a new one. 43 * starting a new one.
44 * 44 *
45 * The Align object must survive after this call, for at least as 45 * The Align object must survive after this call, for at least as
46 * long as the alignment takes. There is currently no way in this 46 * long as the alignment takes. The usual expectation is that the
47 * API to discover when an alignment is complete -- the 47 * Align object will simply share the process or document
48 * expectation is that the Align object will simply share the 48 * lifespan.
49 * process or document lifespan.
50 */ 49 */
51 bool alignModel(Model *reference, Model *other); // via user preference 50 bool alignModel(Model *reference, Model *other); // via user preference
52 51
53 bool alignModelViaTransform(Model *reference, Model *other); 52 bool alignModelViaTransform(Model *reference, Model *other);
54 bool alignModelViaProgram(Model *reference, Model *other, QString program); 53 bool alignModelViaProgram(Model *reference, Model *other, QString program);
55 54
55 /**
56 * Return true if the alignment facility is available (relevant
57 * plugin installed, etc).
58 */
59 static bool canAlign();
60
56 QString getError() const { return m_error; } 61 QString getError() const { return m_error; }
57 62
63 signals:
64 /**
65 * Emitted when an alignment is successfully completed. The
66 * reference and other models can be queried from the alignment
67 * model.
68 */
69 void alignmentComplete(AlignmentModel *alignment);
70
58 private slots: 71 private slots:
72 void alignmentCompletionChanged();
59 void alignmentProgramFinished(int, QProcess::ExitStatus); 73 void alignmentProgramFinished(int, QProcess::ExitStatus);
60 74
61 private: 75 private:
76 static QString getAlignmentTransformName();
77
62 QString m_error; 78 QString m_error;
63 std::map<QProcess *, AlignmentModel *> m_processModels; 79 std::map<QProcess *, AlignmentModel *> m_processModels;
64 }; 80 };
65 81
66 #endif 82 #endif