2013-11-15 13:41:26 +01:00
|
|
|
/************************************************************************
|
2013-09-18 21:16:19 +02:00
|
|
|
**
|
2014-01-15 00:55:41 +01:00
|
|
|
** @file vstandardtablecell.cpp
|
2014-04-30 07:38:52 +02:00
|
|
|
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
2013-11-15 13:50:05 +01:00
|
|
|
** @date November 15, 2013
|
2013-09-18 21:16:19 +02:00
|
|
|
**
|
2013-11-15 13:41:26 +01:00
|
|
|
** @brief
|
|
|
|
** @copyright
|
2017-10-05 11:20:01 +02:00
|
|
|
** This source code is part of the Valentina project, a pattern making
|
2013-11-15 13:41:26 +01:00
|
|
|
** program, whose allow create and modeling patterns of clothing.
|
2015-02-27 11:27:48 +01:00
|
|
|
** Copyright (C) 2013-2015 Valentina project
|
2020-01-31 07:00:05 +01:00
|
|
|
** <https://gitlab.com/smart-pattern/valentina> All Rights Reserved.
|
2013-09-18 21:16:19 +02:00
|
|
|
**
|
2013-11-15 13:41:26 +01:00
|
|
|
** Valentina is free software: you can redistribute it and/or modify
|
2013-09-18 21:16:19 +02:00
|
|
|
** it under the terms of the GNU General Public License as published by
|
|
|
|
** the Free Software Foundation, either version 3 of the License, or
|
|
|
|
** (at your option) any later version.
|
|
|
|
**
|
2013-10-27 13:36:29 +01:00
|
|
|
** Valentina is distributed in the hope that it will be useful,
|
2013-09-18 21:16:19 +02:00
|
|
|
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
** GNU General Public License for more details.
|
|
|
|
**
|
|
|
|
** You should have received a copy of the GNU General Public License
|
|
|
|
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
**
|
2013-11-15 13:41:26 +01:00
|
|
|
*************************************************************************/
|
2013-09-18 21:16:19 +02:00
|
|
|
|
2014-03-14 15:12:53 +01:00
|
|
|
#include "vmeasurement.h"
|
2013-07-17 13:38:11 +02:00
|
|
|
|
2015-10-18 21:30:51 +02:00
|
|
|
#include <QMap>
|
2016-08-08 13:44:49 +02:00
|
|
|
#include <QMessageLogger>
|
2015-10-18 21:30:51 +02:00
|
|
|
#include <QtDebug>
|
|
|
|
|
2016-08-09 15:55:46 +02:00
|
|
|
#include "../ifc/ifcdef.h"
|
2016-08-08 13:44:49 +02:00
|
|
|
#include "vmeasurement_p.h"
|
2023-07-15 09:58:28 +02:00
|
|
|
#include "vvariable.h"
|
2016-08-08 13:44:49 +02:00
|
|
|
|
2022-02-05 14:00:22 +01:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
VMeasurement::VMeasurement(quint32 index, const QString &name)
|
2023-07-15 09:58:28 +02:00
|
|
|
: VVariable(name),
|
|
|
|
d(new VMeasurementData(index, MeasurementType::Separator))
|
2022-02-05 14:00:22 +01:00
|
|
|
{
|
|
|
|
SetType(VarType::MeasurementSeparator);
|
|
|
|
VInternalVariable::SetValue(0);
|
|
|
|
}
|
|
|
|
|
2014-05-02 13:11:30 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2014-06-01 09:35:13 +02:00
|
|
|
/**
|
2017-07-12 20:21:48 +02:00
|
|
|
* @brief VMeasurement create measurement for multisize table
|
2014-07-29 13:28:18 +02:00
|
|
|
* @param name measurement's name
|
2020-10-03 17:52:31 +02:00
|
|
|
* @param base measurement's base value
|
2014-06-01 09:35:13 +02:00
|
|
|
*/
|
2020-10-03 17:52:31 +02:00
|
|
|
VMeasurement::VMeasurement(quint32 index, const QString &name, qreal baseA, qreal baseB, qreal baseC, qreal base)
|
2023-07-15 09:58:28 +02:00
|
|
|
: VVariable(name),
|
|
|
|
d(new VMeasurementData(index, baseA, baseB, baseC, base))
|
2014-07-29 13:28:18 +02:00
|
|
|
{
|
2014-08-20 17:58:10 +02:00
|
|
|
SetType(VarType::Measurement);
|
2020-10-03 17:52:31 +02:00
|
|
|
VInternalVariable::SetValue(d->shiftBase);
|
2014-07-29 13:28:18 +02:00
|
|
|
}
|
2014-03-14 15:12:53 +01:00
|
|
|
|
2014-05-02 13:11:30 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2014-06-01 09:35:13 +02:00
|
|
|
/**
|
|
|
|
* @brief VMeasurement create measurement for individual table
|
2020-10-03 17:52:31 +02:00
|
|
|
* @param name measurement's base value
|
2014-07-09 14:23:04 +02:00
|
|
|
* @param base value in base size and height
|
2014-06-01 09:35:13 +02:00
|
|
|
*/
|
2015-07-24 12:06:39 +02:00
|
|
|
VMeasurement::VMeasurement(VContainer *data, quint32 index, const QString &name, const qreal &base,
|
2020-10-03 17:52:31 +02:00
|
|
|
const QString &formula, bool ok)
|
2023-07-15 09:58:28 +02:00
|
|
|
: VVariable(name),
|
|
|
|
d(new VMeasurementData(data, index, formula, ok, base))
|
2014-07-29 13:28:18 +02:00
|
|
|
{
|
2014-08-20 17:58:10 +02:00
|
|
|
SetType(VarType::Measurement);
|
2017-08-04 19:29:43 +02:00
|
|
|
VInternalVariable::SetValue(base);
|
2014-07-29 13:28:18 +02:00
|
|
|
}
|
2014-03-14 15:12:53 +01:00
|
|
|
|
2014-05-02 13:11:30 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-07-15 09:58:28 +02:00
|
|
|
COPY_CONSTRUCTOR_IMPL_2(VMeasurement, VVariable)
|
2014-06-01 09:35:13 +02:00
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
auto VMeasurement::operator=(const VMeasurement &m) -> VMeasurement &
|
2014-03-14 15:12:53 +01:00
|
|
|
{
|
2023-07-15 09:58:28 +02:00
|
|
|
if (&m == this)
|
2014-07-27 14:30:28 +02:00
|
|
|
{
|
|
|
|
return *this;
|
|
|
|
}
|
2014-07-09 14:23:04 +02:00
|
|
|
VVariable::operator=(m);
|
2014-08-20 19:43:53 +02:00
|
|
|
d = m.d;
|
2014-06-01 09:35:13 +02:00
|
|
|
return *this;
|
2014-03-14 15:12:53 +01:00
|
|
|
}
|
|
|
|
|
2019-12-30 12:00:57 +01:00
|
|
|
#ifdef Q_COMPILER_RVALUE_REFS
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-07-13 16:49:20 +02:00
|
|
|
VMeasurement::VMeasurement(VMeasurement &&m) noexcept
|
2023-07-15 09:58:28 +02:00
|
|
|
: VVariable(std::move(m)),
|
|
|
|
d(std::move(m.d))
|
|
|
|
{
|
|
|
|
}
|
2019-12-30 12:00:57 +01:00
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-07-15 09:58:28 +02:00
|
|
|
auto VMeasurement::operator=(VMeasurement &&m) noexcept -> VMeasurement &
|
2019-12-30 12:00:57 +01:00
|
|
|
{
|
2019-12-30 16:13:18 +01:00
|
|
|
VVariable::operator=(m);
|
2019-12-30 12:00:57 +01:00
|
|
|
std::swap(d, m.d);
|
2019-12-30 16:13:18 +01:00
|
|
|
return *this;
|
2019-12-30 12:00:57 +01:00
|
|
|
}
|
2019-12-30 16:13:18 +01:00
|
|
|
#endif
|
2019-12-30 12:00:57 +01:00
|
|
|
|
2014-05-02 13:11:30 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-07-15 09:58:28 +02:00
|
|
|
VMeasurement::~VMeasurement() = default;
|
2014-07-09 14:23:04 +02:00
|
|
|
|
2020-10-03 17:52:31 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
auto VMeasurement::CorrectionHash(qreal baseA, qreal baseB, qreal baseC) -> QString
|
2020-10-03 17:52:31 +02:00
|
|
|
{
|
2020-10-03 17:52:10 +02:00
|
|
|
QStringList hashBlocks{QString::number(baseA)};
|
|
|
|
|
|
|
|
if (baseB > 0)
|
|
|
|
{
|
|
|
|
hashBlocks.append(QString::number(baseB));
|
|
|
|
}
|
|
|
|
|
|
|
|
if (baseC > 0)
|
|
|
|
{
|
|
|
|
hashBlocks.append(QString::number(baseC));
|
|
|
|
}
|
|
|
|
return hashBlocks.join(';');
|
2020-10-03 17:52:31 +02:00
|
|
|
}
|
|
|
|
|
2017-08-04 19:29:43 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
auto VMeasurement::CalcValue() const -> qreal
|
2017-08-04 19:29:43 +02:00
|
|
|
{
|
2020-10-03 17:52:31 +02:00
|
|
|
if (qFuzzyIsNull(d->currentBaseA))
|
2017-08-04 19:29:43 +02:00
|
|
|
{
|
|
|
|
return VInternalVariable::GetValue();
|
|
|
|
}
|
|
|
|
|
2020-10-03 17:52:31 +02:00
|
|
|
// Formula for calculation gradation
|
|
|
|
const qreal kA = d->stepA > 0 ? (d->currentBaseA - d->baseA) / d->stepA : 0;
|
|
|
|
const qreal kB = d->stepB > 0 ? (d->currentBaseB - d->baseB) / d->stepB : 0;
|
|
|
|
const qreal kC = d->stepC > 0 ? (d->currentBaseC - d->baseC) / d->stepC : 0;
|
|
|
|
|
|
|
|
return d->shiftBase + kA * d->shiftA + kB * d->shiftB + kC * d->shiftC + Correction();
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
auto VMeasurement::Correction() const -> qreal
|
2020-10-03 17:52:31 +02:00
|
|
|
{
|
|
|
|
const QString hash = CorrectionHash(d->currentBaseA, d->currentBaseB, d->currentBaseC);
|
|
|
|
if (d->corrections.contains(hash))
|
2017-08-04 19:29:43 +02:00
|
|
|
{
|
2020-10-03 17:52:31 +02:00
|
|
|
return d->corrections.value(hash);
|
2017-08-04 19:29:43 +02:00
|
|
|
}
|
|
|
|
|
2020-10-03 17:52:31 +02:00
|
|
|
return 0;
|
2017-08-04 19:29:43 +02:00
|
|
|
}
|
|
|
|
|
2014-08-20 19:43:53 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
/**
|
|
|
|
* @brief GetGuiText measurement name for tooltip
|
|
|
|
* @return measurement name
|
|
|
|
*/
|
2023-05-03 13:07:02 +02:00
|
|
|
auto VMeasurement::GetGuiText() const -> QString
|
2014-08-20 19:43:53 +02:00
|
|
|
{
|
|
|
|
return d->gui_text;
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-10-03 17:52:31 +02:00
|
|
|
void VMeasurement::SetGuiText(const QString &guiText)
|
2014-08-20 19:43:53 +02:00
|
|
|
{
|
2020-10-03 17:52:31 +02:00
|
|
|
d->gui_text = guiText;
|
2014-08-20 19:43:53 +02:00
|
|
|
}
|
2015-07-21 17:28:20 +02:00
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
auto VMeasurement::GetFormula() const -> QString
|
2015-07-21 17:28:20 +02:00
|
|
|
{
|
|
|
|
return d->formula;
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
auto VMeasurement::IsCustom() const -> bool
|
2015-07-21 17:28:20 +02:00
|
|
|
{
|
2017-08-04 19:29:43 +02:00
|
|
|
return GetName().indexOf(CustomMSign) == 0;
|
2015-07-21 17:28:20 +02:00
|
|
|
}
|
|
|
|
|
2015-07-24 12:06:39 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
auto VMeasurement::Index() const -> int
|
2015-07-24 12:06:39 +02:00
|
|
|
{
|
2015-10-19 15:21:06 +02:00
|
|
|
return static_cast<int>(d->index);
|
2015-07-24 12:06:39 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
auto VMeasurement::IsFormulaOk() const -> bool
|
2015-07-24 12:06:39 +02:00
|
|
|
{
|
|
|
|
return d->formulaOk;
|
|
|
|
}
|
|
|
|
|
2022-02-05 14:00:22 +01:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
auto VMeasurement::GetMeasurementType() const -> MeasurementType
|
2022-02-05 14:00:22 +01:00
|
|
|
{
|
|
|
|
return d->varType;
|
|
|
|
}
|
|
|
|
|
2017-08-04 19:29:43 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
auto VMeasurement::IsNotUsed() const -> bool
|
2017-08-04 19:29:43 +02:00
|
|
|
{
|
2020-10-03 17:52:31 +02:00
|
|
|
return qFuzzyIsNull(d->shiftBase) && qFuzzyIsNull(d->shiftB) && qFuzzyIsNull(d->shiftA);
|
2017-08-04 19:29:43 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
auto VMeasurement::GetValue() const -> qreal
|
2017-08-04 19:29:43 +02:00
|
|
|
{
|
|
|
|
return CalcValue();
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
auto VMeasurement::GetValue() -> qreal *
|
2017-08-04 19:29:43 +02:00
|
|
|
{
|
|
|
|
VInternalVariable::SetValue(CalcValue());
|
|
|
|
return VInternalVariable::GetValue();
|
|
|
|
}
|
|
|
|
|
2015-07-21 17:28:20 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
auto VMeasurement::GetData() -> VContainer *
|
2015-07-21 17:28:20 +02:00
|
|
|
{
|
2018-09-18 15:38:16 +02:00
|
|
|
return d->data.data();
|
2017-08-04 19:29:43 +02:00
|
|
|
}
|
|
|
|
|
2018-10-12 12:06:03 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-10-03 17:52:31 +02:00
|
|
|
void VMeasurement::SetBaseA(qreal base)
|
2018-10-12 12:06:03 +02:00
|
|
|
{
|
2020-10-03 17:52:31 +02:00
|
|
|
d->currentBaseA = base;
|
2018-10-12 12:06:03 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-10-03 17:52:31 +02:00
|
|
|
void VMeasurement::SetBaseB(qreal base)
|
2018-10-12 12:06:03 +02:00
|
|
|
{
|
2020-10-03 17:52:31 +02:00
|
|
|
d->currentBaseB = base;
|
2018-10-12 12:06:03 +02:00
|
|
|
}
|
|
|
|
|
2017-08-04 19:29:43 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-10-03 17:52:31 +02:00
|
|
|
void VMeasurement::SetBaseC(qreal base)
|
2017-08-04 19:29:43 +02:00
|
|
|
{
|
2020-10-03 17:52:31 +02:00
|
|
|
d->currentBaseC = base;
|
2017-08-04 19:29:43 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
/**
|
|
|
|
* @brief GetBase return value in base size and height
|
|
|
|
* @return value
|
|
|
|
*/
|
2023-05-03 13:07:02 +02:00
|
|
|
auto VMeasurement::GetBase() const -> qreal
|
2017-08-04 19:29:43 +02:00
|
|
|
{
|
2020-10-03 17:52:31 +02:00
|
|
|
return d->shiftBase;
|
2017-08-04 19:29:43 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-10-03 17:52:31 +02:00
|
|
|
void VMeasurement::SetBase(qreal value)
|
2017-08-04 19:29:43 +02:00
|
|
|
{
|
2020-10-03 17:52:31 +02:00
|
|
|
d->shiftBase = value;
|
2017-08-04 19:29:43 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
/**
|
2020-10-03 17:52:31 +02:00
|
|
|
* @brief GetKheight return increment in heights
|
2017-08-04 19:29:43 +02:00
|
|
|
* @return increment
|
|
|
|
*/
|
2023-05-03 13:07:02 +02:00
|
|
|
auto VMeasurement::GetShiftA() const -> qreal
|
2017-08-04 19:29:43 +02:00
|
|
|
{
|
2020-10-03 17:52:31 +02:00
|
|
|
return d->shiftA;
|
2017-08-04 19:29:43 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
// cppcheck-suppress unusedFunction
|
2020-10-03 17:52:31 +02:00
|
|
|
void VMeasurement::SetShiftA(qreal value)
|
2017-08-04 19:29:43 +02:00
|
|
|
{
|
2020-10-03 17:52:31 +02:00
|
|
|
d->shiftA = value;
|
2017-08-04 19:29:43 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
/**
|
2020-10-03 17:52:31 +02:00
|
|
|
* @brief GetKsize return increment in sizes
|
2017-08-04 19:29:43 +02:00
|
|
|
* @return increment
|
|
|
|
*/
|
2023-05-03 13:07:02 +02:00
|
|
|
auto VMeasurement::GetShiftB() const -> qreal
|
2017-08-04 19:29:43 +02:00
|
|
|
{
|
2020-10-03 17:52:31 +02:00
|
|
|
return d->shiftB;
|
2017-08-04 19:29:43 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
// cppcheck-suppress unusedFunction
|
2020-10-03 17:52:31 +02:00
|
|
|
void VMeasurement::SetShiftB(qreal value)
|
|
|
|
{
|
|
|
|
d->shiftB = value;
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
auto VMeasurement::GetShiftC() const -> qreal
|
2020-10-03 17:52:31 +02:00
|
|
|
{
|
|
|
|
return d->shiftC;
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VMeasurement::SetShiftC(qreal value)
|
|
|
|
{
|
|
|
|
d->shiftC = value;
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
auto VMeasurement::GetStepA() const -> qreal
|
2020-10-03 17:52:31 +02:00
|
|
|
{
|
|
|
|
return d->shiftA;
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VMeasurement::SetStepA(qreal value)
|
|
|
|
{
|
|
|
|
d->stepA = value;
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
auto VMeasurement::GetStepB() const -> qreal
|
2020-10-03 17:52:31 +02:00
|
|
|
{
|
|
|
|
return d->stepB;
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VMeasurement::SetStepB(qreal value)
|
|
|
|
{
|
|
|
|
d->stepB = value;
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
auto VMeasurement::GetStepC() const -> qreal
|
2020-10-03 17:52:31 +02:00
|
|
|
{
|
|
|
|
return d->stepC;
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VMeasurement::SetStepC(qreal value)
|
|
|
|
{
|
|
|
|
d->stepC = value;
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
auto VMeasurement::IsSpecialUnits() const -> bool
|
2020-10-03 17:52:31 +02:00
|
|
|
{
|
|
|
|
return d->specialUnits;
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VMeasurement::SetSpecialUnits(bool special)
|
|
|
|
{
|
|
|
|
d->specialUnits = special;
|
|
|
|
}
|
|
|
|
|
2020-10-15 08:35:08 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
auto VMeasurement::GetDimension() const -> IMD
|
2020-10-15 08:35:08 +02:00
|
|
|
{
|
|
|
|
return d->dimension;
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VMeasurement::SetDimension(IMD type)
|
|
|
|
{
|
|
|
|
d->dimension = type;
|
|
|
|
}
|
|
|
|
|
2020-10-03 17:52:31 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
auto VMeasurement::GetCorrection(qreal baseA, qreal baseB, qreal baseC) const -> qreal
|
2020-10-03 17:52:31 +02:00
|
|
|
{
|
|
|
|
return d->corrections.value(VMeasurement::CorrectionHash(baseA, baseB, baseC), 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
auto VMeasurement::GetCorrections() const -> QMap<QString, qreal>
|
2020-10-03 17:52:31 +02:00
|
|
|
{
|
|
|
|
return d->corrections;
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VMeasurement::SetCorrections(const QMap<QString, qreal> &corrections)
|
2017-08-04 19:29:43 +02:00
|
|
|
{
|
2020-10-03 17:52:31 +02:00
|
|
|
d->corrections = corrections;
|
2017-08-04 19:29:43 +02:00
|
|
|
}
|