|
1 | | - |
| 1 | +#include "ShapeEvaluationJob.h" |
2 | 2 |
|
3 | 3 | #include <Logging.h> |
4 | | -#include "ShapeEvaluationJob.h" |
| 4 | + |
5 | 5 | namespace shapeworks { |
6 | 6 |
|
7 | 7 | //----------------------------------------------------------------------------- |
8 | 8 | ShapeEvaluationJob::ShapeEvaluationJob(JobType job_type, ParticleShapeStatistics stats) |
9 | | - : job_type_(job_type), stats_(stats) |
10 | | -{ |
11 | | - qRegisterMetaType<shapeworks::ShapeEvaluationJob::JobType>( |
12 | | - "shapeworks::ShapeEvaluationWorker::JobType"); |
| 9 | + : job_type_(job_type), stats_(stats) { |
| 10 | + qRegisterMetaType<shapeworks::ShapeEvaluationJob::JobType>("shapeworks::ShapeEvaluationWorker::JobType"); |
13 | 11 | qRegisterMetaType<Eigen::VectorXd>("Eigen::VectorXd"); |
14 | 12 | } |
15 | 13 |
|
16 | 14 | //----------------------------------------------------------------------------- |
17 | | -void ShapeEvaluationJob::run() |
18 | | -{ |
| 15 | +void ShapeEvaluationJob::run() { |
19 | 16 | auto callback = std::bind(&ShapeEvaluationJob::receive_progress, this, std::placeholders::_1); |
20 | | - switch (this->job_type_) { |
21 | | - case JobType::CompactnessType: |
22 | | - Q_EMIT result_ready(this->job_type_, this->stats_.get_compactness(callback)); |
23 | | - break; |
24 | | - case JobType::GeneralizationType: |
25 | | - Q_EMIT result_ready(this->job_type_, this->stats_.get_generalization(callback)); |
26 | | - break; |
27 | | - case JobType::SpecificityType: |
28 | | - Q_EMIT result_ready(this->job_type_, this->stats_.get_specificity(callback)); |
29 | | - break; |
| 17 | + switch (job_type_) { |
| 18 | + case JobType::CompactnessType: |
| 19 | + Q_EMIT result_ready(job_type_, stats_.get_compactness(callback)); |
| 20 | + break; |
| 21 | + case JobType::GeneralizationType: |
| 22 | + Q_EMIT result_ready(job_type_, stats_.get_generalization(callback)); |
| 23 | + break; |
| 24 | + case JobType::SpecificityType: |
| 25 | + Q_EMIT result_ready(job_type_, stats_.get_specificity(callback)); |
| 26 | + break; |
30 | 27 | } |
31 | 28 | } |
32 | 29 |
|
33 | 30 | //----------------------------------------------------------------------------- |
34 | | -QString ShapeEvaluationJob::name() |
35 | | -{ |
36 | | - return "Shape Evaluation"; |
37 | | -} |
| 31 | +QString ShapeEvaluationJob::name() { return "Shape Evaluation"; } |
38 | 32 |
|
39 | 33 | //----------------------------------------------------------------------------- |
40 | | -void ShapeEvaluationJob::receive_progress(float progress) |
41 | | -{ |
42 | | - Q_EMIT report_progress(this->job_type_, progress); |
43 | | -} |
44 | | -} |
| 34 | +void ShapeEvaluationJob::receive_progress(float progress) { Q_EMIT report_progress(job_type_, progress); } |
| 35 | + |
| 36 | +//----------------------------------------------------------------------------- |
| 37 | + |
| 38 | +} // namespace shapeworks |
0 commit comments