55 #include <QMessageLogger>
58 #include "../ifc/ifcdef.h"
62 #ifdef Q_COMPILER_RVALUE_REFS
64 { Swap(m);
return *
this; }
82 const qreal &ksize,
const qreal &kheight,
const QString &gui_text,
83 const QString &description,
const QString &tagName)
85 d(new
VMeasurementData(index, gui_text, tagName, baseSize, baseHeight, base, ksize, kheight))
101 const QString &formula,
bool ok,
const QString &gui_text,
const QString &description,
102 const QString &tagName)
136 qWarning()<<
"Multisize table doesn't support inches.";
141 while (i != heights.constEnd())
145 ListValue(list,
static_cast<int>(i.key()), patternUnit);
163 qWarning()<<
"Multisize table doesn't support inches.";
168 while (i != sizes.constEnd())
172 ListValue(list,
static_cast<int>(i.key()), patternUnit);
190 qWarning()<<
"Multisize table doesn't support inches.";
208 qWarning()<<
"Multisize table doesn't support inches.";
223 if (not size.isEmpty())
226 return sizes.contains(size);
237 if (not height.isEmpty())
240 return heights.contains(height);
251 if (
d->currentUnit ==
nullptr ||
d->currentSize ==
nullptr ||
d->currentHeight ==
nullptr)
258 qWarning(
"Gradation doesn't support inches");
266 const qreal k_size = ( *
d->currentSize -
d->baseSize ) / sizeIncrement;
267 const qreal k_height = ( *
d->currentHeight -
d->baseHeight ) / heightIncrement;
268 return d->base + k_size *
d->ksize + k_height *
d->kheight;
275 const QString strVal = QString(
"%1").arg(val);
298 d->_tagName = tagName;
316 return static_cast<int>(
d->index);
328 return qFuzzyIsNull(
d->base) && qFuzzyIsNull(
d->ksize) && qFuzzyIsNull(
d->kheight);
353 d->currentSize = size;
359 d->currentHeight = height;
365 d->currentUnit = unit;
The VContainer class container of all variables.
void SetType(const VarType &type)
virtual qreal GetValue() const
void SetValue(const qreal &value)
The VMeasurement class keep data row of multisize table.
QString GetFormula() const
qreal GetKheight() const
GetKheight return increment in heights.
VMeasurement(quint32 index, const QString &name, qreal baseSize, qreal baseHeight, const qreal &base, const qreal &ksize, const qreal &kheight, const QString &gui_text=QString(), const QString &description=QString(), const QString &tagName=QString())
VMeasurement create measurement for multisize table.
QSharedDataPointer< VMeasurementData > d
void SetSize(qreal *size)
void SetHeight(qreal *height)
virtual qreal GetValue() const Q_DECL_OVERRIDE
void SetKsize(const qreal &value)
void SetUnit(const Unit *unit)
void SetBase(const qreal &value)
static QStringList WholeListSizes(Unit patternUnit)
void setTagName(const QString &tagName)
void Swap(VMeasurement &m) Q_DECL_NOTHROW
static QStringList WholeListHeights(Unit patternUnit)
static void ListValue(QStringList &list, qreal value, Unit patternUnit)
static QStringList ListSizes(QMap< GSizes, bool > sizes, Unit patternUnit)
virtual ~VMeasurement() Q_DECL_OVERRIDE
void SetKheight(const qreal &value)
static bool IsGradationSizeValid(const QString &size)
qreal GetKsize() const
GetKsize return increment in sizes.
static QStringList ListHeights(QMap< GHeights, bool > heights, Unit patternUnit)
VMeasurement & operator=(const VMeasurement &m)
virtual bool isNotUsed() const Q_DECL_OVERRIDE
static bool IsGradationHeightValid(const QString &height)
QString getGuiText() const
getGuiText measurement name for tooltip
qreal GetBase() const
GetBase return value in base size and height.
VVariable & operator=(const VVariable &var)
void Swap(VVariable &var) Q_DECL_NOTHROW
qreal UnitConvertor(qreal value, const Unit &from, const Unit &to)
static const int heightStep
static const int sizeStep
const QString CustomMSign