GUI: SubframeShapes: building shapes iterates over numors
Does it make sense to generate a shape model from multiple DataSet
s given that the sample orientation will vary? This is important because currently when building shape collections, we iterate over numors for some reason:
void SubframeShapes::buildShapeModel()
{
gGui->setReady(false);
setShapeParameters();
try {
auto* params = _shape_model.parameters();
std::vector<ohkl::Peak3D*> fit_peaks;
for (ohkl::Peak3D* peak : _peak_combo->currentPeakCollection()->getPeakList()) {
if (!peak->enabled())
continue;
const double d = 1.0 / peak->q().rowVector().norm();
if (d > params->d_max || d < params->d_min)
continue;
const ohkl::Intensity intensity = peak->correctedIntensity();
if (intensity.value() <= params->strength_min * intensity.sigma())
continue;
fit_peaks.push_back(peak);
}
ohkl::sptrProgressHandler handler(new ohkl::ProgressHandler);
ProgressView view(this);
view.watch(handler);
std::set<ohkl::sptrDataSet> data;
for (auto dataset : gSession->currentProject()->experiment()->getAllData())
data.insert(dataset);
_shape_model.integrate(fit_peaks, data, handler);
_shape_model.updateFit(1000); // This does nothing!! - zamaan
} catch (std::exception& e) {
QMessageBox::critical(this, "Error", QString(e.what()));
}
gGui->statusBar()->showMessage(
QString::number(_shape_model.numberOfPeaks()) + " shapes generated");
toggleUnsafeWidgets();
gGui->setReady(true);
}