JFJochAzIntImageView: Change SetData interface
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
#include "JFJochAzIntImageView.h"
|
||||
#include <QVBoxLayout>
|
||||
|
||||
#include "../../common/JFJochException.h"
|
||||
|
||||
JFJochAzIntImageView::JFJochAzIntImageView(QWidget *parent)
|
||||
: QWidget(parent), label(new QLabel(this)) {
|
||||
label->setAlignment(Qt::AlignCenter);
|
||||
@@ -22,12 +24,22 @@ void JFJochAzIntImageView::Clear() {
|
||||
|
||||
// data: size = azimuthal_bins * q_bins
|
||||
// Layout: q varies fastest (i % q_bins == q index)
|
||||
void JFJochAzIntImageView::SetData(const std::vector<float> &data, int azimuthal_bins, int q_bins) {
|
||||
if (azimuthal_bins <= 0 || q_bins <= 0 ||
|
||||
data.size() != static_cast<size_t>(azimuthal_bins * q_bins)) {
|
||||
void JFJochAzIntImageView::SetData(const std::vector<float> &data,
|
||||
const std::vector<float> &phi,
|
||||
const std::vector<float> &q,
|
||||
int azimuthal_bins) {
|
||||
if (azimuthal_bins <= 0) {
|
||||
Clear();
|
||||
return;
|
||||
}
|
||||
throw std::runtime_error("azimuthal_bins <= 0");
|
||||
}
|
||||
|
||||
int q_bins = data.size() / azimuthal_bins;
|
||||
|
||||
if (q_bins <= 0 || phi.size() != data.size() || q.size() != data.size()) {
|
||||
Clear();
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
"Mismatch in input size");
|
||||
}
|
||||
|
||||
float local_min = range_min, local_max = range_max;
|
||||
if (auto_range) {
|
||||
|
||||
Reference in New Issue
Block a user