From 657c445e46bd8fd5282f2777502e09bba326c591 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Thu, 28 Sep 2017 16:39:27 +0300 Subject: [PATCH] Extract formulas from final measurements. --HG-- branch : feature --- src/libs/ifc/xml/vabstractpattern.cpp | 21 +++++++++++++++++++++ src/libs/ifc/xml/vabstractpattern.h | 1 + 2 files changed, 22 insertions(+) diff --git a/src/libs/ifc/xml/vabstractpattern.cpp b/src/libs/ifc/xml/vabstractpattern.cpp index 5c26c377b..63176c797 100644 --- a/src/libs/ifc/xml/vabstractpattern.cpp +++ b/src/libs/ifc/xml/vabstractpattern.cpp @@ -1761,6 +1761,7 @@ QVector VAbstractPattern::ListExpressions() const list << ListOperationExpressions(); list << ListPathExpressions(); list << ListPieceExpressions(); + list << ListFinalMeasurementsExpressions(); return list; } @@ -1997,6 +1998,26 @@ QVector VAbstractPattern::ListPieceExpressions() const return expressions; } +//--------------------------------------------------------------------------------------------------------------------- +QVector VAbstractPattern::ListFinalMeasurementsExpressions() const +{ + QVector expressions; + const QDomNodeList list = elementsByTagName(TagFMeasurement); + for (int i=0; i < list.size(); ++i) + { + const QDomElement dom = list.at(i).toElement(); + if (dom.isNull()) + { + continue; + } + + // Each tag can contains several attributes. + ReadExpressionAttribute(expressions, dom, AttrFormula); + } + + return expressions; +} + //--------------------------------------------------------------------------------------------------------------------- bool VAbstractPattern::IsVariable(const QString &token) const { diff --git a/src/libs/ifc/xml/vabstractpattern.h b/src/libs/ifc/xml/vabstractpattern.h index b10b39391..d1a681451 100644 --- a/src/libs/ifc/xml/vabstractpattern.h +++ b/src/libs/ifc/xml/vabstractpattern.h @@ -446,6 +446,7 @@ private: QVector ListPathExpressions() const; QVector ListGrainlineExpressions(const QDomElement &element) const; QVector ListPieceExpressions() const; + QVector ListFinalMeasurementsExpressions() const; bool IsVariable(const QString& token) const; bool IsPostfixOperator(const QString& token) const;