From 9d001ea00a528229c0990bfe49158b38624156fc Mon Sep 17 00:00:00 2001 From: dismine Date: Wed, 18 Jun 2014 13:40:42 +0300 Subject: [PATCH 01/20] Refactoring. --HG-- branch : feature --- src/app/xml/vabstractmeasurements.cpp | 219 ++++++++++++++++++++++++ src/app/xml/vabstractmeasurements.h | 50 ++++++ src/app/xml/vindividualmeasurements.cpp | 179 ++----------------- src/app/xml/vindividualmeasurements.h | 35 ++-- src/app/xml/vstandardmeasurements.cpp | 192 ++------------------- src/app/xml/vstandardmeasurements.h | 16 +- src/app/xml/xml.pri | 6 +- 7 files changed, 324 insertions(+), 373 deletions(-) create mode 100644 src/app/xml/vabstractmeasurements.cpp create mode 100644 src/app/xml/vabstractmeasurements.h diff --git a/src/app/xml/vabstractmeasurements.cpp b/src/app/xml/vabstractmeasurements.cpp new file mode 100644 index 000000000..810a78bdc --- /dev/null +++ b/src/app/xml/vabstractmeasurements.cpp @@ -0,0 +1,219 @@ +/************************************************************************ + ** + ** @file vabstractmeasurements.cpp + ** @author Roman Telezhynskyi + ** @date 18 6, 2014 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2014 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** 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. + ** + ** Valentina is distributed in the hope that it will be useful, + ** 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 . + ** + *************************************************************************/ + +#include "vabstractmeasurements.h" + +const QString VAbstractMeasurements::TagUnit = QStringLiteral("unit"); +const QString VAbstractMeasurements::AttrValue = QStringLiteral("value"); + +//--------------------------------------------------------------------------------------------------------------------- +VAbstractMeasurements::VAbstractMeasurements(VContainer *data) + :VDomDocument(data) +{ + SCASSERT(data != nullptr) +} + +//--------------------------------------------------------------------------------------------------------------------- +VAbstractMeasurements::~VAbstractMeasurements() +{} + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief Measurements help read all measurements. + * + * Virtual method that keep all common measurements name. Measurements height and size create in different way in + * individual and standard measurements, see VIndividualMeasurements::Measurements(). + */ +void VAbstractMeasurements::Measurements() +{ + //head and neck + Measurement(headGirth_M); + Measurement(midNeckGirth_M); + Measurement(neckBaseGirth_M); + Measurement(headAndNeckLength_M); + //torso + Measurement(centerFrontWaistLength_M); + Measurement(centerBackWaistLength_M); + Measurement(shoulderLength_M); + Measurement(sideWaistLength_M); + Measurement(trunkLength_M); + Measurement(shoulderGirth_M); + Measurement(upperChestGirth_M); + Measurement(bustGirth_M); + Measurement(underBustGirth_M); + Measurement(waistGirth_M); + Measurement(highHipGirth_M); + Measurement(hipGirth_M); + Measurement(upperFrontChestWidth_M); + Measurement(frontChestWidth_M); + Measurement(acrossFrontShoulderWidth_M); + Measurement(acrossBackShoulderWidth_M); + Measurement(upperBackWidth_M); + Measurement(backWidth_M); + Measurement(bustpointToBustpoint_M); + Measurement(halterBustpointToBustpoint_M); + Measurement(neckToBustpoint_M); + Measurement(crotchLength_M); + Measurement(riseHeight_M); + Measurement(shoulderDrop_M); + Measurement(shoulderSlopeDegrees_M); + Measurement(frontShoulderSlopeLength_M); + Measurement(backShoulderSlopeLength_M); + Measurement(frontShoulderToWaistLength_M); + Measurement(backShoulderToWaistLength_M); + Measurement(frontNeckArc_M); + Measurement(backNeckArc_M); + Measurement(frontUpperChestArc_M); + Measurement(backUpperChestArc_M); + Measurement(frontWaistArc_M); + Measurement(backWaistArc_M); + Measurement(frontUpperHipArc_M); + Measurement(backUpperHipArc_M); + Measurement(frontHipArc_M); + Measurement(backHipArc_M); + Measurement(chestSlope_M); + Measurement(backSlope_M); + Measurement(frontWaistSlope_M); + Measurement(backWaistSlope_M); + Measurement(frontNeckToUpperChestHeight_M); + Measurement(frontNeckToBustHeight_M); + //arm + Measurement(armscyeGirth_M); + Measurement(elbowGirth_M); + Measurement(upperArmGirth_M); + Measurement(wristGirth_M); + Measurement(scyeDepth_M); + Measurement(shoulderAndArmLength_M); + Measurement(underarmLength_M); + Measurement(cervicaleToWristLength_M); + Measurement(shoulderToElbowLength_M); + Measurement(armLength_M); + //hand + Measurement(handWidth_M); + Measurement(handLength_M); + Measurement(handGirth_M); + //leg + Measurement(thighGirth_M); + Measurement(midThighGirth_M); + Measurement(kneeGirth_M); + Measurement(calfGirth_M); + Measurement(ankleGirth_M); + Measurement(kneeHeight_M); + Measurement(ankleHeight_M); + //foot + Measurement(footWidth_M); + Measurement(footLength_M); + //heights + Measurement(cervicaleHeight_M); + Measurement(cervicaleToKneeHeight_M); + Measurement(waistHeight_M); + Measurement(highHipHeight_M); + Measurement(hipHeight_M); + Measurement(waistToHipHeight_M); + Measurement(waistToKneeHeight_M); + Measurement(crotchHeight_M); + //extended + Measurement(heightFrontNeckBasePoint_M); + Measurement(heightBaseNeckSidePoint_M); + Measurement(heightShoulderPoint_M); + Measurement(heightNipplePoint_M); + Measurement(heightBackAngleAxilla_M); + Measurement(heightScapularPoint_M); + Measurement(heightUnderButtockFolds_M); + Measurement(hipsExcludingProtrudingAbdomen_M); + Measurement(girthFootInstep_M); + Measurement(sideWaistToFloor_M); + Measurement(frontWaistToFloor_M); + Measurement(arcThroughGroinArea_M); + Measurement(waistToPlaneSeat_M); + Measurement(neckToRadialPoint_M); + Measurement(neckToThirdFinger_M); + Measurement(neckToFirstLineChestCircumference_M); + Measurement(frontWaistLength_M); + Measurement(arcThroughShoulderJoint_M); + Measurement(neckToBackLineChestCircumference_M); + Measurement(waistToNeckSide_M); + Measurement(arcLengthUpperBody_M); + Measurement(chestWidth_M); + Measurement(anteroposteriorDiameterHands_M); + Measurement(heightClavicularPoint_M); + Measurement(heightArmholeSlash_M); + Measurement(slashShoulderHeight_M); + Measurement(halfGirthNeck_M); + Measurement(halfGirthNeckForShirts_M); + Measurement(halfGirthChestFirst_M); + Measurement(halfGirthChestSecond_M); + Measurement(halfGirthChestThird_M); + Measurement(halfGirthWaist_M); + Measurement(halfGirthHipsConsideringProtrudingAbdomen_M); + Measurement(halfGirthHipsExcludingProtrudingAbdomen_M); + Measurement(girthKneeFlexedFeet_M); + Measurement(neckTransverseDiameter_M); + Measurement(frontSlashShoulderHeight_M); + Measurement(neckToFrontWaistLine_M); + Measurement(handVerticalDiameter_M); + Measurement(neckToKneePoint_M); + Measurement(waistToKnee_M); + Measurement(shoulderHeight_M); + Measurement(headHeight_M); + Measurement(bodyPosition_M); + Measurement(arcBehindShoulderGirdle_M); + Measurement(neckToNeckBase_M); + Measurement(depthWaistFirst_M); + Measurement(depthWaistSecond_M); +} + +//--------------------------------------------------------------------------------------------------------------------- +Unit VAbstractMeasurements::MUnit() const +{ + const QString unit = UniqueTagText(TagUnit, UnitCM); + return VDomDocument::StrToUnits(unit); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VAbstractMeasurements::Measurement(const QString &tag) +{ + const QDomNodeList nodeList = this->elementsByTagName(tag); + if (nodeList.isEmpty()) + { + qDebug()<<"Measurement" << tag <<"doesn't exist"< + ** @date 18 6, 2014 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2014 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** 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. + ** + ** Valentina is distributed in the hope that it will be useful, + ** 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 . + ** + *************************************************************************/ + +#ifndef VABSTRACTMEASUREMENTS_H +#define VABSTRACTMEASUREMENTS_H + +#include "vdomdocument.h" + +class VAbstractMeasurements : public VDomDocument +{ +public: + VAbstractMeasurements(VContainer *data); + virtual ~VAbstractMeasurements(); + virtual void Measurements(); + Unit MUnit() const; + static const QString TagUnit; + static const QString AttrValue; +protected: + void Measurement(const QString &tag); + virtual void ReadMeasurement(const QDomElement &domElement, const QString &tag) = 0; +private: + Q_DISABLE_COPY(VAbstractMeasurements) +}; + +#endif // VABSTRACTMEASUREMENTS_H diff --git a/src/app/xml/vindividualmeasurements.cpp b/src/app/xml/vindividualmeasurements.cpp index 0acefe104..bafbc4f88 100644 --- a/src/app/xml/vindividualmeasurements.cpp +++ b/src/app/xml/vindividualmeasurements.cpp @@ -30,31 +30,25 @@ #include "../widgets/vapplication.h" #include -const QString VIndividualMeasurements::AttrValue = QStringLiteral("value"); const QString VIndividualMeasurements::TagFamily_name = QStringLiteral("family-name"); const QString VIndividualMeasurements::TagGiven_name = QStringLiteral("given-name"); const QString VIndividualMeasurements::TagBirth_date = QStringLiteral("birth-date"); const QString VIndividualMeasurements::TagSex = QStringLiteral("sex"); -const QString VIndividualMeasurements::TagUnit = QStringLiteral("unit"); const QString VIndividualMeasurements::TagEmail = QStringLiteral("email"); const QString VIndividualMeasurements::SexMale = QStringLiteral("male"); const QString VIndividualMeasurements::SexFemale = QStringLiteral("female"); //--------------------------------------------------------------------------------------------------------------------- -VIndividualMeasurements::VIndividualMeasurements(VContainer *data):VDomDocument(data) -{} +VIndividualMeasurements::VIndividualMeasurements(VContainer *data) + :VAbstractMeasurements(data) +{ + SCASSERT(data != nullptr) +} //--------------------------------------------------------------------------------------------------------------------- VIndividualMeasurements::~VIndividualMeasurements() {} -//--------------------------------------------------------------------------------------------------------------------- -Unit VIndividualMeasurements::MUnit() const -{ - const QString unit = UniqueTagText(TagUnit, UnitCM); - return VDomDocument::StrToUnits(unit); -} - //--------------------------------------------------------------------------------------------------------------------- void VIndividualMeasurements::setUnit(const Unit &unit) { @@ -64,172 +58,23 @@ void VIndividualMeasurements::setUnit(const Unit &unit) //--------------------------------------------------------------------------------------------------------------------- void VIndividualMeasurements::Measurements() { - //head and neck - Measurement(headGirth_M); - Measurement(midNeckGirth_M); - Measurement(neckBaseGirth_M); - Measurement(headAndNeckLength_M); - //torso - Measurement(centerFrontWaistLength_M); - Measurement(centerBackWaistLength_M); - Measurement(shoulderLength_M); - Measurement(sideWaistLength_M); - Measurement(trunkLength_M); - Measurement(shoulderGirth_M); - Measurement(upperChestGirth_M); - Measurement(bustGirth_M); - Measurement(underBustGirth_M); - Measurement(waistGirth_M); - Measurement(highHipGirth_M); - Measurement(hipGirth_M); - Measurement(upperFrontChestWidth_M); - Measurement(frontChestWidth_M); - Measurement(acrossFrontShoulderWidth_M); - Measurement(acrossBackShoulderWidth_M); - Measurement(upperBackWidth_M); - Measurement(backWidth_M); - Measurement(bustpointToBustpoint_M); - Measurement(halterBustpointToBustpoint_M); - Measurement(neckToBustpoint_M); - Measurement(crotchLength_M); - Measurement(riseHeight_M); - Measurement(shoulderDrop_M); - Measurement(shoulderSlopeDegrees_M); - Measurement(frontShoulderSlopeLength_M); - Measurement(backShoulderSlopeLength_M); - Measurement(frontShoulderToWaistLength_M); - Measurement(backShoulderToWaistLength_M); - Measurement(frontNeckArc_M); - Measurement(backNeckArc_M); - Measurement(frontUpperChestArc_M); - Measurement(backUpperChestArc_M); - Measurement(frontWaistArc_M); - Measurement(backWaistArc_M); - Measurement(frontUpperHipArc_M); - Measurement(backUpperHipArc_M); - Measurement(frontHipArc_M); - Measurement(backHipArc_M); - Measurement(chestSlope_M); - Measurement(backSlope_M); - Measurement(frontWaistSlope_M); - Measurement(backWaistSlope_M); - Measurement(frontNeckToUpperChestHeight_M); - Measurement(frontNeckToBustHeight_M); - //arm - Measurement(armscyeGirth_M); - Measurement(elbowGirth_M); - Measurement(upperArmGirth_M); - Measurement(wristGirth_M); - Measurement(scyeDepth_M); - Measurement(shoulderAndArmLength_M); - Measurement(underarmLength_M); - Measurement(cervicaleToWristLength_M); - Measurement(shoulderToElbowLength_M); - Measurement(armLength_M); - //hand - Measurement(handWidth_M); - Measurement(handLength_M); - Measurement(handGirth_M); - //leg - Measurement(thighGirth_M); - Measurement(midThighGirth_M); - Measurement(kneeGirth_M); - Measurement(calfGirth_M); - Measurement(ankleGirth_M); - Measurement(kneeHeight_M); - Measurement(ankleHeight_M); - //foot - Measurement(footWidth_M); - Measurement(footLength_M); + VAbstractMeasurements::Measurements(); //heights Measurement(height_M); - Measurement(cervicaleHeight_M); - Measurement(cervicaleToKneeHeight_M); - Measurement(waistHeight_M); - Measurement(highHipHeight_M); - Measurement(hipHeight_M); - Measurement(waistToHipHeight_M); - Measurement(waistToKneeHeight_M); - Measurement(crotchHeight_M); //extended Measurement(size_M); - Measurement(heightFrontNeckBasePoint_M); - Measurement(heightBaseNeckSidePoint_M); - Measurement(heightShoulderPoint_M); - Measurement(heightNipplePoint_M); - Measurement(heightBackAngleAxilla_M); - Measurement(heightScapularPoint_M); - Measurement(heightUnderButtockFolds_M); - Measurement(hipsExcludingProtrudingAbdomen_M); - Measurement(girthFootInstep_M); - Measurement(sideWaistToFloor_M); - Measurement(frontWaistToFloor_M); - Measurement(arcThroughGroinArea_M); - Measurement(waistToPlaneSeat_M); - Measurement(neckToRadialPoint_M); - Measurement(neckToThirdFinger_M); - Measurement(neckToFirstLineChestCircumference_M); - Measurement(frontWaistLength_M); - Measurement(arcThroughShoulderJoint_M); - Measurement(neckToBackLineChestCircumference_M); - Measurement(waistToNeckSide_M); - Measurement(arcLengthUpperBody_M); - Measurement(chestWidth_M); - Measurement(anteroposteriorDiameterHands_M); - Measurement(heightClavicularPoint_M); - Measurement(heightArmholeSlash_M); - Measurement(slashShoulderHeight_M); - Measurement(halfGirthNeck_M); - Measurement(halfGirthNeckForShirts_M); - Measurement(halfGirthChestFirst_M); - Measurement(halfGirthChestSecond_M); - Measurement(halfGirthChestThird_M); - Measurement(halfGirthWaist_M); - Measurement(halfGirthHipsConsideringProtrudingAbdomen_M); - Measurement(halfGirthHipsExcludingProtrudingAbdomen_M); - Measurement(girthKneeFlexedFeet_M); - Measurement(neckTransverseDiameter_M); - Measurement(frontSlashShoulderHeight_M); - Measurement(neckToFrontWaistLine_M); - Measurement(handVerticalDiameter_M); - Measurement(neckToKneePoint_M); - Measurement(waistToKnee_M); - Measurement(shoulderHeight_M); - Measurement(headHeight_M); - Measurement(bodyPosition_M); - Measurement(arcBehindShoulderGirdle_M); - Measurement(neckToNeckBase_M); - Measurement(depthWaistFirst_M); - Measurement(depthWaistSecond_M); } //--------------------------------------------------------------------------------------------------------------------- -void VIndividualMeasurements::Measurement(const QString &tag) +void VIndividualMeasurements::ReadMeasurement(const QDomElement &domElement, const QString &tag) { - const QDomNodeList nodeList = this->elementsByTagName(tag); - if (nodeList.isEmpty()) - { - qDebug()<<"Measurement" << tag <<"doesn't exist"<AddMeasurement(tag, VMeasurement(value, qApp->GuiText(tag), qApp->Description(tag), tag)); - } - } + if (MUnit() == Unit::Mm)//Convert to Cm. + { + value = value / 10.0; } + data->AddMeasurement(tag, VMeasurement(value, qApp->GuiText(tag), qApp->Description(tag), tag)); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/xml/vindividualmeasurements.h b/src/app/xml/vindividualmeasurements.h index ced9a7b43..e117360ef 100644 --- a/src/app/xml/vindividualmeasurements.h +++ b/src/app/xml/vindividualmeasurements.h @@ -29,7 +29,7 @@ #ifndef VINDIVIDUALMEASUREMENTS_H #define VINDIVIDUALMEASUREMENTS_H -#include "vdomdocument.h" +#include "vabstractmeasurements.h" /* VIT_VERSION is (major << 16) + (minor << 8) + patch. @@ -41,39 +41,38 @@ enum class SexType : char { Male, Female }; -class VIndividualMeasurements:public VDomDocument +class VIndividualMeasurements:public VAbstractMeasurements { public: VIndividualMeasurements(VContainer *data); virtual ~VIndividualMeasurements(); - Unit MUnit() const; - void setUnit(const Unit &unit); - void Measurements(); - QString FamilyName() const; - void setFamilyName(const QString &text); - QString GivenName() const; - void setGivenName(const QString &text); - QDate BirthDate() const; - void setBirthDate(const QDate &date); - SexType Sex() const; - void setSex(const SexType &sex); - QString Mail() const; - void setMail(const QString &text); - static const QString AttrValue; + void setUnit(const Unit &unit); + virtual void Measurements(); + QString FamilyName() const; + void setFamilyName(const QString &text); + QString GivenName() const; + void setGivenName(const QString &text); + QDate BirthDate() const; + void setBirthDate(const QDate &date); + SexType Sex() const; + void setSex(const SexType &sex); + QString Mail() const; + void setMail(const QString &text); + static const QString TagFamily_name; static const QString TagGiven_name; static const QString TagBirth_date; static const QString TagSex; - static const QString TagUnit; static const QString TagEmail; static const QString SexMale; static const QString SexFemale; static QString GenderToStr(const SexType &sex); static SexType StrToGender(const QString &sex); +protected: + virtual void ReadMeasurement(const QDomElement &domElement, const QString &tag); private: Q_DISABLE_COPY(VIndividualMeasurements) - void Measurement(const QString &tag); }; #endif // VINDIVIDUALMEASUREMENTS_H diff --git a/src/app/xml/vstandardmeasurements.cpp b/src/app/xml/vstandardmeasurements.cpp index 82f10b09e..1c99fc8a1 100644 --- a/src/app/xml/vstandardmeasurements.cpp +++ b/src/app/xml/vstandardmeasurements.cpp @@ -33,25 +33,20 @@ const QString VStandardMeasurements::TagDescription = QStringLiteral("description"); const QString VStandardMeasurements::TagSize = QStringLiteral("size"); const QString VStandardMeasurements::TagHeight = QStringLiteral("height"); -const QString VStandardMeasurements::AttrValue = QStringLiteral("value"); const QString VStandardMeasurements::AttrSize_increase = QStringLiteral("size_increase"); const QString VStandardMeasurements::AttrHeight_increase = QStringLiteral("height_increase"); //--------------------------------------------------------------------------------------------------------------------- -VStandardMeasurements::VStandardMeasurements(VContainer *data):VDomDocument(data) -{} +VStandardMeasurements::VStandardMeasurements(VContainer *data) + :VAbstractMeasurements(data) +{ + SCASSERT(data != nullptr) +} //--------------------------------------------------------------------------------------------------------------------- VStandardMeasurements::~VStandardMeasurements() {} -//--------------------------------------------------------------------------------------------------------------------- -Unit VStandardMeasurements::MUnit() -{ - const QString unit = UniqueTagText(AttrUnit, UnitCM); - return VDomDocument::StrToUnits(unit); -} - //--------------------------------------------------------------------------------------------------------------------- QString VStandardMeasurements::Description() { @@ -64,178 +59,21 @@ QString VStandardMeasurements::Description() } //--------------------------------------------------------------------------------------------------------------------- -void VStandardMeasurements::Measurements() +void VStandardMeasurements::ReadMeasurement(const QDomElement &domElement, const QString &tag) { - //head and neck - Measurement(headGirth_M); - Measurement(midNeckGirth_M); - Measurement(neckBaseGirth_M); - Measurement(headAndNeckLength_M); - //torso - Measurement(centerFrontWaistLength_M); - Measurement(centerBackWaistLength_M); - Measurement(shoulderLength_M); - Measurement(sideWaistLength_M); - Measurement(trunkLength_M); - Measurement(shoulderGirth_M); - Measurement(upperChestGirth_M); - Measurement(bustGirth_M); - Measurement(underBustGirth_M); - Measurement(waistGirth_M); - Measurement(highHipGirth_M); - Measurement(hipGirth_M); - Measurement(upperFrontChestWidth_M); - Measurement(frontChestWidth_M); - Measurement(acrossFrontShoulderWidth_M); - Measurement(acrossBackShoulderWidth_M); - Measurement(upperBackWidth_M); - Measurement(backWidth_M); - Measurement(bustpointToBustpoint_M); - Measurement(halterBustpointToBustpoint_M); - Measurement(neckToBustpoint_M); - Measurement(crotchLength_M); - Measurement(riseHeight_M); - Measurement(shoulderDrop_M); - Measurement(shoulderSlopeDegrees_M); - Measurement(frontShoulderSlopeLength_M); - Measurement(backShoulderSlopeLength_M); - Measurement(frontShoulderToWaistLength_M); - Measurement(backShoulderToWaistLength_M); - Measurement(frontNeckArc_M); - Measurement(backNeckArc_M); - Measurement(frontUpperChestArc_M); - Measurement(backUpperChestArc_M); - Measurement(frontWaistArc_M); - Measurement(backWaistArc_M); - Measurement(frontUpperHipArc_M); - Measurement(backUpperHipArc_M); - Measurement(frontHipArc_M); - Measurement(backHipArc_M); - Measurement(chestSlope_M); - Measurement(backSlope_M); - Measurement(frontWaistSlope_M); - Measurement(backWaistSlope_M); - Measurement(frontNeckToUpperChestHeight_M); - Measurement(frontNeckToBustHeight_M); - //arm - Measurement(armscyeGirth_M); - Measurement(elbowGirth_M); - Measurement(upperArmGirth_M); - Measurement(wristGirth_M); - Measurement(scyeDepth_M); - Measurement(shoulderAndArmLength_M); - Measurement(underarmLength_M); - Measurement(cervicaleToWristLength_M); - Measurement(shoulderToElbowLength_M); - Measurement(armLength_M); - //hand - Measurement(handWidth_M); - Measurement(handLength_M); - Measurement(handGirth_M); - //leg - Measurement(thighGirth_M); - Measurement(midThighGirth_M); - Measurement(kneeGirth_M); - Measurement(calfGirth_M); - Measurement(ankleGirth_M); - Measurement(kneeHeight_M); - Measurement(ankleHeight_M); - //foot - Measurement(footWidth_M); - Measurement(footLength_M); - //heights - Measurement(cervicaleHeight_M); - Measurement(cervicaleToKneeHeight_M); - Measurement(waistHeight_M); - Measurement(highHipHeight_M); - Measurement(hipHeight_M); - Measurement(waistToHipHeight_M); - Measurement(waistToKneeHeight_M); - Measurement(crotchHeight_M); - //extended - Measurement(heightFrontNeckBasePoint_M); - Measurement(heightBaseNeckSidePoint_M); - Measurement(heightShoulderPoint_M); - Measurement(heightNipplePoint_M); - Measurement(heightBackAngleAxilla_M); - Measurement(heightScapularPoint_M); - Measurement(heightUnderButtockFolds_M); - Measurement(hipsExcludingProtrudingAbdomen_M); - Measurement(girthFootInstep_M); - Measurement(sideWaistToFloor_M); - Measurement(frontWaistToFloor_M); - Measurement(arcThroughGroinArea_M); - Measurement(waistToPlaneSeat_M); - Measurement(neckToRadialPoint_M); - Measurement(neckToThirdFinger_M); - Measurement(neckToFirstLineChestCircumference_M); - Measurement(frontWaistLength_M); - Measurement(arcThroughShoulderJoint_M); - Measurement(neckToBackLineChestCircumference_M); - Measurement(waistToNeckSide_M); - Measurement(arcLengthUpperBody_M); - Measurement(chestWidth_M); - Measurement(anteroposteriorDiameterHands_M); - Measurement(heightClavicularPoint_M); - Measurement(heightArmholeSlash_M); - Measurement(slashShoulderHeight_M); - Measurement(halfGirthNeck_M); - Measurement(halfGirthNeckForShirts_M); - Measurement(halfGirthChestFirst_M); - Measurement(halfGirthChestSecond_M); - Measurement(halfGirthChestThird_M); - Measurement(halfGirthWaist_M); - Measurement(halfGirthHipsConsideringProtrudingAbdomen_M); - Measurement(halfGirthHipsExcludingProtrudingAbdomen_M); - Measurement(girthKneeFlexedFeet_M); - Measurement(neckTransverseDiameter_M); - Measurement(frontSlashShoulderHeight_M); - Measurement(neckToFrontWaistLine_M); - Measurement(handVerticalDiameter_M); - Measurement(neckToKneePoint_M); - Measurement(waistToKnee_M); - Measurement(shoulderHeight_M); - Measurement(headHeight_M); - Measurement(bodyPosition_M); - Measurement(arcBehindShoulderGirdle_M); - Measurement(neckToNeckBase_M); - Measurement(depthWaistFirst_M); - Measurement(depthWaistSecond_M); -} + const qreal value = GetParametrDouble(domElement, AttrValue, "0.0"); + const qreal size_increase = GetParametrDouble(domElement, AttrSize_increase, "0.0"); + const qreal height_increase = GetParametrDouble(domElement, AttrHeight_increase, "0.0"); -//--------------------------------------------------------------------------------------------------------------------- -void VStandardMeasurements::Measurement(const QString &tag) -{ - const QDomNodeList nodeList = this->elementsByTagName(tag); - if (nodeList.isEmpty()) + if (MUnit() == Unit::Mm)// Convert to Cm. { - qDebug()<<"Measurement" << tag <<"doesn't exist"<AddMeasurement(tag, VMeasurement(value/10.0, size_increase/10.0, height_increase/10.0, + qApp->GuiText(tag), qApp->Description(tag), tag)); } - else + else// Cm or inch. { - const QDomNode domNode = nodeList.at(0); - if (domNode.isNull() == false && domNode.isElement()) - { - const QDomElement domElement = domNode.toElement(); - if (domElement.isNull() == false) - { - const qreal value = GetParametrDouble(domElement, AttrValue, "0.0"); - const qreal size_increase = GetParametrDouble(domElement, AttrSize_increase, "0.0"); - const qreal height_increase = GetParametrDouble(domElement, AttrHeight_increase, "0.0"); - - if (MUnit() == Unit::Mm)// Convert to Cm. - { - data->AddMeasurement(tag, VMeasurement(value/10.0, size_increase/10.0, height_increase/10.0, - qApp->GuiText(tag), qApp->Description(tag), tag)); - } - else// Cm or inch. - { - data->AddMeasurement(tag, VMeasurement(value, size_increase, height_increase, qApp->GuiText(tag), - qApp->Description(tag), tag)); - } - } - } + data->AddMeasurement(tag, VMeasurement(value, size_increase, height_increase, qApp->GuiText(tag), + qApp->Description(tag), tag)); } } diff --git a/src/app/xml/vstandardmeasurements.h b/src/app/xml/vstandardmeasurements.h index 92b50a430..c9d0ee1de 100644 --- a/src/app/xml/vstandardmeasurements.h +++ b/src/app/xml/vstandardmeasurements.h @@ -29,7 +29,7 @@ #ifndef VSTANDARDMEASUREMENTS_H #define VSTANDARDMEASUREMENTS_H -#include "vdomdocument.h" +#include "vabstractmeasurements.h" /* VST_VERSION is (major << 16) + (minor << 8) + patch. @@ -39,26 +39,24 @@ // max support version of format #define VST_VERSION 0x000100 -class VStandardMeasurements:public VDomDocument +class VStandardMeasurements:public VAbstractMeasurements { public: VStandardMeasurements(VContainer *data); virtual ~VStandardMeasurements(); - Unit MUnit(); - QString Description(); - void Measurements(); - void SetSize(); - void SetHeight(); + QString Description(); + void SetSize(); + void SetHeight(); static const QString TagMeasurement; static const QString TagDescription; static const QString TagSize; static const QString TagHeight; - static const QString AttrValue; static const QString AttrSize_increase; static const QString AttrHeight_increase; +protected: + virtual void ReadMeasurement(const QDomElement &domElement, const QString &tag); private: Q_DISABLE_COPY(VStandardMeasurements) - void Measurement(const QString &tag); }; #endif // VSTANDARDMEASUREMENTS_H diff --git a/src/app/xml/xml.pri b/src/app/xml/xml.pri index d9b56eea9..90ca2739c 100644 --- a/src/app/xml/xml.pri +++ b/src/app/xml/xml.pri @@ -3,11 +3,13 @@ HEADERS += \ xml/vdomdocument.h \ xml/vpattern.h \ xml/vstandardmeasurements.h \ - xml/vindividualmeasurements.h + xml/vindividualmeasurements.h \ + xml/vabstractmeasurements.h SOURCES += \ xml/vtoolrecord.cpp \ xml/vdomdocument.cpp \ xml/vpattern.cpp \ xml/vstandardmeasurements.cpp \ - xml/vindividualmeasurements.cpp + xml/vindividualmeasurements.cpp \ + xml/vabstractmeasurements.cpp From 0659be33758ad6b1f5d63c034d729d1fef97cdf9 Mon Sep 17 00:00:00 2001 From: dismine Date: Wed, 18 Jun 2014 14:10:26 +0300 Subject: [PATCH 02/20] Refactoring. --HG-- branch : feature --- src/libs/qmuparser/qmuparser.pro | 2 +- src/libs/qmuparser/qmuparserbase.cpp | 90 ------------------------ src/libs/qmuparser/qmuparserbytecode.cpp | 69 ------------------ 3 files changed, 1 insertion(+), 160 deletions(-) diff --git a/src/libs/qmuparser/qmuparser.pro b/src/libs/qmuparser/qmuparser.pro index 4a46c8b68..eab501172 100644 --- a/src/libs/qmuparser/qmuparser.pro +++ b/src/libs/qmuparser/qmuparser.pro @@ -80,7 +80,7 @@ CONFIG(debug, debug|release){ -Wformat=2 -Wimport \ -Winvalid-pch -Wunsafe-loop-optimizations -Wlong-long -Wmissing-format-attribute \ -Wmissing-include-dirs -Wpacked -Wredundant-decls -Winline \ - -Wswitch-default -Wswitch-enum -Wuninitialized -Wvariadic-macros \ + -Wswitch-default -Wuninitialized -Wvariadic-macros \ -Wlogical-op -Wnoexcept -Wmissing-noreturn -Wpointer-arith\ -Wstrict-null-sentinel -Wstrict-overflow=5 -Wundef -Wno-unused -gdwarf-3 \ -ftrapv diff --git a/src/libs/qmuparser/qmuparserbase.cpp b/src/libs/qmuparser/qmuparserbase.cpp index b6941a2b4..0b2bb27df 100644 --- a/src/libs/qmuparser/qmuparserbase.cpp +++ b/src/libs/qmuparser/qmuparserbase.cpp @@ -875,96 +875,6 @@ void QmuParserBase::ApplyFunc( QStack &a_stOpt, QStack & m_vRPN.AddFun(funTok.GetFuncAddr(), (funTok.GetArgCount()==-1) ? -iArgNumerical : iArgNumerical); break; - case cmLE: - Q_UNREACHABLE(); - break; - case cmGE: - Q_UNREACHABLE(); - break; - case cmNEQ: - Q_UNREACHABLE(); - break; - case cmEQ: - Q_UNREACHABLE(); - break; - case cmLT: - Q_UNREACHABLE(); - break; - case cmGT: - Q_UNREACHABLE(); - break; - case cmADD: - Q_UNREACHABLE(); - break; - case cmSUB: - Q_UNREACHABLE(); - break; - case cmMUL: - Q_UNREACHABLE(); - break; - case cmDIV: - Q_UNREACHABLE(); - break; - case cmPOW: - Q_UNREACHABLE(); - break; - case cmLAND: - Q_UNREACHABLE(); - break; - case cmLOR: - Q_UNREACHABLE(); - break; - case cmASSIGN: - Q_UNREACHABLE(); - break; - case cmBO: - Q_UNREACHABLE(); - break; - case cmBC: - Q_UNREACHABLE(); - break; - case cmIF: - Q_UNREACHABLE(); - break; - case cmELSE: - Q_UNREACHABLE(); - break; - case cmENDIF: - Q_UNREACHABLE(); - break; - case cmARG_SEP: - Q_UNREACHABLE(); - break; - case cmVAR: - Q_UNREACHABLE(); - break; - case cmVAL: - Q_UNREACHABLE(); - break; - case cmVARPOW2: - Q_UNREACHABLE(); - break; - case cmVARPOW3: - Q_UNREACHABLE(); - break; - case cmVARPOW4: - Q_UNREACHABLE(); - break; - case cmVARMUL: - Q_UNREACHABLE(); - break; - case cmPOW2: - Q_UNREACHABLE(); - break; - case cmSTRING: - Q_UNREACHABLE(); - break; - case cmEND: - Q_UNREACHABLE(); - break; - case cmUNKNOWN: - Q_UNREACHABLE(); - break; default: break; } diff --git a/src/libs/qmuparser/qmuparserbytecode.cpp b/src/libs/qmuparser/qmuparserbytecode.cpp index 439693911..2e39f9198 100644 --- a/src/libs/qmuparser/qmuparserbytecode.cpp +++ b/src/libs/qmuparser/qmuparserbytecode.cpp @@ -207,75 +207,6 @@ void QmuParserByteCode::ConstantFolding(ECmdCode a_Oprt) x = qPow(x, y); m_vRPN.pop_back(); break; - case cmASSIGN: - Q_UNREACHABLE(); - break; - case cmBO: - Q_UNREACHABLE(); - break; - case cmBC: - Q_UNREACHABLE(); - break; - case cmIF: - Q_UNREACHABLE(); - break; - case cmELSE: - Q_UNREACHABLE(); - break; - case cmENDIF: - Q_UNREACHABLE(); - break; - case cmARG_SEP: - Q_UNREACHABLE(); - break; - case cmVAR: - Q_UNREACHABLE(); - break; - case cmVAL: - Q_UNREACHABLE(); - break; - case cmVARPOW2: - Q_UNREACHABLE(); - break; - case cmVARPOW3: - Q_UNREACHABLE(); - break; - case cmVARPOW4: - Q_UNREACHABLE(); - break; - case cmVARMUL: - Q_UNREACHABLE(); - break; - case cmPOW2: - Q_UNREACHABLE(); - break; - case cmFUNC: - Q_UNREACHABLE(); - break; - case cmFUNC_STR: - Q_UNREACHABLE(); - break; - case cmFUNC_BULK: - Q_UNREACHABLE(); - break; - case cmSTRING: - Q_UNREACHABLE(); - break; - case cmOPRT_BIN: - Q_UNREACHABLE(); - break; - case cmOPRT_POSTFIX: - Q_UNREACHABLE(); - break; - case cmOPRT_INFIX: - Q_UNREACHABLE(); - break; - case cmEND: - Q_UNREACHABLE(); - break; - case cmUNKNOWN: - Q_UNREACHABLE(); - break; default: break; } // switch opcode From 9fb5a0206a7bf769cb0c7c3116691d235d7d1b5a Mon Sep 17 00:00:00 2001 From: dismine Date: Wed, 18 Jun 2014 14:38:20 +0300 Subject: [PATCH 03/20] Refactoring. Delete repetitive code. --HG-- branch : feature --- src/app/dialogs/tools/dialogarc.cpp | 6 +-- src/app/dialogs/tools/dialogtool.cpp | 71 +++------------------------- src/app/dialogs/tools/dialogtool.h | 3 +- 3 files changed, 10 insertions(+), 70 deletions(-) diff --git a/src/app/dialogs/tools/dialogarc.cpp b/src/app/dialogs/tools/dialogarc.cpp index 92cae1561..c32e5e514 100644 --- a/src/app/dialogs/tools/dialogarc.cpp +++ b/src/app/dialogs/tools/dialogarc.cpp @@ -310,7 +310,7 @@ void DialogArc::CheckState() void DialogArc::EvalRadius() { labelEditFormula = ui->labelEditRadius; - Eval(ui->plainTextEditFormula, flagRadius, timerRadius, ui->labelResultRadius); + Eval(ui->plainTextEditFormula->toPlainText(), flagRadius, timerRadius, ui->labelResultRadius); } //--------------------------------------------------------------------------------------------------------------------- @@ -320,7 +320,7 @@ void DialogArc::EvalRadius() void DialogArc::EvalF1() { labelEditFormula = ui->labelEditF1; - Eval(ui->lineEditF1, flagF1, timerF1, ui->labelResultF1); + Eval(ui->lineEditF1->text(), flagF1, timerF1, ui->labelResultF1); } //--------------------------------------------------------------------------------------------------------------------- @@ -330,7 +330,7 @@ void DialogArc::EvalF1() void DialogArc::EvalF2() { labelEditFormula = ui->labelEditF2; - Eval(ui->lineEditF2, flagF2, timerF2, ui->labelResultF2); + Eval(ui->lineEditF2->text(), flagF2, timerF2, ui->labelResultF2); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogtool.cpp b/src/app/dialogs/tools/dialogtool.cpp index 570d2ef8e..d7a35b19c 100644 --- a/src/app/dialogs/tools/dialogtool.cpp +++ b/src/app/dialogs/tools/dialogtool.cpp @@ -437,19 +437,18 @@ void DialogTool::ValFormulaChanged(bool &flag, QPlainTextEdit *edit, QTimer *tim //--------------------------------------------------------------------------------------------------------------------- /** * @brief Eval evaluate formula and show result - * @param edit lineEdit of formula + * @param text formula * @param flag flag state of formula * @param timer timer of formula * @param label label for signal error */ -void DialogTool::Eval(QLineEdit *edit, bool &flag, QTimer *timer, QLabel *label) +void DialogTool::Eval(const QString &text, bool &flag, QTimer *timer, QLabel *label) { - SCASSERT(edit != nullptr); SCASSERT(timer != nullptr); SCASSERT(label != nullptr); SCASSERT(labelEditFormula != nullptr); QPalette palette = labelEditFormula->palette(); - if (edit->text().isEmpty()) + if (text.isEmpty()) { flag = false; palette.setColor(labelEditFormula->foregroundRole(), Qt::red); @@ -458,66 +457,8 @@ void DialogTool::Eval(QLineEdit *edit, bool &flag, QTimer *timer, QLabel *label) { try { - const QString formula = qApp->FormulaFromUser(edit->text()); - Calculator *cal = new Calculator(data); - const qreal result = cal->EvalFormula(formula); - delete cal; - - QSettings settings(QSettings::IniFormat, QSettings::UserScope, QApplication::organizationName(), - QApplication::applicationName()); - bool osSeparatorValue = settings.value("configuration/osSeparator", 1).toBool(); - - if (osSeparatorValue) - { - QLocale loc = QLocale::system(); - label->setText(loc.toString(result) + VDomDocument::UnitsToStr(qApp->patternUnit(), true)); - } - else - { - QLocale loc = QLocale(QLocale::C); - label->setText(loc.toString(result) + VDomDocument::UnitsToStr(qApp->patternUnit(), true)); - } - flag = true; - palette.setColor(labelEditFormula->foregroundRole(), QColor(76, 76, 76)); - emit ToolTip(""); - } - catch (qmu::QmuParserError &e) - { - label->setText(tr("Error")); - flag = false; - palette.setColor(labelEditFormula->foregroundRole(), Qt::red); - emit ToolTip("Parser error: "+e.GetMsg()); - qDebug() << "\nMath parser error:\n" - << "--------------------------------------\n" - << "Message: " << e.GetMsg() << "\n" - << "Expression: " << e.GetExpr() << "\n" - << "--------------------------------------"; - } - } - CheckState(); - timer->stop(); - labelEditFormula->setPalette(palette); -} - -//--------------------------------------------------------------------------------------------------------------------- -void DialogTool::Eval(QPlainTextEdit *edit, bool &flag, QTimer *timer, QLabel *label) -{ - SCASSERT(edit != nullptr); - SCASSERT(timer != nullptr); - SCASSERT(label != nullptr); - SCASSERT(labelEditFormula != nullptr); - QPalette palette = labelEditFormula->palette(); - if (edit->toPlainText().isEmpty()) - { - flag = false; - palette.setColor(labelEditFormula->foregroundRole(), Qt::red); - } - else - { - try - { - // Replace line return with spaces for calc - QString formula = edit->toPlainText(); + // Replace line return with spaces for calc if exist + QString formula = text; formula.replace("\n", " "); formula = qApp->FormulaFromUser(formula); Calculator *cal = new Calculator(data); @@ -863,7 +804,7 @@ void DialogTool::EvalFormula() { SCASSERT(plainTextEditFormula != nullptr); SCASSERT(labelResultCalculation != nullptr); - Eval(plainTextEditFormula, flagFormula, timerFormula, labelResultCalculation); + Eval(plainTextEditFormula->toPlainText(), flagFormula, timerFormula, labelResultCalculation); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogtool.h b/src/app/dialogs/tools/dialogtool.h index 0ddbabe69..5497c2f58 100644 --- a/src/app/dialogs/tools/dialogtool.h +++ b/src/app/dialogs/tools/dialogtool.h @@ -194,8 +194,7 @@ protected: void PutValHere(QPlainTextEdit *plainTextEdit, QListWidget *listWidget); void ValFormulaChanged(bool &flag, QLineEdit *edit, QTimer * timer); void ValFormulaChanged(bool &flag, QPlainTextEdit *edit, QTimer * timer); - void Eval(QPlainTextEdit *edit, bool &flag, QTimer *timer, QLabel *label); - void Eval(QLineEdit *edit, bool &flag, QTimer *timer, QLabel *label); + void Eval(const QString &text, bool &flag, QTimer *timer, QLabel *label); void setCurrentPointId(QComboBox *box, quint32 &pointId, const quint32 &value, const quint32 &id) const; void setCurrentSplineId(QComboBox *box, quint32 &splineId, const quint32 &value, const quint32 &id, ComboBoxCutSpline cut = ComboBoxCutSpline::NoCutSpline) const; From 3492514b043c2da6b7b874616df49f3b76cc64b0 Mon Sep 17 00:00:00 2001 From: dismine Date: Wed, 18 Jun 2014 14:45:11 +0300 Subject: [PATCH 04/20] Refactoring. Delete repetitive code. --HG-- branch : feature --- src/app/app.pro | 1 - src/app/tools/vtooldetail.cpp | 21 --------------------- src/app/tools/vtooluniondetails.cpp | 21 --------------------- 3 files changed, 43 deletions(-) diff --git a/src/app/app.pro b/src/app/app.pro index 40ba0d1a0..02d64b309 100644 --- a/src/app/app.pro +++ b/src/app/app.pro @@ -142,7 +142,6 @@ CONFIG(debug, debug|release){ -Wlong-long \ -Wmissing-format-attribute \ -Wswitch-default \ - -Wswitch-enum \ -Wuninitialized \ -Wvariadic-macros \ -Wlogical-op \ diff --git a/src/app/tools/vtooldetail.cpp b/src/app/tools/vtooldetail.cpp index 733db56e3..2f6efad77 100644 --- a/src/app/tools/vtooldetail.cpp +++ b/src/app/tools/vtooldetail.cpp @@ -511,27 +511,6 @@ void VToolDetail::AddNode(VPattern *doc, QDomElement &domElement, const VNodeDet case (Tool::NodeSplinePath): doc->SetAttribute(nod, AttrType, NodeSplinePath); break; - case (Tool::ArrowTool): - case (Tool::SinglePointTool): - case (Tool::EndLineTool): - case (Tool::LineTool): - case (Tool::AlongLineTool): - case (Tool::ShoulderPointTool): - case (Tool::NormalTool): - case (Tool::BisectorTool): - case (Tool::LineIntersectTool): - case (Tool::SplineTool): - case (Tool::CutSplineTool): - case (Tool::CutArcTool): - case (Tool::ArcTool): - case (Tool::SplinePathTool): - case (Tool::CutSplinePathTool): - case (Tool::PointOfContact): - case (Tool::DetailTool): - case (Tool::Height): - case (Tool::Triangle): - case (Tool::PointOfIntersection): - case (Tool::UnionDetails): default: qDebug()<<"May be wrong tool type!!! Ignoring."<SetAttribute(nod, AttrType, QStringLiteral("NodeSplinePath")); break; - case (Tool::ArrowTool): - case (Tool::SinglePointTool): - case (Tool::EndLineTool): - case (Tool::LineTool): - case (Tool::AlongLineTool): - case (Tool::ShoulderPointTool): - case (Tool::NormalTool): - case (Tool::BisectorTool): - case (Tool::LineIntersectTool): - case (Tool::SplineTool): - case (Tool::CutSplineTool): - case (Tool::CutArcTool): - case (Tool::ArcTool): - case (Tool::SplinePathTool): - case (Tool::CutSplinePathTool): - case (Tool::PointOfContact): - case (Tool::DetailTool): - case (Tool::Height): - case (Tool::Triangle): - case (Tool::PointOfIntersection): - case (Tool::UnionDetails): default: qDebug()<<"May be wrong tool type!!! Ignoring."< Date: Wed, 18 Jun 2014 14:47:43 +0300 Subject: [PATCH 05/20] Refactoring. Delete repetitive code. --HG-- branch : feature --- src/app/tools/vtooldetail.cpp | 21 --------------- src/app/tools/vtooluniondetails.cpp | 42 ----------------------------- 2 files changed, 63 deletions(-) diff --git a/src/app/tools/vtooldetail.cpp b/src/app/tools/vtooldetail.cpp index 2f6efad77..f47732770 100644 --- a/src/app/tools/vtooldetail.cpp +++ b/src/app/tools/vtooldetail.cpp @@ -198,27 +198,6 @@ void VToolDetail::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern VNodeSplinePath::Create(doc, data, id, detail.at(i).getId(), Document::FullParse, Source::FromGui); } break; - case (Tool::ArrowTool): - case (Tool::SinglePointTool): - case (Tool::EndLineTool): - case (Tool::LineTool): - case (Tool::AlongLineTool): - case (Tool::ShoulderPointTool): - case (Tool::NormalTool): - case (Tool::BisectorTool): - case (Tool::LineIntersectTool): - case (Tool::SplineTool): - case (Tool::CutSplineTool): - case (Tool::CutArcTool): - case (Tool::ArcTool): - case (Tool::SplinePathTool): - case (Tool::CutSplinePathTool): - case (Tool::PointOfContact): - case (Tool::DetailTool): - case (Tool::Height): - case (Tool::Triangle): - case (Tool::PointOfIntersection): - case (Tool::UnionDetails): default: qDebug()<<"May be wrong tool type!!! Ignoring."< Date: Wed, 18 Jun 2014 14:50:27 +0300 Subject: [PATCH 06/20] Refactoring. Delete repetitive code. --HG-- branch : feature --- src/app/dialogs/tools/dialogdetail.cpp | 21 --------------------- src/app/geometry/vequidistant.cpp | 21 --------------------- src/app/tools/vtooldetail.cpp | 21 --------------------- 3 files changed, 63 deletions(-) diff --git a/src/app/dialogs/tools/dialogdetail.cpp b/src/app/dialogs/tools/dialogdetail.cpp index f4e210540..7d8f83e92 100644 --- a/src/app/dialogs/tools/dialogdetail.cpp +++ b/src/app/dialogs/tools/dialogdetail.cpp @@ -170,27 +170,6 @@ void DialogDetail::NewItem(quint32 id, const Tool &typeTool, const NodeDetail &t name = splPath->name(); break; } - case (Tool::ArrowTool): - case (Tool::SinglePointTool): - case (Tool::EndLineTool): - case (Tool::LineTool): - case (Tool::AlongLineTool): - case (Tool::ShoulderPointTool): - case (Tool::NormalTool): - case (Tool::BisectorTool): - case (Tool::LineIntersectTool): - case (Tool::SplineTool): - case (Tool::CutSplineTool): - case (Tool::CutArcTool): - case (Tool::ArcTool): - case (Tool::SplinePathTool): - case (Tool::CutSplinePathTool): - case (Tool::PointOfContact): - case (Tool::DetailTool): - case (Tool::Height): - case (Tool::Triangle): - case (Tool::PointOfIntersection): - case (Tool::UnionDetails): default: qDebug()<<"Got wrong tools. Ignore."; break; diff --git a/src/app/geometry/vequidistant.cpp b/src/app/geometry/vequidistant.cpp index cab6b2223..b50faff69 100644 --- a/src/app/geometry/vequidistant.cpp +++ b/src/app/geometry/vequidistant.cpp @@ -132,27 +132,6 @@ QPainterPath VEquidistant::ContourPath(const quint32 &idDetail, const VContainer } } break; - case (Tool::ArrowTool): - case (Tool::SinglePointTool): - case (Tool::EndLineTool): - case (Tool::LineTool): - case (Tool::AlongLineTool): - case (Tool::ShoulderPointTool): - case (Tool::NormalTool): - case (Tool::BisectorTool): - case (Tool::LineIntersectTool): - case (Tool::SplineTool): - case (Tool::CutSplineTool): - case (Tool::CutArcTool): - case (Tool::ArcTool): - case (Tool::SplinePathTool): - case (Tool::CutSplinePathTool): - case (Tool::PointOfContact): - case (Tool::DetailTool): - case (Tool::Height): - case (Tool::Triangle): - case (Tool::PointOfIntersection): - case (Tool::UnionDetails): default: qDebug()<<"Get wrong tool type. Ignore."<< static_cast(detail.at(i).getTypeTool()); break; diff --git a/src/app/tools/vtooldetail.cpp b/src/app/tools/vtooldetail.cpp index f47732770..d5e61c90f 100644 --- a/src/app/tools/vtooldetail.cpp +++ b/src/app/tools/vtooldetail.cpp @@ -92,27 +92,6 @@ VToolDetail::VToolDetail(VPattern *doc, VContainer *data, const quint32 &id, con case (Tool::NodeSplinePath): InitTool(scene, detail.at(i)); break; - case (Tool::ArrowTool): - case (Tool::SinglePointTool): - case (Tool::EndLineTool): - case (Tool::LineTool): - case (Tool::AlongLineTool): - case (Tool::ShoulderPointTool): - case (Tool::NormalTool): - case (Tool::BisectorTool): - case (Tool::LineIntersectTool): - case (Tool::SplineTool): - case (Tool::CutSplineTool): - case (Tool::CutArcTool): - case (Tool::ArcTool): - case (Tool::SplinePathTool): - case (Tool::CutSplinePathTool): - case (Tool::PointOfContact): - case (Tool::DetailTool): - case (Tool::Height): - case (Tool::Triangle): - case (Tool::PointOfIntersection): - case (Tool::UnionDetails): default: qDebug()<<"Get wrong tool type. Ignore."; break; From 1a25b8201949224bc93ee2e5ba23f21fc55031e9 Mon Sep 17 00:00:00 2001 From: dismine Date: Wed, 18 Jun 2014 14:52:53 +0300 Subject: [PATCH 07/20] Refactoring. Delete repetitive code. --HG-- branch : feature --- src/libs/qmuparser/qmuparserbase.cpp | 34 ------------------------ src/libs/qmuparser/qmuparserbytecode.cpp | 31 --------------------- 2 files changed, 65 deletions(-) diff --git a/src/libs/qmuparser/qmuparserbase.cpp b/src/libs/qmuparser/qmuparserbase.cpp index 0b2bb27df..e8653fcf9 100644 --- a/src/libs/qmuparser/qmuparserbase.cpp +++ b/src/libs/qmuparser/qmuparserbase.cpp @@ -335,40 +335,6 @@ void QmuParserBase::CheckOprt(const QString &a_sName, const QmuParserCallback &a case cmOPRT_INFIX: Error(ecINVALID_INFIX_IDENT, -1, a_sName); break; - case cmLE: - case cmGE: - case cmNEQ: - case cmEQ: - case cmLT: - case cmGT: - case cmADD: - case cmSUB: - case cmMUL: - case cmDIV: - case cmPOW: - case cmLAND: - case cmLOR: - case cmASSIGN: - case cmBO: - case cmBC: - case cmIF: - case cmELSE: - case cmENDIF: - case cmARG_SEP: - case cmVAR: - case cmVAL: - case cmVARPOW2: - case cmVARPOW3: - case cmVARPOW4: - case cmVARMUL: - case cmPOW2: - case cmFUNC: - case cmFUNC_STR: - case cmFUNC_BULK: - case cmSTRING: - case cmOPRT_BIN: - case cmEND: - case cmUNKNOWN: default: Error(ecINVALID_NAME, -1, a_sName); break; diff --git a/src/libs/qmuparser/qmuparserbytecode.cpp b/src/libs/qmuparser/qmuparserbytecode.cpp index 2e39f9198..de0777d91 100644 --- a/src/libs/qmuparser/qmuparserbytecode.cpp +++ b/src/libs/qmuparser/qmuparserbytecode.cpp @@ -355,37 +355,6 @@ void QmuParserByteCode::AddOp(ECmdCode a_Oprt) bOptimized = true; } break; - case cmNEQ: - case cmEQ: - case cmLOR: - case cmASSIGN: - case cmBO: - case cmBC: - case cmIF: - case cmELSE: - case cmENDIF: - case cmARG_SEP: - case cmVAR: - case cmVAL: - case cmVARPOW2: - case cmVARPOW3: - case cmVARPOW4: - case cmVARMUL: - case cmPOW2: - case cmFUNC: - case cmFUNC_STR: - case cmFUNC_BULK: - case cmSTRING: - case cmOPRT_BIN: - case cmOPRT_POSTFIX: - case cmOPRT_INFIX: - case cmEND: - case cmUNKNOWN: - case cmLE: - case cmGE: - case cmLT: - case cmGT: - case cmLAND: default: break; From 240633413881be9af66ee14dee9aa7c95baae6e6 Mon Sep 17 00:00:00 2001 From: dismine Date: Wed, 18 Jun 2014 15:11:48 +0300 Subject: [PATCH 08/20] Refactoring. Delete repetitive code. --HG-- branch : feature --- src/app/mainwindow.cpp | 10 ++-------- src/app/xml/vpattern.cpp | 10 ++-------- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/src/app/mainwindow.cpp b/src/app/mainwindow.cpp index 17c1915bc..c7d01b2f5 100644 --- a/src/app/mainwindow.cpp +++ b/src/app/mainwindow.cpp @@ -1565,14 +1565,8 @@ void MainWindow::FullParseFile() #ifndef QT_NO_CURSOR QApplication::restoreOverrideCursor(); #endif - QMessageBox msgBox; - msgBox.setWindowTitle(tr("Error!")); - msgBox.setText(tr("Error parsing file.")); - msgBox.setInformativeText("std::bad_alloc"); - msgBox.setStandardButtons(QMessageBox::Ok); - msgBox.setDefaultButton(QMessageBox::Ok); - msgBox.setIcon(QMessageBox::Warning); - msgBox.exec(); + QMessageBox::critical(this, tr("Critical error!"), tr("Error parsing file (std::bad_alloc)."), QMessageBox::Ok, + QMessageBox::Ok); #ifndef QT_NO_CURSOR QApplication::setOverrideCursor(Qt::WaitCursor); #endif diff --git a/src/app/xml/vpattern.cpp b/src/app/xml/vpattern.cpp index 353d09fda..3ad86dced 100644 --- a/src/app/xml/vpattern.cpp +++ b/src/app/xml/vpattern.cpp @@ -687,14 +687,8 @@ void VPattern::LiteParseTree() #ifndef QT_NO_CURSOR QApplication::restoreOverrideCursor(); #endif - QMessageBox msgBox; - msgBox.setWindowTitle(tr("Error!")); - msgBox.setText(tr("Error parsing file.")); - msgBox.setInformativeText("std::bad_alloc"); - msgBox.setStandardButtons(QMessageBox::Ok); - msgBox.setDefaultButton(QMessageBox::Ok); - msgBox.setIcon(QMessageBox::Warning); - msgBox.exec(); + QMessageBox::critical(nullptr, tr("Critical error!"), tr("Error parsing file (std::bad_alloc)."), QMessageBox::Ok, + QMessageBox::Ok); #ifndef QT_NO_CURSOR QApplication::setOverrideCursor(Qt::WaitCursor); #endif From 3b36cd8af4ce084a4a47dc5c1d6b15f96ecdc54d Mon Sep 17 00:00:00 2001 From: dismine Date: Wed, 18 Jun 2014 15:13:55 +0300 Subject: [PATCH 09/20] Refactoring. Delete repetitive code. --HG-- branch : feature --- src/libs/qmuparser/qmuparserbase.cpp | 22 ---------------- src/libs/qmuparser/qmuparserbytecode.cpp | 33 ------------------------ 2 files changed, 55 deletions(-) diff --git a/src/libs/qmuparser/qmuparserbase.cpp b/src/libs/qmuparser/qmuparserbase.cpp index e8653fcf9..005dd783e 100644 --- a/src/libs/qmuparser/qmuparserbase.cpp +++ b/src/libs/qmuparser/qmuparserbase.cpp @@ -1858,28 +1858,6 @@ void QmuParserBase::StackDump(const QStack &a_stVal, const QStack Date: Wed, 18 Jun 2014 15:20:35 +0300 Subject: [PATCH 10/20] Refactoring. Delete repetitive code. --HG-- branch : feature --- src/app/xml/vpattern.cpp | 40 ++++++++++------------------------------ 1 file changed, 10 insertions(+), 30 deletions(-) diff --git a/src/app/xml/vpattern.cpp b/src/app/xml/vpattern.cpp index 3ad86dced..0f1d72e33 100644 --- a/src/app/xml/vpattern.cpp +++ b/src/app/xml/vpattern.cpp @@ -1029,9 +1029,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem catch (qmu::QmuParserError &e) { VExceptionObjectError excep(tr("Error creating or updating point of end line"), domElement); - QString message("Message: " + e.GetMsg() + "\n"+ - "Expression: " + e.GetExpr()); - excep.AddMoreInformation(message); + excep.AddMoreInformation(QString("Message: " + e.GetMsg() + "\n"+ "Expression: " + e.GetExpr())); throw excep; } break; @@ -1067,9 +1065,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem catch (qmu::QmuParserError &e) { VExceptionObjectError excep(tr("Error creating or updating point along line"), domElement); - QString message("Message: " + e.GetMsg() + "\n"+ - "Expression: " + e.GetExpr()); - excep.AddMoreInformation(message); + excep.AddMoreInformation(QString("Message: " + e.GetMsg() + "\n"+ "Expression: " + e.GetExpr())); throw excep; } break; @@ -1106,9 +1102,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem catch (qmu::QmuParserError &e) { VExceptionObjectError excep(tr("Error creating or updating point of shoulder"), domElement); - QString message("Message: " + e.GetMsg() + "\n"+ - "Expression: " + e.GetExpr()); - excep.AddMoreInformation(message); + excep.AddMoreInformation(QString("Message: " + e.GetMsg() + "\n"+ "Expression: " + e.GetExpr())); throw excep; } break; @@ -1145,9 +1139,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem catch (qmu::QmuParserError &e) { VExceptionObjectError excep(tr("Error creating or updating point of normal"), domElement); - QString message("Message: " + e.GetMsg() + "\n"+ - "Expression: " + e.GetExpr()); - excep.AddMoreInformation(message); + excep.AddMoreInformation(QString("Message: " + e.GetMsg() + "\n"+ "Expression: " + e.GetExpr())); throw excep; } break; @@ -1184,9 +1176,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem catch (qmu::QmuParserError &e) { VExceptionObjectError excep(tr("Error creating or updating point of bisector"), domElement); - QString message("Message: " + e.GetMsg() + "\n"+ - "Expression: " + e.GetExpr()); - excep.AddMoreInformation(message); + excep.AddMoreInformation(QString("Message: " + e.GetMsg() + "\n"+ "Expression: " + e.GetExpr())); throw excep; } break; @@ -1243,9 +1233,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem catch (qmu::QmuParserError &e) { VExceptionObjectError excep(tr("Error creating or updating point of contact"), domElement); - QString message("Message: " + e.GetMsg() + "\n"+ - "Expression: " + e.GetExpr()); - excep.AddMoreInformation(message); + excep.AddMoreInformation(QString("Message: " + e.GetMsg() + "\n"+ "Expression: " + e.GetExpr())); throw excep; } break; @@ -1362,9 +1350,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem catch (qmu::QmuParserError &e) { VExceptionObjectError excep(tr("Error creating or updating cut spline point"), domElement); - QString message("Message: " + e.GetMsg() + "\n"+ - "Expression: " + e.GetExpr()); - excep.AddMoreInformation(message); + excep.AddMoreInformation(QString("Message: " + e.GetMsg() + "\n"+ "Expression: " + e.GetExpr())); throw excep; } break; @@ -1397,9 +1383,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem catch (qmu::QmuParserError &e) { VExceptionObjectError excep(tr("Error creating or updating cut spline path point"), domElement); - QString message("Message: " + e.GetMsg() + "\n"+ - "Expression: " + e.GetExpr()); - excep.AddMoreInformation(message); + excep.AddMoreInformation(QString("Message: " + e.GetMsg() + "\n"+ "Expression: " + e.GetExpr())); throw excep; } break; @@ -1431,9 +1415,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem catch (qmu::QmuParserError &e) { VExceptionObjectError excep(tr("Error creating or updating cut arc point"), domElement); - QString message("Message: " + e.GetMsg() + "\n"+ - "Expression: " + e.GetExpr()); - excep.AddMoreInformation(message); + excep.AddMoreInformation(QString("Message: " + e.GetMsg() + "\n"+ "Expression: " + e.GetExpr())); throw excep; } break; @@ -1652,9 +1634,7 @@ void VPattern::ParseArcElement(VMainGraphicsScene *scene, QDomElement &domElemen catch (qmu::QmuParserError &e) { VExceptionObjectError excep(tr("Error creating or updating simple arc"), domElement); - QString message("Message: " + e.GetMsg() + "\n"+ - "Expression: " + e.GetExpr()); - excep.AddMoreInformation(message); + excep.AddMoreInformation(QString("Message: " + e.GetMsg() + "\n"+ "Expression: " + e.GetExpr())); throw excep; } break; From ec44c57c34ddfa196a15130115f00a316c1a8a02 Mon Sep 17 00:00:00 2001 From: dismine Date: Wed, 18 Jun 2014 15:58:57 +0300 Subject: [PATCH 11/20] Refactoring. Delete repetitive code. --HG-- branch : feature --- src/libs/qmuparser/qmuparserbase.cpp | 8 +- src/libs/qmuparser/qmuparsertokenreader.cpp | 163 +++++++++----------- 2 files changed, 77 insertions(+), 94 deletions(-) diff --git a/src/libs/qmuparser/qmuparserbase.cpp b/src/libs/qmuparser/qmuparserbase.cpp index 005dd783e..5bf020f97 100644 --- a/src/libs/qmuparser/qmuparserbase.cpp +++ b/src/libs/qmuparser/qmuparserbase.cpp @@ -1450,19 +1450,19 @@ void QmuParserBase::CreateRPN() const case cmIF: m_nIfElseCounter++; // fallthrough intentional (no break!) - case cmLAND: - case cmLOR: - case cmLT: - case cmGT: case cmLE: case cmGE: case cmNEQ: case cmEQ: + case cmLT: + case cmGT: case cmADD: case cmSUB: case cmMUL: case cmDIV: case cmPOW: + case cmLAND: + case cmLOR: case cmASSIGN: case cmOPRT_BIN: // A binary operator (user defined or built in) has been found. diff --git a/src/libs/qmuparser/qmuparsertokenreader.cpp b/src/libs/qmuparser/qmuparsertokenreader.cpp index e7ae392f7..2cc4aa02e 100644 --- a/src/libs/qmuparser/qmuparsertokenreader.cpp +++ b/src/libs/qmuparser/qmuparsertokenreader.cpp @@ -384,108 +384,91 @@ bool QmuParserTokenReader::IsBuiltIn ( token_type &a_Tok ) int len = pOprtDef.at ( i ).length(); if ( pOprtDef.at ( i ) == m_strFormula.mid ( m_iPos, len ) ) { - switch ( i ) + if (i >= cmLE && i <= cmASSIGN) { - //case cmAND: - //case cmOR: - //case cmXOR: - case cmLAND: - case cmLOR: - case cmLT: - case cmGT: - case cmLE: - case cmGE: - case cmNEQ: - case cmEQ: - case cmADD: - case cmSUB: - case cmMUL: - case cmDIV: - case cmPOW: - case cmASSIGN: - //if (len!=sTok.length()) - // continue; + //if (len!=sTok.length()) + // continue; - // The assignement operator need special treatment - if ( i == cmASSIGN && m_iSynFlags & noASSIGN ) + // The assignement operator need special treatment + if ( i == cmASSIGN && m_iSynFlags & noASSIGN ) + { + Error ( ecUNEXPECTED_OPERATOR, m_iPos, pOprtDef.at ( i ) ); + } + + if ( m_pParser->HasBuiltInOprt() == false) + { + continue; + } + if ( m_iSynFlags & noOPT ) + { + // Maybe its an infix operator not an operator + // Both operator types can share characters in + // their identifiers + if ( IsInfixOpTok ( a_Tok ) ) { - Error ( ecUNEXPECTED_OPERATOR, m_iPos, pOprtDef.at ( i ) ); + return true; } - if ( m_pParser->HasBuiltInOprt() == false) - { - continue; - } - if ( m_iSynFlags & noOPT ) - { - // Maybe its an infix operator not an operator - // Both operator types can share characters in - // their identifiers - if ( IsInfixOpTok ( a_Tok ) ) - { - return true; - } + Error ( ecUNEXPECTED_OPERATOR, m_iPos, pOprtDef.at ( i ) ); + } - Error ( ecUNEXPECTED_OPERATOR, m_iPos, pOprtDef.at ( i ) ); - } + m_iSynFlags = noBC | noOPT | noARG_SEP | noPOSTOP | noASSIGN | noIF | noELSE; + m_iSynFlags |= ( ( i != cmEND ) && ( i != cmBC ) ) ? noEND : 0; + } + else if (i == cmBO) + { + if ( m_iSynFlags & noBO ) + { + Error ( ecUNEXPECTED_PARENS, m_iPos, pOprtDef.at ( i ) ); + } - m_iSynFlags = noBC | noOPT | noARG_SEP | noPOSTOP | noASSIGN | noIF | noELSE; - m_iSynFlags |= ( ( i != cmEND ) && ( i != cmBC ) ) ? noEND : 0; - break; + if ( m_lastTok.GetCode() == cmFUNC ) + { + m_iSynFlags = noOPT | noEND | noARG_SEP | noPOSTOP | noASSIGN | noIF | noELSE; + } + else + { + m_iSynFlags = noBC | noOPT | noEND | noARG_SEP | noPOSTOP | noASSIGN | noIF | noELSE; + } - case cmBO: - if ( m_iSynFlags & noBO ) - { - Error ( ecUNEXPECTED_PARENS, m_iPos, pOprtDef.at ( i ) ); - } + ++m_iBrackets; + } + else if (i == cmBC) + { + if ( m_iSynFlags & noBC ) + { + Error ( ecUNEXPECTED_PARENS, m_iPos, pOprtDef.at ( i ) ); + } - if ( m_lastTok.GetCode() == cmFUNC ) - { - m_iSynFlags = noOPT | noEND | noARG_SEP | noPOSTOP | noASSIGN | noIF | noELSE; - } - else - { - m_iSynFlags = noBC | noOPT | noEND | noARG_SEP | noPOSTOP | noASSIGN | noIF | noELSE; - } + m_iSynFlags = noBO | noVAR | noVAL | noFUN | noINFIXOP | noSTR | noASSIGN; - ++m_iBrackets; - break; + if ( --m_iBrackets < 0 ) + { + Error ( ecUNEXPECTED_PARENS, m_iPos, pOprtDef.at ( i ) ); + } + } + else if (i == cmELSE) + { + if ( m_iSynFlags & noELSE ) + { + Error ( ecUNEXPECTED_CONDITIONAL, m_iPos, pOprtDef.at ( i ) ); + } - case cmBC: - if ( m_iSynFlags & noBC ) - { - Error ( ecUNEXPECTED_PARENS, m_iPos, pOprtDef.at ( i ) ); - } + m_iSynFlags = noBC | noPOSTOP | noEND | noOPT | noIF | noELSE; + } + else if (i == cmIF) + { + if ( m_iSynFlags & noIF ) + { + Error ( ecUNEXPECTED_CONDITIONAL, m_iPos, pOprtDef.at ( i ) ); + } - m_iSynFlags = noBO | noVAR | noVAL | noFUN | noINFIXOP | noSTR | noASSIGN; - - if ( --m_iBrackets < 0 ) - { - Error ( ecUNEXPECTED_PARENS, m_iPos, pOprtDef.at ( i ) ); - } - break; - - case cmELSE: - if ( m_iSynFlags & noELSE ) - { - Error ( ecUNEXPECTED_CONDITIONAL, m_iPos, pOprtDef.at ( i ) ); - } - - m_iSynFlags = noBC | noPOSTOP | noEND | noOPT | noIF | noELSE; - break; - - case cmIF: - if ( m_iSynFlags & noIF ) - { - Error ( ecUNEXPECTED_CONDITIONAL, m_iPos, pOprtDef.at ( i ) ); - } - - m_iSynFlags = noBC | noPOSTOP | noEND | noOPT | noIF | noELSE; - break; - - default: // The operator is listed in c_DefaultOprt, but not here. This is a bad thing... - Error ( ecINTERNAL_ERROR ); - } // switch operator id + m_iSynFlags = noBC | noPOSTOP | noEND | noOPT | noIF | noELSE; + } + else // The operator is listed in c_DefaultOprt, but not here. This is a bad thing... + { + Error ( ecINTERNAL_ERROR ); + } m_iPos += len; a_Tok.Set ( static_cast(i), pOprtDef.at ( i ) ); From 95422546b671a3f1a943c4f5f408654098b63b9c Mon Sep 17 00:00:00 2001 From: dismine Date: Wed, 18 Jun 2014 16:07:12 +0300 Subject: [PATCH 12/20] Refactoring. Delete repetitive code. --HG-- branch : feature --- src/libs/qmuparser/qmuparserbase.cpp | 70 ++++++++-------------------- 1 file changed, 19 insertions(+), 51 deletions(-) diff --git a/src/libs/qmuparser/qmuparserbase.cpp b/src/libs/qmuparser/qmuparserbase.cpp index 5bf020f97..e430830b0 100644 --- a/src/libs/qmuparser/qmuparserbase.cpp +++ b/src/libs/qmuparser/qmuparserbase.cpp @@ -932,58 +932,26 @@ void QmuParserBase::ApplyRemainingOprt(QStack &stOpt, QStack= cmLE && code <= cmASSIGN) || code == cmOPRT_INFIX || code == cmOPRT_BIN) { - case cmOPRT_INFIX: - case cmOPRT_BIN: - case cmLE: - case cmGE: - case cmNEQ: - case cmEQ: - case cmLT: - case cmGT: - case cmADD: - case cmSUB: - case cmMUL: - case cmDIV: - case cmPOW: - case cmLAND: - case cmLOR: - case cmASSIGN: - if (stOpt.top().GetCode()==cmOPRT_INFIX) - { - ApplyFunc(stOpt, stVal, 1); - } - else - { - ApplyBinOprt(stOpt, stVal); - } - break; - case cmELSE: - ApplyIfElse(stOpt, stVal); - break; - case cmBO: - case cmBC: - case cmIF: - case cmENDIF: - case cmARG_SEP: - case cmVAR: - case cmVAL: - case cmVARPOW2: - case cmVARPOW3: - case cmVARPOW4: - case cmVARMUL: - case cmPOW2: - case cmFUNC: - case cmFUNC_STR: - case cmFUNC_BULK: - case cmSTRING: - case cmOPRT_POSTFIX: - case cmEND: - case cmUNKNOWN: - default: - Error(ecINTERNAL_ERROR); - break; + if (stOpt.top().GetCode()==cmOPRT_INFIX) + { + ApplyFunc(stOpt, stVal, 1); + } + else + { + ApplyBinOprt(stOpt, stVal); + } + } + else if (code == cmELSE) + { + ApplyIfElse(stOpt, stVal); + } + else + { + Error(ecINTERNAL_ERROR); } } } From 717fabed9ae5cd7d947d641e2b5287161da40f24 Mon Sep 17 00:00:00 2001 From: dismine Date: Wed, 18 Jun 2014 19:11:14 +0300 Subject: [PATCH 13/20] Refactoring. Delete repetitive code. --HG-- branch : feature --- src/app/mainwindow.cpp | 1 + src/app/xml/vpattern.cpp | 161 ++++++++++++++++++--------------------- src/app/xml/vpattern.h | 10 ++- 3 files changed, 85 insertions(+), 87 deletions(-) diff --git a/src/app/mainwindow.cpp b/src/app/mainwindow.cpp index c7d01b2f5..02b2fafa2 100644 --- a/src/app/mainwindow.cpp +++ b/src/app/mainwindow.cpp @@ -96,6 +96,7 @@ MainWindow::MainWindow(QWidget *parent) doc = new VPattern(pattern, &mode, sceneDraw, sceneDetails); connect(doc, &VPattern::ClearMainWindow, this, &MainWindow::Clear); + connect(doc, &VPattern::patternChanged, this, &MainWindow::PatternWasModified); connect(doc, &VPattern::UndoCommand, this, &MainWindow::FullParseFile); connect(qApp->getUndoStack(), &QUndoStack::cleanChanged, this, &MainWindow::PatternWasModified); diff --git a/src/app/xml/vpattern.cpp b/src/app/xml/vpattern.cpp index 0f1d72e33..fb697fbd2 100644 --- a/src/app/xml/vpattern.cpp +++ b/src/app/xml/vpattern.cpp @@ -214,7 +214,7 @@ bool VPattern::SetNameDraw(const QString &name) { nameActivDraw = name; element.setAttribute(AttrName, nameActivDraw); - emit patternChanged(); + emit patternChanged(false); emit ChangedNameDraw(oldName, nameActivDraw); return true; } @@ -558,7 +558,7 @@ void VPattern::SetPath(const QString &path) if (element.isElement()) { SetAttribute(element, AttrPath, path); - emit patternChanged(); + emit patternChanged(false); } else { @@ -706,7 +706,7 @@ void VPattern::LiteParseTree() */ void VPattern::haveLiteChange() { - emit patternChanged(); + emit patternChanged(false); } //--------------------------------------------------------------------------------------------------------------------- @@ -936,6 +936,29 @@ void VPattern::ParseDetails(VMainGraphicsScene *sceneDetail, const QDomElement & } } +//--------------------------------------------------------------------------------------------------------------------- +void VPattern::PointsCommonAttributes(const QDomElement &domElement, quint32 &id, QString &name, qreal &mx, qreal &my, + QString &typeLine) +{ + PointsCommonAttributes(domElement, id, name, mx, my); + typeLine = GetParametrString(domElement, VAbstractTool::AttrTypeLine, VAbstractTool::TypeLineLine); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VPattern::PointsCommonAttributes(const QDomElement &domElement, quint32 &id, QString &name, qreal &mx, qreal &my) +{ + PointsCommonAttributes(domElement, id, mx, my); + name = GetParametrString(domElement, VAbstractTool::AttrName, "A"); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VPattern::PointsCommonAttributes(const QDomElement &domElement, quint32 &id, qreal &mx, qreal &my) +{ + ToolsCommonAttributes(domElement, id); + mx = qApp->toPixel(GetParametrDouble(domElement, VAbstractTool::AttrMx, "10.0")); + my = qApp->toPixel(GetParametrDouble(domElement, VAbstractTool::AttrMy, "15.0")); +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief ParsePointElement parse point tag. @@ -951,6 +974,11 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem Q_ASSERT_X(domElement.isNull() == false, Q_FUNC_INFO, "domElement is null"); Q_ASSERT_X(type.isEmpty() == false, Q_FUNC_INFO, "type of point is empty"); + quint32 id = 0; + QString name; + qreal mx = 0; + qreal my = 0; + QString typeLine; QStringList points{VToolSinglePoint::ToolType, VToolEndLine::ToolType, VToolAlongLine::ToolType, VToolShoulderPoint::ToolType, VToolNormal::ToolType, VToolBisector::ToolType, @@ -964,12 +992,9 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem VToolSinglePoint *spoint = 0; try { - const quint32 id = GetParametrId(domElement); - const QString name = GetParametrString(domElement, VAbstractTool::AttrName, "A"); + PointsCommonAttributes(domElement, id, name, mx, my); const qreal x = qApp->toPixel(GetParametrDouble(domElement, VAbstractTool::AttrX, "10.0")); const qreal y = qApp->toPixel(GetParametrDouble(domElement, VAbstractTool::AttrY, "10.0")); - const qreal mx = qApp->toPixel(GetParametrDouble(domElement, VAbstractTool::AttrMx, "10.0")); - const qreal my = qApp->toPixel(GetParametrDouble(domElement, VAbstractTool::AttrMy, "15.0")); data->UpdateGObject(id, new VPointF(x, y, name, mx, my)); VDrawTool::AddRecord(id, Tool::SinglePointTool, this); @@ -999,12 +1024,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem case 1: //VToolEndLine::ToolType try { - const quint32 id = GetParametrId(domElement); - const QString name = GetParametrString(domElement, VAbstractTool::AttrName, ""); - const qreal mx = qApp->toPixel(GetParametrDouble(domElement, VAbstractTool::AttrMx, "10.0")); - const qreal my = qApp->toPixel(GetParametrDouble(domElement, VAbstractTool::AttrMy, "15.0")); - const QString typeLine = GetParametrString(domElement, VAbstractTool::AttrTypeLine, - VAbstractTool::TypeLineLine); + PointsCommonAttributes(domElement, id, name, mx, my, typeLine); const QString formula = GetParametrString(domElement, VAbstractTool::AttrLength, "100.0"); QString f = formula;//need for saving fixed formula; @@ -1036,12 +1056,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem case 2: //VToolAlongLine::ToolType try { - const quint32 id = GetParametrId(domElement); - const QString name = GetParametrString(domElement, VAbstractTool::AttrName, ""); - const qreal mx = qApp->toPixel(GetParametrDouble(domElement, VAbstractTool::AttrMx, "10.0")); - const qreal my = qApp->toPixel(GetParametrDouble(domElement, VAbstractTool::AttrMy, "15.0")); - const QString typeLine = GetParametrString(domElement, VAbstractTool::AttrTypeLine, - VAbstractTool::TypeLineLine); + PointsCommonAttributes(domElement, id, name, mx, my, typeLine); const QString formula = GetParametrString(domElement, VAbstractTool::AttrLength, "100.0"); QString f = formula;//need for saving fixed formula; const quint32 firstPointId = GetParametrUInt(domElement, VAbstractTool::AttrFirstPoint, "0"); @@ -1072,12 +1087,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem case 3: //VToolShoulderPoint::ToolType try { - const quint32 id = GetParametrId(domElement); - const QString name = GetParametrString(domElement, VAbstractTool::AttrName, ""); - const qreal mx = qApp->toPixel(GetParametrDouble(domElement, VAbstractTool::AttrMx, "10.0")); - const qreal my = qApp->toPixel(GetParametrDouble(domElement, VAbstractTool::AttrMy, "15.0")); - const QString typeLine = GetParametrString(domElement, VAbstractTool::AttrTypeLine, - VAbstractTool::TypeLineLine); + PointsCommonAttributes(domElement, id, name, mx, my, typeLine); const QString formula = GetParametrString(domElement, VAbstractTool::AttrLength, "100.0"); QString f = formula;//need for saving fixed formula; const quint32 p1Line = GetParametrUInt(domElement, VAbstractTool::AttrP1Line, "0"); @@ -1109,12 +1119,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem case 4: //VToolNormal::ToolType try { - const quint32 id = GetParametrId(domElement); - const QString name = GetParametrString(domElement, VAbstractTool::AttrName, ""); - const qreal mx = qApp->toPixel(GetParametrDouble(domElement, VAbstractTool::AttrMx, "10.0")); - const qreal my = qApp->toPixel(GetParametrDouble(domElement, VAbstractTool::AttrMy, "15.0")); - const QString typeLine = GetParametrString(domElement, VAbstractTool::AttrTypeLine, - VAbstractTool::TypeLineLine); + PointsCommonAttributes(domElement, id, name, mx, my, typeLine); const QString formula = GetParametrString(domElement, VAbstractTool::AttrLength, "100.0"); QString f = formula;//need for saving fixed formula; const quint32 firstPointId = GetParametrUInt(domElement, VAbstractTool::AttrFirstPoint, "0"); @@ -1146,12 +1151,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem case 5: //VToolBisector::ToolType try { - const quint32 id = GetParametrId(domElement); - const QString name = GetParametrString(domElement, VAbstractTool::AttrName, ""); - const qreal mx = qApp->toPixel(GetParametrDouble(domElement, VAbstractTool::AttrMx, "10.0")); - const qreal my = qApp->toPixel(GetParametrDouble(domElement, VAbstractTool::AttrMy, "15.0")); - const QString typeLine = GetParametrString(domElement, VAbstractTool::AttrTypeLine, - VAbstractTool::TypeLineLine); + PointsCommonAttributes(domElement, id, name, mx, my, typeLine); const QString formula = GetParametrString(domElement, VAbstractTool::AttrLength, "100.0"); QString f = formula;//need for saving fixed formula; const quint32 firstPointId = GetParametrUInt(domElement, VAbstractTool::AttrFirstPoint, "0"); @@ -1183,10 +1183,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem case 6: //VToolLineIntersect::ToolType try { - const quint32 id = GetParametrId(domElement); - const QString name = GetParametrString(domElement, VAbstractTool::AttrName, ""); - const qreal mx = qApp->toPixel(GetParametrDouble(domElement, VAbstractTool::AttrMx, "10.0")); - const qreal my = qApp->toPixel(GetParametrDouble(domElement, VAbstractTool::AttrMy, "15.0")); + PointsCommonAttributes(domElement, id, name, mx, my); const quint32 p1Line1Id = GetParametrUInt(domElement, VAbstractTool::AttrP1Line1, "0"); const quint32 p2Line1Id = GetParametrUInt(domElement, VAbstractTool::AttrP2Line1, "0"); const quint32 p1Line2Id = GetParametrUInt(domElement, VAbstractTool::AttrP1Line2, "0"); @@ -1205,10 +1202,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem case 7: //VToolPointOfContact::ToolType try { - const quint32 id = GetParametrId(domElement); - const QString name = GetParametrString(domElement, VAbstractTool::AttrName, ""); - const qreal mx = qApp->toPixel(GetParametrDouble(domElement, VAbstractTool::AttrMx, "10.0")); - const qreal my = qApp->toPixel(GetParametrDouble(domElement, VAbstractTool::AttrMy, "15.0")); + PointsCommonAttributes(domElement, id, name, mx, my); const QString radius = GetParametrString(domElement, VAbstractTool::AttrRadius, "0"); QString f = radius;//need for saving fixed formula; const quint32 center = GetParametrUInt(domElement, VAbstractTool::AttrCenter, "0"); @@ -1240,12 +1234,10 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem case 8: //VNodePoint::ToolType try { - const quint32 id = GetParametrId(domElement); + PointsCommonAttributes(domElement, id, mx, my); const quint32 idObject = GetParametrUInt(domElement, VAbstractNode::AttrIdObject, "0"); const quint32 idTool = GetParametrUInt(domElement, VAbstractNode::AttrIdTool, "0"); const VPointF *point = data->GeometricObject(idObject ); - const qreal mx = qApp->toPixel(GetParametrDouble(domElement, VAbstractTool::AttrMx, "10.0")); - const qreal my = qApp->toPixel(GetParametrDouble(domElement, VAbstractTool::AttrMy, "15.0")); data->UpdateGObject(id, new VPointF(point->x(), point->y(), point->name(), mx, my, idObject, Draw::Modeling)); VNodePoint::Create(this, data, id, idObject, parse, Source::FromFile, idTool); @@ -1260,12 +1252,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem case 9: //VToolHeight::ToolType try { - const quint32 id = GetParametrId(domElement); - const QString name = GetParametrString(domElement, VAbstractTool::AttrName, ""); - const qreal mx = qApp->toPixel(GetParametrDouble(domElement, VAbstractTool::AttrMx, "10.0")); - const qreal my = qApp->toPixel(GetParametrDouble(domElement, VAbstractTool::AttrMy, "15.0")); - const QString typeLine = GetParametrString(domElement, VAbstractTool::AttrTypeLine, - VAbstractTool::TypeLineLine); + PointsCommonAttributes(domElement, id, name, mx, my, typeLine); const quint32 basePointId = GetParametrUInt(domElement, VAbstractTool::AttrBasePoint, "0"); const quint32 p1LineId = GetParametrUInt(domElement, VAbstractTool::AttrP1Line, "0"); const quint32 p2LineId = GetParametrUInt(domElement, VAbstractTool::AttrP2Line, "0"); @@ -1283,10 +1270,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem case 10: //VToolTriangle::ToolType try { - const quint32 id = GetParametrId(domElement); - const QString name = GetParametrString(domElement, VAbstractTool::AttrName, ""); - const qreal mx = qApp->toPixel(GetParametrDouble(domElement, VAbstractTool::AttrMx, "10.0")); - const qreal my = qApp->toPixel(GetParametrDouble(domElement, VAbstractTool::AttrMy, "15.0")); + PointsCommonAttributes(domElement, id, name, mx, my); const quint32 axisP1Id = GetParametrUInt(domElement, VAbstractTool::AttrAxisP1, "0"); const quint32 axisP2Id = GetParametrUInt(domElement, VAbstractTool::AttrAxisP2, "0"); const quint32 firstPointId = GetParametrUInt(domElement, VAbstractTool::AttrFirstPoint, "0"); @@ -1305,10 +1289,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem case 11: //VToolPointOfIntersection::ToolType try { - const quint32 id = GetParametrId(domElement); - const QString name = GetParametrString(domElement, VAbstractTool::AttrName, ""); - const qreal mx = qApp->toPixel(GetParametrDouble(domElement, VAbstractTool::AttrMx, "10.0")); - const qreal my = qApp->toPixel(GetParametrDouble(domElement, VAbstractTool::AttrMy, "15.0")); + PointsCommonAttributes(domElement, id, name, mx, my); const quint32 firstPointId = GetParametrUInt(domElement, VAbstractTool::AttrFirstPoint, "0"); const quint32 secondPointId = GetParametrUInt(domElement, VAbstractTool::AttrSecondPoint, "0"); @@ -1325,10 +1306,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem case 12: //VToolCutSpline::ToolType try { - const quint32 id = GetParametrId(domElement); - const QString name = GetParametrString(domElement, VAbstractTool::AttrName, ""); - const qreal mx = qApp->toPixel(GetParametrDouble(domElement, VAbstractTool::AttrMx, "10.0")); - const qreal my = qApp->toPixel(GetParametrDouble(domElement, VAbstractTool::AttrMy, "15.0")); + PointsCommonAttributes(domElement, id, name, mx, my); const QString formula = GetParametrString(domElement, VAbstractTool::AttrLength, "0"); QString f = formula;//need for saving fixed formula; const quint32 splineId = GetParametrUInt(domElement, VToolCutSpline::AttrSpline, "0"); @@ -1357,10 +1335,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem case 13: //VToolCutSplinePath::ToolType try { - const quint32 id = GetParametrId(domElement); - const QString name = GetParametrString(domElement, VAbstractTool::AttrName, ""); - const qreal mx = qApp->toPixel(GetParametrDouble(domElement, VAbstractTool::AttrMx, "10.0")); - const qreal my = qApp->toPixel(GetParametrDouble(domElement, VAbstractTool::AttrMy, "15.0")); + PointsCommonAttributes(domElement, id, name, mx, my); const QString formula = GetParametrString(domElement, VAbstractTool::AttrLength, "0"); QString f = formula;//need for saving fixed formula; const quint32 splinePathId = GetParametrUInt(domElement, VToolCutSplinePath::AttrSplinePath, "0"); @@ -1390,10 +1365,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem case 14: //VToolCutArc::ToolType try { - const quint32 id = GetParametrId(domElement); - const QString name = GetParametrString(domElement, VAbstractTool::AttrName, ""); - const qreal mx = qApp->toPixel(GetParametrDouble(domElement, VAbstractTool::AttrMx, "10.0")); - const qreal my = qApp->toPixel(GetParametrDouble(domElement, VAbstractTool::AttrMy, "15.0")); + PointsCommonAttributes(domElement, id, name, mx, my); const QString formula = GetParametrString(domElement, VAbstractTool::AttrLength, "0"); QString f = formula;//need for saving fixed formula; const quint32 arcId = GetParametrUInt(domElement, VToolCutArc::AttrArc, "0"); @@ -1437,9 +1409,10 @@ void VPattern::ParseLineElement(VMainGraphicsScene *scene, const QDomElement &do { SCASSERT(scene != nullptr); Q_ASSERT_X(domElement.isNull() == false, Q_FUNC_INFO, "domElement is null"); + quint32 id = 0; try { - const quint32 id = GetParametrId(domElement); + ToolsCommonAttributes(domElement, id); const quint32 firstPoint = GetParametrUInt(domElement, VAbstractTool::AttrFirstPoint, "0"); const quint32 secondPoint = GetParametrUInt(domElement, VAbstractTool::AttrSecondPoint, "0"); const QString typeLine = GetParametrString(domElement, VAbstractTool::AttrTypeLine, @@ -1455,6 +1428,14 @@ void VPattern::ParseLineElement(VMainGraphicsScene *scene, const QDomElement &do } } +//--------------------------------------------------------------------------------------------------------------------- +void VPattern::SplinesCommonAttributes(const QDomElement &domElement, quint32 &id, quint32 &idObject, quint32 &idTool) +{ + ToolsCommonAttributes(domElement, id); + idObject = GetParametrUInt(domElement, VAbstractNode::AttrIdObject, "0"); + idTool = GetParametrUInt(domElement, VAbstractNode::AttrIdTool, "0"); +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief ParseSplineElement parse spline tag. @@ -1470,6 +1451,10 @@ void VPattern::ParseSplineElement(VMainGraphicsScene *scene, const QDomElement & Q_ASSERT_X(domElement.isNull() == false, Q_FUNC_INFO, "domElement is null"); Q_ASSERT_X(type.isEmpty() == false, Q_FUNC_INFO, "type of spline is empty"); + quint32 id = 0; + quint32 idObject = 0; + quint32 idTool = 0; + QStringList splines{VToolSpline::ToolType, VToolSplinePath::ToolType, VNodeSpline::ToolType, VNodeSplinePath::ToolType}; switch (splines.indexOf(type)) @@ -1477,7 +1462,7 @@ void VPattern::ParseSplineElement(VMainGraphicsScene *scene, const QDomElement & case 0: //VToolSpline::ToolType try { - const quint32 id = GetParametrId(domElement); + ToolsCommonAttributes(domElement, id); const quint32 point1 = GetParametrUInt(domElement, VAbstractTool::AttrPoint1, "0"); const quint32 point4 = GetParametrUInt(domElement, VAbstractTool::AttrPoint4, "0"); const qreal angle1 = GetParametrDouble(domElement, VAbstractTool::AttrAngle1, "270.0"); @@ -1499,7 +1484,7 @@ void VPattern::ParseSplineElement(VMainGraphicsScene *scene, const QDomElement & case 1: //VToolSplinePath::ToolType try { - const quint32 id = GetParametrId(domElement); + ToolsCommonAttributes(domElement, id); const qreal kCurve = GetParametrDouble(domElement, VAbstractTool::AttrKCurve, "1.0"); VSplinePath *path = new VSplinePath(kCurve); @@ -1543,9 +1528,7 @@ void VPattern::ParseSplineElement(VMainGraphicsScene *scene, const QDomElement & case 2: //VNodeSpline::ToolType try { - const quint32 id = GetParametrId(domElement); - const quint32 idObject = GetParametrUInt(domElement, VAbstractNode::AttrIdObject, "0"); - const quint32 idTool = GetParametrUInt(domElement, VAbstractNode::AttrIdTool, "0"); + SplinesCommonAttributes(domElement, id, idObject, idTool); VSpline *spl = new VSpline(*data->GeometricObject(idObject)); spl->setIdObject(idObject); spl->setMode(Draw::Modeling); @@ -1562,9 +1545,7 @@ void VPattern::ParseSplineElement(VMainGraphicsScene *scene, const QDomElement & case 3: //VNodeSplinePath::ToolType try { - const quint32 id = GetParametrId(domElement); - const quint32 idObject = GetParametrUInt(domElement, VAbstractNode::AttrIdObject, "0"); - const quint32 idTool = GetParametrUInt(domElement, VAbstractNode::AttrIdTool, "0"); + SplinesCommonAttributes(domElement, id, idObject, idTool); VSplinePath *path = new VSplinePath(*data->GeometricObject(idObject)); path->setIdObject(idObject); path->setMode(Draw::Modeling); @@ -1599,6 +1580,7 @@ void VPattern::ParseArcElement(VMainGraphicsScene *scene, QDomElement &domElemen Q_ASSERT_X(domElement.isNull() == false, Q_FUNC_INFO, "domElement is null"); Q_ASSERT_X(type.isEmpty() == false, Q_FUNC_INFO, "type of spline is empty"); + quint32 id = 0; QStringList arcs{VToolArc::ToolType, VNodeArc::ToolType}; switch (arcs.indexOf(type)) @@ -1606,7 +1588,7 @@ void VPattern::ParseArcElement(VMainGraphicsScene *scene, QDomElement &domElemen case 0: //VToolArc::ToolType try { - const quint32 id = GetParametrId(domElement); + ToolsCommonAttributes(domElement, id); const quint32 center = GetParametrUInt(domElement, VAbstractTool::AttrCenter, "0"); const QString radius = GetParametrString(domElement, VAbstractTool::AttrRadius, "10"); QString r = radius;//need for saving fixed formula; @@ -1641,7 +1623,7 @@ void VPattern::ParseArcElement(VMainGraphicsScene *scene, QDomElement &domElemen case 1: //VNodeArc::ToolType try { - const quint32 id = GetParametrId(domElement); + ToolsCommonAttributes(domElement, id); const quint32 idObject = GetParametrUInt(domElement, VAbstractNode::AttrIdObject, "0"); const quint32 idTool = GetParametrUInt(domElement, VAbstractNode::AttrIdTool, "0"); VArc *arc = new VArc(*data->GeometricObject(idObject)); @@ -1678,6 +1660,7 @@ void VPattern::ParseToolsElement(VMainGraphicsScene *scene, const QDomElement &d Q_ASSERT_X(domElement.isNull() == false, Q_FUNC_INFO, "domElement is null"); Q_ASSERT_X(type.isEmpty() == false, Q_FUNC_INFO, "type of spline is empty"); + quint32 id = 0; QStringList tools{VToolUnionDetails::ToolType}; switch (tools.indexOf(type)) @@ -1685,7 +1668,7 @@ void VPattern::ParseToolsElement(VMainGraphicsScene *scene, const QDomElement &d case 0: //VToolUnionDetails::ToolType try { - const quint32 id = GetParametrId(domElement); + ToolsCommonAttributes(domElement, id); const quint32 indexD1 = GetParametrUInt(domElement, VToolUnionDetails::AttrIndexD1, "-1"); const quint32 indexD2 = GetParametrUInt(domElement, VToolUnionDetails::AttrIndexD2, "-1"); @@ -1863,6 +1846,12 @@ void VPattern::GarbageCollector() } } +//--------------------------------------------------------------------------------------------------------------------- +void VPattern::ToolsCommonAttributes(const QDomElement &domElement, quint32 &id) +{ + id = GetParametrId(domElement); +} + //--------------------------------------------------------------------------------------------------------------------- QDomElement VPattern::GetPPElement(const QString &name) { diff --git a/src/app/xml/vpattern.h b/src/app/xml/vpattern.h index 5e8fda878..753c9cdb5 100644 --- a/src/app/xml/vpattern.h +++ b/src/app/xml/vpattern.h @@ -130,7 +130,7 @@ signals: /** * @brief patternChanged emit if we have unsaved change. */ - void patternChanged(); + void patternChanged(bool saved); /** * @brief ShowTool highlight tool. * @param id tool id. @@ -199,6 +199,14 @@ private: void PrepareForParse(const Document &parse); void UpdateMeasurements(); void GarbageCollector(); + void ToolsCommonAttributes(const QDomElement &domElement, quint32 &id); + void PointsCommonAttributes(const QDomElement &domElement, quint32 &id, QString &name, qreal &mx, + qreal &my, QString &typeLine); + void PointsCommonAttributes(const QDomElement &domElement, quint32 &id, QString &name, qreal &mx, + qreal &my); + void PointsCommonAttributes(const QDomElement &domElement, quint32 &id, qreal &mx, qreal &my); + void SplinesCommonAttributes(const QDomElement &domElement, quint32 &id, quint32 &idObject, + quint32 &idTool); }; //--------------------------------------------------------------------------------------------------------------------- From e01b8b216470bd264c0b6eec799f44ed93a7c325 Mon Sep 17 00:00:00 2001 From: dismine Date: Wed, 18 Jun 2014 19:17:18 +0300 Subject: [PATCH 14/20] Refactoring. Delete repetitive code. --HG-- branch : feature --- src/libs/qmuparser/qmuparserbase.cpp | 37 ---------------------------- 1 file changed, 37 deletions(-) diff --git a/src/libs/qmuparser/qmuparserbase.cpp b/src/libs/qmuparser/qmuparserbase.cpp index e430830b0..3bf001f68 100644 --- a/src/libs/qmuparser/qmuparserbase.cpp +++ b/src/libs/qmuparser/qmuparserbase.cpp @@ -595,22 +595,6 @@ int QmuParserBase::GetOprtPrecedence(const token_type &a_Tok) const case cmOPRT_INFIX: case cmOPRT_BIN: return a_Tok.GetPri(); - case cmBO: - case cmBC: - case cmENDIF: - case cmVAR: - case cmVAL: - case cmVARPOW2: - case cmVARPOW3: - case cmVARPOW4: - case cmVARMUL: - case cmPOW2: - case cmFUNC: - case cmFUNC_STR: - case cmFUNC_BULK: - case cmSTRING: - case cmOPRT_POSTFIX: - case cmUNKNOWN: default: Error(ecINTERNAL_ERROR, 5); return 999; @@ -644,27 +628,6 @@ EOprtAssociativity QmuParserBase::GetOprtAssociativity(const token_type &a_Tok) return oaRIGHT; case cmOPRT_BIN: return a_Tok.GetAssociativity(); - case cmBO: - case cmBC: - case cmIF: - case cmELSE: - case cmENDIF: - case cmARG_SEP: - case cmVAR: - case cmVAL: - case cmVARPOW2: - case cmVARPOW3: - case cmVARPOW4: - case cmVARMUL: - case cmPOW2: - case cmFUNC: - case cmFUNC_STR: - case cmFUNC_BULK: - case cmSTRING: - case cmOPRT_POSTFIX: - case cmOPRT_INFIX: - case cmEND: - case cmUNKNOWN: default: return oaNONE; } From 1884e302b45e5bd35117bbbad89e9e46dbc9b60f Mon Sep 17 00:00:00 2001 From: dismine Date: Thu, 19 Jun 2014 12:29:56 +0300 Subject: [PATCH 15/20] Refactoring. Delete repetitive code. Replace lineEdit by plainTextEdit. --HG-- branch : feature --- src/app/dialogs/tools/dialogalongline.cpp | 18 +- src/app/dialogs/tools/dialogalongline.h | 1 - src/app/dialogs/tools/dialogalongline.ui | 10 +- src/app/dialogs/tools/dialogarc.cpp | 83 ++- src/app/dialogs/tools/dialogarc.h | 5 +- src/app/dialogs/tools/dialogarc.ui | 252 ++++++-- src/app/dialogs/tools/dialogbisector.cpp | 18 +- src/app/dialogs/tools/dialogbisector.h | 1 - src/app/dialogs/tools/dialogbisector.ui | 8 +- src/app/dialogs/tools/dialogcutarc.cpp | 18 +- src/app/dialogs/tools/dialogcutarc.h | 1 - src/app/dialogs/tools/dialogcutarc.ui | 10 +- src/app/dialogs/tools/dialogcutspline.cpp | 27 +- src/app/dialogs/tools/dialogcutspline.h | 7 + src/app/dialogs/tools/dialogcutspline.ui | 74 ++- src/app/dialogs/tools/dialogcutsplinepath.cpp | 25 +- src/app/dialogs/tools/dialogcutsplinepath.h | 7 + src/app/dialogs/tools/dialogcutsplinepath.ui | 74 ++- .../dialogs/tools/dialogeditwrongformula.cpp | 25 +- .../dialogs/tools/dialogeditwrongformula.h | 7 + .../dialogs/tools/dialogeditwrongformula.ui | 608 ++++++++++-------- src/app/dialogs/tools/dialogendline.cpp | 19 +- src/app/dialogs/tools/dialogendline.h | 2 - src/app/dialogs/tools/dialogendline.ui | 4 +- src/app/dialogs/tools/dialognormal.cpp | 16 +- src/app/dialogs/tools/dialognormal.h | 1 - src/app/dialogs/tools/dialognormal.ui | 10 +- .../dialogs/tools/dialogpointofcontact.cpp | 18 +- src/app/dialogs/tools/dialogpointofcontact.h | 1 - src/app/dialogs/tools/dialogpointofcontact.ui | 10 +- src/app/dialogs/tools/dialogshoulderpoint.cpp | 18 +- src/app/dialogs/tools/dialogshoulderpoint.h | 1 - src/app/dialogs/tools/dialogshoulderpoint.ui | 10 +- src/app/dialogs/tools/dialogtool.cpp | 40 +- src/app/dialogs/tools/dialogtool.h | 5 +- src/app/share/resources/theme.qrc | 3 + .../tools/drawTools/vtoolcutsplinepath.cpp | 110 ++-- 37 files changed, 906 insertions(+), 641 deletions(-) diff --git a/src/app/dialogs/tools/dialogalongline.cpp b/src/app/dialogs/tools/dialogalongline.cpp index cbb375364..af7dd47f4 100644 --- a/src/app/dialogs/tools/dialogalongline.cpp +++ b/src/app/dialogs/tools/dialogalongline.cpp @@ -66,9 +66,6 @@ DialogAlongLine::DialogAlongLine(const VContainer *data, QWidget *parent) connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogAlongLine::DeployFormulaTextEdit); InitVariables(ui); connect(listWidget, &QListWidget::itemDoubleClicked, this, &DialogTool::PutVal); - - ui->pushButtonGrowLength->setIcon(QIcon::fromTheme("go-down", - QIcon(":/icons/win.icon.theme/icons/win.icon.theme/16x16/actions/go-down.png"))); } //--------------------------------------------------------------------------------------------------------------------- @@ -80,20 +77,7 @@ void DialogAlongLine::FormulaTextChanged() //--------------------------------------------------------------------------------------------------------------------- void DialogAlongLine::DeployFormulaTextEdit() { - if (ui->plainTextEditFormula->height() < DIALOGALONLINE_MAX_FORMULA_HEIGHT) - { - ui->plainTextEditFormula->setFixedHeight(DIALOGALONLINE_MAX_FORMULA_HEIGHT); - //Set icon from theme (internal for Windows system) - ui->pushButtonGrowLength->setIcon(QIcon::fromTheme("go-next", - QIcon(":/icons/win.icon.theme/icons/win.icon.theme/16x16/actions/go-next.png"))); - } - else - { - ui->plainTextEditFormula->setFixedHeight(this->formulaBaseHeight); - //Set icon from theme (internal for Windows system) - ui->pushButtonGrowLength->setIcon(QIcon::fromTheme("go-down", - QIcon(":/icons/win.icon.theme/icons/win.icon.theme/16x16/actions/go-down.png"))); - } + DeployFormula(ui->plainTextEditFormula, ui->pushButtonGrowLength, formulaBaseHeight); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogalongline.h b/src/app/dialogs/tools/dialogalongline.h index 581d67269..478aef06b 100644 --- a/src/app/dialogs/tools/dialogalongline.h +++ b/src/app/dialogs/tools/dialogalongline.h @@ -31,7 +31,6 @@ #include "dialogtool.h" -#define DIALOGALONLINE_MAX_FORMULA_HEIGHT 64 namespace Ui { class DialogAlongLine; diff --git a/src/app/dialogs/tools/dialogalongline.ui b/src/app/dialogs/tools/dialogalongline.ui index 5bf4d8691..41f3e0fd4 100644 --- a/src/app/dialogs/tools/dialogalongline.ui +++ b/src/app/dialogs/tools/dialogalongline.ui @@ -160,6 +160,12 @@ + + + 0 + 0 + + 16777215 @@ -189,8 +195,7 @@ - - :/icons/win.icon.theme/icons/win.icon.theme/16x16/actions/go-down.png:/icons/win.icon.theme/icons/win.icon.theme/16x16/actions/go-down.png + @@ -468,7 +473,6 @@ - diff --git a/src/app/dialogs/tools/dialogarc.cpp b/src/app/dialogs/tools/dialogarc.cpp index c32e5e514..14d0f2d00 100644 --- a/src/app/dialogs/tools/dialogarc.cpp +++ b/src/app/dialogs/tools/dialogarc.cpp @@ -44,10 +44,14 @@ DialogArc::DialogArc(const VContainer *data, QWidget *parent) :DialogTool(data, parent), ui(new Ui::DialogArc), flagRadius(false), flagF1(false), flagF2(false), timerRadius(nullptr), timerF1(nullptr), timerF2(nullptr), center(0), radius(QString()), f1(QString()), - f2(QString()), formulaBaseHeight(0) + f2(QString()), formulaBaseHeight(0), formulaBaseHeightF1(0), formulaBaseHeightF2(0) { ui->setupUi(this); + InitVariables(ui); + + plainTextEditFormula = ui->plainTextEditFormula; + timerRadius = new QTimer(this); connect(timerRadius, &QTimer::timeout, this, &DialogArc::EvalRadius); @@ -60,13 +64,13 @@ DialogArc::DialogArc(const VContainer *data, QWidget *parent) InitOkCancelApply(ui); this->formulaBaseHeight=ui->plainTextEditFormula->height(); + this->formulaBaseHeightF1=ui->plainTextEditF1->height(); + this->formulaBaseHeightF2=ui->plainTextEditF2->height(); FillComboBoxPoints(ui->comboBoxBasePoint); CheckState(); - InitVariables(ui); - connect(ui->toolButtonPutHereRadius, &QPushButton::clicked, this, &DialogArc::PutRadius); connect(ui->toolButtonPutHereF1, &QPushButton::clicked, this, &DialogArc::PutF1); connect(ui->toolButtonPutHereF2, &QPushButton::clicked, this, &DialogArc::PutF2); @@ -76,31 +80,30 @@ DialogArc::DialogArc(const VContainer *data, QWidget *parent) connect(ui->toolButtonEqualF2, &QPushButton::clicked, this, &DialogArc::EvalF2); connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogArc::RadiusChanged); - connect(ui->lineEditF1, &QLineEdit::textChanged, this, &DialogArc::F1Changed); - connect(ui->lineEditF2, &QLineEdit::textChanged, this, &DialogArc::F2Changed); - connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogArc::DeployFormulaTextEdit); + connect(ui->plainTextEditF1, &QPlainTextEdit::textChanged, this, &DialogArc::F1Changed); + connect(ui->plainTextEditF2, &QPlainTextEdit::textChanged, this, &DialogArc::F2Changed); - ui->pushButtonGrowLength->setIcon(QIcon::fromTheme("go-down", - QIcon(":/icons/win.icon.theme/icons/win.icon.theme/16x16/actions/go-down.png"))); + connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogArc::DeployFormulaTextEdit); + connect(ui->pushButtonGrowLengthF1, &QPushButton::clicked, this, &DialogArc::DeployF1TextEdit); + connect(ui->pushButtonGrowLengthF2, &QPushButton::clicked, this, &DialogArc::DeployF2TextEdit); } //--------------------------------------------------------------------------------------------------------------------- void DialogArc::DeployFormulaTextEdit() { - if (ui->plainTextEditFormula->height() < DIALOGARC_MAX_FORMULA_HEIGHT) - { - ui->plainTextEditFormula->setFixedHeight(DIALOGARC_MAX_FORMULA_HEIGHT); - //Set icon from theme (internal for Windows system) - ui->pushButtonGrowLength->setIcon(QIcon::fromTheme("go-next", - QIcon(":/icons/win.icon.theme/icons/win.icon.theme/16x16/actions/go-next.png"))); - } - else - { - ui->plainTextEditFormula->setFixedHeight(this->formulaBaseHeight); - //Set icon from theme (internal for Windows system) - ui->pushButtonGrowLength->setIcon(QIcon::fromTheme("go-down", - QIcon(":/icons/win.icon.theme/icons/win.icon.theme/16x16/actions/go-down.png"))); - } + DeployFormula(ui->plainTextEditFormula, ui->pushButtonGrowLength, formulaBaseHeight); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogArc::DeployF1TextEdit() +{ + DeployFormula(ui->plainTextEditF1, ui->pushButtonGrowLengthF1, formulaBaseHeightF1); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogArc::DeployF2TextEdit() +{ + DeployFormula(ui->plainTextEditF2, ui->pushButtonGrowLengthF2, formulaBaseHeightF2); } //--------------------------------------------------------------------------------------------------------------------- @@ -127,8 +130,13 @@ void DialogArc::SetCenter(const quint32 &value) */ void DialogArc::SetF2(const QString &value) { - f2 = value; - ui->lineEditF2->setText(f2); + f2 = qApp->FormulaToUser(value); + // increase height if needed. + if (f2.length() > 80) + { + this->DeployF2TextEdit(); + } + ui->plainTextEditF2->setPlainText(f2); } //--------------------------------------------------------------------------------------------------------------------- @@ -138,8 +146,13 @@ void DialogArc::SetF2(const QString &value) */ void DialogArc::SetF1(const QString &value) { - f1 = value; - ui->lineEditF1->setText(f1); + f1 = qApp->FormulaToUser(value); + // increase height if needed. + if (f1.length() > 80) + { + this->DeployF1TextEdit(); + } + ui->plainTextEditF1->setPlainText(f1); } //--------------------------------------------------------------------------------------------------------------------- @@ -197,8 +210,10 @@ void DialogArc::SaveData() { radius = ui->plainTextEditFormula->toPlainText(); radius.replace("\n", " "); - f1 = ui->lineEditF1->text(); - f2 = ui->lineEditF2->text(); + f1 = ui->plainTextEditF1->toPlainText(); + f1.replace("\n", " "); + f2 = ui->plainTextEditF2->toPlainText(); + f2.replace("\n", " "); center = getCurrentObjectId(ui->comboBoxBasePoint); } @@ -239,7 +254,7 @@ void DialogArc::PutRadius() */ void DialogArc::PutF1() { - PutValHere(ui->lineEditF1, ui->listWidget); + PutValHere(ui->plainTextEditF1, ui->listWidget); } //--------------------------------------------------------------------------------------------------------------------- @@ -248,7 +263,7 @@ void DialogArc::PutF1() */ void DialogArc::PutF2() { - PutValHere(ui->lineEditF2, ui->listWidget); + PutValHere(ui->plainTextEditF2, ui->listWidget); } //--------------------------------------------------------------------------------------------------------------------- @@ -278,7 +293,7 @@ void DialogArc::RadiusChanged() void DialogArc::F1Changed() { labelEditFormula = ui->labelEditF1; - ValFormulaChanged(flagF1, ui->lineEditF1, timerF1); + ValFormulaChanged(flagF1, ui->plainTextEditF1, timerF1); } //--------------------------------------------------------------------------------------------------------------------- @@ -288,7 +303,7 @@ void DialogArc::F1Changed() void DialogArc::F2Changed() { labelEditFormula = ui->labelEditF2; - ValFormulaChanged(flagF2, ui->lineEditF2, timerF2); + ValFormulaChanged(flagF2, ui->plainTextEditF2, timerF2); } //--------------------------------------------------------------------------------------------------------------------- @@ -320,7 +335,7 @@ void DialogArc::EvalRadius() void DialogArc::EvalF1() { labelEditFormula = ui->labelEditF1; - Eval(ui->lineEditF1->text(), flagF1, timerF1, ui->labelResultF1); + Eval(ui->plainTextEditF1->toPlainText(), flagF1, timerF1, ui->labelResultF1); } //--------------------------------------------------------------------------------------------------------------------- @@ -330,7 +345,7 @@ void DialogArc::EvalF1() void DialogArc::EvalF2() { labelEditFormula = ui->labelEditF2; - Eval(ui->lineEditF2->text(), flagF2, timerF2, ui->labelResultF2); + Eval(ui->plainTextEditF2->toPlainText(), flagF2, timerF2, ui->labelResultF2); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogarc.h b/src/app/dialogs/tools/dialogarc.h index 411e46f4a..74e1c9ee6 100644 --- a/src/app/dialogs/tools/dialogarc.h +++ b/src/app/dialogs/tools/dialogarc.h @@ -31,7 +31,6 @@ #include "dialogtool.h" -#define DIALOGARC_MAX_FORMULA_HEIGHT 64 namespace Ui { class DialogArc; @@ -69,6 +68,8 @@ public slots: * @brief DeployFormulaTextEdit grow or shrink formula input */ void DeployFormulaTextEdit(); + void DeployF1TextEdit(); + void DeployF2TextEdit(); virtual void ValChenged(int row); void PutRadius(); void PutF1(); @@ -118,6 +119,8 @@ private: /** @brief formulaBaseHeight base height defined by dialogui */ int formulaBaseHeight; + int formulaBaseHeightF1; + int formulaBaseHeightF2; void EvalRadius(); void EvalF1(); diff --git a/src/app/dialogs/tools/dialogarc.ui b/src/app/dialogs/tools/dialogarc.ui index 606cf83c4..4ffd32682 100644 --- a/src/app/dialogs/tools/dialogarc.ui +++ b/src/app/dialogs/tools/dialogarc.ui @@ -23,9 +23,6 @@ - - QLayout::SetDefaultConstraint - @@ -77,50 +74,17 @@ - - + + + Qt::Horizontal + + - 16777215 - 24 + 40 + 20 - - - - - - - 18 - 18 - - - - - 0 - 0 - - - - <html><head/><body><p>Show full calculation in message box</p></body></html> - - - - - - - - - - - - 16 - 16 - - - - true - - + @@ -186,6 +150,60 @@ + + + + + + + 0 + 0 + + + + + 16777215 + 24 + + + + + + + + + 18 + 18 + + + + + 0 + 0 + + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + + + + + + + + + + 16 + 16 + + + + true + + + + + @@ -239,17 +257,17 @@ - - - - 0 - 0 - + + + Qt::Horizontal - - First angle of arc counterclockwise + + + 40 + 20 + - + @@ -315,6 +333,60 @@ + + + + + + + 0 + 0 + + + + + 16777215 + 24 + + + + + + + + + 18 + 18 + + + + + 0 + 0 + + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + + + + + + + + + + 16 + 16 + + + + true + + + + + @@ -368,17 +440,17 @@ - - - - 0 - 0 - + + + Qt::Horizontal - - Second angle of arc counterclockwise + + + 40 + 20 + - + @@ -444,6 +516,60 @@ + + + + + + + 0 + 0 + + + + + 16777215 + 24 + + + + + + + + + 18 + 18 + + + + + 0 + 0 + + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + + + + + + + + + + 16 + 16 + + + + true + + + + + @@ -623,8 +749,6 @@ - lineEditF1 - lineEditF2 comboBoxBasePoint radioButtonSizeGrowth radioButtonStandardTable diff --git a/src/app/dialogs/tools/dialogbisector.cpp b/src/app/dialogs/tools/dialogbisector.cpp index 0eb457e48..8f7f713ac 100644 --- a/src/app/dialogs/tools/dialogbisector.cpp +++ b/src/app/dialogs/tools/dialogbisector.cpp @@ -68,9 +68,6 @@ DialogBisector::DialogBisector(const VContainer *data, QWidget *parent) connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogBisector::NamePointChanged); connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogBisector::FormulaTextChanged); connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogBisector::DeployFormulaTextEdit); - - ui->pushButtonGrowLength->setIcon(QIcon::fromTheme("go-down", - QIcon(":/icons/win.icon.theme/icons/win.icon.theme/16x16/actions/go-down.png"))); } //--------------------------------------------------------------------------------------------------------------------- @@ -82,20 +79,7 @@ void DialogBisector::FormulaTextChanged() //--------------------------------------------------------------------------------------------------------------------- void DialogBisector::DeployFormulaTextEdit() { - if (ui->plainTextEditFormula->height() < DIALOGBISECTOR_MAX_FORMULA_HEIGHT) - { - ui->plainTextEditFormula->setFixedHeight(DIALOGBISECTOR_MAX_FORMULA_HEIGHT); - //Set icon from theme (internal for Windows system) - ui->pushButtonGrowLength->setIcon(QIcon::fromTheme("go-next", - QIcon(":/icons/win.icon.theme/icons/win.icon.theme/16x16/actions/go-next.png"))); - } - else - { - ui->plainTextEditFormula->setFixedHeight(this->formulaBaseHeight); - //Set icon from theme (internal for Windows system) - ui->pushButtonGrowLength->setIcon(QIcon::fromTheme("go-down", - QIcon(":/icons/win.icon.theme/icons/win.icon.theme/16x16/actions/go-down.png"))); - } + DeployFormula(ui->plainTextEditFormula, ui->pushButtonGrowLength, formulaBaseHeight); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogbisector.h b/src/app/dialogs/tools/dialogbisector.h index 700f48c18..8757d482f 100644 --- a/src/app/dialogs/tools/dialogbisector.h +++ b/src/app/dialogs/tools/dialogbisector.h @@ -31,7 +31,6 @@ #include "dialogtool.h" -#define DIALOGBISECTOR_MAX_FORMULA_HEIGHT 64 namespace Ui { class DialogBisector; diff --git a/src/app/dialogs/tools/dialogbisector.ui b/src/app/dialogs/tools/dialogbisector.ui index 5c634c8aa..14a44ddb3 100644 --- a/src/app/dialogs/tools/dialogbisector.ui +++ b/src/app/dialogs/tools/dialogbisector.ui @@ -151,6 +151,12 @@ + + + 0 + 0 + + 16777215 @@ -180,7 +186,7 @@ - + diff --git a/src/app/dialogs/tools/dialogcutarc.cpp b/src/app/dialogs/tools/dialogcutarc.cpp index e4791526c..c597e4efe 100644 --- a/src/app/dialogs/tools/dialogcutarc.cpp +++ b/src/app/dialogs/tools/dialogcutarc.cpp @@ -64,9 +64,6 @@ DialogCutArc::DialogCutArc(const VContainer *data, QWidget *parent) connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogCutArc::NamePointChanged); connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogCutArc::FormulaTextChanged); connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogCutArc::DeployFormulaTextEdit); - - ui->pushButtonGrowLength->setIcon(QIcon::fromTheme("go-down", - QIcon(":/icons/win.icon.theme/icons/win.icon.theme/16x16/actions/go-down.png"))); } //--------------------------------------------------------------------------------------------------------------------- @@ -78,20 +75,7 @@ void DialogCutArc::FormulaTextChanged() //--------------------------------------------------------------------------------------------------------------------- void DialogCutArc::DeployFormulaTextEdit() { - if (ui->plainTextEditFormula->height() < DIALOGCUTARC_MAX_FORMULA_HEIGHT) - { - ui->plainTextEditFormula->setFixedHeight(DIALOGCUTARC_MAX_FORMULA_HEIGHT); - //Set icon from theme (internal for Windows system) - ui->pushButtonGrowLength->setIcon(QIcon::fromTheme("go-next", - QIcon(":/icons/win.icon.theme/icons/win.icon.theme/16x16/actions/go-next.png"))); - } - else - { - ui->plainTextEditFormula->setFixedHeight(this->formulaBaseHeight); - //Set icon from theme (internal for Windows system) - ui->pushButtonGrowLength->setIcon(QIcon::fromTheme("go-down", - QIcon(":/icons/win.icon.theme/icons/win.icon.theme/16x16/actions/go-down.png"))); - } + DeployFormula(ui->plainTextEditFormula, ui->pushButtonGrowLength, formulaBaseHeight); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogcutarc.h b/src/app/dialogs/tools/dialogcutarc.h index f4a6b6a13..02cb79b66 100644 --- a/src/app/dialogs/tools/dialogcutarc.h +++ b/src/app/dialogs/tools/dialogcutarc.h @@ -31,7 +31,6 @@ #include "dialogtool.h" -#define DIALOGCUTARC_MAX_FORMULA_HEIGHT 64 namespace Ui { class DialogCutArc; diff --git a/src/app/dialogs/tools/dialogcutarc.ui b/src/app/dialogs/tools/dialogcutarc.ui index c79294e69..3450b24fe 100644 --- a/src/app/dialogs/tools/dialogcutarc.ui +++ b/src/app/dialogs/tools/dialogcutarc.ui @@ -144,6 +144,12 @@ + + + 0 + 0 + + 16777215 @@ -173,9 +179,7 @@ - - - + diff --git a/src/app/dialogs/tools/dialogcutspline.cpp b/src/app/dialogs/tools/dialogcutspline.cpp index 979c3d34f..fffa1f87d 100644 --- a/src/app/dialogs/tools/dialogcutspline.cpp +++ b/src/app/dialogs/tools/dialogcutspline.cpp @@ -39,12 +39,13 @@ * @param parent parent widget */ DialogCutSpline::DialogCutSpline(const VContainer *data, QWidget *parent) - :DialogTool(data, parent), ui(new Ui::DialogCutSpline), pointName(QString()), formula(QString()), splineId(0) + :DialogTool(data, parent), ui(new Ui::DialogCutSpline), pointName(QString()), formula(QString()), splineId(0), + formulaBaseHeight(0) { ui->setupUi(this); InitVariables(ui); labelResultCalculation = ui->labelResultCalculation; - lineEditFormula = ui->lineEditFormula; + plainTextEditFormula = ui->plainTextEditFormula; labelEditFormula = ui->labelEditFormula; labelEditNamePoint = ui->labelEditNamePoint; InitOkCancel(ui); @@ -53,13 +54,16 @@ DialogCutSpline::DialogCutSpline(const VContainer *data, QWidget *parent) flagName = false; CheckState(); + this->formulaBaseHeight=ui->plainTextEditFormula->height(); + FillComboBoxSplines(ui->comboBoxSpline); connect(ui->toolButtonPutHere, &QPushButton::clicked, this, &DialogCutSpline::PutHere); connect(ui->listWidget, &QListWidget::itemDoubleClicked, this, &DialogCutSpline::PutVal); connect(ui->toolButtonEqual, &QPushButton::clicked, this, &DialogCutSpline::EvalFormula); connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogCutSpline::NamePointChanged); - connect(ui->lineEditFormula, &QLineEdit::textChanged, this, &DialogCutSpline::FormulaChanged); + connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogCutSpline::FormulaChanged); + connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogCutSpline::DeployFormulaTextEdit); } //--------------------------------------------------------------------------------------------------------------------- @@ -87,7 +91,13 @@ void DialogCutSpline::setPointName(const QString &value) void DialogCutSpline::setFormula(const QString &value) { formula = qApp->FormulaToUser(value); - ui->lineEditFormula->setText(formula); + // increase height if needed. TODO : see if I can get the max number of caracters in one line + // of this PlainTextEdit to change 80 to this value + if (formula.length() > 80) + { + this->DeployFormulaTextEdit(); + } + ui->plainTextEditFormula->setPlainText(formula); } //--------------------------------------------------------------------------------------------------------------------- @@ -125,7 +135,14 @@ void DialogCutSpline::ChoosedObject(quint32 id, const SceneObject &type) void DialogCutSpline::DialogAccepted() { pointName = ui->lineEditNamePoint->text(); - formula = ui->lineEditFormula->text(); + formula = ui->plainTextEditFormula->toPlainText(); + formula.replace("\n", " "); splineId = getCurrentObjectId(ui->comboBoxSpline); emit DialogClosed(QDialog::Accepted); } + +//--------------------------------------------------------------------------------------------------------------------- +void DialogCutSpline::DeployFormulaTextEdit() +{ + DeployFormula(ui->plainTextEditFormula, ui->pushButtonGrowLength, formulaBaseHeight); +} diff --git a/src/app/dialogs/tools/dialogcutspline.h b/src/app/dialogs/tools/dialogcutspline.h index 03be441cb..810658c39 100644 --- a/src/app/dialogs/tools/dialogcutspline.h +++ b/src/app/dialogs/tools/dialogcutspline.h @@ -61,6 +61,10 @@ public slots: * @brief DialogApply apply data and emit signal about applied dialog. */ virtual void DialogApply(){} + /** + * @brief DeployFormulaTextEdit grow or shrink formula input + */ + void DeployFormulaTextEdit(); private: Q_DISABLE_COPY(DialogCutSpline) @@ -75,6 +79,9 @@ private: /** @brief splineId keep id of spline */ quint32 splineId; + + /** @brief formulaBaseHeight base height defined by dialogui */ + int formulaBaseHeight; }; //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogcutspline.ui b/src/app/dialogs/tools/dialogcutspline.ui index 4fb194f59..7e564cda5 100644 --- a/src/app/dialogs/tools/dialogcutspline.ui +++ b/src/app/dialogs/tools/dialogcutspline.ui @@ -6,7 +6,7 @@ 0 0 - 520 + 665 546 @@ -67,17 +67,17 @@ - - - - 0 - 0 - + + + Qt::Horizontal - - Formula for the calculation of the spline + + + 40 + 20 + - + @@ -140,6 +140,60 @@ + + + + + + + 0 + 0 + + + + + 16777215 + 24 + + + + + + + + + 18 + 18 + + + + + 0 + 0 + + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + + + + + + + + + + 16 + 16 + + + + true + + + + + diff --git a/src/app/dialogs/tools/dialogcutsplinepath.cpp b/src/app/dialogs/tools/dialogcutsplinepath.cpp index 725c1ef62..ee38e9a3b 100644 --- a/src/app/dialogs/tools/dialogcutsplinepath.cpp +++ b/src/app/dialogs/tools/dialogcutsplinepath.cpp @@ -40,12 +40,12 @@ */ DialogCutSplinePath::DialogCutSplinePath(const VContainer *data, QWidget *parent) :DialogTool(data, parent), ui(new Ui::DialogCutSplinePath), pointName(QString()), formula(QString()), - splinePathId(0) + splinePathId(0), formulaBaseHeight(0) { ui->setupUi(this); InitVariables(ui); labelResultCalculation = ui->labelResultCalculation; - lineEditFormula = ui->lineEditFormula; + plainTextEditFormula = ui->plainTextEditFormula; labelEditFormula = ui->labelEditFormula; labelEditNamePoint = ui->labelEditNamePoint; @@ -53,6 +53,7 @@ DialogCutSplinePath::DialogCutSplinePath(const VContainer *data, QWidget *parent flagFormula = false; flagName = false; CheckState(); + this->formulaBaseHeight=ui->plainTextEditFormula->height(); FillComboBoxSplinesPath(ui->comboBoxSplinePath); @@ -60,7 +61,8 @@ DialogCutSplinePath::DialogCutSplinePath(const VContainer *data, QWidget *parent connect(ui->listWidget, &QListWidget::itemDoubleClicked, this, &DialogCutSplinePath::PutVal); connect(ui->toolButtonEqual, &QPushButton::clicked, this, &DialogCutSplinePath::EvalFormula); connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogCutSplinePath::NamePointChanged); - connect(ui->lineEditFormula, &QLineEdit::textChanged, this, &DialogCutSplinePath::FormulaChanged); + connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogCutSplinePath::FormulaChanged); + connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogCutSplinePath::DeployFormulaTextEdit); } //--------------------------------------------------------------------------------------------------------------------- @@ -88,7 +90,13 @@ void DialogCutSplinePath::setPointName(const QString &value) void DialogCutSplinePath::setFormula(const QString &value) { formula = qApp->FormulaToUser(value); - ui->lineEditFormula->setText(formula); + // increase height if needed. TODO : see if I can get the max number of caracters in one line + // of this PlainTextEdit to change 80 to this value + if (formula.length() > 80) + { + this->DeployFormulaTextEdit(); + } + ui->plainTextEditFormula->setPlainText(formula); } //--------------------------------------------------------------------------------------------------------------------- @@ -126,7 +134,14 @@ void DialogCutSplinePath::ChoosedObject(quint32 id, const SceneObject &type) void DialogCutSplinePath::DialogAccepted() { pointName = ui->lineEditNamePoint->text(); - formula = ui->lineEditFormula->text(); + formula = ui->plainTextEditFormula->toPlainText(); + formula.replace("\n", " "); splinePathId = getCurrentObjectId(ui->comboBoxSplinePath); emit DialogClosed(QDialog::Accepted); } + +//--------------------------------------------------------------------------------------------------------------------- +void DialogCutSplinePath::DeployFormulaTextEdit() +{ + DeployFormula(ui->plainTextEditFormula, ui->pushButtonGrowLength, formulaBaseHeight); +} diff --git a/src/app/dialogs/tools/dialogcutsplinepath.h b/src/app/dialogs/tools/dialogcutsplinepath.h index 0dd7d421f..8bd39f888 100644 --- a/src/app/dialogs/tools/dialogcutsplinepath.h +++ b/src/app/dialogs/tools/dialogcutsplinepath.h @@ -61,6 +61,10 @@ public slots: * @brief DialogApply apply data and emit signal about applied dialog. */ virtual void DialogApply(){} + /** + * @brief DeployFormulaTextEdit grow or shrink formula input + */ + void DeployFormulaTextEdit(); private: Q_DISABLE_COPY(DialogCutSplinePath) @@ -75,6 +79,9 @@ private: /** @brief splinePathId keep id of splinePath */ quint32 splinePathId; + + /** @brief formulaBaseHeight base height defined by dialogui */ + int formulaBaseHeight; }; //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogcutsplinepath.ui b/src/app/dialogs/tools/dialogcutsplinepath.ui index 26351262b..7a441a07c 100644 --- a/src/app/dialogs/tools/dialogcutsplinepath.ui +++ b/src/app/dialogs/tools/dialogcutsplinepath.ui @@ -6,7 +6,7 @@ 0 0 - 605 + 464 499 @@ -67,17 +67,17 @@ - - - - 0 - 0 - + + + Qt::Horizontal - - Formula for the calculation of the curve length + + + 40 + 20 + - + @@ -140,6 +140,60 @@ + + + + + + + 0 + 0 + + + + + 16777215 + 24 + + + + + + + + + 18 + 18 + + + + + 0 + 0 + + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + + + + + + + + + + 16 + 16 + + + + true + + + + + diff --git a/src/app/dialogs/tools/dialogeditwrongformula.cpp b/src/app/dialogs/tools/dialogeditwrongformula.cpp index c303e8895..6cf8a7b10 100644 --- a/src/app/dialogs/tools/dialogeditwrongformula.cpp +++ b/src/app/dialogs/tools/dialogeditwrongformula.cpp @@ -31,24 +31,26 @@ //--------------------------------------------------------------------------------------------------------------------- DialogEditWrongFormula::DialogEditWrongFormula(const VContainer *data, QWidget *parent) - :DialogTool(data, parent), ui(new Ui::DialogEditWrongFormula), formula(QString()) + :DialogTool(data, parent), ui(new Ui::DialogEditWrongFormula), formula(QString()), formulaBaseHeight(0) { ui->setupUi(this); InitVariables(ui); labelResultCalculation = ui->labelResult; - lineEditFormula = ui->lineEditFormula; + plainTextEditFormula = ui->plainTextEditFormula; labelEditFormula = ui->labelFormula; InitOkCancel(ui); flagFormula = false; CheckState(); + this->formulaBaseHeight=ui->plainTextEditFormula->height(); connect(ui->toolButtonPutHere, &QPushButton::clicked, this, &DialogEditWrongFormula::PutHere); connect(ui->listWidget, &QListWidget::itemDoubleClicked, this, &DialogEditWrongFormula::PutVal); connect(ui->toolButtonEqual, &QPushButton::clicked, this, &DialogEditWrongFormula::EvalFormula); - connect(ui->lineEditFormula, &QLineEdit::textChanged, this, &DialogEditWrongFormula::FormulaChanged); + connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogEditWrongFormula::FormulaChanged); + connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogEditWrongFormula::DeployFormulaTextEdit); //Disable Qt::WaitCursor #ifndef QT_NO_CURSOR @@ -68,7 +70,8 @@ DialogEditWrongFormula::~DialogEditWrongFormula() //--------------------------------------------------------------------------------------------------------------------- void DialogEditWrongFormula::DialogAccepted() { - formula = ui->lineEditFormula->text(); + formula = ui->plainTextEditFormula->toPlainText(); + formula.replace("\n", " "); emit DialogClosed(QDialog::Accepted); accepted(); } @@ -80,6 +83,12 @@ void DialogEditWrongFormula::DialogRejected() rejected(); } +//--------------------------------------------------------------------------------------------------------------------- +void DialogEditWrongFormula::DeployFormulaTextEdit() +{ + DeployFormula(ui->plainTextEditFormula, ui->pushButtonGrowLength, formulaBaseHeight); +} + //--------------------------------------------------------------------------------------------------------------------- void DialogEditWrongFormula::CheckState() { @@ -91,7 +100,13 @@ void DialogEditWrongFormula::CheckState() void DialogEditWrongFormula::setFormula(const QString &value) { formula = qApp->FormulaToUser(value); - ui->lineEditFormula->setText(formula); + // increase height if needed. TODO : see if I can get the max number of caracters in one line + // of this PlainTextEdit to change 80 to this value + if (formula.length() > 80) + { + this->DeployFormulaTextEdit(); + } + ui->plainTextEditFormula->setPlainText(formula); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogeditwrongformula.h b/src/app/dialogs/tools/dialogeditwrongformula.h index d7e22f6de..f1459f69d 100644 --- a/src/app/dialogs/tools/dialogeditwrongformula.h +++ b/src/app/dialogs/tools/dialogeditwrongformula.h @@ -56,6 +56,10 @@ public: public slots: virtual void DialogAccepted(); virtual void DialogRejected(); + /** + * @brief DeployFormulaTextEdit grow or shrink formula input + */ + void DeployFormulaTextEdit(); protected: virtual void CheckState(); private: @@ -64,6 +68,9 @@ private: /** @brief formula string with formula */ QString formula; + + /** @brief formulaBaseHeight base height defined by dialogui */ + int formulaBaseHeight; }; diff --git a/src/app/dialogs/tools/dialogeditwrongformula.ui b/src/app/dialogs/tools/dialogeditwrongformula.ui index 15e900f08..fa86b6032 100644 --- a/src/app/dialogs/tools/dialogeditwrongformula.ui +++ b/src/app/dialogs/tools/dialogeditwrongformula.ui @@ -6,305 +6,357 @@ 0 0 - 607 + 507 535 Edit wrong formula - + - + - - - - - - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 255 - 0 - 0 - - - - - - - - - 159 - 158 - 158 - - - - - - - - Formula - - - - - - - - 0 - 0 - - - - First angle of arc counterclockwise - - - - - - - Insert variable into formula - - - ... - - - - :/icon/24x24/putHereLeft.png:/icon/24x24/putHereLeft.png - - - - 24 - 24 - - - - - - - - Calculate value - - - ... - - - - :/icon/24x24/equal.png:/icon/24x24/equal.png - - - - 24 - 24 - - - - - - - - - 0 - 0 - - - - - 87 - 0 - - - - Value of first angle - - - _ - - - - - - - - - - - - - - - - 0 - 0 - - - - Input data - - - - - - - - 0 - 0 - - - - Size and height - - - true - - - - - - - - 0 - 0 - - - - Standard table - - - - - - - - 0 - 0 - - - - Increments - - - - - - - true - - - - 0 - 0 - - - - Length of lines - - - - - - - true - - - - 0 - 0 - - - - Length of arcs - - - - - - - true - - - - 0 - 0 - - - - Length of curves - - - - - - - true - - - - 0 - 0 - - - - Angle of lines - - - - - - - - - - - Variables - - - - - - - - - + + + + 0 + 0 + - - true + + + + + + + 255 + 0 + 0 + + + + + + + + + 255 + 0 + 0 + + + + + + + + + 159 + 158 + 158 + + + + + + + + Formula - + Qt::Horizontal - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + 40 + 20 + + + + + + + + Insert variable into formula + + + ... + + + + :/icon/24x24/putHereLeft.png:/icon/24x24/putHereLeft.png + + + + 24 + 24 + + + + + + + + Calculate value + + + ... + + + + :/icon/24x24/equal.png:/icon/24x24/equal.png + + + + 24 + 24 + + + + + + + + + 0 + 0 + + + + + 87 + 0 + + + + Value of first angle + + + _ + + + + + + + 0 + 0 + + + + + 16777215 + 24 + + + + + + + + + 18 + 18 + + + + + 0 + 0 + + + + <html><head/><body><p>Show full calculation in message box</p></body></html> + + + + + + + + + + + + 16 + 16 + + + + true + + + + + + + + + + + + + + + + 0 + 0 + + + + Input data + + + + + + + + 0 + 0 + + + + Size and height + + + true + + + + + + + + 0 + 0 + + + + Standard table + + + + + + + + 0 + 0 + + + + Increments + + + + + + + true + + + + 0 + 0 + + + + Length of lines + + + + + + + true + + + + 0 + 0 + + + + Length of arcs + + + + + + + true + + + + 0 + 0 + + + + Length of curves + + + + + + + true + + + + 0 + 0 + + + + Angle of lines + + + + + + + + + + + Variables + + + + + + + + + + + + true + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + diff --git a/src/app/dialogs/tools/dialogendline.cpp b/src/app/dialogs/tools/dialogendline.cpp index aeca74c04..81fd9b5a7 100644 --- a/src/app/dialogs/tools/dialogendline.cpp +++ b/src/app/dialogs/tools/dialogendline.cpp @@ -67,10 +67,6 @@ DialogEndLine::DialogEndLine(const VContainer *data, QWidget *parent) connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogEndLine::NamePointChanged); connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogEndLine::FormulaTextChanged); connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogEndLine::DeployFormulaTextEdit); - - ui->pushButtonGrowLength->setIcon(QIcon::fromTheme("go-down", - QIcon(":/icons/win.icon.theme/icons/win.icon.theme/16x16/actions/go-down.png"))); - } //--------------------------------------------------------------------------------------------------------------------- @@ -82,20 +78,7 @@ void DialogEndLine::FormulaTextChanged() //--------------------------------------------------------------------------------------------------------------------- void DialogEndLine::DeployFormulaTextEdit() { - if (ui->plainTextEditFormula->height() < DIALOGENDLINE_MAX_FORMULA_HEIGHT) - { - ui->plainTextEditFormula->setFixedHeight(DIALOGENDLINE_MAX_FORMULA_HEIGHT); - //Set icon from theme (internal for Windows system) - ui->pushButtonGrowLength->setIcon(QIcon::fromTheme("go-next", - QIcon(":/icons/win.icon.theme/icons/win.icon.theme/16x16/actions/go-next.png"))); - } - else - { - ui->plainTextEditFormula->setFixedHeight(this->formulaBaseHeight); - //Set icon from theme (internal for Windows system) - ui->pushButtonGrowLength->setIcon(QIcon::fromTheme("go-down", - QIcon(":/icons/win.icon.theme/icons/win.icon.theme/16x16/actions/go-down.png"))); - } + DeployFormula(ui->plainTextEditFormula, ui->pushButtonGrowLength, formulaBaseHeight); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogendline.h b/src/app/dialogs/tools/dialogendline.h index 9f755b7d7..5e53bfe5c 100644 --- a/src/app/dialogs/tools/dialogendline.h +++ b/src/app/dialogs/tools/dialogendline.h @@ -31,8 +31,6 @@ #include "dialogtool.h" - -#define DIALOGENDLINE_MAX_FORMULA_HEIGHT 64 namespace Ui { class DialogEndLine; diff --git a/src/app/dialogs/tools/dialogendline.ui b/src/app/dialogs/tools/dialogendline.ui index 12be8bf7a..dc25f6b0d 100644 --- a/src/app/dialogs/tools/dialogendline.ui +++ b/src/app/dialogs/tools/dialogendline.ui @@ -189,8 +189,7 @@ - - :/icons/win.icon.theme/icons/win.icon.theme/16x16/actions/go-down.png:/icons/win.icon.theme/icons/win.icon.theme/16x16/actions/go-down.png + @@ -677,7 +676,6 @@ - diff --git a/src/app/dialogs/tools/dialognormal.cpp b/src/app/dialogs/tools/dialognormal.cpp index 87cabe48f..6a3e6aa55 100644 --- a/src/app/dialogs/tools/dialognormal.cpp +++ b/src/app/dialogs/tools/dialognormal.cpp @@ -65,9 +65,6 @@ DialogNormal::DialogNormal(const VContainer *data, QWidget *parent) connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogNormal::NamePointChanged); connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogNormal::FormulaTextChanged); connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogNormal::DeployFormulaTextEdit); - - ui->pushButtonGrowLength->setIcon(QIcon::fromTheme("go-down", - QIcon(":/icons/win.icon.theme/icons/win.icon.theme/16x16/actions/go-down.png"))); } //--------------------------------------------------------------------------------------------------------------------- @@ -79,18 +76,7 @@ void DialogNormal::FormulaTextChanged() //--------------------------------------------------------------------------------------------------------------------- void DialogNormal::DeployFormulaTextEdit() { - if (ui->plainTextEditFormula->height() < DIALOGNORMAL_MAX_FORMULA_HEIGHT) - { - ui->plainTextEditFormula->setFixedHeight(DIALOGNORMAL_MAX_FORMULA_HEIGHT); - //Set icon from theme (internal for Windows system) - ui->pushButtonGrowLength->setIcon(QIcon::fromTheme("go-next")); - } - else - { - ui->plainTextEditFormula->setFixedHeight(this->formulaBaseHeight); - //Set icon from theme (internal for Windows system) - ui->pushButtonGrowLength->setIcon(QIcon::fromTheme("go-down")); - } + DeployFormula(ui->plainTextEditFormula, ui->pushButtonGrowLength, formulaBaseHeight); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialognormal.h b/src/app/dialogs/tools/dialognormal.h index 2fdcbb6cc..747067463 100644 --- a/src/app/dialogs/tools/dialognormal.h +++ b/src/app/dialogs/tools/dialognormal.h @@ -31,7 +31,6 @@ #include "dialogtool.h" -#define DIALOGNORMAL_MAX_FORMULA_HEIGHT 64 namespace Ui { class DialogNormal; diff --git a/src/app/dialogs/tools/dialognormal.ui b/src/app/dialogs/tools/dialognormal.ui index a135ba36a..b563b943a 100644 --- a/src/app/dialogs/tools/dialognormal.ui +++ b/src/app/dialogs/tools/dialognormal.ui @@ -154,6 +154,12 @@ + + + 0 + 0 + + 16777215 @@ -183,9 +189,7 @@ - - - + diff --git a/src/app/dialogs/tools/dialogpointofcontact.cpp b/src/app/dialogs/tools/dialogpointofcontact.cpp index ee3310d4c..3735d6bc1 100644 --- a/src/app/dialogs/tools/dialogpointofcontact.cpp +++ b/src/app/dialogs/tools/dialogpointofcontact.cpp @@ -97,9 +97,6 @@ DialogPointOfContact::DialogPointOfContact(const VContainer *data, QWidget *pare connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogPointOfContact::NamePointChanged); connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogPointOfContact::FormulaTextChanged); connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogPointOfContact::DeployFormulaTextEdit); - - ui->pushButtonGrowLength->setIcon(QIcon::fromTheme("go-down", - QIcon(":/icons/win.icon.theme/icons/win.icon.theme/16x16/actions/go-down.png"))); } //--------------------------------------------------------------------------------------------------------------------- @@ -111,20 +108,7 @@ void DialogPointOfContact::FormulaTextChanged() //--------------------------------------------------------------------------------------------------------------------- void DialogPointOfContact::DeployFormulaTextEdit() { - if (ui->plainTextEditFormula->height() < DIALOGPOINTOFCONTACT_MAX_FORMULA_HEIGHT) - { - ui->plainTextEditFormula->setFixedHeight(DIALOGPOINTOFCONTACT_MAX_FORMULA_HEIGHT); - //Set icon from theme (internal for Windows system) - ui->pushButtonGrowLength->setIcon(QIcon::fromTheme("go-next", - QIcon(":/icons/win.icon.theme/icons/win.icon.theme/16x16/actions/go-next.png"))); - } - else - { - ui->plainTextEditFormula->setFixedHeight(this->formulaBaseHeight); - //Set icon from theme (internal for Windows system) - ui->pushButtonGrowLength->setIcon(QIcon::fromTheme("go-down", - QIcon(":/icons/win.icon.theme/icons/win.icon.theme/16x16/actions/go-down.png"))); - } + DeployFormula(ui->plainTextEditFormula, ui->pushButtonGrowLength, formulaBaseHeight); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogpointofcontact.h b/src/app/dialogs/tools/dialogpointofcontact.h index d0517dd2f..e4413785e 100644 --- a/src/app/dialogs/tools/dialogpointofcontact.h +++ b/src/app/dialogs/tools/dialogpointofcontact.h @@ -32,7 +32,6 @@ #include "ui_dialogpointofcontact.h" #include "dialogtool.h" -#define DIALOGPOINTOFCONTACT_MAX_FORMULA_HEIGHT 64 namespace Ui { class DialogPointOfContact; diff --git a/src/app/dialogs/tools/dialogpointofcontact.ui b/src/app/dialogs/tools/dialogpointofcontact.ui index 147765832..fd13a0448 100644 --- a/src/app/dialogs/tools/dialogpointofcontact.ui +++ b/src/app/dialogs/tools/dialogpointofcontact.ui @@ -154,6 +154,12 @@ + + + 0 + 0 + + 16777215 @@ -183,9 +189,7 @@ - - - + diff --git a/src/app/dialogs/tools/dialogshoulderpoint.cpp b/src/app/dialogs/tools/dialogshoulderpoint.cpp index 0df400703..c579f7bad 100644 --- a/src/app/dialogs/tools/dialogshoulderpoint.cpp +++ b/src/app/dialogs/tools/dialogshoulderpoint.cpp @@ -68,9 +68,6 @@ DialogShoulderPoint::DialogShoulderPoint(const VContainer *data, QWidget *parent connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogShoulderPoint::NamePointChanged); connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogShoulderPoint::FormulaTextChanged); connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogShoulderPoint::DeployFormulaTextEdit); - - ui->pushButtonGrowLength->setIcon(QIcon::fromTheme("go-down", - QIcon(":/icons/win.icon.theme/icons/win.icon.theme/16x16/actions/go-down.png"))); } //--------------------------------------------------------------------------------------------------------------------- @@ -82,20 +79,7 @@ void DialogShoulderPoint::FormulaTextChanged() //--------------------------------------------------------------------------------------------------------------------- void DialogShoulderPoint::DeployFormulaTextEdit() { - if (ui->plainTextEditFormula->height() < DIALOGSHOULDERPOINT_MAX_FORMULA_HEIGHT) - { - ui->plainTextEditFormula->setFixedHeight(DIALOGSHOULDERPOINT_MAX_FORMULA_HEIGHT); - //Set icon from theme (internal for Windows system) - ui->pushButtonGrowLength->setIcon(QIcon::fromTheme("go-next", - QIcon(":/icons/win.icon.theme/icons/win.icon.theme/16x16/actions/go-next.png"))); - } - else - { - ui->plainTextEditFormula->setFixedHeight(this->formulaBaseHeight); - //Set icon from theme (internal for Windows system) - ui->pushButtonGrowLength->setIcon(QIcon::fromTheme("go-down", - QIcon(":/icons/win.icon.theme/icons/win.icon.theme/16x16/actions/go-down.png"))); - } + DeployFormula(ui->plainTextEditFormula, ui->pushButtonGrowLength, formulaBaseHeight); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogshoulderpoint.h b/src/app/dialogs/tools/dialogshoulderpoint.h index 3b7a389a8..17afae0ad 100644 --- a/src/app/dialogs/tools/dialogshoulderpoint.h +++ b/src/app/dialogs/tools/dialogshoulderpoint.h @@ -31,7 +31,6 @@ #include "dialogtool.h" -#define DIALOGSHOULDERPOINT_MAX_FORMULA_HEIGHT 64 namespace Ui { class DialogShoulderPoint; diff --git a/src/app/dialogs/tools/dialogshoulderpoint.ui b/src/app/dialogs/tools/dialogshoulderpoint.ui index a9ed3dc8b..583815972 100644 --- a/src/app/dialogs/tools/dialogshoulderpoint.ui +++ b/src/app/dialogs/tools/dialogshoulderpoint.ui @@ -154,6 +154,12 @@ + + + 0 + 0 + + 16777215 @@ -183,9 +189,7 @@ - - - + diff --git a/src/app/dialogs/tools/dialogtool.cpp b/src/app/dialogs/tools/dialogtool.cpp index d7a35b19c..5efafebf4 100644 --- a/src/app/dialogs/tools/dialogtool.cpp +++ b/src/app/dialogs/tools/dialogtool.cpp @@ -41,7 +41,6 @@ #include #include #include -#include #include #include #include @@ -51,6 +50,8 @@ #include #include +#define DIALOGARC_MAX_FORMULA_HEIGHT 64 + //--------------------------------------------------------------------------------------------------------------------- /** * @brief DialogTool create dialog @@ -59,7 +60,7 @@ */ DialogTool::DialogTool(const VContainer *data, QWidget *parent) :QDialog(parent), data(data), isInitialized(false), flagName(true), flagFormula(true), timerFormula(nullptr), - bOk(nullptr), bApply(nullptr), spinBoxAngle(nullptr), lineEditFormula(nullptr), plainTextEditFormula(nullptr), + bOk(nullptr), bApply(nullptr), spinBoxAngle(nullptr), plainTextEditFormula(nullptr), listWidget(nullptr), labelResultCalculation(nullptr), labelDescription(nullptr), labelEditNamePoint(nullptr), labelEditFormula(nullptr), radioButtonSizeGrowth(nullptr), radioButtonStandardTable(nullptr), radioButtonIncrements(nullptr), radioButtonLengthLine(nullptr), radioButtonLengthArc(nullptr), @@ -385,12 +386,6 @@ void DialogTool::PutValHere(QPlainTextEdit *plainTextEdit, QListWidget *listWidg QTextCursor cursor = plainTextEdit->textCursor(); cursor.insertText(item->text()); plainTextEdit->setTextCursor(cursor); - /* - int pos = lineEdit->cursorPosition(); - lineEdit->setText(lineEdit->text().insert(lineEdit->cursorPosition(), item->text())); - lineEdit->setFocus(); - lineEdit->setCursorPosition(pos + item->text().size()); - */ } //--------------------------------------------------------------------------------------------------------------------- @@ -601,6 +596,27 @@ bool DialogTool::ChoosedPoint(const quint32 &id, QComboBox *box, const QString & return false; } +//--------------------------------------------------------------------------------------------------------------------- +void DialogTool::DeployFormula(QPlainTextEdit *formula, QPushButton *buttonGrowLength, int formulaBaseHeight) +{ + SCASSERT(formula != nullptr); + SCASSERT(buttonGrowLength != nullptr) + if (formula->height() < DIALOGARC_MAX_FORMULA_HEIGHT) + { + formula->setFixedHeight(DIALOGARC_MAX_FORMULA_HEIGHT); + //Set icon from theme (internal for Windows system) + buttonGrowLength->setIcon(QIcon::fromTheme("go-next", + QIcon(":/icons/win.icon.theme/16x16/actions/go-next.png"))); + } + else + { + formula->setFixedHeight(formulaBaseHeight); + //Set icon from theme (internal for Windows system) + buttonGrowLength->setIcon(QIcon::fromTheme("go-down", + QIcon(":/icons/win.icon.theme/16x16/actions/go-down.png"))); + } +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief FillList fill combobox list @@ -700,7 +716,7 @@ void DialogTool::DialogRejected() */ void DialogTool::FormulaChanged() { - QLineEdit* edit = qobject_cast(sender()); + QPlainTextEdit* edit = qobject_cast(sender()); if (edit) { ValFormulaChanged(flagFormula, edit, timerFormula); @@ -897,12 +913,6 @@ void DialogTool::PutVal(QListWidgetItem *item) QTextCursor cursor = plainTextEditFormula->textCursor(); cursor.insertText(item->text()); plainTextEditFormula->setTextCursor(cursor); - /*int pos = plainTextEditFormula->cursorPosition(); - lineEditFormula->setText(lineEditFormula->text().insert(lineEditFormula->cursorPosition(), - item->text())); - lineEditFormula->setFocus(); - lineEditFormula->setCursorPosition(pos + item->text().size()); - */ } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogtool.h b/src/app/dialogs/tools/dialogtool.h index 5497c2f58..62153427f 100644 --- a/src/app/dialogs/tools/dialogtool.h +++ b/src/app/dialogs/tools/dialogtool.h @@ -39,7 +39,6 @@ class QLabel; class QRadioButton; class QComboBox; class QListWidgetItem; -class QLineEdit; class QListWidget; class VContainer; class QPlainTextEdit; @@ -134,8 +133,7 @@ protected: /** @brief spinBoxAngle spinbox for angle */ QDoubleSpinBox *spinBoxAngle; - /** @brief lineEditFormula linEdit for formula */ - QLineEdit *lineEditFormula; + /** @brief plainTextEditFormula formula */ QPlainTextEdit *plainTextEditFormula; /** @brief listWidget listWidget with variables */ QListWidget *listWidget; @@ -205,6 +203,7 @@ protected: ComboBoxCutSpline cut = ComboBoxCutSpline::NoCutSpline) const; quint32 getCurrentObjectId(QComboBox *box) const; bool ChoosedPoint(const quint32 &id, QComboBox *box, const QString &toolTip); + void DeployFormula(QPlainTextEdit *formula, QPushButton *buttonGrowLength, int formulaBaseHeight); template void InitArrow(T *ui) { diff --git a/src/app/share/resources/theme.qrc b/src/app/share/resources/theme.qrc index cd91162f3..efa266e2b 100644 --- a/src/app/share/resources/theme.qrc +++ b/src/app/share/resources/theme.qrc @@ -40,5 +40,8 @@ icons/win.icon.theme/24x24/actions/edit-redo.png icons/win.icon.theme/32x32/actions/edit-redo.png icons/win.icon.theme/32x32/actions/edit-undo.png + icons/win.icon.theme/16x16/actions/go-down.png + icons/win.icon.theme/24x24/actions/go-down.png + icons/win.icon.theme/32x32/actions/go-down.png diff --git a/src/app/tools/drawTools/vtoolcutsplinepath.cpp b/src/app/tools/drawTools/vtoolcutsplinepath.cpp index 1c862bf64..6f5906669 100644 --- a/src/app/tools/drawTools/vtoolcutsplinepath.cpp +++ b/src/app/tools/drawTools/vtoolcutsplinepath.cpp @@ -164,41 +164,51 @@ void VToolCutSplinePath::Create(const quint32 _id, const QString &pointName, QSt VSplinePath *splPath1 = new VSplinePath(); VSplinePath *splPath2 = new VSplinePath(); + + for (qint32 i = 0; i < splPath->CountPoint(); i++) + { + if (i <= p1 && i < p2) + { + if (i == p1) + { + splPath1->append(VSplinePoint(splP1.P(), splP1.KAsm1(), spl1.GetAngle1()+180, spl1.GetKasm1(), + spl1.GetAngle1())); + VSplinePoint cutPoint; + if (typeCreation == Source::FromGui) + { + cutPoint = VSplinePoint(*p, spl1.GetKasm2(), spl1.GetAngle2(), spl1.GetAngle2()+180, + spl1.GetAngle2()); + } + else + { + cutPoint = VSplinePoint(*p, spl1.GetKasm2(), spl1.GetAngle2(), spl2.GetKasm1(), + spl1.GetAngle2()+180); + } + splPath1->append(cutPoint); + continue; + } + splPath1->append(splPath->at(i)); + } + else + { + if (i == p2) + { + const VSplinePoint cutPoint = VSplinePoint(*p, spl1.GetKasm2(), spl2.GetAngle1()+180, + spl2.GetKasm1(), spl2.GetAngle1()); + splPath2->append(cutPoint); + splPath2->append(VSplinePoint(splP2.P(), spl2.GetKasm2(), spl2.GetAngle2(), splP2.KAsm2(), + spl2.GetAngle2()+180)); + continue; + } + splPath2->append(splPath->at(i)); + } + } + + splPath1->setMaxCountPoints(splPath->CountPoint()); + splPath2->setMaxCountPoints(splPath->CountPoint()); + if (typeCreation == Source::FromGui) { - for (qint32 i = 0; i < splPath->CountPoint(); i++) - { - if (i <= p1 && i < p2) - { - if (i == p1) - { - splPath1->append(VSplinePoint(splP1.P(), splP1.KAsm1(), spl1.GetAngle1()+180, spl1.GetKasm1(), - spl1.GetAngle1())); - const VSplinePoint cutPoint = VSplinePoint(*p, spl1.GetKasm2(), spl1.GetAngle2(), - spl1.GetAngle2()+180, spl1.GetAngle2()); - splPath1->append(cutPoint); - continue; - } - splPath1->append(splPath->at(i)); - } - else - { - if (i == p2) - { - const VSplinePoint cutPoint = VSplinePoint(*p, spl1.GetKasm2(), spl2.GetAngle1()+180, - spl2.GetKasm1(), spl2.GetAngle1()); - splPath2->append(cutPoint); - splPath2->append(VSplinePoint(splP2.P(), spl2.GetKasm2(), spl2.GetAngle2(), splP2.KAsm2(), - spl2.GetAngle2()+180)); - continue; - } - splPath2->append(splPath->at(i)); - } - } - - splPath1->setMaxCountPoints(splPath->CountPoint()); - splPath2->setMaxCountPoints(splPath->CountPoint()); - splPath1id = data->AddGObject(splPath1); data->AddLengthSpline(splPath1->name(), qApp->fromPixel(splPath1->GetLength())); @@ -207,39 +217,6 @@ void VToolCutSplinePath::Create(const quint32 _id, const QString &pointName, QSt } else { - for (qint32 i = 0; i < splPath->CountPoint(); i++) - { - if (i <= p1 && i < p2) - { - if (i == p1) - { - splPath1->append(VSplinePoint(splP1.P(), splP1.KAsm1(), spl1.GetAngle1()+180, spl1.GetKasm1(), - spl1.GetAngle1())); - const VSplinePoint cutPoint = VSplinePoint(*p, spl1.GetKasm2(), spl1.GetAngle2(), - spl2.GetKasm1(), spl1.GetAngle2()+180); - splPath1->append(cutPoint); - continue; - } - splPath1->append(splPath->at(i)); - } - else - { - if (i == p2) - { - const VSplinePoint cutPoint = VSplinePoint(*p, spl1.GetKasm2(), spl2.GetAngle1()+180, - spl2.GetKasm1(), spl2.GetAngle1()); - splPath2->append(cutPoint); - splPath2->append(VSplinePoint(splP2.P(), spl2.GetKasm2(), spl2.GetAngle2(), splP2.KAsm2(), - spl2.GetAngle2()+180)); - continue; - } - splPath2->append(splPath->at(i)); - } - } - - splPath1->setMaxCountPoints(splPath->CountPoint()); - splPath2->setMaxCountPoints(splPath->CountPoint()); - data->UpdateGObject(splPath1id, splPath1); data->AddLengthSpline(splPath1->name(), qApp->fromPixel(splPath1->GetLength())); @@ -251,6 +228,7 @@ void VToolCutSplinePath::Create(const quint32 _id, const QString &pointName, QSt doc->UpdateToolData(id, data); } } + VDrawTool::AddRecord(id, Tool::CutSplinePathTool, doc); if (parse == Document::FullParse) { From 9fdedf85fc40c0e853c0b85191e3deba0c76bf2b Mon Sep 17 00:00:00 2001 From: dismine Date: Thu, 19 Jun 2014 12:31:56 +0300 Subject: [PATCH 16/20] Replace Q_ASSERT by SCASSERT. --HG-- branch : feature --- src/app/container/vcontainer.cpp | 18 +++++++++--------- src/app/dialogs/app/dialogpatternxmledit.cpp | 18 +++++++++--------- src/app/dialogs/tools/dialogtool.cpp | 2 +- src/app/geometry/vequidistant.cpp | 8 ++++---- src/app/undocommands/addpatternpiece.cpp | 6 +++--- 5 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/app/container/vcontainer.cpp b/src/app/container/vcontainer.cpp index 4f8b81778..fbc2d10f7 100644 --- a/src/app/container/vcontainer.cpp +++ b/src/app/container/vcontainer.cpp @@ -188,7 +188,7 @@ val VContainer::GetVariable(const QHash &obj, key id) const */ const VMeasurement VContainer::GetMeasurement(const QString &name) const { - Q_ASSERT(name.isEmpty()==false); + SCASSERT(name.isEmpty()==false); return GetVariable(measurements, name); } @@ -200,7 +200,7 @@ const VMeasurement VContainer::GetMeasurement(const QString &name) const */ const VIncrement VContainer::GetIncrement(const QString& name) const { - Q_ASSERT(name.isEmpty()==false); + SCASSERT(name.isEmpty()==false); return GetVariable(increments, name); } @@ -212,7 +212,7 @@ const VIncrement VContainer::GetIncrement(const QString& name) const */ qreal VContainer::GetLine(const QString &name) const { - Q_ASSERT(name.isEmpty()==false); + SCASSERT(name.isEmpty()==false); return GetVariable(lengthLines, name); } @@ -224,7 +224,7 @@ qreal VContainer::GetLine(const QString &name) const */ qreal VContainer::GetLengthArc(const QString &name) const { - Q_ASSERT(name.isEmpty()==false); + SCASSERT(name.isEmpty()==false); return GetVariable(lengthArcs, name); } @@ -236,7 +236,7 @@ qreal VContainer::GetLengthArc(const QString &name) const */ qreal VContainer::GetLengthSpline(const QString &name) const { - Q_ASSERT(name.isEmpty()==false); + SCASSERT(name.isEmpty()==false); return GetVariable(lengthSplines, name); } @@ -248,7 +248,7 @@ qreal VContainer::GetLengthSpline(const QString &name) const */ qreal VContainer::GetLineAngle(const QString &name) const { - Q_ASSERT(name.isEmpty()==false); + SCASSERT(name.isEmpty()==false); return GetVariable(lineAngles, name); } @@ -352,7 +352,7 @@ void VContainer::UpdateObject(QHash &obj, const quint32 &id, val p */ void VContainer::AddLengthSpline(const QString &name, const qreal &value) { - Q_ASSERT(name.isEmpty() == false); + SCASSERT(name.isEmpty() == false); lengthSplines[name] = value; } @@ -375,7 +375,7 @@ void VContainer::AddLengthArc(const quint32 &id) */ void VContainer::AddLineAngle(const QString &name, const qreal &value) { - Q_ASSERT(name.isEmpty() == false); + SCASSERT(name.isEmpty() == false); lineAngles[name] = value; } @@ -560,6 +560,6 @@ void VContainer::UpdateDetail(quint32 id, const VDetail &detail) */ void VContainer::AddLengthLine(const QString &name, const qreal &value) { - Q_ASSERT(name.isEmpty() == false); + SCASSERT(name.isEmpty() == false); lengthLines[name] = value; } diff --git a/src/app/dialogs/app/dialogpatternxmledit.cpp b/src/app/dialogs/app/dialogpatternxmledit.cpp index 521ed0792..04f619278 100644 --- a/src/app/dialogs/app/dialogpatternxmledit.cpp +++ b/src/app/dialogs/app/dialogpatternxmledit.cpp @@ -127,7 +127,7 @@ bool DialogPatternXmlEdit::ApplyNodeChange(QDomNode domElement, QString name, QS bool DialogPatternXmlEdit::ApplyNodeAdd(QDomNode domElement, VXMLTreeElement* treeElement, QString name, QString value) { QDomElement newnode = domElement.ownerDocument().createElement(name); - //Q_ASSERT(newnode != nullptr); + //SCASSERT(newnode != nullptr); newnode.setNodeValue(value); domElement.appendChild(newnode); treeElement->SetDocNode(newnode); @@ -282,7 +282,7 @@ bool DialogPatternXmlEdit::DeleteNodeAndSons(VXMLTreeElement * currentNode, bool } if (index < 0) { - Q_ASSERT(index==0); + SCASSERT(index==0); return false; } parent->removeRow(index); @@ -318,7 +318,7 @@ DialogPatternXmlEdit::ChangesStackElement* DialogPatternXmlEdit::CreateStackElem //--------------------------------------------------------------------------------------------------------------------- bool DialogPatternXmlEdit::UndoChange(DialogPatternXmlEdit::ChangesStackElement* current) { - Q_ASSERT(current != nullptr); + SCASSERT(current != nullptr); VXMLTreeElement * currentNode = current->element; @@ -371,7 +371,7 @@ bool DialogPatternXmlEdit::UndoChange(DialogPatternXmlEdit::ChangesStackElement* } if (index < 0) { - Q_ASSERT(index==0); + SCASSERT(index==0); return false; } parent->removeRow(index); @@ -621,7 +621,7 @@ void DialogPatternXmlEdit::RemoveChangeStackElement(ChangesStackElement* elmt) } if (index->next == nullptr) { - Q_ASSERT(index->next != nullptr); + SCASSERT(index->next != nullptr); return; } if (index->next->newText != nullptr) @@ -834,7 +834,7 @@ void DialogPatternXmlEdit::ButtonSetClicked() { // If node was created or edited previously, rewrite if (this->currentNodeEditedStatus == DialogPatternXmlEdit::ChangeTypeDelete) { // You shouldn't be able to edit a deleted node... - Q_ASSERT(this->currentNodeEditedStatus != DialogPatternXmlEdit::ChangeTypeDelete); + SCASSERT(this->currentNodeEditedStatus != DialogPatternXmlEdit::ChangeTypeDelete); ClearEditData(); return; } @@ -958,7 +958,7 @@ void DialogPatternXmlEdit::BaseSelectionChanged(int value) ui->pushButton_Apply_Changes->setEnabled(false); index = ui->comboBox_Base_Selection->itemData(value).toInt(); //.convert(QVariant::Int); - Q_ASSERT(value < rootBasesNum); + SCASSERT(value < rootBasesNum); // QMessageBox::information(this, "test", QString("%1:%2").arg(value).arg(index)); // Clear all tree info and nodes @@ -1169,7 +1169,7 @@ void VXMLTreeView::appendchain(VXMLTreeElement* elmt) current = new TreeElementchain; if (current == nullptr) { - Q_ASSERT(current != nullptr); + SCASSERT(current != nullptr); // TODO : throw exception } current->elmt=elmt; @@ -1180,7 +1180,7 @@ void VXMLTreeView::appendchain(VXMLTreeElement* elmt) TreeElementchain* temp= new TreeElementchain; if (temp == nullptr) { - Q_ASSERT(temp != nullptr); + SCASSERT(temp != nullptr); // TODO : throw exception } temp->elmt=elmt; diff --git a/src/app/dialogs/tools/dialogtool.cpp b/src/app/dialogs/tools/dialogtool.cpp index 5efafebf4..e6698ea66 100644 --- a/src/app/dialogs/tools/dialogtool.cpp +++ b/src/app/dialogs/tools/dialogtool.cpp @@ -569,7 +569,7 @@ quint32 DialogTool::getCurrentObjectId(QComboBox *box) const { SCASSERT(box != nullptr); qint32 index = box->currentIndex(); - Q_ASSERT(index != -1); + SCASSERT(index != -1); if (index != -1) { return qvariant_cast(box->itemData(index)); diff --git a/src/app/geometry/vequidistant.cpp b/src/app/geometry/vequidistant.cpp index b50faff69..9ee6c10f0 100644 --- a/src/app/geometry/vequidistant.cpp +++ b/src/app/geometry/vequidistant.cpp @@ -374,7 +374,7 @@ QVector VEquidistant::CheckLoops(const QVector &points) //--------------------------------------------------------------------------------------------------------------------- QVector VEquidistant::GetReversePoint(const QVector &points) { - Q_ASSERT(points.size() > 0); + SCASSERT(points.size() > 0); QVector reversePoints; for (qint32 i = points.size() - 1; i >= 0; --i) { @@ -386,7 +386,7 @@ QVector VEquidistant::GetReversePoint(const QVector &points) //--------------------------------------------------------------------------------------------------------------------- QVector VEquidistant::EkvPoint(const QLineF &line1, const QLineF &line2, const qreal &width) { - Q_ASSERT(width > 0); + SCASSERT(width > 0); QVector points; if (line1.p2() != line2.p2()) { @@ -436,7 +436,7 @@ QVector VEquidistant::EkvPoint(const QLineF &line1, const QLineF &line2 //--------------------------------------------------------------------------------------------------------------------- QLineF VEquidistant::ParallelLine(const QLineF &line, qreal width) { - Q_ASSERT(width > 0); + SCASSERT(width > 0); QLineF paralel = QLineF (SingleParallelPoint(line, 90, width), SingleParallelPoint(QLineF(line.p2(), line.p1()), -90, width)); return paralel; @@ -445,7 +445,7 @@ QLineF VEquidistant::ParallelLine(const QLineF &line, qreal width) //--------------------------------------------------------------------------------------------------------------------- QPointF VEquidistant::SingleParallelPoint(const QLineF &line, const qreal &angle, const qreal &width) { - Q_ASSERT(width > 0); + SCASSERT(width > 0); QLineF pLine = line; pLine.setAngle( pLine.angle() + angle ); pLine.setLength( width ); diff --git a/src/app/undocommands/addpatternpiece.cpp b/src/app/undocommands/addpatternpiece.cpp index 915e72b11..f77d91ec7 100644 --- a/src/app/undocommands/addpatternpiece.cpp +++ b/src/app/undocommands/addpatternpiece.cpp @@ -34,9 +34,9 @@ AddPatternPiece::AddPatternPiece(const QDomElement &xml, VPattern *doc, const QS QUndoCommand *parent) : QObject(), QUndoCommand(parent), xml(xml), doc(doc), namePP(namePP), redoFlag(false), mPath(mPath) { - Q_ASSERT(xml.isNull() == false); - Q_ASSERT(namePP.isEmpty() == false); - Q_ASSERT(mPath.isEmpty() == false); + SCASSERT(xml.isNull() == false); + SCASSERT(namePP.isEmpty() == false); + SCASSERT(mPath.isEmpty() == false); setText(tr("Add pattern piece %1").arg(namePP)); } From 0aca968e61fbe77b3efaef2b1acadecf157b8afb Mon Sep 17 00:00:00 2001 From: dismine Date: Thu, 19 Jun 2014 13:10:09 +0300 Subject: [PATCH 17/20] New icons. --HG-- branch : feature --- src/app/dialogs/tools/dialogarc.ui | 18 ++++++++++++------ src/app/share/resources/icon.qrc | 1 - src/app/share/resources/icon/24x24/equal.png | Bin 255 -> 118 bytes .../share/resources/icon/24x24/putHere.png | Bin 1209 -> 1112 bytes .../resources/icon/24x24/putHereLeft.png | Bin 1233 -> 0 bytes .../resources/icon/32x32/putHereLeft.png | Bin 0 -> 1299 bytes 6 files changed, 12 insertions(+), 7 deletions(-) delete mode 100644 src/app/share/resources/icon/24x24/putHereLeft.png create mode 100644 src/app/share/resources/icon/32x32/putHereLeft.png diff --git a/src/app/dialogs/tools/dialogarc.ui b/src/app/dialogs/tools/dialogarc.ui index 4ffd32682..42957ae81 100644 --- a/src/app/dialogs/tools/dialogarc.ui +++ b/src/app/dialogs/tools/dialogarc.ui @@ -96,7 +96,7 @@ - :/icon/24x24/putHereLeft.png:/icon/24x24/putHereLeft.png + :/icon/24x24/putHere.png:/icon/24x24/putHere.png @@ -189,7 +189,9 @@ - + + + @@ -279,7 +281,7 @@ - :/icon/24x24/putHereLeft.png:/icon/24x24/putHereLeft.png + :/icon/24x24/putHere.png:/icon/24x24/putHere.png @@ -372,7 +374,9 @@ - + + + @@ -462,7 +466,7 @@ - :/icon/24x24/putHereLeft.png:/icon/24x24/putHereLeft.png + :/icon/24x24/putHere.png:/icon/24x24/putHere.png @@ -555,7 +559,9 @@ - + + + diff --git a/src/app/share/resources/icon.qrc b/src/app/share/resources/icon.qrc index d0a47eba8..d0717dda0 100644 --- a/src/app/share/resources/icon.qrc +++ b/src/app/share/resources/icon.qrc @@ -26,7 +26,6 @@ icon/32x32/intersect.png icon/32x32/spline.png icon/32x32/arc.png - icon/24x24/putHereLeft.png icon/32x32/splinePath.png icon/32x32/history.png icon/32x32/put_after.png diff --git a/src/app/share/resources/icon/24x24/equal.png b/src/app/share/resources/icon/24x24/equal.png index ff7ca48453da84639b96ef13e6e736dcf68b788e..89a704c56dde804f97a31f5f24afb55609b80438 100644 GIT binary patch delta 84 zcmey*ST;eNOM-)qfq~&cx$TdMilPqMo-U3d9-YYv609r?%FN7%>!YF$xOg9S*OibF n>uCyfu$0j4cGHz$En#5TwUtSf<45{DpmqjNS3j3^P6I-_D@M)O)#G^8}l~S~1@WutEz@kkVLm-0TFGY(SrA>jmL@YXV YKb%8p;U@P**Z=?k07*qoM6N<$g4OX<9RL6T diff --git a/src/app/share/resources/icon/24x24/putHere.png b/src/app/share/resources/icon/24x24/putHere.png index 00e4d8f1d7c15adde3474b32adc5044008055bdb..fadcb6032db88f99e7c267afef1c4bc9d6c8f250 100644 GIT binary patch delta 1046 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 JPDHLkV1moKDYXCq diff --git a/src/app/share/resources/icon/24x24/putHereLeft.png b/src/app/share/resources/icon/24x24/putHereLeft.png deleted file mode 100644 index a69736efdc542f5b95b8d5ee6e0e06bc4815cebf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1233 zcmV;?1TOoDP)o;E-Ld+m+m$QsXR zG@`_j$nMI4q$I~~Kv08h)~l+n_n!RvpP#ucOG2oL(Lg{%Faxs)#$kylV8j@@Cx<`j z_CSo0x~_S*c&C0m8jnQPrkxhZe~Jt;6-F z0b`6!sb+_ywEd_KHJf71?e3NsjXclE@|+~;foYp~8`ipdQ0zQa?Z|LExj*B{>`yJQUOWwTs!{&>(tcxW{VnASDujvnRvMgmfy~Fe8&pA6ABI$ra zZdt8vC~nqlZf?1`cg1G2IZjbSpk|Im0g04l!PV6}LM-TI30W@mhsu-3GoC+t#^Wz$ z#Cpry_gAEO#5u(*689B#T~ozCFhk7H1CsaTdB)jfv>c6clEm1QSM2sHOiJ>;@$}i} zeEZG6d2l{ukf*3da0Xt$DL62NC=fBQlQH$)GaL>{(?`?6ApO^ahm#j?{+e)kxuB|x z_Kf1a$B8G@fx4=Q78~-Z5;`uNkjCQqe}=J`ORA`mePfZ<)r*?3AnAAUb6C)BaFXoka)_R^=K z{>5k8T0XyDu)f(?*jG%)6S+4%M_UE{r~(KrP*b3H;5DV6jfiGqW?+JfAfhtN;O?NN zx?f9-fzXswgRTvX(wQcm7$>vqk!8`ki{;y+tNn{hKq;5fwOGsr)h`iTM#qy1^4H#0&AIOq5qYl=(vQ6;a{00000NkvXXu0mjf*&S8T diff --git a/src/app/share/resources/icon/32x32/putHereLeft.png b/src/app/share/resources/icon/32x32/putHereLeft.png new file mode 100644 index 0000000000000000000000000000000000000000..396a819b1abaf6cfaa160ad8c769b947edd6a4f0 GIT binary patch literal 1299 zcmV+u1?>8XP)7MG&pzQL$1f))(!!Em9I`tEOwR$tIiqnAw@R_jr0|(%rTRm_Va=m>>6KhT;6? z+`A`&i12TQ#Qz|~cL&yOJ@rv9o$6ahKfd4d9sp}TJ79Z(dL*;74L#2uLQ;mi0i@PvRf~t$q_u!TCP?a2-+B(qDvz{fojl`W22$|A}i^Y#iyahrKbXbM&jzha+ zXll6!9c$OJ#M)^k1epG}x>he=WE~gK%jzH9o{Jl)h!X-KN(fqOwBEZ4$#e>q<-krP zAngT^mW9Gd7MCyn+W+w03%dZQdVwU5&`RfyH)Ja1fI<&M0Z91(ucUp>1Au%$ajs2n z?h&uh8i*x`fhG_!b<#qJNMdx9B`zIdiRX+&EYN(iuP5LA;3lXrFfUKv1%T@RCIV@N z)OrOU5}PW$hU!LWmok(p;FUf*9xk5Ds4%z)Ars0I9NhrZ``?xDj1THX145eA)&O z9QfkTU3;Es`^5K#n{H|+)xK6bibWJi$InUQzID9-G+zp!kWn>s7|9SL1S3tyC~TB=2f40@I_IxJ$Yw0MrDCsYc8kq=Edk zETnD2ava!Bf>#OQWw`+>qmy4N7_Bj+Yx!*g|9IYKOUG7_wM{Dp(mJ}S2_0)zMn6kI z05k|jB3hxQr0Tb3PLr^@bKiwMewom{eJ|E*eG#j+JcU&oABC_Qpu8MFRBJnC+=_Z; z)d82uLr7Gvd=9O2e29eU2Dw?-P6iYgAw!%a-Uh?mw;*IZAtmxd!|^$=;n)tZ62u)4 z3p=ABcI!E~b^rC81Ppql5PY9VS&!+^g(iwSKxpq+1X6A^9cw?oNQj~6bx867L5zTy zgFto1o4@Qn+1Gofd&eu#)f}`p%Ii2ncNk&i8e~HYpr(pa^q-L`5Mj}Dpj-@5E(Hhz zno|c{W;8n<9$R+y@V12+8$<#$HC03&BHac^3xdcDD(#OUsQM^QXj3>0f#E`M_VhsU zXvtLr078M;Mdsa?I$n74p~Za(t7y)FeVv2_+m>8g03fJPpj_4{76`ttF;WQ6ogOTG zyYJJ>-vB7aOfvb|3M82oKYh62bgDsSq^yn98{<(Byb6$;49=apxo9CS>M}kP&ZPsA zX=YY3P0UR1E2bP5EyhK?xUfcD2+TelCe0);a}X2URP?_Ze*-z?3yj~@vDN?p002ov JPDHLkV1kHTP`m&D literal 0 HcmV?d00001 From ce19b4ccabdbe0e70e7e09e3a5763c8aaaf02dd7 Mon Sep 17 00:00:00 2001 From: dismine Date: Thu, 19 Jun 2014 13:23:56 +0300 Subject: [PATCH 18/20] New arrows icons. --HG-- branch : feature --- src/app/dialogs/tools/dialogendline.ui | 20 ++++++++++-------- src/app/dialogs/tools/dialognormal.ui | 20 ++++++++++-------- src/app/share/resources/icon.qrc | 17 ++++++++------- .../share/resources/icon/24x24/arrowDown.png | Bin 716 -> 0 bytes .../share/resources/icon/24x24/arrowLeft.png | Bin 649 -> 0 bytes .../resources/icon/24x24/arrowLeftDown.png | Bin 893 -> 0 bytes .../resources/icon/24x24/arrowLeftUp.png | Bin 808 -> 0 bytes .../share/resources/icon/24x24/arrowRight.png | Bin 736 -> 0 bytes .../resources/icon/24x24/arrowRightDown.png | Bin 925 -> 0 bytes .../resources/icon/24x24/arrowRightUp.png | Bin 864 -> 0 bytes .../share/resources/icon/24x24/arrowUp.png | Bin 655 -> 0 bytes .../share/resources/icon/32x32/arrowDown.png | Bin 0 -> 1910 bytes .../share/resources/icon/32x32/arrowLeft.png | Bin 0 -> 548 bytes .../resources/icon/32x32/arrowLeftDown.png | Bin 0 -> 2366 bytes .../resources/icon/32x32/arrowLeftUp.png | Bin 0 -> 2266 bytes .../share/resources/icon/32x32/arrowRight.png | Bin 0 -> 535 bytes .../resources/icon/32x32/arrowRightDown.png | Bin 0 -> 2413 bytes .../resources/icon/32x32/arrowRightUp.png | Bin 0 -> 2180 bytes .../share/resources/icon/32x32/arrowUp.png | Bin 0 -> 1839 bytes 19 files changed, 31 insertions(+), 26 deletions(-) delete mode 100644 src/app/share/resources/icon/24x24/arrowDown.png delete mode 100644 src/app/share/resources/icon/24x24/arrowLeft.png delete mode 100644 src/app/share/resources/icon/24x24/arrowLeftDown.png delete mode 100644 src/app/share/resources/icon/24x24/arrowLeftUp.png delete mode 100644 src/app/share/resources/icon/24x24/arrowRight.png delete mode 100644 src/app/share/resources/icon/24x24/arrowRightDown.png delete mode 100644 src/app/share/resources/icon/24x24/arrowRightUp.png delete mode 100644 src/app/share/resources/icon/24x24/arrowUp.png create mode 100644 src/app/share/resources/icon/32x32/arrowDown.png create mode 100644 src/app/share/resources/icon/32x32/arrowLeft.png create mode 100644 src/app/share/resources/icon/32x32/arrowLeftDown.png create mode 100644 src/app/share/resources/icon/32x32/arrowLeftUp.png create mode 100644 src/app/share/resources/icon/32x32/arrowRight.png create mode 100644 src/app/share/resources/icon/32x32/arrowRightDown.png create mode 100644 src/app/share/resources/icon/32x32/arrowRightUp.png create mode 100644 src/app/share/resources/icon/32x32/arrowUp.png diff --git a/src/app/dialogs/tools/dialogendline.ui b/src/app/dialogs/tools/dialogendline.ui index dc25f6b0d..9db253c80 100644 --- a/src/app/dialogs/tools/dialogendline.ui +++ b/src/app/dialogs/tools/dialogendline.ui @@ -189,7 +189,9 @@ - + + + @@ -330,7 +332,7 @@ - :/icon/24x24/arrowRightUp.png:/icon/24x24/arrowRightUp.png + :/icon/32x32/arrowRightUp.png:/icon/32x32/arrowRightUp.png @@ -347,7 +349,7 @@ - :/icon/24x24/arrowLeftUp.png:/icon/24x24/arrowLeftUp.png + :/icon/32x32/arrowLeftUp.png:/icon/32x32/arrowLeftUp.png @@ -364,7 +366,7 @@ - :/icon/24x24/arrowLeft.png:/icon/24x24/arrowLeft.png + :/icon/32x32/arrowLeft.png:/icon/32x32/arrowLeft.png @@ -381,7 +383,7 @@ - :/icon/24x24/arrowRight.png:/icon/24x24/arrowRight.png + :/icon/32x32/arrowRight.png:/icon/32x32/arrowRight.png @@ -404,7 +406,7 @@ - :/icon/24x24/arrowUp.png:/icon/24x24/arrowUp.png + :/icon/32x32/arrowUp.png:/icon/32x32/arrowUp.png @@ -421,7 +423,7 @@ - :/icon/24x24/arrowDown.png:/icon/24x24/arrowDown.png + :/icon/32x32/arrowDown.png:/icon/32x32/arrowDown.png @@ -438,7 +440,7 @@ - :/icon/24x24/arrowLeftDown.png:/icon/24x24/arrowLeftDown.png + :/icon/32x32/arrowLeftDown.png:/icon/32x32/arrowLeftDown.png @@ -455,7 +457,7 @@ - :/icon/24x24/arrowRightDown.png:/icon/24x24/arrowRightDown.png + :/icon/32x32/arrowRightDown.png:/icon/32x32/arrowRightDown.png diff --git a/src/app/dialogs/tools/dialognormal.ui b/src/app/dialogs/tools/dialognormal.ui index b563b943a..b774de117 100644 --- a/src/app/dialogs/tools/dialognormal.ui +++ b/src/app/dialogs/tools/dialognormal.ui @@ -189,7 +189,9 @@ - + + + @@ -349,7 +351,7 @@ - :/icon/24x24/arrowRightUp.png:/icon/24x24/arrowRightUp.png + :/icon/32x32/arrowRightUp.png:/icon/32x32/arrowRightUp.png @@ -366,7 +368,7 @@ - :/icon/24x24/arrowLeftUp.png:/icon/24x24/arrowLeftUp.png + :/icon/32x32/arrowLeftUp.png:/icon/32x32/arrowLeftUp.png @@ -383,7 +385,7 @@ - :/icon/24x24/arrowLeft.png:/icon/24x24/arrowLeft.png + :/icon/32x32/arrowLeft.png:/icon/32x32/arrowLeft.png @@ -400,7 +402,7 @@ - :/icon/24x24/arrowRight.png:/icon/24x24/arrowRight.png + :/icon/32x32/arrowRight.png:/icon/32x32/arrowRight.png @@ -423,7 +425,7 @@ - :/icon/24x24/arrowUp.png:/icon/24x24/arrowUp.png + :/icon/32x32/arrowUp.png:/icon/32x32/arrowUp.png @@ -440,7 +442,7 @@ - :/icon/24x24/arrowDown.png:/icon/24x24/arrowDown.png + :/icon/32x32/arrowDown.png:/icon/32x32/arrowDown.png @@ -457,7 +459,7 @@ - :/icon/24x24/arrowLeftDown.png:/icon/24x24/arrowLeftDown.png + :/icon/32x32/arrowLeftDown.png:/icon/32x32/arrowLeftDown.png @@ -474,7 +476,7 @@ - :/icon/24x24/arrowRightDown.png:/icon/24x24/arrowRightDown.png + :/icon/32x32/arrowRightDown.png:/icon/32x32/arrowRightDown.png diff --git a/src/app/share/resources/icon.qrc b/src/app/share/resources/icon.qrc index d0717dda0..e127d2f36 100644 --- a/src/app/share/resources/icon.qrc +++ b/src/app/share/resources/icon.qrc @@ -8,14 +8,6 @@ icon/32x32/option_draw.png icon/32x32/table.png icon/24x24/putHere.png - icon/24x24/arrowDown.png - icon/24x24/arrowUp.png - icon/24x24/arrowRightUp.png - icon/24x24/arrowRightDown.png - icon/24x24/arrowRight.png - icon/24x24/arrowLeftUp.png - icon/24x24/arrowLeftDown.png - icon/24x24/arrowLeft.png icon/24x24/equal.png icon/32x32/segment.png icon/32x32/line.png @@ -54,5 +46,14 @@ icon/flags/nl.png icon/flags/it.png icon/community_config.png + icon/32x32/arrowLeft.png + icon/32x32/arrowRight.png + icon/32x32/arrowRightDown.png + icon/32x32/arrowDown.png + icon/32x32/arrowRightUp.png + icon/32x32/arrowLeftDown.png + icon/32x32/arrowUp.png + icon/32x32/arrowLeftUp.png + icon/32x32/putHereLeft.png diff --git a/src/app/share/resources/icon/24x24/arrowDown.png b/src/app/share/resources/icon/24x24/arrowDown.png deleted file mode 100644 index 817af191de0cf9b7f1cf57df84ec1dc8e1b93399..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 716 zcmV;-0yF)IP)j0?z;d0$E8! zK~y-)?UT)J6Im35zjOQEZtOJOZX9B_?F>#J8X+OE=FND7c{4OCBoGoJiKC2_z{H7z zW0TnZb1n-cL>BgF_SCKx=Tk{l2Y&0nB)^)s@Bao7>Z0K0^A}DIM}GXz7>_dO_1NFr zlkT7oQAj25^5v_axAs?%Hvt4fUBKe{>va6-kPq+P17Kd<(a$pP@~(J+O717R2ND4h zgAswM&UCe;zP$xw@I{HJVgwYAdffo>V1NL@c*Ws~#3KeG0qeo2Qmdle2bp_DJ%M@x zRh(A1x+JVi!m7koC9W(nRkbf#1Acv?Z;J)<#hlsY#a~yWW2RRV%3=u!)5(O>lMz00 z$2NZ~w2}>=*$t;BBR@Vmgrg($>$a;)3~f#>LH?q8VZa`T9gzlF*7{V(VxXu(N`;3Q-V%S5QT~Cv7xH z(sVs2%`&>Z9#_3S@%dNWoyXK3V=ZAM#Bqb>cANJ0W74#>9;A(kbdXE$`GK!a&$wQ# zSgr~#EqsfcnC=ekg9Fme&Qs^?`uZziE6eB(hs50->W2+xMwuC+8w!QdeLtZa5(9ccj{SfChqWOyvEKijCm9 yosrug5^9CDmaQkdMB9(3LyMOmfB9SgPu~IiVE>haXU@?80000Xh&@&7q<=0brE6y(xcdr#GvZo2WC`4#+P?u^mYMXhZuwiXx)6c`v7 zX3lZZ#Kf{dmnJ^TH#zSw&zl4Pdc@h>0! zyF2}IxwNJ%f!686V=a04>h*8?)MFq`H6$}sIPFcl-D0+^GhPJmafAd)$S zY_{k-4%muRCxAdmd!fMsFbPNR<5uT5|M8UY>WWG07QfTQ>-SloMTAj|?X56C;RSa_ z*owK)D90gFsV-b)0r-4!avWWKXZOP?BDlj1L-OGiYZ?)ya~j$H@LXGApClXdwGE$Mr1T(5{;J{Tn#sqh+#V*2t#boBUKiOl8BWYPOZKi zP|C(w7JWxDa|D^xU|W)ml*FlIWCEvWs?MVB!dCN zVaRx#5X}vkaTxMk36qHk`PbYMJ< zG364a-5p9V4ymr!!LfrT7}B~ z9?za1Qh&N3r0Xy@8f`#JYdK&kg^-eXbxq)9->wu(Z)CMj(rRORJ#@w+zh1*G7D!wd jX)6ro;cpuL=kN0qDjeWwORkH~00000NkvXXu0mjf<@_A2 diff --git a/src/app/share/resources/icon/24x24/arrowLeftDown.png b/src/app/share/resources/icon/24x24/arrowLeftDown.png deleted file mode 100644 index f77bdf6961ba33889e0e4b5f00ce8e79dd7e04f5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 893 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 diff --git a/src/app/share/resources/icon/24x24/arrowRightUp.png b/src/app/share/resources/icon/24x24/arrowRightUp.png deleted file mode 100644 index 4a17aede6bbbfdeac5e8ae1580342046ecb5c519..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 864 zcmV-m1E2hfP)ch~vq)PI35`rK0gz4-0dpMmV3=gda15Ty|tQd=;} zK%9_HCIq9g^!t6>yhpXZ!S_G>_>rf*%oISO{`F0XfEY+J)O=1HhsKPM6ExfZ=dN97X728SQ#20A!IM z6N6-iIE)FWfkfjQvdb<>_nhEum+{qz;3hyv8P#=I8Hz;++3b|twy8Kpj4@3T{rjF{RQQ*;Qb1-6e5sWrE;bM6WWlpsohWuuiw-%e43A=Y05%GWb?W(l*x_~txSARHSYx|1g$iV*0{#tM04WV3@42767bNtmc@Fh0Na~X_nKsWQH84j zl;}nG7{L;SN(X}#L2VYS+JR&Xl-x=*-XX;^q$snHGz38_)ygL1z?wd9y z2=U5gbfrXK!Nh``@3Y%#;WzhGyp|(2n$zvK{A3e>NO3y`WJTdP(B4bXvSebJF z(pduJ^Lb8APS|a15vK|D)-L7E`m=)XKSwJvk>$bvA1whK%b~iv^E6+r{A7$F=NHtP q=OLE8@Y0|^xGE6QtC7Cwv*~Z_bx{VZzu%Dn0000`;0vt(1 zK~y-)?UYYX(*PL8e_gvRY-O{PK_H+(5=@kfiHR5ENsT7PnLs>!2{yNIQc1c& zgg=^l3A`GbXye=RHS6#Qr=o&s;u*(usybFx=kLmrH8fGT+1hKB4+(2^7J(`o8+fYF9MEibmnM$!xdJOxI=9FbNLI^vZ{9E`5m3Bxzxo$Gn z?viml(vm>C)nQQ8vG)%UCa2FPY8ocB@)4fZB-wMx`T=qfAvrEyqd}vh(lX7{jeagK zMfFC5Bf~&*9JDAv6Ty%Kj-!Bj-$iX%)Gd?Mm68>^n(g;-69R#p!N|+>qkxp}b0P`2 zsWhRSMb69gB>~UtDX~VOB$6K=XKH>Pga}Jj=~+$ugg~aCpiE9un43i&FCa=oyvX`$ z>3wJ8_p_ZJ>+Jp6Vjw1%yK$YHw{LM}VS)K4i^5O`dFTG)Me+)6Hiw-a!A_;=XEF%6 zJn2iy+__$)Cnd4P6m2m{mfHzX=Q0X|kio#m_dSpx3?rgbk|Ne9naeUV pF@`)dg^+-eVi8duy$Ig_&_57d`1H|?-W31<002ovPDHLkV1m*ADBA!4 diff --git a/src/app/share/resources/icon/32x32/arrowDown.png b/src/app/share/resources/icon/32x32/arrowDown.png new file mode 100644 index 0000000000000000000000000000000000000000..199edf66ddaa2f65fcb1f1f5b44567fe938db336 GIT binary patch literal 1910 zcmV-+2Z{KJP)pI{cSfC#@6|Nb*DqS~mZmbrQbkmd#mAh@A05Ip0?ZziDX zn~y)ULXAVX5e9;yHCO_oG+21L6hQIG#GII0sr-0-D0tm%TK+kdmDSjY+2lVt0n43`S{>#Mlff49v zMu<0AG28?K@e!&l-0aK@S08_2xVh*$16D;(fBa+MV`gS}_W3shR^NfZ%ddYKezUVO zy!rA6MG@S0s(b$Ye**N?!{`4QUcdUqAfzh&A48GQwY#5Rv2rrp{tQe%a*_-m?!S15 zq3C3uI^UxYKN#+R{m<~|%)Oug{`^&d+XoFN4j={zTG;IS0unF+VsVh0LGl0rgb~5W zz;D^}|G#;7892F^79wV|EP+(((05SlkK=Hm(BL+~|!oaPU|A7W! zSC7*mAo%#|FECO5MF>3l_zS0ECR`FgC;xa3jL4V3=z-za-~Qq>2%n1>K=H`W2TxKA zuU`Ek-XQ(DGe6{v<=L4SnHU6Rgcv@2K|}_-v?zmu8O#4afBrB$yZChWzrX*|a2j;6 z$%F$K&|KUm%3t4p{f8>~_bvBm^twKw==xK+FZiNOa4n@PE860@jKXWWRr`WB$#;AmDAl{q85Ko$7Wf48OkpVtD)L^Jly+ z0_L0dPcA;0{ZE*W;lqC>hPS`|qu^hBJPhA}RsWY)pCt$uwHF(W(;n}>eDB?lzYOny znvwB`Pv03{pSs@)RQ8RiGW%kKk@DxmS3iCNYW@hUcR~2e_g@SjkKNh|l&--UYiNZU zBNPkkOuF^?yQU&1^WQ%V?1!)XyWDE#hg_(kMl+&N0~yK##328x1F;FWys@|S&X4~M zx-WeJ^38!*2Z-f>7*y1B41!}GCUHcc8);zt#sR*Hov;!RLb-UP3L7tea~ar$usZF`#jHVDnq6) zX9e={J)l&C^D%IK*aR{#0V^D;QH`1gdvzA?awDHn9UcO$OKdn=qfq+qU;o#%9yX4o}N8J7=@N_mz z%W{b;$VLU4hI!>Y4GvlR9~k~hyM&VW1QE4wjegFUf07*qoM6N<$g0vx@kpKVy literal 0 HcmV?d00001 diff --git a/src/app/share/resources/icon/32x32/arrowLeft.png b/src/app/share/resources/icon/32x32/arrowLeft.png new file mode 100644 index 0000000000000000000000000000000000000000..6fe84b8d92d9d50ea6eb153321cbda9633c9e8c9 GIT binary patch literal 548 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 literal 0 HcmV?d00001 diff --git a/src/app/share/resources/icon/32x32/arrowLeftUp.png b/src/app/share/resources/icon/32x32/arrowLeftUp.png new file mode 100644 index 0000000000000000000000000000000000000000..99070f5a0285fa3e4cbd5282543ffb5df1f8079f GIT binary patch literal 2266 zcmV<02qpK4P)RCwBA)U7_nfDA6Rm@+Vd7~R#T z|69vV{=+0#K*YYge;7E~!AxNwehX%8UvZxCyOiL6J{O}mKrSO#@N%n}D3G!NVljsQ z{}})Rh!Nc)kR^p6OW1@3{=)?Nk3Ra(;O(OdSHZAh@fpS~PyaIfXJYus2;_4Cu@n#+ z1MwYz00JAz#>zDB*YAHjfC8%+&;ZCcVCMi8Bo&mIf-G7IbPdDA?$hEx_A3-TD3KB?B-txf!fH)&FBCdU)&A)jO9TIPX7r|L@(;{~5k= z@-hf2iu^`V#KgpG47B3#lgoE)Z@l`(aP8AShVOC`EMGr=tOh$A7)Bt4tUxRT#4rAS zU$aCYz$NDY<%bMFjjb@#7@+|v4aE9D>?NPP66A04m|@btwuhDR^H{&@K8>%aFOesbe7kO{{4@$+x--5>ve zNr;i*Ju?%-cTQFY5qUlaB|Q;_YtR33JbC=e1)s~9kl5#rUwOyy0vO21_$vzwLtK&? zLuiKOF>o%z0Z_t-or~?m&u_o@e=#yKh>3ImGICI3V`OB6%Y)MX^)nCuKELx?1jzk> zHH<(2XovtXKJ9_gb@1u!C(_T^IG)HUh%m75a3K__$uUc+%D(?_>Hg2}Pv3K3WF{B@ z83LuBGCX?C_~7cDGt#qj^g}kYzVG`c&-a^m--HP4(-H3M57?CN@$|FL z)_)02P8`kWM-Jwh!*?tqt2SDL!e+&Q;tyS|H(HCf&2Mz=?7~LVGQ99bd$?mrQV%7D`K{rk%XA#%vCEK*1u6Gmo1R%5TI=nxPI$QQiu~N zN{lR&el_9E>>9j%y#{rifoi(}loPl-Ig%Abq1Zi-Ug15qqPA+%r^Oe`Zk0M9SrDK) z0-U^-JBDIQ{}KYilpKDYe&mwTY;LW-T-gz;nQnmGCNMZYe2$31{GLK6@HKQkWT@L_ z<=q!9SsWx>o`-DWELS&e%3|Yt3U$b)UfP!;_R@M=Z*ws0Hn5fNl-A6IqshD69t$BL z3D0(ZF2(&i9DhTWi9Pl?)L&z|4rTp;x z6y+|_>uO3_o_k)Jo_LI5c%+j>Sg7WBmh)>~6H;!|%+E(RAM~BNdP16?UhoI)`AZ0A zWqH{jB`yw+-RW5WEkN_t(%M86h0mQwl8#BH)&w7|uTrax_@MQLZhY^oxUdSkaZwP( zjUfI5aqmJGiXgZWY{4otiio=Pg<6fzq^348HZzlVGc$KQ7jGqK9@+|e;V{E6bLYF~ ze)l`ynXy97bWG*=w|4(uj9<#5+a*T#>}Xr8qtKd2!Lej9Q?_hJ)5`>ntAyc_M3NUo z@&zfDKkdGPoU-uKlltU zUZo+UX^aP3k^03M12Ro|YvjGrw|UciRhCHIj~STUqzyyim=lTUL{xnY49n25>42#U zh^cKNQShY86ci#hoS=*zY)#KR@)|Q^d>Y$_Kn7>Rp=zYokROTYcmc9lh#JMDAb=WF z;K+$?IMBa-fbDucmpPpb0i{kj8qM}M2YtZoyiLE`F>Gj9_fvCi{^nV5@MsT7eJv#K z4Mq&xqMeo9+Oz@TM8olq#(_Bt1O8mL1ds2$weTcKvjd8=an}lhClLfv8<@xAg`NA? zsw0o%iO(M<#%BJFLSrfd=B1bt@5`X#a? zHRhOQ*${meweg#KX4pi~<}%(S$h z2%k2Www`f4dIN&uv8}GfA_FDi@5#$pp{!-x;A!zR`I?|Omb|TJU~etq{6T8orA;{_ ziHD1KZZf}T;pVPM-Z_l@?xyj+%iN-}bBLDyZ literal 0 HcmV?d00001 diff --git a/src/app/share/resources/icon/32x32/arrowRight.png b/src/app/share/resources/icon/32x32/arrowRight.png new file mode 100644 index 0000000000000000000000000000000000000000..113acb37966e65fd1f0d29181b574ce3fb74b7a6 GIT binary patch literal 535 zcmV+y0_gpTP)}~YK50pf_#@z*fXqSP6=;u@J>V6v0?TQSbwVBno0@XQyIe zqaX-cDI|sXQOH5g-0jZJ>gbC@j+0}(-93;zFuZKB`#ia`b?EVnr?o19W62?r5n*CQ_TpvHnJkT=%4gwj^4aBlQEWuTK>i0_qCU$K-F$R4Z7Le~v z00IcbBxDa`braAkIcsyp+dw8e0~%m~D#)DG?lSE^(Bexs-v9Xb?>`5!A|@!E@c8>* zhSz@?7>Y|x*qN9ZJHLMZ$c3Wl?nD>!mbup$Uj6*f@cs`2Lu{T&nShAUC!ka|vPleg z%5)hgue`@_@7aHbJ3y@GW5~?J${Yn&1PTF02;ls>W4X+}6=xaFy#L2=?!!NZf4~1) zf#jK>j+X%WUP#yV@qa$H?>t{WFu2M7We^f&`wkT6K~5zg#R5RA0A+s#VvxI@00a<5 zV4?%`z(oh3z((;LQo!3A)SdZ%_}l;g2fqIQFD%6Io`DDecM;HlSawd%Mb*XT4E)?I z;B@>CNPy^1KmIaIns#x|ub+Qiak&V?Yd`}(@CpdLzWEthO7`_98j-QW>Atg?;3>q`U83asxmn0?m{<3kiGJFFX z@)d}`0TYg-1UG|*mhe+jTx9-$g@a}B#(TfN01L~n{~(5eT;}Di$Sxwz^#P{v*RQX; zfrY3tR)c_r>G%J)9_U^8%*cB4*;lY@VE896Nd-h|@&hx$-=9Cf-n9y`a1oIZxrQ^0 zfQDWEcl}=U(k%}ep1%Fb@B?HB6#r*tVhGJJViJ)SQ+j{<#Xmt&p1%YWBrv?Daf*v% zhKA}eFf*|*`~~HH21u^|3oQw*UUDsFo9E0LUh1 z;-9sGk&E>kn=n5&mmnvDs2DecvynOH3456uqyiUKQQdRYmh@ z=;qT(5D=7cp;0q2Dp40EGa5DSTo@B|VZ<3h;uSm%hypLUsoT}{Iq!bYtywGNY-_d(I@<~Z`l|(UriGbP zhEa3Pw9FM4JfpTF0&Ch#QAA%X&DkGpW`Mh|=Rc(5CRwfb1+3TQg|=x4)4Y^L4``cFSyGPn9qprlVwY4jGlhCwLKwi z+)zhUWR#(`LMw?@bFkbE42{9L&S$wozPJ)ky}<5gP>tTMT3p!{ueNB{f0=PRH`1yb zR@XPV>^XdU+jr z`uB4;nYLhb#IfIJa|iI!Gv5tJ0Ct!xN}bU14piv!_?BHQs;0@{&zme{r{07xE=9Cf z9)aDx-OaQJW$ml#B?qbSgL@g)^K#%QUVVJdfQ0xuOB(Bcj()Tul`@MztWGPkEKj(R z!Q_D8`GYyP*3>z)9Jc!G%RYGfyWwruWbLtYu>} ziCR&>emnsn0Ko(uCUw_uso3OEZJsu$=aLAa(s1bN4n*;nS%tikNl>}I4G&Ua9TCK5 zmhup4ehkL`d7giGe3dSQUeL>wXmFr>0rd3;y z+^krW|1SQM3*C_YIUm zlo6EtbTKrUy_|1&9R1|P|N7MCj!bFFk`y(f=;fBtu%?M9s)5s6t!kE+sYZFFti|FW z(FjN~^}T3V)KjQT;t5kzOOVo*Y08jU-GtA(!#AE6T@+Sr(ON|K+z?t%;iB?~=$z|C z1#3#ehQdvOP#BmnRSxr`&lqfsA$zVtEpq@=078Y$d4gq&9F!{nbU83l55C#WE6cdf fW^nm;FCWk+H4E&qhTISr00000NkvXXu0mjf*DRGf literal 0 HcmV?d00001 diff --git a/src/app/share/resources/icon/32x32/arrowRightUp.png b/src/app/share/resources/icon/32x32/arrowRightUp.png new file mode 100644 index 0000000000000000000000000000000000000000..877920aa736d1f57c98f50702b5940f3ad928789 GIT binary patch literal 2180 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 literal 0 HcmV?d00001 From ac71fd3cad4bdd22d3b74e6ee21d6fd2db7b6efd Mon Sep 17 00:00:00 2001 From: dismine Date: Thu, 19 Jun 2014 14:43:02 +0300 Subject: [PATCH 19/20] Refactoring. Delete repetitive code. --HG-- branch : feature --- src/app/dialogs/tools/dialogalongline.cpp | 18 ++++++------- src/app/dialogs/tools/dialogarc.cpp | 7 ++---- src/app/dialogs/tools/dialogbisector.cpp | 11 +++----- src/app/dialogs/tools/dialogcutarc.cpp | 7 ++---- src/app/dialogs/tools/dialogcutspline.cpp | 10 +++----- src/app/dialogs/tools/dialogcutsplinepath.cpp | 7 ++---- .../dialogs/tools/dialogeditwrongformula.cpp | 9 +++---- .../dialogs/tools/dialogeditwrongformula.ui | 6 ++--- src/app/dialogs/tools/dialogendline.cpp | 8 ++---- src/app/dialogs/tools/dialognormal.cpp | 11 +++----- .../dialogs/tools/dialogpointofcontact.cpp | 25 +++---------------- .../tools/dialogpointofintersection.cpp | 1 + src/app/dialogs/tools/dialogshoulderpoint.cpp | 12 +++------ src/app/dialogs/tools/dialogtool.h | 11 ++++++++ src/app/dialogs/tools/dialogtriangle.cpp | 1 + 15 files changed, 52 insertions(+), 92 deletions(-) diff --git a/src/app/dialogs/tools/dialogalongline.cpp b/src/app/dialogs/tools/dialogalongline.cpp index af7dd47f4..4907d9ea8 100644 --- a/src/app/dialogs/tools/dialogalongline.cpp +++ b/src/app/dialogs/tools/dialogalongline.cpp @@ -39,32 +39,28 @@ */ DialogAlongLine::DialogAlongLine(const VContainer *data, QWidget *parent) :DialogTool(data, parent), ui(new Ui::DialogAlongLine), number(0), pointName(QString()), typeLine(QString()), - formula(QString()), firstPointId(0), secondPointId(0), formulaBaseHeight(0) + formula(QString()), firstPointId(0), secondPointId(0), formulaBaseHeight(ui->plainTextEditFormula->height()) { ui->setupUi(this); - labelResultCalculation = ui->labelResultCalculation; - plainTextEditFormula = ui->plainTextEditFormula; - labelEditFormula = ui->labelEditFormula; - - this->formulaBaseHeight=ui->plainTextEditFormula->height(); + InitVariables(ui); + InitFormulaUI(ui); + labelEditNamePoint = ui->labelEditNamePoint; + InitOkCancelApply(ui); flagFormula = false; flagName = false; - InitOkCancelApply(ui); CheckState(); - FillComboBoxTypeLine(ui->comboBoxLineType); - ui->comboBoxLineType->setCurrentIndex(0); FillComboBoxPoints(ui->comboBoxFirstPoint); FillComboBoxPoints(ui->comboBoxSecondPoint); + FillComboBoxTypeLine(ui->comboBoxLineType); + ui->comboBoxLineType->setCurrentIndex(0); - labelEditNamePoint = ui->labelEditNamePoint; connect(ui->toolButtonPutHere, &QPushButton::clicked, this, &DialogAlongLine::PutHere); connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogAlongLine::NamePointChanged); connect(ui->toolButtonEqual, &QPushButton::clicked, this, &DialogAlongLine::EvalFormula); connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogAlongLine::FormulaTextChanged); connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogAlongLine::DeployFormulaTextEdit); - InitVariables(ui); connect(listWidget, &QListWidget::itemDoubleClicked, this, &DialogTool::PutVal); } diff --git a/src/app/dialogs/tools/dialogarc.cpp b/src/app/dialogs/tools/dialogarc.cpp index 14d0f2d00..e992c745f 100644 --- a/src/app/dialogs/tools/dialogarc.cpp +++ b/src/app/dialogs/tools/dialogarc.cpp @@ -44,7 +44,8 @@ DialogArc::DialogArc(const VContainer *data, QWidget *parent) :DialogTool(data, parent), ui(new Ui::DialogArc), flagRadius(false), flagF1(false), flagF2(false), timerRadius(nullptr), timerF1(nullptr), timerF2(nullptr), center(0), radius(QString()), f1(QString()), - f2(QString()), formulaBaseHeight(0), formulaBaseHeightF1(0), formulaBaseHeightF2(0) + f2(QString()), formulaBaseHeight(ui->plainTextEditFormula->height()), + formulaBaseHeightF1(ui->plainTextEditF1->height()), formulaBaseHeightF2(ui->plainTextEditF2->height()) { ui->setupUi(this); @@ -63,10 +64,6 @@ DialogArc::DialogArc(const VContainer *data, QWidget *parent) InitOkCancelApply(ui); - this->formulaBaseHeight=ui->plainTextEditFormula->height(); - this->formulaBaseHeightF1=ui->plainTextEditF1->height(); - this->formulaBaseHeightF2=ui->plainTextEditF2->height(); - FillComboBoxPoints(ui->comboBoxBasePoint); CheckState(); diff --git a/src/app/dialogs/tools/dialogbisector.cpp b/src/app/dialogs/tools/dialogbisector.cpp index 8f7f713ac..bf07c35d7 100644 --- a/src/app/dialogs/tools/dialogbisector.cpp +++ b/src/app/dialogs/tools/dialogbisector.cpp @@ -40,17 +40,14 @@ */ DialogBisector::DialogBisector(const VContainer *data, QWidget *parent) :DialogTool(data, parent), ui(new Ui::DialogBisector), number(0), pointName(QString()), typeLine(QString()), - formula(QString()), firstPointId(0), secondPointId(0), thirdPointId(0), formulaBaseHeight(0) + formula(QString()), firstPointId(0), secondPointId(0), thirdPointId(0), + formulaBaseHeight(ui->plainTextEditFormula->height()) { ui->setupUi(this); InitVariables(ui); - labelResultCalculation = ui->labelResultCalculation; - plainTextEditFormula = ui->plainTextEditFormula; - labelEditFormula = ui->labelEditFormula; + InitFormulaUI(ui); labelEditNamePoint = ui->labelEditNamePoint; - this->formulaBaseHeight=ui->plainTextEditFormula->height(); - InitOkCancelApply(ui); flagFormula = false; flagName = false; @@ -58,8 +55,8 @@ DialogBisector::DialogBisector(const VContainer *data, QWidget *parent) FillComboBoxPoints(ui->comboBoxFirstPoint); FillComboBoxPoints(ui->comboBoxSecondPoint); - FillComboBoxPoints(ui->comboBoxThirdPoint); FillComboBoxTypeLine(ui->comboBoxLineType); + FillComboBoxPoints(ui->comboBoxThirdPoint); connect(ui->toolButtonPutHere, &QPushButton::clicked, this, &DialogBisector::PutHere); connect(listWidget, &QListWidget::itemDoubleClicked, this, &DialogBisector::PutVal); diff --git a/src/app/dialogs/tools/dialogcutarc.cpp b/src/app/dialogs/tools/dialogcutarc.cpp index c597e4efe..2f618fcba 100644 --- a/src/app/dialogs/tools/dialogcutarc.cpp +++ b/src/app/dialogs/tools/dialogcutarc.cpp @@ -40,20 +40,17 @@ */ DialogCutArc::DialogCutArc(const VContainer *data, QWidget *parent) : DialogTool(data, parent), ui(new Ui::DialogCutArc), pointName(QString()), formula(QString()), arcId(0), - formulaBaseHeight(0) + formulaBaseHeight(ui->plainTextEditFormula->height()) { ui->setupUi(this); InitVariables(ui); - labelResultCalculation = ui->labelResultCalculation; - plainTextEditFormula = ui->plainTextEditFormula; - labelEditFormula = ui->labelEditFormula; + InitFormulaUI(ui); labelEditNamePoint = ui->labelEditNamePoint; InitOkCancelApply(ui); flagFormula = false; flagName = false; CheckState(); - this->formulaBaseHeight=ui->plainTextEditFormula->height(); FillComboBoxArcs(ui->comboBoxArc); diff --git a/src/app/dialogs/tools/dialogcutspline.cpp b/src/app/dialogs/tools/dialogcutspline.cpp index fffa1f87d..110d99cb9 100644 --- a/src/app/dialogs/tools/dialogcutspline.cpp +++ b/src/app/dialogs/tools/dialogcutspline.cpp @@ -40,22 +40,18 @@ */ DialogCutSpline::DialogCutSpline(const VContainer *data, QWidget *parent) :DialogTool(data, parent), ui(new Ui::DialogCutSpline), pointName(QString()), formula(QString()), splineId(0), - formulaBaseHeight(0) + formulaBaseHeight(ui->plainTextEditFormula->height()) { ui->setupUi(this); InitVariables(ui); - labelResultCalculation = ui->labelResultCalculation; - plainTextEditFormula = ui->plainTextEditFormula; - labelEditFormula = ui->labelEditFormula; + InitFormulaUI(ui); labelEditNamePoint = ui->labelEditNamePoint; - InitOkCancel(ui); + InitOkCancel(ui); flagFormula = false; flagName = false; CheckState(); - this->formulaBaseHeight=ui->plainTextEditFormula->height(); - FillComboBoxSplines(ui->comboBoxSpline); connect(ui->toolButtonPutHere, &QPushButton::clicked, this, &DialogCutSpline::PutHere); diff --git a/src/app/dialogs/tools/dialogcutsplinepath.cpp b/src/app/dialogs/tools/dialogcutsplinepath.cpp index ee38e9a3b..bcebf1611 100644 --- a/src/app/dialogs/tools/dialogcutsplinepath.cpp +++ b/src/app/dialogs/tools/dialogcutsplinepath.cpp @@ -40,20 +40,17 @@ */ DialogCutSplinePath::DialogCutSplinePath(const VContainer *data, QWidget *parent) :DialogTool(data, parent), ui(new Ui::DialogCutSplinePath), pointName(QString()), formula(QString()), - splinePathId(0), formulaBaseHeight(0) + splinePathId(0), formulaBaseHeight(ui->plainTextEditFormula->height()) { ui->setupUi(this); InitVariables(ui); - labelResultCalculation = ui->labelResultCalculation; - plainTextEditFormula = ui->plainTextEditFormula; - labelEditFormula = ui->labelEditFormula; + InitFormulaUI(ui); labelEditNamePoint = ui->labelEditNamePoint; InitOkCancel(ui); flagFormula = false; flagName = false; CheckState(); - this->formulaBaseHeight=ui->plainTextEditFormula->height(); FillComboBoxSplinesPath(ui->comboBoxSplinePath); diff --git a/src/app/dialogs/tools/dialogeditwrongformula.cpp b/src/app/dialogs/tools/dialogeditwrongformula.cpp index 6cf8a7b10..ef0d5702e 100644 --- a/src/app/dialogs/tools/dialogeditwrongformula.cpp +++ b/src/app/dialogs/tools/dialogeditwrongformula.cpp @@ -31,20 +31,17 @@ //--------------------------------------------------------------------------------------------------------------------- DialogEditWrongFormula::DialogEditWrongFormula(const VContainer *data, QWidget *parent) - :DialogTool(data, parent), ui(new Ui::DialogEditWrongFormula), formula(QString()), formulaBaseHeight(0) + :DialogTool(data, parent), ui(new Ui::DialogEditWrongFormula), formula(QString()), + formulaBaseHeight(ui->plainTextEditFormula->height()) { ui->setupUi(this); InitVariables(ui); - labelResultCalculation = ui->labelResult; - plainTextEditFormula = ui->plainTextEditFormula; - labelEditFormula = ui->labelFormula; + InitFormulaUI(ui); InitOkCancel(ui); flagFormula = false; CheckState(); - this->formulaBaseHeight=ui->plainTextEditFormula->height(); - connect(ui->toolButtonPutHere, &QPushButton::clicked, this, &DialogEditWrongFormula::PutHere); connect(ui->listWidget, &QListWidget::itemDoubleClicked, this, &DialogEditWrongFormula::PutVal); diff --git a/src/app/dialogs/tools/dialogeditwrongformula.ui b/src/app/dialogs/tools/dialogeditwrongformula.ui index fa86b6032..64cc17aa9 100644 --- a/src/app/dialogs/tools/dialogeditwrongformula.ui +++ b/src/app/dialogs/tools/dialogeditwrongformula.ui @@ -17,7 +17,7 @@ - + 0 @@ -88,7 +88,7 @@ ... - + :/icon/24x24/putHereLeft.png:/icon/24x24/putHereLeft.png @@ -120,7 +120,7 @@ - + 0 diff --git a/src/app/dialogs/tools/dialogendline.cpp b/src/app/dialogs/tools/dialogendline.cpp index 81fd9b5a7..70a016fd5 100644 --- a/src/app/dialogs/tools/dialogendline.cpp +++ b/src/app/dialogs/tools/dialogendline.cpp @@ -40,17 +40,13 @@ */ DialogEndLine::DialogEndLine(const VContainer *data, QWidget *parent) :DialogTool(data, parent), ui(new Ui::DialogEndLine), pointName(QString()), typeLine(QString()), formula(QString()), - angle(0), basePointId(0), formulaBaseHeight(0) + angle(0), basePointId(0), formulaBaseHeight(ui->plainTextEditFormula->height()) { ui->setupUi(this); InitVariables(ui); - labelResultCalculation = ui->labelResultCalculation; - plainTextEditFormula = ui->plainTextEditFormula; - labelEditFormula = ui->labelEditFormula; + InitFormulaUI(ui); labelEditNamePoint = ui->labelEditNamePoint; - this->formulaBaseHeight=ui->plainTextEditFormula->height(); - InitOkCancelApply(ui); flagFormula = false; flagName = false; diff --git a/src/app/dialogs/tools/dialognormal.cpp b/src/app/dialogs/tools/dialognormal.cpp index 6a3e6aa55..f425a283a 100644 --- a/src/app/dialogs/tools/dialognormal.cpp +++ b/src/app/dialogs/tools/dialognormal.cpp @@ -37,18 +37,15 @@ */ DialogNormal::DialogNormal(const VContainer *data, QWidget *parent) :DialogTool(data, parent), ui(new Ui::DialogNormal), number(0), pointName(QString()), typeLine(QString()), - formula(QString()), angle(0), firstPointId(0), secondPointId(0), formulaBaseHeight(0) + formula(QString()), angle(0), firstPointId(0), secondPointId(0), + formulaBaseHeight(ui->plainTextEditFormula->height()) { ui->setupUi(this); InitVariables(ui); - labelResultCalculation = ui->labelResultCalculation; - plainTextEditFormula = ui->plainTextEditFormula; - labelEditFormula = ui->labelEditFormula; + InitFormulaUI(ui); labelEditNamePoint = ui->labelEditNamePoint; + InitOkCancelApply(ui); - - this->formulaBaseHeight=ui->plainTextEditFormula->height(); - flagFormula = false; flagName = false; CheckState(); diff --git a/src/app/dialogs/tools/dialogpointofcontact.cpp b/src/app/dialogs/tools/dialogpointofcontact.cpp index 3735d6bc1..0b2293fd3 100644 --- a/src/app/dialogs/tools/dialogpointofcontact.cpp +++ b/src/app/dialogs/tools/dialogpointofcontact.cpp @@ -39,40 +39,21 @@ */ DialogPointOfContact::DialogPointOfContact(const VContainer *data, QWidget *parent) :DialogTool(data, parent), ui(new Ui::DialogPointOfContact), number(0), pointName(QString()), radius(QString()), - center(0), firstPoint(0), secondPoint(0), formulaBaseHeight(0) + center(0), firstPoint(0), secondPoint(0), formulaBaseHeight(ui->plainTextEditFormula->height()) { ui->setupUi(this); InitVariables(ui); - listWidget = ui->listWidget; - labelResultCalculation = ui->labelResultCalculation; - labelDescription = ui->labelDescription; - radioButtonSizeGrowth = ui->radioButtonSizeGrowth; - radioButtonStandardTable = ui->radioButtonStandardTable; - radioButtonIncrements = ui->radioButtonIncrements; - radioButtonLengthLine = ui->radioButtonLengthLine; - radioButtonLengthArc = ui->radioButtonLengthArc; - radioButtonLengthCurve = ui->radioButtonLengthSpline; - plainTextEditFormula = ui->plainTextEditFormula; - labelEditFormula = ui->labelEditFormula; + InitFormulaUI(ui); labelEditNamePoint = ui->labelEditNamePoint; - this->formulaBaseHeight=ui->plainTextEditFormula->height(); InitOkCancelApply(ui); - - /* bOk = ui.buttonBox->button(QDialogButtonBox::Ok); - SCASSERT(bOk != nullptr); - connect(bOk, &QPushButton::clicked, this, &DialogTool::DialogAccepted); - QPushButton *bCansel = ui.buttonBox->button(QDialogButtonBox::Cancel); - SCASSERT(bCansel != nullptr); - connect(bCansel, &QPushButton::clicked, this, &DialogTool::DialogRejected); - */ flagFormula = false; flagName = false; CheckState(); - FillComboBoxPoints(ui->comboBoxCenter); FillComboBoxPoints(ui->comboBoxFirstPoint); FillComboBoxPoints(ui->comboBoxSecondPoint); + FillComboBoxPoints(ui->comboBoxCenter); connect(ui->toolButtonPutHere, &QPushButton::clicked, this, &DialogPointOfContact::PutHere); connect(ui->listWidget, &QListWidget::itemDoubleClicked, this, &DialogPointOfContact::PutVal); diff --git a/src/app/dialogs/tools/dialogpointofintersection.cpp b/src/app/dialogs/tools/dialogpointofintersection.cpp index 58b058cdb..9a998063c 100644 --- a/src/app/dialogs/tools/dialogpointofintersection.cpp +++ b/src/app/dialogs/tools/dialogpointofintersection.cpp @@ -44,6 +44,7 @@ DialogPointOfIntersection::DialogPointOfIntersection(const VContainer *data, QWi { ui->setupUi(this); labelEditNamePoint = ui->labelEditNamePoint; + InitOkCancel(ui); flagName = false; CheckState(); diff --git a/src/app/dialogs/tools/dialogshoulderpoint.cpp b/src/app/dialogs/tools/dialogshoulderpoint.cpp index c579f7bad..63a08c8b5 100644 --- a/src/app/dialogs/tools/dialogshoulderpoint.cpp +++ b/src/app/dialogs/tools/dialogshoulderpoint.cpp @@ -40,19 +40,15 @@ */ DialogShoulderPoint::DialogShoulderPoint(const VContainer *data, QWidget *parent) :DialogTool(data, parent), ui(new Ui::DialogShoulderPoint), number(0), pointName(QString()), - typeLine(QString()), formula(QString()), p1Line(0), p2Line(0), pShoulder(0), formulaBaseHeight(0) + typeLine(QString()), formula(QString()), p1Line(0), p2Line(0), pShoulder(0), + formulaBaseHeight(ui->plainTextEditFormula->height()) { ui->setupUi(this); - number = 0; InitVariables(ui); - labelResultCalculation = ui->labelResultCalculation; - plainTextEditFormula = ui->plainTextEditFormula; - labelEditFormula = ui->labelEditFormula; + InitFormulaUI(ui); labelEditNamePoint = ui->labelEditNamePoint; + InitOkCancelApply(ui); - - this->formulaBaseHeight=ui->plainTextEditFormula->height(); - flagFormula = false; flagName = false; CheckState(); diff --git a/src/app/dialogs/tools/dialogtool.h b/src/app/dialogs/tools/dialogtool.h index 62153427f..bcf1dc425 100644 --- a/src/app/dialogs/tools/dialogtool.h +++ b/src/app/dialogs/tools/dialogtool.h @@ -276,6 +276,17 @@ protected: SCASSERT(bCancel != nullptr); connect(bCancel, &QPushButton::clicked, this, &DialogTool::DialogRejected); } + template + /** + * @brief InitFormulaUI initialise ui object for formula fild + * @param ui Dialog container + */ + void InitFormulaUI(T *ui) + { + labelResultCalculation = ui->labelResultCalculation; + plainTextEditFormula = ui->plainTextEditFormula; + labelEditFormula = ui->labelEditFormula; + } /** * @brief associatedTool vdrawtool associated with opened dialog. */ diff --git a/src/app/dialogs/tools/dialogtriangle.cpp b/src/app/dialogs/tools/dialogtriangle.cpp index b421253fc..1db585d65 100644 --- a/src/app/dialogs/tools/dialogtriangle.cpp +++ b/src/app/dialogs/tools/dialogtriangle.cpp @@ -43,6 +43,7 @@ DialogTriangle::DialogTriangle(const VContainer *data, QWidget *parent) { ui->setupUi(this); labelEditNamePoint = ui->labelEditNamePoint; + InitOkCancel(ui); flagName = false; CheckState(); From ffd898be7d58df20974e9547513e3f0536e7ff7a Mon Sep 17 00:00:00 2001 From: dismine Date: Thu, 19 Jun 2014 15:01:38 +0300 Subject: [PATCH 20/20] Formula height cannot be initialized in initialization list. --HG-- branch : feature --- src/app/dialogs/tools/dialogalongline.cpp | 3 ++- src/app/dialogs/tools/dialogarc.cpp | 6 ++++-- src/app/dialogs/tools/dialogbisector.cpp | 3 ++- src/app/dialogs/tools/dialogcutarc.cpp | 3 ++- src/app/dialogs/tools/dialogcutspline.cpp | 3 ++- src/app/dialogs/tools/dialogcutsplinepath.cpp | 3 ++- src/app/dialogs/tools/dialogeditwrongformula.cpp | 4 ++-- src/app/dialogs/tools/dialogendline.cpp | 3 ++- src/app/dialogs/tools/dialognormal.cpp | 4 ++-- src/app/dialogs/tools/dialogpointofcontact.cpp | 3 ++- src/app/dialogs/tools/dialogshoulderpoint.cpp | 4 ++-- src/app/dialogs/tools/dialogsinglepoint.cpp | 3 +-- src/app/dialogs/tools/dialogspline.cpp | 4 ++-- 13 files changed, 27 insertions(+), 19 deletions(-) diff --git a/src/app/dialogs/tools/dialogalongline.cpp b/src/app/dialogs/tools/dialogalongline.cpp index 4907d9ea8..b7dad8c54 100644 --- a/src/app/dialogs/tools/dialogalongline.cpp +++ b/src/app/dialogs/tools/dialogalongline.cpp @@ -39,12 +39,13 @@ */ DialogAlongLine::DialogAlongLine(const VContainer *data, QWidget *parent) :DialogTool(data, parent), ui(new Ui::DialogAlongLine), number(0), pointName(QString()), typeLine(QString()), - formula(QString()), firstPointId(0), secondPointId(0), formulaBaseHeight(ui->plainTextEditFormula->height()) + formula(QString()), firstPointId(0), secondPointId(0), formulaBaseHeight(0) { ui->setupUi(this); InitVariables(ui); InitFormulaUI(ui); labelEditNamePoint = ui->labelEditNamePoint; + this->formulaBaseHeight = ui->plainTextEditFormula->height(); InitOkCancelApply(ui); flagFormula = false; diff --git a/src/app/dialogs/tools/dialogarc.cpp b/src/app/dialogs/tools/dialogarc.cpp index e992c745f..77cc8b597 100644 --- a/src/app/dialogs/tools/dialogarc.cpp +++ b/src/app/dialogs/tools/dialogarc.cpp @@ -44,14 +44,16 @@ DialogArc::DialogArc(const VContainer *data, QWidget *parent) :DialogTool(data, parent), ui(new Ui::DialogArc), flagRadius(false), flagF1(false), flagF2(false), timerRadius(nullptr), timerF1(nullptr), timerF2(nullptr), center(0), radius(QString()), f1(QString()), - f2(QString()), formulaBaseHeight(ui->plainTextEditFormula->height()), - formulaBaseHeightF1(ui->plainTextEditF1->height()), formulaBaseHeightF2(ui->plainTextEditF2->height()) + f2(QString()), formulaBaseHeight(0), formulaBaseHeightF1(0), formulaBaseHeightF2(0) { ui->setupUi(this); InitVariables(ui); plainTextEditFormula = ui->plainTextEditFormula; + this->formulaBaseHeight = ui->plainTextEditFormula->height(); + this->formulaBaseHeightF1 = ui->plainTextEditF1->height(); + this->formulaBaseHeightF2 = ui->plainTextEditF2->height(); timerRadius = new QTimer(this); connect(timerRadius, &QTimer::timeout, this, &DialogArc::EvalRadius); diff --git a/src/app/dialogs/tools/dialogbisector.cpp b/src/app/dialogs/tools/dialogbisector.cpp index bf07c35d7..3610409fd 100644 --- a/src/app/dialogs/tools/dialogbisector.cpp +++ b/src/app/dialogs/tools/dialogbisector.cpp @@ -41,12 +41,13 @@ DialogBisector::DialogBisector(const VContainer *data, QWidget *parent) :DialogTool(data, parent), ui(new Ui::DialogBisector), number(0), pointName(QString()), typeLine(QString()), formula(QString()), firstPointId(0), secondPointId(0), thirdPointId(0), - formulaBaseHeight(ui->plainTextEditFormula->height()) + formulaBaseHeight(0) { ui->setupUi(this); InitVariables(ui); InitFormulaUI(ui); labelEditNamePoint = ui->labelEditNamePoint; + this->formulaBaseHeight = ui->plainTextEditFormula->height(); InitOkCancelApply(ui); flagFormula = false; diff --git a/src/app/dialogs/tools/dialogcutarc.cpp b/src/app/dialogs/tools/dialogcutarc.cpp index 2f618fcba..b80da3206 100644 --- a/src/app/dialogs/tools/dialogcutarc.cpp +++ b/src/app/dialogs/tools/dialogcutarc.cpp @@ -40,12 +40,13 @@ */ DialogCutArc::DialogCutArc(const VContainer *data, QWidget *parent) : DialogTool(data, parent), ui(new Ui::DialogCutArc), pointName(QString()), formula(QString()), arcId(0), - formulaBaseHeight(ui->plainTextEditFormula->height()) + formulaBaseHeight(0) { ui->setupUi(this); InitVariables(ui); InitFormulaUI(ui); labelEditNamePoint = ui->labelEditNamePoint; + this->formulaBaseHeight = ui->plainTextEditFormula->height(); InitOkCancelApply(ui); flagFormula = false; diff --git a/src/app/dialogs/tools/dialogcutspline.cpp b/src/app/dialogs/tools/dialogcutspline.cpp index 110d99cb9..bfb5e1fb7 100644 --- a/src/app/dialogs/tools/dialogcutspline.cpp +++ b/src/app/dialogs/tools/dialogcutspline.cpp @@ -40,12 +40,13 @@ */ DialogCutSpline::DialogCutSpline(const VContainer *data, QWidget *parent) :DialogTool(data, parent), ui(new Ui::DialogCutSpline), pointName(QString()), formula(QString()), splineId(0), - formulaBaseHeight(ui->plainTextEditFormula->height()) + formulaBaseHeight(0) { ui->setupUi(this); InitVariables(ui); InitFormulaUI(ui); labelEditNamePoint = ui->labelEditNamePoint; + this->formulaBaseHeight = ui->plainTextEditFormula->height(); InitOkCancel(ui); flagFormula = false; diff --git a/src/app/dialogs/tools/dialogcutsplinepath.cpp b/src/app/dialogs/tools/dialogcutsplinepath.cpp index bcebf1611..769fffe8b 100644 --- a/src/app/dialogs/tools/dialogcutsplinepath.cpp +++ b/src/app/dialogs/tools/dialogcutsplinepath.cpp @@ -40,12 +40,13 @@ */ DialogCutSplinePath::DialogCutSplinePath(const VContainer *data, QWidget *parent) :DialogTool(data, parent), ui(new Ui::DialogCutSplinePath), pointName(QString()), formula(QString()), - splinePathId(0), formulaBaseHeight(ui->plainTextEditFormula->height()) + splinePathId(0), formulaBaseHeight(0) { ui->setupUi(this); InitVariables(ui); InitFormulaUI(ui); labelEditNamePoint = ui->labelEditNamePoint; + this->formulaBaseHeight = ui->plainTextEditFormula->height(); InitOkCancel(ui); flagFormula = false; diff --git a/src/app/dialogs/tools/dialogeditwrongformula.cpp b/src/app/dialogs/tools/dialogeditwrongformula.cpp index ef0d5702e..28fe4afe6 100644 --- a/src/app/dialogs/tools/dialogeditwrongformula.cpp +++ b/src/app/dialogs/tools/dialogeditwrongformula.cpp @@ -31,12 +31,12 @@ //--------------------------------------------------------------------------------------------------------------------- DialogEditWrongFormula::DialogEditWrongFormula(const VContainer *data, QWidget *parent) - :DialogTool(data, parent), ui(new Ui::DialogEditWrongFormula), formula(QString()), - formulaBaseHeight(ui->plainTextEditFormula->height()) + :DialogTool(data, parent), ui(new Ui::DialogEditWrongFormula), formula(QString()), formulaBaseHeight(0) { ui->setupUi(this); InitVariables(ui); InitFormulaUI(ui); + this->formulaBaseHeight = ui->plainTextEditFormula->height(); InitOkCancel(ui); flagFormula = false; diff --git a/src/app/dialogs/tools/dialogendline.cpp b/src/app/dialogs/tools/dialogendline.cpp index 70a016fd5..5b7770a1c 100644 --- a/src/app/dialogs/tools/dialogendline.cpp +++ b/src/app/dialogs/tools/dialogendline.cpp @@ -40,12 +40,13 @@ */ DialogEndLine::DialogEndLine(const VContainer *data, QWidget *parent) :DialogTool(data, parent), ui(new Ui::DialogEndLine), pointName(QString()), typeLine(QString()), formula(QString()), - angle(0), basePointId(0), formulaBaseHeight(ui->plainTextEditFormula->height()) + angle(0), basePointId(0), formulaBaseHeight(0) { ui->setupUi(this); InitVariables(ui); InitFormulaUI(ui); labelEditNamePoint = ui->labelEditNamePoint; + this->formulaBaseHeight = ui->plainTextEditFormula->height(); InitOkCancelApply(ui); flagFormula = false; diff --git a/src/app/dialogs/tools/dialognormal.cpp b/src/app/dialogs/tools/dialognormal.cpp index f425a283a..b306c45a1 100644 --- a/src/app/dialogs/tools/dialognormal.cpp +++ b/src/app/dialogs/tools/dialognormal.cpp @@ -37,13 +37,13 @@ */ DialogNormal::DialogNormal(const VContainer *data, QWidget *parent) :DialogTool(data, parent), ui(new Ui::DialogNormal), number(0), pointName(QString()), typeLine(QString()), - formula(QString()), angle(0), firstPointId(0), secondPointId(0), - formulaBaseHeight(ui->plainTextEditFormula->height()) + formula(QString()), angle(0), firstPointId(0), secondPointId(0), formulaBaseHeight(0) { ui->setupUi(this); InitVariables(ui); InitFormulaUI(ui); labelEditNamePoint = ui->labelEditNamePoint; + this->formulaBaseHeight = ui->plainTextEditFormula->height(); InitOkCancelApply(ui); flagFormula = false; diff --git a/src/app/dialogs/tools/dialogpointofcontact.cpp b/src/app/dialogs/tools/dialogpointofcontact.cpp index 0b2293fd3..322471c8f 100644 --- a/src/app/dialogs/tools/dialogpointofcontact.cpp +++ b/src/app/dialogs/tools/dialogpointofcontact.cpp @@ -39,12 +39,13 @@ */ DialogPointOfContact::DialogPointOfContact(const VContainer *data, QWidget *parent) :DialogTool(data, parent), ui(new Ui::DialogPointOfContact), number(0), pointName(QString()), radius(QString()), - center(0), firstPoint(0), secondPoint(0), formulaBaseHeight(ui->plainTextEditFormula->height()) + center(0), firstPoint(0), secondPoint(0), formulaBaseHeight(0) { ui->setupUi(this); InitVariables(ui); InitFormulaUI(ui); labelEditNamePoint = ui->labelEditNamePoint; + this->formulaBaseHeight = ui->plainTextEditFormula->height(); InitOkCancelApply(ui); flagFormula = false; diff --git a/src/app/dialogs/tools/dialogshoulderpoint.cpp b/src/app/dialogs/tools/dialogshoulderpoint.cpp index 63a08c8b5..d88e15e1a 100644 --- a/src/app/dialogs/tools/dialogshoulderpoint.cpp +++ b/src/app/dialogs/tools/dialogshoulderpoint.cpp @@ -40,13 +40,13 @@ */ DialogShoulderPoint::DialogShoulderPoint(const VContainer *data, QWidget *parent) :DialogTool(data, parent), ui(new Ui::DialogShoulderPoint), number(0), pointName(QString()), - typeLine(QString()), formula(QString()), p1Line(0), p2Line(0), pShoulder(0), - formulaBaseHeight(ui->plainTextEditFormula->height()) + typeLine(QString()), formula(QString()), p1Line(0), p2Line(0), pShoulder(0), formulaBaseHeight(0) { ui->setupUi(this); InitVariables(ui); InitFormulaUI(ui); labelEditNamePoint = ui->labelEditNamePoint; + this->formulaBaseHeight = ui->plainTextEditFormula->height(); InitOkCancelApply(ui); flagFormula = false; diff --git a/src/app/dialogs/tools/dialogsinglepoint.cpp b/src/app/dialogs/tools/dialogsinglepoint.cpp index e7caa1d34..596a8a17a 100644 --- a/src/app/dialogs/tools/dialogsinglepoint.cpp +++ b/src/app/dialogs/tools/dialogsinglepoint.cpp @@ -36,8 +36,7 @@ * @param parent parent widget */ DialogSinglePoint::DialogSinglePoint(const VContainer *data, QWidget *parent) - :DialogTool(data, parent), ui(new Ui::DialogSinglePoint), name(QString()), - point(QPointF()) + :DialogTool(data, parent), ui(new Ui::DialogSinglePoint), name(QString()), point(QPointF()) { ui->setupUi(this); ui->doubleSpinBoxX->setRange(0, qApp->fromPixel(SceneSize)); diff --git a/src/app/dialogs/tools/dialogspline.cpp b/src/app/dialogs/tools/dialogspline.cpp index bf5a8df41..4640380cb 100644 --- a/src/app/dialogs/tools/dialogspline.cpp +++ b/src/app/dialogs/tools/dialogspline.cpp @@ -39,8 +39,8 @@ * @param parent parent widget */ DialogSpline::DialogSpline(const VContainer *data, QWidget *parent) - :DialogTool(data, parent), ui(new Ui::DialogSpline), number(0), p1(0), p4(0), angle1(0), angle2(0), - kAsm1(1), kAsm2(1), kCurve(1) + :DialogTool(data, parent), ui(new Ui::DialogSpline), number(0), p1(0), p4(0), angle1(0), angle2(0), kAsm1(1), + kAsm2(1), kCurve(1) { ui->setupUi(this); InitOkCancel(ui);