diff --git a/GUI/coregui/Models/BeamAngleItems.cpp b/GUI/coregui/Models/BeamAngleItems.cpp index f3cee16c93179e007700b7e5ba9f832bca10a8e7..220f833979d6ffc0dbb7f16d46e937fac476e574 100644 --- a/GUI/coregui/Models/BeamAngleItems.cpp +++ b/GUI/coregui/Models/BeamAngleItems.cpp @@ -27,7 +27,7 @@ BeamInclinationAngleItem::BeamInclinationAngleItem() cache->setVisible(false); cache->setLimits(AttLimits::limited(0.0, 90.0)); cache->setDecimals(3); - setChildValue(BeamDistributionItem::P_CACHED_VALUE, 0.2); + setItemValue(BeamDistributionItem::P_CACHED_VALUE, 0.2); SessionItem *distribution = dynamic_cast<DistributionNoneItem *>(getGroupItem(P_DISTRIBUTION)); Q_ASSERT(distribution); @@ -50,7 +50,7 @@ std::unique_ptr<IDistribution1D> BeamInclinationAngleItem::createDistribution1D( BeamAzimuthalAngleItem::BeamAzimuthalAngleItem() : BeamDistributionItem(Constants::BeamAzimuthalAngleType) { - setChildValue(BeamDistributionItem::P_CACHED_VALUE, 0.0); + setItemValue(BeamDistributionItem::P_CACHED_VALUE, 0.0); auto cache = getItem(BeamDistributionItem::P_CACHED_VALUE); cache->setVisible(false); cache->setLimits(AttLimits::limited(-90.0, 90.0)); @@ -80,37 +80,37 @@ BeamAngleHelper::creatAngleDistribution(DistributionItem *distributionItem) std::unique_ptr<IDistribution1D> P_distribution {}; if (distributionItem->modelType() == Constants::DistributionGateType) { double min - = distributionItem->getChildValue(DistributionGateItem::P_MIN).toDouble(); + = distributionItem->getItemValue(DistributionGateItem::P_MIN).toDouble(); double max - = distributionItem->getChildValue(DistributionGateItem::P_MAX).toDouble(); + = distributionItem->getItemValue(DistributionGateItem::P_MAX).toDouble(); P_distribution = std::move( GUIHelpers::make_unique<DistributionGate>(Units::deg2rad(min), Units::deg2rad(max))); } else if (distributionItem->modelType() == Constants::DistributionLorentzType) { double mean - = distributionItem->getChildValue(DistributionLorentzItem::P_MEAN).toDouble(); + = distributionItem->getItemValue(DistributionLorentzItem::P_MEAN).toDouble(); double hwhm - = distributionItem->getChildValue(DistributionLorentzItem::P_HWHM).toDouble(); + = distributionItem->getItemValue(DistributionLorentzItem::P_HWHM).toDouble(); P_distribution = std::move(GUIHelpers::make_unique<DistributionLorentz>( Units::deg2rad(mean), Units::deg2rad(hwhm))); } else if (distributionItem->modelType() == Constants::DistributionGaussianType) { double mean - = distributionItem->getChildValue(DistributionGaussianItem::P_MEAN).toDouble(); - double std_dev = distributionItem->getChildValue( + = distributionItem->getItemValue(DistributionGaussianItem::P_MEAN).toDouble(); + double std_dev = distributionItem->getItemValue( DistributionGaussianItem::P_STD_DEV).toDouble(); P_distribution = std::move(GUIHelpers::make_unique<DistributionGaussian>( Units::deg2rad(mean), Units::deg2rad(std_dev))); } else if (distributionItem->modelType() == Constants::DistributionLogNormalType) { - double median = distributionItem->getChildValue(DistributionLogNormalItem::P_MEDIAN) + double median = distributionItem->getItemValue(DistributionLogNormalItem::P_MEDIAN) .toDouble(); - double scale_par = distributionItem->getChildValue( + double scale_par = distributionItem->getItemValue( DistributionLogNormalItem::P_SCALE_PAR).toDouble(); P_distribution = std::move( GUIHelpers::make_unique<DistributionLogNormal>(Units::deg2rad(median), scale_par)); } else if (distributionItem->modelType() == Constants::DistributionCosineType) { double mean - = distributionItem->getChildValue(DistributionCosineItem::P_MEAN).toDouble(); + = distributionItem->getItemValue(DistributionCosineItem::P_MEAN).toDouble(); double sigma - = distributionItem->getChildValue(DistributionCosineItem::P_SIGMA).toDouble(); + = distributionItem->getItemValue(DistributionCosineItem::P_SIGMA).toDouble(); P_distribution = std::move(GUIHelpers::make_unique<DistributionCosine>( Units::deg2rad(mean), Units::deg2rad(sigma))); } diff --git a/GUI/coregui/Models/BeamDistributionItem.cpp b/GUI/coregui/Models/BeamDistributionItem.cpp index 0144731958582cc988a6127a3ead2f1c03090bae..c806a20f441b5feeb55279bc43c3f072c2835044 100644 --- a/GUI/coregui/Models/BeamDistributionItem.cpp +++ b/GUI/coregui/Models/BeamDistributionItem.cpp @@ -64,11 +64,11 @@ BeamDistributionItem::getParameterDistributionForName(const std::string ¶met auto P_distribution = createDistribution1D(); if (P_distribution) { - int nbr_samples = distributionItem->getChildValue( + int nbr_samples = distributionItem->getItemValue( DistributionItem::P_NUMBER_OF_SAMPLES).toInt(); double sigma_factor(0); if (distributionItem->isTag(DistributionItem::P_SIGMA_FACTOR)) { - sigma_factor = distributionItem->getChildValue( + sigma_factor = distributionItem->getItemValue( DistributionItem::P_SIGMA_FACTOR).toInt(); } diff --git a/GUI/coregui/Models/BeamItem.cpp b/GUI/coregui/Models/BeamItem.cpp index 0866825f1a6ef73cf84a80466566e141f6507649..e04c868cb5da5bdc05fe411b6ec5edaf9af98f11 100644 --- a/GUI/coregui/Models/BeamItem.cpp +++ b/GUI/coregui/Models/BeamItem.cpp @@ -43,23 +43,23 @@ BeamItem::BeamItem() : SessionItem(Constants::BeamType) double BeamItem::getIntensity() const { ScientificDoubleProperty intensity - = getChildValue(P_INTENSITY).value<ScientificDoubleProperty>(); + = getItemValue(P_INTENSITY).value<ScientificDoubleProperty>(); return intensity.getValue(); } void BeamItem::setIntensity(double value) { ScientificDoubleProperty intensity - = getChildValue(P_INTENSITY).value<ScientificDoubleProperty>(); + = getItemValue(P_INTENSITY).value<ScientificDoubleProperty>(); intensity.setValue(value); - setChildValue(P_INTENSITY, intensity.getVariant()); + setItemValue(P_INTENSITY, intensity.getVariant()); } double BeamItem::getWavelength() const { SessionItem *beamWavelength = getGroupItem(P_WAVELENGTH); Q_ASSERT(beamWavelength); - return beamWavelength->getChildValue(BeamDistributionItem::P_CACHED_VALUE).toDouble(); + return beamWavelength->getItemValue(BeamDistributionItem::P_CACHED_VALUE).toDouble(); } void BeamItem::setWavelength(double value, const QString &distribution_name) @@ -70,14 +70,14 @@ void BeamItem::setWavelength(double value, const QString &distribution_name) SessionItem *distributionItem = beamWavelength->setGroupProperty( BeamDistributionItem::P_DISTRIBUTION, Constants::DistributionNoneType); Q_ASSERT(distributionItem); - distributionItem->setChildValue(DistributionNoneItem::P_VALUE, value); + distributionItem->setItemValue(DistributionNoneItem::P_VALUE, value); } double BeamItem::getInclinationAngle() const { SessionItem *angleItem = getGroupItem(P_INCLINATION_ANGLE); Q_ASSERT(angleItem); - return angleItem->getChildValue(BeamDistributionItem::P_CACHED_VALUE).toDouble(); + return angleItem->getItemValue(BeamDistributionItem::P_CACHED_VALUE).toDouble(); } void BeamItem::setInclinationAngle(double value, const QString &distribution_name) @@ -88,14 +88,14 @@ void BeamItem::setInclinationAngle(double value, const QString &distribution_nam SessionItem *distributionItem = angleItem->setGroupProperty( BeamDistributionItem::P_DISTRIBUTION, Constants::DistributionNoneType); Q_ASSERT(distributionItem); - distributionItem->setChildValue(DistributionNoneItem::P_VALUE, value); + distributionItem->setItemValue(DistributionNoneItem::P_VALUE, value); } double BeamItem::getAzimuthalAngle() const { SessionItem *angleItem = getGroupItem(P_AZIMUTHAL_ANGLE); Q_ASSERT(angleItem); - return angleItem->getChildValue(BeamDistributionItem::P_CACHED_VALUE).toDouble(); + return angleItem->getItemValue(BeamDistributionItem::P_CACHED_VALUE).toDouble(); } void BeamItem::setAzimuthalAngle(double value, const QString &distribution_name) @@ -106,5 +106,5 @@ void BeamItem::setAzimuthalAngle(double value, const QString &distribution_name) SessionItem *distributionItem = angleItem->setGroupProperty( BeamDistributionItem::P_DISTRIBUTION, Constants::DistributionNoneType); Q_ASSERT(distributionItem); - distributionItem->setChildValue(DistributionNoneItem::P_VALUE, value); + distributionItem->setItemValue(DistributionNoneItem::P_VALUE, value); } diff --git a/GUI/coregui/Models/BeamWavelengthItem.cpp b/GUI/coregui/Models/BeamWavelengthItem.cpp index 34b4f588a5a9b836e18b75d9c1b01aa3b7ae2dc3..05dbd159d9f913ac7e42acf638e3cb23d6e17930 100644 --- a/GUI/coregui/Models/BeamWavelengthItem.cpp +++ b/GUI/coregui/Models/BeamWavelengthItem.cpp @@ -22,5 +22,5 @@ BeamWavelengthItem::BeamWavelengthItem() cache->setVisible(false); cache->setLimits(AttLimits::lowerLimited(1e-4)); cache->setDecimals(4); - setChildValue(BeamDistributionItem::P_CACHED_VALUE, 0.1); + setItemValue(BeamDistributionItem::P_CACHED_VALUE, 0.1); } diff --git a/GUI/coregui/Models/DistributionItem.cpp b/GUI/coregui/Models/DistributionItem.cpp index 5a35211d2b5030b7891068e938f6968d113ae1c0..d8bdc310dc0014d48494acca19fa4018463d22e3 100644 --- a/GUI/coregui/Models/DistributionItem.cpp +++ b/GUI/coregui/Models/DistributionItem.cpp @@ -55,7 +55,7 @@ std::unique_ptr<IDistribution1D> DistributionNoneItem::createDistribution() cons void DistributionNoneItem::init_parameters(double value, PropertyAttribute attribute) { - setChildValue(DistributionNoneItem::P_VALUE, value); + setItemValue(DistributionNoneItem::P_VALUE, value); // setPropertyAttribute(DistributionNoneItem::P_VALUE, attribute); } @@ -75,8 +75,8 @@ DistributionGateItem::DistributionGateItem() std::unique_ptr<IDistribution1D> DistributionGateItem::createDistribution() const { - double min = getChildValue(P_MIN).toDouble(); - double max = getChildValue(P_MAX).toDouble(); + double min = getItemValue(P_MIN).toDouble(); + double max = getItemValue(P_MAX).toDouble(); return GUIHelpers::make_unique<DistributionGate>(min, max); } @@ -84,9 +84,9 @@ void DistributionGateItem::init_parameters(double value, PropertyAttribute attri { double sigma(0.1*std::abs(value)); if(sigma == 0.0) sigma = 0.1; - setChildValue(P_MIN, value - sigma); + setItemValue(P_MIN, value - sigma); // setPropertyAttribute(P_MIN, attribute); - setChildValue(P_MAX, value + sigma); + setItemValue(P_MAX, value + sigma); // setPropertyAttribute(P_MAX, attribute); } @@ -106,8 +106,8 @@ DistributionLorentzItem::DistributionLorentzItem() std::unique_ptr<IDistribution1D> DistributionLorentzItem::createDistribution() const { - double mean = getChildValue(P_MEAN).toDouble(); - double hwhm = getChildValue(P_HWHM).toDouble(); + double mean = getItemValue(P_MEAN).toDouble(); + double hwhm = getItemValue(P_HWHM).toDouble(); return GUIHelpers::make_unique<DistributionLorentz>(mean, hwhm); } @@ -116,9 +116,9 @@ void DistributionLorentzItem::init_parameters(double value, PropertyAttribute at double sigma(0.1*std::abs(value)); if(sigma == 0.0) sigma = 0.1; - setChildValue(P_MEAN, value); + setItemValue(P_MEAN, value); // setPropertyAttribute(P_MEAN, attribute); - setChildValue(P_HWHM, sigma); + setItemValue(P_HWHM, sigma); getItem(P_HWHM)->setLimits(AttLimits::lowerLimited(0.0)); } @@ -138,8 +138,8 @@ DistributionGaussianItem::DistributionGaussianItem() std::unique_ptr<IDistribution1D> DistributionGaussianItem::createDistribution() const { - double mean = getChildValue(P_MEAN).toDouble(); - double std_dev = getChildValue(P_STD_DEV).toDouble(); + double mean = getItemValue(P_MEAN).toDouble(); + double std_dev = getItemValue(P_STD_DEV).toDouble(); return GUIHelpers::make_unique<DistributionGaussian>(mean, std_dev); } @@ -148,9 +148,9 @@ void DistributionGaussianItem::init_parameters(double value, PropertyAttribute a double sigma(0.1*std::abs(value)); if(sigma == 0.0) sigma = 0.1; - setChildValue(P_MEAN, value); + setItemValue(P_MEAN, value); // setPropertyAttribute(P_MEAN, attribute); - setChildValue(P_STD_DEV, sigma); + setItemValue(P_STD_DEV, sigma); getItem(P_STD_DEV)->setLimits(AttLimits::lowerLimited(0.0)); } @@ -170,8 +170,8 @@ DistributionLogNormalItem::DistributionLogNormalItem() std::unique_ptr<IDistribution1D> DistributionLogNormalItem::createDistribution() const { - double median = getChildValue(P_MEDIAN).toDouble(); - double scale_par = getChildValue(P_SCALE_PAR).toDouble(); + double median = getItemValue(P_MEDIAN).toDouble(); + double scale_par = getItemValue(P_SCALE_PAR).toDouble(); return GUIHelpers::make_unique<DistributionLogNormal>(median, scale_par); } @@ -180,9 +180,9 @@ void DistributionLogNormalItem::init_parameters(double value, PropertyAttribute double sigma(0.1*std::abs(value)); if(sigma == 0.0) sigma = 0.1; - setChildValue(P_MEDIAN, value); + setItemValue(P_MEDIAN, value); // setPropertyAttribute(P_MEDIAN, attribute); - setChildValue(P_SCALE_PAR, sigma); + setItemValue(P_SCALE_PAR, sigma); getItem(P_SCALE_PAR)->setLimits(AttLimits::lowerLimited(0.0)); } @@ -202,8 +202,8 @@ DistributionCosineItem::DistributionCosineItem() std::unique_ptr<IDistribution1D> DistributionCosineItem::createDistribution() const { - double mean = getChildValue(P_MEAN).toDouble(); - double sigma = getChildValue(P_SIGMA).toDouble(); + double mean = getItemValue(P_MEAN).toDouble(); + double sigma = getItemValue(P_SIGMA).toDouble(); return GUIHelpers::make_unique<DistributionCosine>(mean, sigma); } @@ -212,8 +212,8 @@ void DistributionCosineItem::init_parameters(double value, PropertyAttribute att double sigma(0.1*std::abs(value)); if(sigma == 0.0) sigma = 0.1; - setChildValue(P_MEAN, value); + setItemValue(P_MEAN, value); // setPropertyAttribute(P_MEAN, attribute); - setChildValue(P_SIGMA, sigma); + setItemValue(P_SIGMA, sigma); getItem(P_SIGMA)->setLimits(AttLimits::lowerLimited(0.0)); } diff --git a/GUI/coregui/Models/DomainObjectBuilder.cpp b/GUI/coregui/Models/DomainObjectBuilder.cpp index 7266dc33d1a2ee50020742ec76c932d019ba8545..fc7221c7f4ab9ce5a32c3411395bdd1c208dd821 100644 --- a/GUI/coregui/Models/DomainObjectBuilder.cpp +++ b/GUI/coregui/Models/DomainObjectBuilder.cpp @@ -89,7 +89,7 @@ std::unique_ptr<ParticleLayout> DomainObjectBuilder::buildParticleLayout( if (children[i]->modelType() == Constants::ParticleDistributionType) { auto prop = children[i] - ->getChildValue(ParticleDistributionItem::P_DISTRIBUTED_PARAMETER) + ->getItemValue(ParticleDistributionItem::P_DISTRIBUTED_PARAMETER) .value<ComboProperty>(); QString par_name = prop.getValue(); if (par_name == ParticleDistributionItem::NO_SELECTION) { diff --git a/GUI/coregui/Models/FTDecayFunctionItems.cpp b/GUI/coregui/Models/FTDecayFunctionItems.cpp index 58caa27a2d5a0363609e88eef0da283b68b79cce..0220be67a46d20c900149922d1b39582cdc37775 100644 --- a/GUI/coregui/Models/FTDecayFunctionItems.cpp +++ b/GUI/coregui/Models/FTDecayFunctionItems.cpp @@ -39,7 +39,7 @@ FTDecayFunction1DCauchyItem::FTDecayFunction1DCauchyItem() IFTDecayFunction1D *FTDecayFunction1DCauchyItem::createFTDecayFunction() const { return new FTDecayFunction1DCauchy( - getChildValue(P_DECAY_LENGTH).toDouble() ); + getItemValue(P_DECAY_LENGTH).toDouble() ); } // Gauss @@ -52,7 +52,7 @@ FTDecayFunction1DGaussItem::FTDecayFunction1DGaussItem() IFTDecayFunction1D *FTDecayFunction1DGaussItem::createFTDecayFunction() const { return new FTDecayFunction1DGauss( - getChildValue(P_DECAY_LENGTH).toDouble() ); + getItemValue(P_DECAY_LENGTH).toDouble() ); } // Triangle @@ -65,7 +65,7 @@ FTDecayFunction1DTriangleItem::FTDecayFunction1DTriangleItem() IFTDecayFunction1D *FTDecayFunction1DTriangleItem::createFTDecayFunction() const { return new FTDecayFunction1DTriangle( - getChildValue(P_DECAY_LENGTH).toDouble() ); + getItemValue(P_DECAY_LENGTH).toDouble() ); } // Voigt @@ -79,8 +79,8 @@ FTDecayFunction1DVoigtItem::FTDecayFunction1DVoigtItem() IFTDecayFunction1D *FTDecayFunction1DVoigtItem::createFTDecayFunction() const { return new FTDecayFunction1DVoigt( - getChildValue(P_DECAY_LENGTH).toDouble(), - getChildValue(P_ETA).toDouble() ); + getItemValue(P_DECAY_LENGTH).toDouble(), + getItemValue(P_ETA).toDouble() ); } FTDecayFunction2DCauchyItem::FTDecayFunction2DCauchyItem() @@ -93,9 +93,9 @@ FTDecayFunction2DCauchyItem::FTDecayFunction2DCauchyItem() IFTDecayFunction2D *FTDecayFunction2DCauchyItem::createFTDecayFunction() const { auto *p_result - = new FTDecayFunction2DCauchy(getChildValue(P_DECAY_LENGTH_X).toDouble(), - getChildValue(P_DECAY_LENGTH_Y).toDouble()); - double gamma = Units::deg2rad(getChildValue(P_GAMMA).toDouble()); + = new FTDecayFunction2DCauchy(getItemValue(P_DECAY_LENGTH_X).toDouble(), + getItemValue(P_DECAY_LENGTH_Y).toDouble()); + double gamma = Units::deg2rad(getItemValue(P_GAMMA).toDouble()); p_result->setGamma(gamma); return p_result; } @@ -110,9 +110,9 @@ FTDecayFunction2DGaussItem::FTDecayFunction2DGaussItem() IFTDecayFunction2D *FTDecayFunction2DGaussItem::createFTDecayFunction() const { auto *p_result - = new FTDecayFunction2DGauss(getChildValue(P_DECAY_LENGTH_X).toDouble(), - getChildValue(P_DECAY_LENGTH_Y).toDouble()); - double gamma = Units::deg2rad(getChildValue(P_GAMMA).toDouble()); + = new FTDecayFunction2DGauss(getItemValue(P_DECAY_LENGTH_X).toDouble(), + getItemValue(P_DECAY_LENGTH_Y).toDouble()); + double gamma = Units::deg2rad(getItemValue(P_GAMMA).toDouble()); p_result->setGamma(gamma); return p_result; } @@ -128,10 +128,10 @@ FTDecayFunction2DVoigtItem::FTDecayFunction2DVoigtItem() IFTDecayFunction2D *FTDecayFunction2DVoigtItem::createFTDecayFunction() const { auto *p_result - = new FTDecayFunction2DVoigt(getChildValue(P_DECAY_LENGTH_X).toDouble(), - getChildValue(P_DECAY_LENGTH_Y).toDouble(), - getChildValue(P_ETA).toDouble()); - double gamma = Units::deg2rad(getChildValue(P_GAMMA).toDouble()); + = new FTDecayFunction2DVoigt(getItemValue(P_DECAY_LENGTH_X).toDouble(), + getItemValue(P_DECAY_LENGTH_Y).toDouble(), + getItemValue(P_ETA).toDouble()); + double gamma = Units::deg2rad(getItemValue(P_GAMMA).toDouble()); p_result->setGamma(gamma); return p_result; } diff --git a/GUI/coregui/Models/FTDistributionItems.cpp b/GUI/coregui/Models/FTDistributionItems.cpp index d20a6f390b4ae936aceef7d9a50f2aa8d41eb4d1..d5e971c8f44152dc9166ba7a18e780ada8ca2272 100644 --- a/GUI/coregui/Models/FTDistributionItems.cpp +++ b/GUI/coregui/Models/FTDistributionItems.cpp @@ -40,7 +40,7 @@ FTDistribution1DCauchyItem::FTDistribution1DCauchyItem() IFTDistribution1D *FTDistribution1DCauchyItem::createFTDistribution() const { return new FTDistribution1DCauchy( - getChildValue(P_CORR_LENGTH).toDouble() ); + getItemValue(P_CORR_LENGTH).toDouble() ); } // Gauss @@ -53,7 +53,7 @@ FTDistribution1DGaussItem::FTDistribution1DGaussItem() IFTDistribution1D *FTDistribution1DGaussItem::createFTDistribution() const { return new FTDistribution1DGauss( - getChildValue(P_CORR_LENGTH).toDouble() ); + getItemValue(P_CORR_LENGTH).toDouble() ); } // Gate @@ -66,7 +66,7 @@ FTDistribution1DGateItem::FTDistribution1DGateItem() IFTDistribution1D *FTDistribution1DGateItem::createFTDistribution() const { return new FTDistribution1DGate( - getChildValue(P_CORR_LENGTH).toDouble() ); + getItemValue(P_CORR_LENGTH).toDouble() ); } // Triangle @@ -79,7 +79,7 @@ FTDistribution1DTriangleItem::FTDistribution1DTriangleItem() IFTDistribution1D *FTDistribution1DTriangleItem::createFTDistribution() const { return new FTDistribution1DTriangle( - getChildValue(P_CORR_LENGTH).toDouble() ); + getItemValue(P_CORR_LENGTH).toDouble() ); } // Cosine @@ -92,7 +92,7 @@ FTDistribution1DCosineItem::FTDistribution1DCosineItem() IFTDistribution1D *FTDistribution1DCosineItem::createFTDistribution() const { return new FTDistribution1DCosine( - getChildValue(P_CORR_LENGTH).toDouble() ); + getItemValue(P_CORR_LENGTH).toDouble() ); } // Voigt @@ -106,8 +106,8 @@ FTDistribution1DVoigtItem::FTDistribution1DVoigtItem() IFTDistribution1D *FTDistribution1DVoigtItem::createFTDistribution() const { return new FTDistribution1DVoigt( - getChildValue(P_CORR_LENGTH).toDouble(), - getChildValue(P_ETA).toDouble() ); + getItemValue(P_CORR_LENGTH).toDouble(), + getItemValue(P_ETA).toDouble() ); } @@ -124,10 +124,10 @@ FTDistribution2DCauchyItem::FTDistribution2DCauchyItem() IFTDistribution2D *FTDistribution2DCauchyItem::createFTDistribution() const { auto *p_result = new FTDistribution2DCauchy( - getChildValue(P_CORR_LENGTH_X).toDouble(), - getChildValue(P_CORR_LENGTH_Y).toDouble() + getItemValue(P_CORR_LENGTH_X).toDouble(), + getItemValue(P_CORR_LENGTH_Y).toDouble() ); - double gamma = Units::deg2rad(getChildValue(P_GAMMA).toDouble() ); + double gamma = Units::deg2rad(getItemValue(P_GAMMA).toDouble() ); p_result->setGamma(gamma); return p_result; } @@ -143,10 +143,10 @@ FTDistribution2DGaussItem::FTDistribution2DGaussItem() IFTDistribution2D *FTDistribution2DGaussItem::createFTDistribution() const { auto *p_result = new FTDistribution2DGauss( - getChildValue(P_CORR_LENGTH_X).toDouble(), - getChildValue(P_CORR_LENGTH_Y).toDouble() + getItemValue(P_CORR_LENGTH_X).toDouble(), + getItemValue(P_CORR_LENGTH_Y).toDouble() ); - double gamma = Units::deg2rad(getChildValue(P_GAMMA).toDouble() ); + double gamma = Units::deg2rad(getItemValue(P_GAMMA).toDouble() ); p_result->setGamma(gamma); return p_result; } @@ -162,10 +162,10 @@ FTDistribution2DGateItem::FTDistribution2DGateItem() IFTDistribution2D *FTDistribution2DGateItem::createFTDistribution() const { auto *p_result = new FTDistribution2DGate( - getChildValue(P_CORR_LENGTH_X).toDouble(), - getChildValue(P_CORR_LENGTH_Y).toDouble() + getItemValue(P_CORR_LENGTH_X).toDouble(), + getItemValue(P_CORR_LENGTH_Y).toDouble() ); - double gamma = Units::deg2rad(getChildValue(P_GAMMA).toDouble() ); + double gamma = Units::deg2rad(getItemValue(P_GAMMA).toDouble() ); p_result->setGamma(gamma); return p_result; } @@ -181,10 +181,10 @@ FTDistribution2DConeItem::FTDistribution2DConeItem() IFTDistribution2D *FTDistribution2DConeItem::createFTDistribution() const { auto *p_result = new FTDistribution2DCone( - getChildValue(P_CORR_LENGTH_X).toDouble(), - getChildValue(P_CORR_LENGTH_Y).toDouble() + getItemValue(P_CORR_LENGTH_X).toDouble(), + getItemValue(P_CORR_LENGTH_Y).toDouble() ); - double gamma = Units::deg2rad(getChildValue(P_GAMMA).toDouble() ); + double gamma = Units::deg2rad(getItemValue(P_GAMMA).toDouble() ); p_result->setGamma(gamma); return p_result; } @@ -201,11 +201,11 @@ FTDistribution2DVoigtItem::FTDistribution2DVoigtItem() IFTDistribution2D *FTDistribution2DVoigtItem::createFTDistribution() const { auto *p_result = new FTDistribution2DVoigt( - getChildValue(P_CORR_LENGTH_X).toDouble(), - getChildValue(P_CORR_LENGTH_Y).toDouble(), - getChildValue(P_ETA).toDouble() + getItemValue(P_CORR_LENGTH_X).toDouble(), + getItemValue(P_CORR_LENGTH_Y).toDouble(), + getItemValue(P_ETA).toDouble() ); - double gamma = Units::deg2rad(getChildValue(P_GAMMA).toDouble() ); + double gamma = Units::deg2rad(getItemValue(P_GAMMA).toDouble() ); p_result->setGamma(gamma); return p_result; } diff --git a/GUI/coregui/Models/FitModel.cpp b/GUI/coregui/Models/FitModel.cpp index 6114a2340ace523a10145a23e428d14d38c1c49c..4518bd31db03ea6fa449446e6eb0acbe4345f3fe 100644 --- a/GUI/coregui/Models/FitModel.cpp +++ b/GUI/coregui/Models/FitModel.cpp @@ -47,11 +47,11 @@ InputDataItem *FitModel::getInputData() { } QString FitModel::getSelectedSampleName () { - return getFitSelection()->getChildValue(FitSelectionItem::P_SAMPLE).toString(); + return getFitSelection()->getItemValue(FitSelectionItem::P_SAMPLE).toString(); } QString FitModel::getSelectedInstrumentName(){ - return getFitSelection()->getChildValue(FitSelectionItem::P_INSTRUMENT).toString(); + return getFitSelection()->getItemValue(FitSelectionItem::P_INSTRUMENT).toString(); } QStringList FitModel::getSampleNames() { @@ -101,12 +101,12 @@ SessionItem *FitModel::getSelectedInstrumentItem() { void FitModel::setSelectedSample(const QString &displayName) { SessionItem *selection = getFitSelection(); - selection->setChildValue(FitSelectionItem::P_SAMPLE, displayName); + selection->setItemValue(FitSelectionItem::P_SAMPLE, displayName); } void FitModel::setSelectedInstrument(const QString &displayName) { SessionItem *selection = getFitSelection(); - selection->setChildValue(FitSelectionItem::P_INSTRUMENT, displayName); + selection->setItemValue(FitSelectionItem::P_INSTRUMENT, displayName); } MinimizerSettingsItem *FitModel::getMinimizerSettings() { @@ -116,7 +116,7 @@ MinimizerSettingsItem *FitModel::getMinimizerSettings() { QString FitModel::getMinimizerAlgorithm() { if (auto *item = getMinimizerSettings()) { - return item->getChildValue(MinimizerSettingsItem::P_ALGO).value<ComboProperty>() + return item->getItemValue(MinimizerSettingsItem::P_ALGO).value<ComboProperty>() .getValue(); } return QString(); @@ -124,14 +124,14 @@ QString FitModel::getMinimizerAlgorithm() { QString FitModel::getInputDataPath() { if (auto *item = getInputData()) { - return item->getChildValue(InputDataItem::P_PATH).toString(); + return item->getItemValue(InputDataItem::P_PATH).toString(); } return ""; } void FitModel::setInputDataPath(const QString &path) { if (auto *item = getInputData()) { - item->setChildValue(InputDataItem::P_PATH, path); + item->setItemValue(InputDataItem::P_PATH, path); } } diff --git a/GUI/coregui/Models/FitParameterModel.cpp b/GUI/coregui/Models/FitParameterModel.cpp index d7bb932da777762ca3e2ac73a6f44dff8690eacd..ffc7d2d4c2460c453504b6ec66b8109436709885 100644 --- a/GUI/coregui/Models/FitParameterModel.cpp +++ b/GUI/coregui/Models/FitParameterModel.cpp @@ -54,7 +54,7 @@ QModelIndex FitParameterModel::itemForLink(const QString &link) const for (int j = 0; j < rowcount; j++) { QModelIndex curIndex = index(j,0,index(i,0,QModelIndex())); QString value = itemForIndex(curIndex) - ->getChildValue(FitParameterLinkItem::P_LINK).toString(); + ->getItemValue(FitParameterLinkItem::P_LINK).toString(); if (value == link) return curIndex; } @@ -113,11 +113,11 @@ bool FitParameterModel::dropMimeData(const QMimeData *data, Qt::DropAction actio if (!parent.isValid()) { auto newlink = addParameter(); double value = parts[1].toDouble(); - newlink->setChildValue(FitParameterItem::P_INIT, value); + newlink->setItemValue(FitParameterItem::P_INIT, value); cur = indexOfItem(newlink); } auto link = insertNewItem(Constants::FitParameterLinkType, cur, row); - if (link) link->setChildValue(FitParameterLinkItem::P_LINK, parts[0]); + if (link) link->setItemValue(FitParameterLinkItem::P_LINK, parts[0]); emit dataChanged(cur, cur); return true; } @@ -132,14 +132,14 @@ QVariant FitParameterModel::data(const QModelIndex & index, int role) const if (item->parent() != itemForIndex(QModelIndex())) { if (index.column() == 0) - return item->getChildValue(FitParameterLinkItem::P_LINK); + return item->getItemValue(FitParameterLinkItem::P_LINK); else return QVariant(); } if (index.column() == 0) return item->itemName(); else - return item->getChildValue(m_columnNames->value(index.column())); + return item->getItemValue(m_columnNames->value(index.column())); } } return QVariant(); @@ -151,7 +151,7 @@ bool FitParameterModel::setData(const QModelIndex &index, const QVariant &value, return false; if (SessionItem *item = itemForIndex(index)) { if (role == Qt::EditRole && index.column() > 0 && index.column() < 5) { - item->setChildValue(m_columnNames->value(index.column()), value); + item->setItemValue(m_columnNames->value(index.column()), value); emit dataChanged(index, index); return true; } diff --git a/GUI/coregui/Models/FormFactorItems.cpp b/GUI/coregui/Models/FormFactorItems.cpp index 45ac03cfec8fa672908f36a2304e075cc6b9fb37..8f78d183726146af9dc347c5847ccf1f2f8a0f95 100644 --- a/GUI/coregui/Models/FormFactorItems.cpp +++ b/GUI/coregui/Models/FormFactorItems.cpp @@ -38,10 +38,10 @@ AnisoPyramidItem::AnisoPyramidItem() std::unique_ptr<IFormFactor> AnisoPyramidItem::createFormFactor() const { return GUIHelpers::make_unique<FormFactorAnisoPyramid>( - getChildValue(P_LENGTH).toDouble(), - getChildValue(P_WIDTH).toDouble(), - getChildValue(P_HEIGHT).toDouble(), - getChildValue(P_ALPHA).toDouble()*Units::degree + getItemValue(P_LENGTH).toDouble(), + getItemValue(P_WIDTH).toDouble(), + getItemValue(P_HEIGHT).toDouble(), + getItemValue(P_ALPHA).toDouble()*Units::degree ); } @@ -62,9 +62,9 @@ BoxItem::BoxItem() std::unique_ptr<IFormFactor> BoxItem::createFormFactor() const { return GUIHelpers::make_unique<FormFactorBox>( - getChildValue(P_LENGTH).toDouble(), - getChildValue(P_WIDTH).toDouble(), - getChildValue(P_HEIGHT).toDouble() + getItemValue(P_LENGTH).toDouble(), + getItemValue(P_WIDTH).toDouble(), + getItemValue(P_HEIGHT).toDouble() ); } @@ -85,9 +85,9 @@ ConeItem::ConeItem() std::unique_ptr<IFormFactor> ConeItem::createFormFactor() const { return GUIHelpers::make_unique<FormFactorCone>( - getChildValue(P_RADIUS).toDouble(), - getChildValue(P_HEIGHT).toDouble(), - getChildValue(P_ALPHA).toDouble()*Units::degree + getItemValue(P_RADIUS).toDouble(), + getItemValue(P_HEIGHT).toDouble(), + getItemValue(P_ALPHA).toDouble()*Units::degree ); } @@ -108,9 +108,9 @@ Cone6Item::Cone6Item() std::unique_ptr<IFormFactor> Cone6Item::createFormFactor() const { return GUIHelpers::make_unique<FormFactorCone6>( - getChildValue(P_RADIUS).toDouble(), - getChildValue(P_HEIGHT).toDouble(), - getChildValue(P_ALPHA).toDouble()*Units::degree + getItemValue(P_RADIUS).toDouble(), + getItemValue(P_HEIGHT).toDouble(), + getItemValue(P_ALPHA).toDouble()*Units::degree ); } @@ -133,10 +133,10 @@ CuboctahedronItem::CuboctahedronItem() std::unique_ptr<IFormFactor> CuboctahedronItem::createFormFactor() const { return GUIHelpers::make_unique<FormFactorCuboctahedron>( - getChildValue(P_LENGTH).toDouble(), - getChildValue(P_HEIGHT).toDouble(), - getChildValue(P_HEIGHT_RATIO).toDouble(), - getChildValue(P_ALPHA).toDouble()*Units::degree + getItemValue(P_LENGTH).toDouble(), + getItemValue(P_HEIGHT).toDouble(), + getItemValue(P_HEIGHT_RATIO).toDouble(), + getItemValue(P_ALPHA).toDouble()*Units::degree ); } @@ -155,8 +155,8 @@ CylinderItem::CylinderItem() std::unique_ptr<IFormFactor> CylinderItem::createFormFactor() const { return GUIHelpers::make_unique<FormFactorCylinder>( - getChildValue(P_RADIUS).toDouble(), - getChildValue(P_HEIGHT).toDouble() + getItemValue(P_RADIUS).toDouble(), + getItemValue(P_HEIGHT).toDouble() ); } @@ -177,9 +177,9 @@ EllipsoidalCylinderItem::EllipsoidalCylinderItem() std::unique_ptr<IFormFactor> EllipsoidalCylinderItem::createFormFactor() const { return GUIHelpers::make_unique<FormFactorEllipsoidalCylinder>( - getChildValue(P_RADIUS_X).toDouble(), - getChildValue(P_RADIUS_Y).toDouble(), - getChildValue(P_HEIGHT).toDouble() + getItemValue(P_RADIUS_X).toDouble(), + getItemValue(P_RADIUS_Y).toDouble(), + getItemValue(P_HEIGHT).toDouble() ); } @@ -196,7 +196,7 @@ FullSphereItem::FullSphereItem() std::unique_ptr<IFormFactor> FullSphereItem::createFormFactor() const { return GUIHelpers::make_unique<FormFactorFullSphere>( - getChildValue(P_RADIUS).toDouble() + getItemValue(P_RADIUS).toDouble() ); } @@ -215,8 +215,8 @@ FullSpheroidItem::FullSpheroidItem() std::unique_ptr<IFormFactor> FullSpheroidItem::createFormFactor() const { return GUIHelpers::make_unique<FormFactorFullSpheroid>( - getChildValue(P_RADIUS).toDouble(), - getChildValue(P_HEIGHT).toDouble() + getItemValue(P_RADIUS).toDouble(), + getItemValue(P_HEIGHT).toDouble() ); } @@ -237,9 +237,9 @@ HemiEllipsoidItem::HemiEllipsoidItem() std::unique_ptr<IFormFactor> HemiEllipsoidItem::createFormFactor() const { return GUIHelpers::make_unique<FormFactorHemiEllipsoid>( - getChildValue(P_RADIUS_X).toDouble(), - getChildValue(P_RADIUS_Y).toDouble(), - getChildValue(P_HEIGHT).toDouble() + getItemValue(P_RADIUS_X).toDouble(), + getItemValue(P_RADIUS_Y).toDouble(), + getItemValue(P_HEIGHT).toDouble() ); } @@ -258,8 +258,8 @@ Prism3Item::Prism3Item() std::unique_ptr<IFormFactor> Prism3Item::createFormFactor() const { return GUIHelpers::make_unique<FormFactorPrism3>( - getChildValue(P_LENGTH).toDouble(), - getChildValue(P_HEIGHT).toDouble() + getItemValue(P_LENGTH).toDouble(), + getItemValue(P_HEIGHT).toDouble() ); } @@ -278,8 +278,8 @@ Prism6Item::Prism6Item() std::unique_ptr<IFormFactor> Prism6Item::createFormFactor() const { return GUIHelpers::make_unique<FormFactorPrism6>( - getChildValue(P_RADIUS).toDouble(), - getChildValue(P_HEIGHT).toDouble() + getItemValue(P_RADIUS).toDouble(), + getItemValue(P_HEIGHT).toDouble() ); } @@ -300,9 +300,9 @@ PyramidItem::PyramidItem() std::unique_ptr<IFormFactor> PyramidItem::createFormFactor() const { return GUIHelpers::make_unique<FormFactorPyramid>( - getChildValue(P_LENGTH).toDouble(), - getChildValue(P_HEIGHT).toDouble(), - getChildValue(P_ALPHA).toDouble()*Units::degree + getItemValue(P_LENGTH).toDouble(), + getItemValue(P_HEIGHT).toDouble(), + getItemValue(P_ALPHA).toDouble()*Units::degree ); } @@ -323,9 +323,9 @@ Ripple1Item::Ripple1Item() std::unique_ptr<IFormFactor> Ripple1Item::createFormFactor() const { return GUIHelpers::make_unique<FormFactorRipple1>( - getChildValue(P_LENGTH).toDouble(), - getChildValue(P_WIDTH).toDouble(), - getChildValue(P_HEIGHT).toDouble() + getItemValue(P_LENGTH).toDouble(), + getItemValue(P_WIDTH).toDouble(), + getItemValue(P_HEIGHT).toDouble() ); } @@ -348,10 +348,10 @@ Ripple2Item::Ripple2Item() std::unique_ptr<IFormFactor> Ripple2Item::createFormFactor() const { return GUIHelpers::make_unique<FormFactorRipple2>( - getChildValue(P_LENGTH).toDouble(), - getChildValue(P_WIDTH).toDouble(), - getChildValue(P_HEIGHT).toDouble(), - getChildValue(P_ASYMMETRY).toDouble() + getItemValue(P_LENGTH).toDouble(), + getItemValue(P_WIDTH).toDouble(), + getItemValue(P_HEIGHT).toDouble(), + getItemValue(P_ASYMMETRY).toDouble() ); } @@ -372,9 +372,9 @@ TetrahedronItem::TetrahedronItem() std::unique_ptr<IFormFactor> TetrahedronItem::createFormFactor() const { return GUIHelpers::make_unique<FormFactorTetrahedron>( - getChildValue(P_LENGTH).toDouble(), - getChildValue(P_HEIGHT).toDouble(), - getChildValue(P_ALPHA).toDouble()*Units::degree + getItemValue(P_LENGTH).toDouble(), + getItemValue(P_HEIGHT).toDouble(), + getItemValue(P_ALPHA).toDouble()*Units::degree ); } @@ -394,8 +394,8 @@ TruncatedCubeItem::TruncatedCubeItem() std::unique_ptr<IFormFactor> TruncatedCubeItem::createFormFactor() const { return GUIHelpers::make_unique<FormFactorTruncatedCube>( - getChildValue(P_LENGTH).toDouble(), - getChildValue(P_REMOVED_LENGTH).toDouble() + getItemValue(P_LENGTH).toDouble(), + getItemValue(P_REMOVED_LENGTH).toDouble() ); } @@ -414,8 +414,8 @@ TruncatedSphereItem::TruncatedSphereItem() std::unique_ptr<IFormFactor> TruncatedSphereItem::createFormFactor() const { return GUIHelpers::make_unique<FormFactorTruncatedSphere>( - getChildValue(P_RADIUS).toDouble(), - getChildValue(P_HEIGHT).toDouble() + getItemValue(P_RADIUS).toDouble(), + getItemValue(P_HEIGHT).toDouble() ); } @@ -436,9 +436,9 @@ TruncatedSpheroidItem::TruncatedSpheroidItem() std::unique_ptr<IFormFactor> TruncatedSpheroidItem::createFormFactor() const { return GUIHelpers::make_unique<FormFactorTruncatedSpheroid>( - getChildValue(P_RADIUS).toDouble(), - getChildValue(P_HEIGHT).toDouble(), - getChildValue(P_HFC).toDouble() + getItemValue(P_RADIUS).toDouble(), + getItemValue(P_HEIGHT).toDouble(), + getItemValue(P_HFC).toDouble() ); } diff --git a/GUI/coregui/Models/GUIObjectBuilder.cpp b/GUI/coregui/Models/GUIObjectBuilder.cpp index 74890c93043ea1575254d3189fb32933573c041e..08f993c76aed5a67e3f0969b7cf9468955e7d705 100644 --- a/GUI/coregui/Models/GUIObjectBuilder.cpp +++ b/GUI/coregui/Models/GUIObjectBuilder.cpp @@ -149,9 +149,9 @@ void GUIObjectBuilder::visit(const ParticleLayout *sample) approx_prop.setValue("Decoupling Approximation"); break; } - item->setChildValue(ParticleLayoutItem::P_APPROX, + item->setItemValue(ParticleLayoutItem::P_APPROX, approx_prop.getVariant()); - item->setChildValue(ParticleLayoutItem::P_TOTAL_DENSITY, + item->setItemValue(ParticleLayoutItem::P_TOTAL_DENSITY, sample->getTotalParticleSurfaceDensity()); m_levelToParentItem[getLevel()] = item; } @@ -172,7 +172,7 @@ void GUIObjectBuilder::visit(const Layer *sample) SessionItem *layerItem = m_sampleModel->insertNewItem( Constants::LayerType, m_sampleModel->indexOfItem(parent)); - layerItem->setChildValue(LayerItem::P_MATERIAL, + layerItem->setItemValue(LayerItem::P_MATERIAL, createMaterialFromDomain(sample->getMaterial()).getVariant()); TransformFromDomain::setItemFromSample(layerItem, sample, interface); @@ -193,7 +193,7 @@ void GUIObjectBuilder::visit(const MultiLayer *sample) SessionItem *item = m_sampleModel->insertNewItem(Constants::MultiLayerType); item->setItemName(sample->getName().c_str()); - item->setChildValue(MultiLayerItem::P_CROSS_CORR_LENGTH, + item->setItemValue(MultiLayerItem::P_CROSS_CORR_LENGTH, sample->getCrossCorrLength()); m_levelToParentItem[getLevel()] = item; m_itemToSample[item] = sample; @@ -234,8 +234,8 @@ void GUIObjectBuilder::visit(const Particle *sample) buildPositionInfo(particleItem, sample); - particleItem->setChildValue(ParticleItem::P_ABUNDANCE, sample->getAbundance()); - particleItem->setChildValue(ParticleItem::P_MATERIAL, + particleItem->setItemValue(ParticleItem::P_ABUNDANCE, sample->getAbundance()); + particleItem->setItemValue(ParticleItem::P_MATERIAL, createMaterialFromDomain(sample->getMaterial()).getVariant()); m_levelToParentItem[getLevel()] = particleItem; } @@ -265,7 +265,7 @@ void GUIObjectBuilder::visit(const ParticleCoreShell *sample) SessionItem *coreshellItem = m_sampleModel->insertNewItem( Constants::ParticleCoreShellType, m_sampleModel->indexOfItem(parent)); - coreshellItem->setChildValue(ParticleItem::P_ABUNDANCE, sample->getAbundance()); + coreshellItem->setItemValue(ParticleItem::P_ABUNDANCE, sample->getAbundance()); buildPositionInfo(coreshellItem, sample); @@ -281,7 +281,7 @@ void GUIObjectBuilder::visit(const ParticleComposition *sample) Q_ASSERT(parent); SessionItem *particle_composition_item = m_sampleModel->insertNewItem( Constants::ParticleCompositionType, m_sampleModel->indexOfItem(parent)); - particle_composition_item->setChildValue(ParticleItem::P_ABUNDANCE, + particle_composition_item->setItemValue(ParticleItem::P_ABUNDANCE, sample->getAbundance()); buildPositionInfo(particle_composition_item, sample); @@ -295,13 +295,13 @@ void GUIObjectBuilder::visit(const FormFactorAnisoPyramid *sample) SessionItem *particleItem = m_levelToParentItem[getLevel()-1]; SessionItem *ffItem = particleItem->setGroupProperty( ParticleItem::P_FORM_FACTOR, Constants::AnisoPyramidType); - ffItem->setChildValue(AnisoPyramidItem::P_LENGTH, + ffItem->setItemValue(AnisoPyramidItem::P_LENGTH, sample->getLength()); - ffItem->setChildValue(AnisoPyramidItem::P_WIDTH, + ffItem->setItemValue(AnisoPyramidItem::P_WIDTH, sample->getWidth()); - ffItem->setChildValue(AnisoPyramidItem::P_HEIGHT, + ffItem->setItemValue(AnisoPyramidItem::P_HEIGHT, sample->getHeight()); - ffItem->setChildValue(AnisoPyramidItem::P_ALPHA, + ffItem->setItemValue(AnisoPyramidItem::P_ALPHA, Units::rad2deg(sample->getAlpha())); m_levelToParentItem[getLevel()] = particleItem; } @@ -311,9 +311,9 @@ void GUIObjectBuilder::visit(const FormFactorBox *sample) SessionItem *particleItem = m_levelToParentItem[getLevel()-1]; SessionItem *ffItem = particleItem->setGroupProperty( ParticleItem::P_FORM_FACTOR, Constants::BoxType); - ffItem->setChildValue(BoxItem::P_LENGTH, sample->getLength()); - ffItem->setChildValue(BoxItem::P_WIDTH, sample->getWidth()); - ffItem->setChildValue(BoxItem::P_HEIGHT, sample->getHeight()); + ffItem->setItemValue(BoxItem::P_LENGTH, sample->getLength()); + ffItem->setItemValue(BoxItem::P_WIDTH, sample->getWidth()); + ffItem->setItemValue(BoxItem::P_HEIGHT, sample->getHeight()); m_levelToParentItem[getLevel()] = particleItem; } @@ -322,9 +322,9 @@ void GUIObjectBuilder::visit(const FormFactorCone *sample) SessionItem *particleItem = m_levelToParentItem[getLevel()-1]; SessionItem *ffItem = particleItem->setGroupProperty( ParticleItem::P_FORM_FACTOR, Constants::ConeType); - ffItem->setChildValue(ConeItem::P_RADIUS, sample->getRadius()); - ffItem->setChildValue(ConeItem::P_HEIGHT, sample->getHeight()); - ffItem->setChildValue(ConeItem::P_ALPHA, + ffItem->setItemValue(ConeItem::P_RADIUS, sample->getRadius()); + ffItem->setItemValue(ConeItem::P_HEIGHT, sample->getHeight()); + ffItem->setItemValue(ConeItem::P_ALPHA, Units::rad2deg(sample->getAlpha())); m_levelToParentItem[getLevel()] = particleItem; } @@ -334,9 +334,9 @@ void GUIObjectBuilder::visit(const FormFactorCone6 *sample) SessionItem *particleItem = m_levelToParentItem[getLevel()-1]; SessionItem *ffItem = particleItem->setGroupProperty( ParticleItem::P_FORM_FACTOR, Constants::Cone6Type); - ffItem->setChildValue(Cone6Item::P_RADIUS, sample->getRadius()); - ffItem->setChildValue(Cone6Item::P_HEIGHT, sample->getHeight()); - ffItem->setChildValue(Cone6Item::P_ALPHA, + ffItem->setItemValue(Cone6Item::P_RADIUS, sample->getRadius()); + ffItem->setItemValue(Cone6Item::P_HEIGHT, sample->getHeight()); + ffItem->setItemValue(Cone6Item::P_ALPHA, Units::rad2deg(sample->getAlpha())); m_levelToParentItem[getLevel()] = particleItem; } @@ -346,13 +346,13 @@ void GUIObjectBuilder::visit(const FormFactorCuboctahedron *sample) SessionItem *particleItem = m_levelToParentItem[getLevel()-1]; SessionItem *ffItem = particleItem->setGroupProperty( ParticleItem::P_FORM_FACTOR, Constants::CuboctahedronType); - ffItem->setChildValue(CuboctahedronItem::P_LENGTH, + ffItem->setItemValue(CuboctahedronItem::P_LENGTH, sample->getLength()); - ffItem->setChildValue(CuboctahedronItem::P_HEIGHT, + ffItem->setItemValue(CuboctahedronItem::P_HEIGHT, sample->getHeight()); - ffItem->setChildValue(CuboctahedronItem::P_HEIGHT_RATIO, + ffItem->setItemValue(CuboctahedronItem::P_HEIGHT_RATIO, sample->getHeightRatio()); - ffItem->setChildValue(CuboctahedronItem::P_ALPHA, + ffItem->setItemValue(CuboctahedronItem::P_ALPHA, Units::rad2deg(sample->getAlpha())); m_levelToParentItem[getLevel()] = particleItem; } @@ -362,8 +362,8 @@ void GUIObjectBuilder::visit(const FormFactorCylinder *sample) SessionItem *particleItem = m_levelToParentItem[getLevel()-1]; SessionItem *ffItem = particleItem->setGroupProperty( ParticleItem::P_FORM_FACTOR, Constants::CylinderType); - ffItem->setChildValue(CylinderItem::P_RADIUS, sample->getRadius()); - ffItem->setChildValue(CylinderItem::P_HEIGHT, sample->getHeight()); + ffItem->setItemValue(CylinderItem::P_RADIUS, sample->getRadius()); + ffItem->setItemValue(CylinderItem::P_HEIGHT, sample->getHeight()); m_levelToParentItem[getLevel()] = particleItem; } @@ -372,11 +372,11 @@ void GUIObjectBuilder::visit(const FormFactorEllipsoidalCylinder *sample) SessionItem *particleItem = m_levelToParentItem[getLevel()-1]; SessionItem *ffItem = particleItem->setGroupProperty( ParticleItem::P_FORM_FACTOR, Constants::EllipsoidalCylinderType); - ffItem->setChildValue(EllipsoidalCylinderItem::P_RADIUS_X, + ffItem->setItemValue(EllipsoidalCylinderItem::P_RADIUS_X, sample->getRadiusX()); - ffItem->setChildValue(EllipsoidalCylinderItem::P_RADIUS_Y, + ffItem->setItemValue(EllipsoidalCylinderItem::P_RADIUS_Y, sample->getRadiusY()); - ffItem->setChildValue(EllipsoidalCylinderItem::P_HEIGHT, + ffItem->setItemValue(EllipsoidalCylinderItem::P_HEIGHT, sample->getHeight()); m_levelToParentItem[getLevel()] = particleItem; } @@ -386,7 +386,7 @@ void GUIObjectBuilder::visit(const FormFactorFullSphere *sample) SessionItem *particleItem = m_levelToParentItem[getLevel()-1]; SessionItem *ffItem = particleItem->setGroupProperty( ParticleItem::P_FORM_FACTOR, Constants::FullSphereType); - ffItem->setChildValue(FullSphereItem::P_RADIUS, + ffItem->setItemValue(FullSphereItem::P_RADIUS, sample->getRadius()); m_levelToParentItem[getLevel()] = particleItem; } @@ -396,9 +396,9 @@ void GUIObjectBuilder::visit(const FormFactorFullSpheroid *sample) SessionItem *particleItem = m_levelToParentItem[getLevel()-1]; SessionItem *ffItem = particleItem->setGroupProperty( ParticleItem::P_FORM_FACTOR, Constants::FullSpheroidType); - ffItem->setChildValue(FullSpheroidItem::P_RADIUS, + ffItem->setItemValue(FullSpheroidItem::P_RADIUS, sample->getRadius()); - ffItem->setChildValue(FullSpheroidItem::P_HEIGHT, + ffItem->setItemValue(FullSpheroidItem::P_HEIGHT, sample->getHeight()); m_levelToParentItem[getLevel()] = particleItem; } @@ -408,11 +408,11 @@ void GUIObjectBuilder::visit(const FormFactorHemiEllipsoid *sample) SessionItem *particleItem = m_levelToParentItem[getLevel()-1]; SessionItem *ffItem = particleItem->setGroupProperty( ParticleItem::P_FORM_FACTOR, Constants::HemiEllipsoidType); - ffItem->setChildValue(HemiEllipsoidItem::P_RADIUS_X, + ffItem->setItemValue(HemiEllipsoidItem::P_RADIUS_X, sample->getRadiusX()); - ffItem->setChildValue(HemiEllipsoidItem::P_RADIUS_Y, + ffItem->setItemValue(HemiEllipsoidItem::P_RADIUS_Y, sample->getRadiusY()); - ffItem->setChildValue(HemiEllipsoidItem::P_HEIGHT, + ffItem->setItemValue(HemiEllipsoidItem::P_HEIGHT, sample->getHeight()); m_levelToParentItem[getLevel()] = particleItem; } @@ -422,8 +422,8 @@ void GUIObjectBuilder::visit(const FormFactorPrism3 *sample) SessionItem *particleItem = m_levelToParentItem[getLevel()-1]; SessionItem *ffItem = particleItem->setGroupProperty( ParticleItem::P_FORM_FACTOR, Constants::Prism3Type); - ffItem->setChildValue(Prism3Item::P_LENGTH, sample->getLength()); - ffItem->setChildValue(Prism3Item::P_HEIGHT, sample->getHeight()); + ffItem->setItemValue(Prism3Item::P_LENGTH, sample->getLength()); + ffItem->setItemValue(Prism3Item::P_HEIGHT, sample->getHeight()); m_levelToParentItem[getLevel()] = particleItem; } @@ -432,8 +432,8 @@ void GUIObjectBuilder::visit(const FormFactorPrism6 *sample) SessionItem *particleItem = m_levelToParentItem[getLevel()-1]; SessionItem *ffItem = particleItem->setGroupProperty( ParticleItem::P_FORM_FACTOR, Constants::Prism6Type); - ffItem->setChildValue(Prism6Item::P_RADIUS, sample->getRadius()); - ffItem->setChildValue(Prism6Item::P_HEIGHT, sample->getHeight()); + ffItem->setItemValue(Prism6Item::P_RADIUS, sample->getRadius()); + ffItem->setItemValue(Prism6Item::P_HEIGHT, sample->getHeight()); m_levelToParentItem[getLevel()] = particleItem; } @@ -442,9 +442,9 @@ void GUIObjectBuilder::visit(const FormFactorPyramid *sample) SessionItem *particleItem = m_levelToParentItem[getLevel()-1]; SessionItem *ffItem = particleItem->setGroupProperty( ParticleItem::P_FORM_FACTOR, Constants::PyramidType); - ffItem->setChildValue(PyramidItem::P_LENGTH, sample->getLength()); - ffItem->setChildValue(PyramidItem::P_HEIGHT, sample->getHeight()); - ffItem->setChildValue(PyramidItem::P_ALPHA, + ffItem->setItemValue(PyramidItem::P_LENGTH, sample->getLength()); + ffItem->setItemValue(PyramidItem::P_HEIGHT, sample->getHeight()); + ffItem->setItemValue(PyramidItem::P_ALPHA, Units::rad2deg(sample->getAlpha())); m_levelToParentItem[getLevel()] = particleItem; } @@ -454,9 +454,9 @@ void GUIObjectBuilder::visit(const FormFactorRipple1 *sample) SessionItem *particleItem = m_levelToParentItem[getLevel()-1]; SessionItem *ffItem = particleItem->setGroupProperty( ParticleItem::P_FORM_FACTOR, Constants::Ripple1Type); - ffItem->setChildValue(Ripple1Item::P_LENGTH, sample->getLength()); - ffItem->setChildValue(Ripple1Item::P_WIDTH, sample->getWidth()); - ffItem->setChildValue(Ripple1Item::P_HEIGHT, sample->getHeight()); + ffItem->setItemValue(Ripple1Item::P_LENGTH, sample->getLength()); + ffItem->setItemValue(Ripple1Item::P_WIDTH, sample->getWidth()); + ffItem->setItemValue(Ripple1Item::P_HEIGHT, sample->getHeight()); m_levelToParentItem[getLevel()] = particleItem; } @@ -465,10 +465,10 @@ void GUIObjectBuilder::visit(const FormFactorRipple2 *sample) SessionItem *particleItem = m_levelToParentItem[getLevel()-1]; SessionItem *ffItem = particleItem->setGroupProperty( ParticleItem::P_FORM_FACTOR, Constants::Ripple2Type); - ffItem->setChildValue(Ripple2Item::P_LENGTH, sample->getLength()); - ffItem->setChildValue(Ripple2Item::P_WIDTH, sample->getWidth()); - ffItem->setChildValue(Ripple2Item::P_HEIGHT, sample->getHeight()); - ffItem->setChildValue(Ripple2Item::P_ASYMMETRY, + ffItem->setItemValue(Ripple2Item::P_LENGTH, sample->getLength()); + ffItem->setItemValue(Ripple2Item::P_WIDTH, sample->getWidth()); + ffItem->setItemValue(Ripple2Item::P_HEIGHT, sample->getHeight()); + ffItem->setItemValue(Ripple2Item::P_ASYMMETRY, sample->getAsymmetry()); m_levelToParentItem[getLevel()] = particleItem; } @@ -478,11 +478,11 @@ void GUIObjectBuilder::visit(const FormFactorTetrahedron *sample) SessionItem *particleItem = m_levelToParentItem[getLevel()-1]; SessionItem *ffItem = particleItem->setGroupProperty( ParticleItem::P_FORM_FACTOR, Constants::TetrahedronType); - ffItem->setChildValue(TetrahedronItem::P_LENGTH, + ffItem->setItemValue(TetrahedronItem::P_LENGTH, sample->getLength()); - ffItem->setChildValue(TetrahedronItem::P_HEIGHT, + ffItem->setItemValue(TetrahedronItem::P_HEIGHT, sample->getHeight()); - ffItem->setChildValue(TetrahedronItem::P_ALPHA, + ffItem->setItemValue(TetrahedronItem::P_ALPHA, Units::rad2deg(sample->getAlpha())); m_levelToParentItem[getLevel()] = particleItem; } @@ -492,9 +492,9 @@ void GUIObjectBuilder::visit(const FormFactorTruncatedCube *sample) SessionItem *particleItem = m_levelToParentItem[getLevel()-1]; SessionItem *ffItem = particleItem->setGroupProperty( ParticleItem::P_FORM_FACTOR, Constants::TruncatedCubeType); - ffItem->setChildValue(TruncatedCubeItem::P_LENGTH, + ffItem->setItemValue(TruncatedCubeItem::P_LENGTH, sample->getLength()); - ffItem->setChildValue(TruncatedCubeItem::P_REMOVED_LENGTH, + ffItem->setItemValue(TruncatedCubeItem::P_REMOVED_LENGTH, sample->getRemovedLength()); m_levelToParentItem[getLevel()] = particleItem; } @@ -504,9 +504,9 @@ void GUIObjectBuilder::visit(const FormFactorTruncatedSphere *sample) SessionItem *particleItem = m_levelToParentItem[getLevel()-1]; SessionItem *ffItem = particleItem->setGroupProperty( ParticleItem::P_FORM_FACTOR, Constants::TruncatedSphereType); - ffItem->setChildValue(TruncatedSphereItem::P_RADIUS, + ffItem->setItemValue(TruncatedSphereItem::P_RADIUS, sample->getRadius()); - ffItem->setChildValue(TruncatedSphereItem::P_HEIGHT, + ffItem->setItemValue(TruncatedSphereItem::P_HEIGHT, sample->getHeight()); m_levelToParentItem[getLevel()] = particleItem; } @@ -516,11 +516,11 @@ void GUIObjectBuilder::visit(const FormFactorTruncatedSpheroid *sample) SessionItem *particleItem = m_levelToParentItem[getLevel()-1]; SessionItem *ffItem = particleItem->setGroupProperty( ParticleItem::P_FORM_FACTOR, Constants::TruncatedSpheroidType); - ffItem->setChildValue(TruncatedSpheroidItem::P_RADIUS, + ffItem->setItemValue(TruncatedSpheroidItem::P_RADIUS, sample->getRadius()); - ffItem->setChildValue(TruncatedSpheroidItem::P_HEIGHT, + ffItem->setItemValue(TruncatedSpheroidItem::P_HEIGHT, sample->getHeight()); - ffItem->setChildValue(TruncatedSpheroidItem::P_HFC, + ffItem->setItemValue(TruncatedSpheroidItem::P_HFC, sample->getHeightFlattening()); m_levelToParentItem[getLevel()] = particleItem; } @@ -591,7 +591,7 @@ void GUIObjectBuilder::visit(const RotationX *sample) Constants::TransformationType, m_sampleModel->indexOfItem(parent)); SessionItem *p_rotationItem = transformation_item->setGroupProperty( TransformationItem::P_ROT, Constants::XRotationType); - p_rotationItem->setChildValue(XRotationItem::P_ANGLE, + p_rotationItem->setItemValue(XRotationItem::P_ANGLE, Units::rad2deg(sample->getAngle()) ); m_levelToParentItem[getLevel()] = transformation_item; } @@ -607,7 +607,7 @@ void GUIObjectBuilder::visit(const RotationY *sample) Constants::TransformationType, m_sampleModel->indexOfItem(parent)); SessionItem *p_rotationItem = transformation_item->setGroupProperty( TransformationItem::P_ROT, Constants::YRotationType); - p_rotationItem->setChildValue(YRotationItem::P_ANGLE, + p_rotationItem->setItemValue(YRotationItem::P_ANGLE, Units::rad2deg(sample->getAngle())); m_levelToParentItem[getLevel()] = transformation_item; } @@ -623,7 +623,7 @@ void GUIObjectBuilder::visit(const RotationZ *sample) Constants::TransformationType, m_sampleModel->indexOfItem(parent)); SessionItem *p_rotationItem = transformation_item->setGroupProperty( TransformationItem::P_ROT, Constants::ZRotationType); - p_rotationItem->setChildValue(ZRotationItem::P_ANGLE, + p_rotationItem->setItemValue(ZRotationItem::P_ANGLE, Units::rad2deg(sample->getAngle()) ); m_levelToParentItem[getLevel()] = transformation_item; } @@ -639,11 +639,11 @@ void GUIObjectBuilder::visit(const RotationEuler *sample) Constants::TransformationType, m_sampleModel->indexOfItem(parent)); SessionItem *p_rotationItem = transformation_item->setGroupProperty( TransformationItem::P_ROT, Constants::EulerRotationType); - p_rotationItem->setChildValue(EulerRotationItem::P_ALPHA, + p_rotationItem->setItemValue(EulerRotationItem::P_ALPHA, Units::rad2deg(sample->getAlpha()) ); - p_rotationItem->setChildValue(EulerRotationItem::P_BETA, + p_rotationItem->setItemValue(EulerRotationItem::P_BETA, Units::rad2deg(sample->getBeta()) ); - p_rotationItem->setChildValue(EulerRotationItem::P_GAMMA, + p_rotationItem->setItemValue(EulerRotationItem::P_GAMMA, Units::rad2deg(sample->getGamma()) ); m_levelToParentItem[getLevel()] = transformation_item; } @@ -652,9 +652,9 @@ void GUIObjectBuilder::buildPositionInfo(SessionItem *particleItem, const IParti { kvector_t position = sample->getPosition(); SessionItem *p_position_item = particleItem->getGroupItem(ParticleItem::P_POSITION); - p_position_item->setChildValue(VectorItem::P_X, position.x()); - p_position_item->setChildValue(VectorItem::P_Y, position.y()); - p_position_item->setChildValue(VectorItem::P_Z, position.z()); + p_position_item->setItemValue(VectorItem::P_X, position.x()); + p_position_item->setItemValue(VectorItem::P_Y, position.y()); + p_position_item->setItemValue(VectorItem::P_Z, position.z()); } MaterialProperty GUIObjectBuilder::createMaterialFromDomain( diff --git a/GUI/coregui/Models/IntensityDataItem.cpp b/GUI/coregui/Models/IntensityDataItem.cpp index 787536a400ee9c77b6c2e1e0e579275445a58ba4..7d5138f422721a994f53d43607252b01f415e830 100644 --- a/GUI/coregui/Models/IntensityDataItem.cpp +++ b/GUI/coregui/Models/IntensityDataItem.cpp @@ -112,12 +112,12 @@ void IntensityDataItem::setOutputData(OutputData<double> *data) double IntensityDataItem::getLowerX() const { - return getGroupItem(P_XAXIS)->getChildValue(BasicAxisItem::P_MIN).toDouble(); + return getGroupItem(P_XAXIS)->getItemValue(BasicAxisItem::P_MIN).toDouble(); } double IntensityDataItem::getUpperX() const { - return getGroupItem(P_XAXIS)->getChildValue(BasicAxisItem::P_MAX).toDouble(); + return getGroupItem(P_XAXIS)->getItemValue(BasicAxisItem::P_MAX).toDouble(); } double IntensityDataItem::getXmin() const @@ -134,12 +134,12 @@ double IntensityDataItem::getXmax() const double IntensityDataItem::getLowerY() const { - return getGroupItem(P_YAXIS)->getChildValue(BasicAxisItem::P_MIN).toDouble(); + return getGroupItem(P_YAXIS)->getItemValue(BasicAxisItem::P_MIN).toDouble(); } double IntensityDataItem::getUpperY() const { - return getGroupItem(P_YAXIS)->getChildValue(BasicAxisItem::P_MAX).toDouble(); + return getGroupItem(P_YAXIS)->getItemValue(BasicAxisItem::P_MAX).toDouble(); } double IntensityDataItem::getYmin() const @@ -156,48 +156,48 @@ double IntensityDataItem::getYmax() const double IntensityDataItem::getLowerZ() const { - return getGroupItem(P_ZAXIS)->getChildValue(BasicAxisItem::P_MIN).toDouble(); + return getGroupItem(P_ZAXIS)->getItemValue(BasicAxisItem::P_MIN).toDouble(); } double IntensityDataItem::getUpperZ() const { - return getGroupItem(P_ZAXIS)->getChildValue(BasicAxisItem::P_MAX).toDouble(); + return getGroupItem(P_ZAXIS)->getItemValue(BasicAxisItem::P_MAX).toDouble(); } QString IntensityDataItem::getGradient() const { - ComboProperty combo_property = getChildValue(P_GRADIENT).value<ComboProperty>(); + ComboProperty combo_property = getItemValue(P_GRADIENT).value<ComboProperty>(); return combo_property.getValue(); } bool IntensityDataItem::isLogz() const { - return getGroupItem(P_ZAXIS)->getChildValue(AmplitudeAxisItem::P_IS_LOGSCALE).toBool(); + return getGroupItem(P_ZAXIS)->getItemValue(AmplitudeAxisItem::P_IS_LOGSCALE).toBool(); } bool IntensityDataItem::isInterpolated() const { - return getChildValue(P_IS_INTERPOLATED).toBool(); + return getItemValue(P_IS_INTERPOLATED).toBool(); } QString IntensityDataItem::getXaxisTitle() const { - return getGroupItem(P_XAXIS)->getChildValue(BasicAxisItem::P_TITLE).toString(); + return getGroupItem(P_XAXIS)->getItemValue(BasicAxisItem::P_TITLE).toString(); } QString IntensityDataItem::getYaxisTitle() const { - return getGroupItem(P_YAXIS)->getChildValue(BasicAxisItem::P_TITLE).toString(); + return getGroupItem(P_YAXIS)->getItemValue(BasicAxisItem::P_TITLE).toString(); } bool IntensityDataItem::isZAxisLocked() const { - return getGroupItem(P_ZAXIS)->getChildValue(AmplitudeAxisItem::P_LOCK_MIN_MAX).toBool(); + return getGroupItem(P_ZAXIS)->getItemValue(AmplitudeAxisItem::P_LOCK_MIN_MAX).toBool(); } void IntensityDataItem::setZAxisLocked(bool state) { - return getGroupItem(P_ZAXIS)->setChildValue(AmplitudeAxisItem::P_LOCK_MIN_MAX, state); + return getGroupItem(P_ZAXIS)->setItemValue(AmplitudeAxisItem::P_LOCK_MIN_MAX, state); } //! Sets the name of intensity data item from proposed name. This name will be used to save file @@ -210,69 +210,69 @@ void IntensityDataItem::setNameFromProposed(const QString &proposed_name) QString IntensityDataItem::getSelectedAxesUnits() const { - ComboProperty combo= getChildValue(IntensityDataItem::P_AXES_UNITS) + ComboProperty combo= getItemValue(IntensityDataItem::P_AXES_UNITS) .value<ComboProperty>(); return combo.getValue(); } void IntensityDataItem::setLowerX(double xmin) { - getGroupItem(P_XAXIS)->setChildValue(BasicAxisItem::P_MIN, xmin); + getGroupItem(P_XAXIS)->setItemValue(BasicAxisItem::P_MIN, xmin); } void IntensityDataItem::setUpperX(double xmax) { - getGroupItem(P_XAXIS)->setChildValue(BasicAxisItem::P_MAX, xmax); + getGroupItem(P_XAXIS)->setItemValue(BasicAxisItem::P_MAX, xmax); } void IntensityDataItem::setLowerY(double ymin) { - getGroupItem(P_YAXIS)->setChildValue(BasicAxisItem::P_MIN, ymin); + getGroupItem(P_YAXIS)->setItemValue(BasicAxisItem::P_MIN, ymin); } void IntensityDataItem::setUpperY(double ymax) { - getGroupItem(P_YAXIS)->setChildValue(BasicAxisItem::P_MAX, ymax); + getGroupItem(P_YAXIS)->setItemValue(BasicAxisItem::P_MAX, ymax); } void IntensityDataItem::setLowerAndUpperZ(double zmin, double zmax) { if(getLowerZ() != zmin) { - getGroupItem(P_ZAXIS)->setChildValue(BasicAxisItem::P_MIN, zmin); + getGroupItem(P_ZAXIS)->setItemValue(BasicAxisItem::P_MIN, zmin); } if(getUpperZ() != zmax) { - getGroupItem(P_ZAXIS)->setChildValue(BasicAxisItem::P_MAX, zmax); + getGroupItem(P_ZAXIS)->setItemValue(BasicAxisItem::P_MAX, zmax); } } void IntensityDataItem::setLowerZ(double zmin) { - getGroupItem(P_ZAXIS)->setChildValue(BasicAxisItem::P_MIN, zmin); + getGroupItem(P_ZAXIS)->setItemValue(BasicAxisItem::P_MIN, zmin); } void IntensityDataItem::setUpperZ(double zmax) { - getGroupItem(P_ZAXIS)->setChildValue(BasicAxisItem::P_MAX, zmax); + getGroupItem(P_ZAXIS)->setItemValue(BasicAxisItem::P_MAX, zmax); } void IntensityDataItem::setLogz(bool logz) { - getGroupItem(P_ZAXIS)->setChildValue(AmplitudeAxisItem::P_IS_LOGSCALE, logz); + getGroupItem(P_ZAXIS)->setItemValue(AmplitudeAxisItem::P_IS_LOGSCALE, logz); } void IntensityDataItem::setInterpolated(bool interp) { - setChildValue(P_IS_INTERPOLATED, interp); + setItemValue(P_IS_INTERPOLATED, interp); } void IntensityDataItem::setXaxisTitle(QString xtitle) { - getGroupItem(P_XAXIS)->setChildValue(BasicAxisItem::P_TITLE, xtitle); + getGroupItem(P_XAXIS)->setItemValue(BasicAxisItem::P_TITLE, xtitle); } void IntensityDataItem::setYaxisTitle(QString ytitle) { - getGroupItem(P_YAXIS)->setChildValue(BasicAxisItem::P_TITLE, ytitle); + getGroupItem(P_YAXIS)->setItemValue(BasicAxisItem::P_TITLE, ytitle); } //! set zoom range of x,y axes to axes of input data diff --git a/GUI/coregui/Models/InterferenceFunctionItems.cpp b/GUI/coregui/Models/InterferenceFunctionItems.cpp index 3fc218e6cb7de1023a12aed96ab91de7a8f1399e..e6333b255a41620fcfd2d8fc27f24d4428eddb54 100644 --- a/GUI/coregui/Models/InterferenceFunctionItems.cpp +++ b/GUI/coregui/Models/InterferenceFunctionItems.cpp @@ -82,7 +82,7 @@ InterferenceFunction2DParaCrystalItem::InterferenceFunction2DParaCrystalItem( mapper()->setOnPropertyChange( [this](const QString &name) { if(name == P_XI_INTEGRATION && isTag(P_ROTATION_ANGLE)) { - if(getChildValue(P_XI_INTEGRATION).toBool()) { + if(getItemValue(P_XI_INTEGRATION).toBool()) { getItem(P_ROTATION_ANGLE)->setEnabled(false); } else { getItem(P_ROTATION_ANGLE)->setEnabled(true); diff --git a/GUI/coregui/Models/ItemLink.cpp b/GUI/coregui/Models/ItemLink.cpp index 27079bdf28d7dc9e03b6d56e7ff8ebe884431bfe..944a799e61256850f71b3560d9aa9ea8d9a2ff79 100644 --- a/GUI/coregui/Models/ItemLink.cpp +++ b/GUI/coregui/Models/ItemLink.cpp @@ -43,7 +43,7 @@ void ItemLink::setValue(double value) QVariant ItemLink::getVariant() { - QVariant variant = m_item->getChildValue(m_property_name); + QVariant variant = m_item->getItemValue(m_property_name); if(variant.typeName() == QString("double")) { variant.setValue(m_value); return variant; @@ -64,6 +64,6 @@ QVariant ItemLink::getVariant() void ItemLink::updateItem() { - getItem()->setChildValue(getPropertyName(), getVariant()); + getItem()->setItemValue(getPropertyName(), getVariant()); } diff --git a/GUI/coregui/Models/JobItem.cpp b/GUI/coregui/Models/JobItem.cpp index bad1e94207d7bb2e803edf095bc3166ac2bfa639..03caa7bb278903c2d73eee179699197bf859d3c1 100644 --- a/GUI/coregui/Models/JobItem.cpp +++ b/GUI/coregui/Models/JobItem.cpp @@ -107,12 +107,12 @@ JobItem::~JobItem() QString JobItem::getIdentifier() const { - return getChildValue(P_IDENTIFIER).toString(); + return getItemValue(P_IDENTIFIER).toString(); } void JobItem::setIdentifier(const QString &identifier) { - setChildValue(JobItem::P_IDENTIFIER, identifier); + setItemValue(JobItem::P_IDENTIFIER, identifier); } IntensityDataItem *JobItem::getIntensityDataItem() @@ -126,15 +126,15 @@ IntensityDataItem *JobItem::getIntensityDataItem() QString JobItem::getStatus() const { - ComboProperty combo_property = getChildValue(P_STATUS).value<ComboProperty>(); + ComboProperty combo_property = getItemValue(P_STATUS).value<ComboProperty>(); return combo_property.getValue(); } void JobItem::setStatus(const QString &status) { - ComboProperty combo_property = getChildValue(P_STATUS).value<ComboProperty>(); + ComboProperty combo_property = getItemValue(P_STATUS).value<ComboProperty>(); combo_property.setValue(status); - setChildValue(P_STATUS, combo_property.getVariant()); + setItemValue(P_STATUS, combo_property.getVariant()); if(status == Constants::STATUS_FAILED) { if(IntensityDataItem *intensityItem = getIntensityDataItem()) { if(intensityItem->getOutputData()) @@ -146,90 +146,90 @@ void JobItem::setStatus(const QString &status) bool JobItem::isIdle() const { - ComboProperty combo_property = getChildValue(P_STATUS).value<ComboProperty>(); + ComboProperty combo_property = getItemValue(P_STATUS).value<ComboProperty>(); return combo_property.getValue() == Constants::STATUS_IDLE; } bool JobItem::isRunning() const { - ComboProperty combo_property = getChildValue(P_STATUS).value<ComboProperty>(); + ComboProperty combo_property = getItemValue(P_STATUS).value<ComboProperty>(); return combo_property.getValue() == Constants::STATUS_RUNNING; } bool JobItem::isCompleted() const { - ComboProperty combo_property = getChildValue(P_STATUS).value<ComboProperty>(); + ComboProperty combo_property = getItemValue(P_STATUS).value<ComboProperty>(); return combo_property.getValue() == Constants::STATUS_COMPLETED; } bool JobItem::isCanceled() const { - ComboProperty combo_property = getChildValue(P_STATUS).value<ComboProperty>(); + ComboProperty combo_property = getItemValue(P_STATUS).value<ComboProperty>(); return combo_property.getValue() == Constants::STATUS_CANCELED; } bool JobItem::isFailed() const { - ComboProperty combo_property = getChildValue(P_STATUS).value<ComboProperty>(); + ComboProperty combo_property = getItemValue(P_STATUS).value<ComboProperty>(); return combo_property.getValue() == Constants::STATUS_FAILED; } void JobItem::setBeginTime(const QString &begin_time) { - setChildValue(P_BEGIN_TIME, begin_time); + setItemValue(P_BEGIN_TIME, begin_time); } void JobItem::setEndTime(const QString &end_time) { - setChildValue(P_END_TIME, end_time); + setItemValue(P_END_TIME, end_time); } QString JobItem::getComments() const { - return getChildValue(P_COMMENTS).toString(); + return getItemValue(P_COMMENTS).toString(); } void JobItem::setComments(const QString &comments) { - setChildValue(P_COMMENTS, comments); + setItemValue(P_COMMENTS, comments); } int JobItem::getProgress() const { - return getChildValue(P_PROGRESS).toInt(); + return getItemValue(P_PROGRESS).toInt(); } void JobItem::setProgress(int progress) { - setChildValue(P_PROGRESS, progress); + setItemValue(P_PROGRESS, progress); } int JobItem::getNumberOfThreads() const { - return getChildValue(P_NTHREADS).toInt(); + return getItemValue(P_NTHREADS).toInt(); } void JobItem::setNumberOfThreads(int number_of_threads) { - setChildValue(P_NTHREADS, number_of_threads); + setItemValue(P_NTHREADS, number_of_threads); } void JobItem::setRunPolicy(const QString &run_policy) { - ComboProperty combo_property = getChildValue(JobItem::P_RUN_POLICY).value<ComboProperty>(); + ComboProperty combo_property = getItemValue(JobItem::P_RUN_POLICY).value<ComboProperty>(); combo_property.setValue(run_policy); - setChildValue(JobItem::P_RUN_POLICY, combo_property.getVariant()); + setItemValue(JobItem::P_RUN_POLICY, combo_property.getVariant()); } bool JobItem::runImmediately() const { - ComboProperty combo_property = getChildValue(P_RUN_POLICY).value<ComboProperty>(); + ComboProperty combo_property = getItemValue(P_RUN_POLICY).value<ComboProperty>(); return combo_property.getValue() == Constants::JOB_RUN_IMMEDIATELY; } bool JobItem::runInBackground() const { - ComboProperty combo_property = getChildValue(P_RUN_POLICY).value<ComboProperty>(); + ComboProperty combo_property = getItemValue(P_RUN_POLICY).value<ComboProperty>(); return combo_property.getValue() == Constants::JOB_RUN_IN_BACKGROUND; } diff --git a/GUI/coregui/Models/JobModel.cpp b/GUI/coregui/Models/JobModel.cpp index 0b469cf847af3d169db714af807a8be0b5f1132d..a6214add7b1c7ebf095c94d2e09bb6d2a48f4c1e 100644 --- a/GUI/coregui/Models/JobModel.cpp +++ b/GUI/coregui/Models/JobModel.cpp @@ -107,7 +107,7 @@ void JobModel::setSampleForJobItem(JobItem *jobItem, const MultiLayerItem *multi // our original multiLayerItem might come from backup itself, lets clean up its specific name QString name = new_item->itemName(); name.remove(Constants::JOB_BACKUP); - jobItem->setChildValue(JobItem::P_SAMPLE_NAME, name); + jobItem->setItemValue(JobItem::P_SAMPLE_NAME, name); // if new_item is supposed to be the backup, then it's name should end up with '_backup' if(backup) { @@ -135,7 +135,7 @@ void JobModel::setInstrumentForJobItem(JobItem *jobItem, const InstrumentItem *i // our original instrumentItem might itself come from backup, lets clean up its specific name QString name = new_item->itemName(); name.remove(Constants::JOB_BACKUP); - jobItem->setChildValue(JobItem::P_INSTRUMENT_NAME, name); + jobItem->setItemValue(JobItem::P_INSTRUMENT_NAME, name); // if new_item is supposed to be the backup, then it's name should end up with '_backup' if(backup) { diff --git a/GUI/coregui/Models/JobResultsPresenter.cpp b/GUI/coregui/Models/JobResultsPresenter.cpp index fdd4c27589a3bd2a6ca58dcd961632743f9a5271..42eedaf815ae6749cb1f27424ac0da2603a6f0e5 100644 --- a/GUI/coregui/Models/JobResultsPresenter.cpp +++ b/GUI/coregui/Models/JobResultsPresenter.cpp @@ -179,7 +179,7 @@ JobResultsPresenter::preferableGUIAxesUnits(IDetector2D::EAxesUnits default_unit void JobResultsPresenter::initIntensityItemProperties(IntensityDataItem *intensityItem, const IDetector2D *detector) { - ComboProperty combo = intensityItem->getChildValue(IntensityDataItem::P_AXES_UNITS) + ComboProperty combo = intensityItem->getItemValue(IntensityDataItem::P_AXES_UNITS) .value<ComboProperty>(); if(!combo.getValues().isEmpty()) return; @@ -200,7 +200,7 @@ void JobResultsPresenter::initIntensityItemProperties(IntensityDataItem *intensi combo.setValue(cachedUnits); } - intensityItem->setChildValue(IntensityDataItem::P_AXES_UNITS, combo.getVariant()); + intensityItem->setItemValue(IntensityDataItem::P_AXES_UNITS, combo.getVariant()); diff --git a/GUI/coregui/Models/MagneticFieldItem.cpp b/GUI/coregui/Models/MagneticFieldItem.cpp index 2897b8d2b59701a0731fee5700fff296822c0c5c..3fef0b1eb65207f858f419a2c769a3516babfb4e 100644 --- a/GUI/coregui/Models/MagneticFieldItem.cpp +++ b/GUI/coregui/Models/MagneticFieldItem.cpp @@ -29,7 +29,7 @@ MagneticFieldItem::MagneticFieldItem() QString MagneticFieldItem::itemLabel() const { - return QString("(%1, %2, %3)").arg(getChildValue(P_BX).toDouble()) - .arg(getChildValue(P_BY).toDouble()) - .arg(getChildValue(P_BZ).toDouble()); + return QString("(%1, %2, %3)").arg(getItemValue(P_BX).toDouble()) + .arg(getItemValue(P_BY).toDouble()) + .arg(getItemValue(P_BZ).toDouble()); } diff --git a/GUI/coregui/Models/MaskItems.cpp b/GUI/coregui/Models/MaskItems.cpp index f17190925351c5729b004bf5b735bc38fd825d9c..ee477d6cf9e2f0d37c3e1bd47657856d9c6cce92 100644 --- a/GUI/coregui/Models/MaskItems.cpp +++ b/GUI/coregui/Models/MaskItems.cpp @@ -68,10 +68,10 @@ RectangleItem::RectangleItem() std::unique_ptr<Geometry::IShape2D> RectangleItem::createShape(double scale) const { - double xlow = scale*getChildValue(P_XLOW).toDouble(); - double ylow = scale*getChildValue(P_YLOW).toDouble(); - double xup = scale*getChildValue(P_XUP).toDouble(); - double yup = scale*getChildValue(P_YUP).toDouble(); + double xlow = scale*getItemValue(P_XLOW).toDouble(); + double ylow = scale*getItemValue(P_YLOW).toDouble(); + double xup = scale*getItemValue(P_XUP).toDouble(); + double yup = scale*getItemValue(P_YUP).toDouble(); return GUIHelpers::make_unique<Geometry::Rectangle>(xlow, ylow, xup, yup); } @@ -105,8 +105,8 @@ std::unique_ptr<Geometry::IShape2D> PolygonItem::createShape(double scale) const { std::vector<double> x,y; foreach(SessionItem *item, this->getChildrenOfType(Constants::PolygonPointType)) { - x.push_back(scale*item->getChildValue(PolygonPointItem::P_POSX).toDouble()); - y.push_back(scale*item->getChildValue(PolygonPointItem::P_POSY).toDouble()); + x.push_back(scale*item->getItemValue(PolygonPointItem::P_POSX).toDouble()); + y.push_back(scale*item->getItemValue(PolygonPointItem::P_POSY).toDouble()); } return GUIHelpers::make_unique<Geometry::Polygon>(x, y); } @@ -124,7 +124,7 @@ VerticalLineItem::VerticalLineItem() std::unique_ptr<Geometry::IShape2D> VerticalLineItem::createShape(double scale) const { return GUIHelpers::make_unique<Geometry::VerticalLine>( - scale*getChildValue(VerticalLineItem::P_POSX).toDouble()); + scale*getItemValue(VerticalLineItem::P_POSX).toDouble()); } /* ------------------------------------------------------------------------- */ @@ -140,7 +140,7 @@ HorizontalLineItem::HorizontalLineItem() std::unique_ptr<Geometry::IShape2D> HorizontalLineItem::createShape(double scale) const { return GUIHelpers::make_unique<Geometry::HorizontalLine>( - scale*getChildValue(HorizontalLineItem::P_POSY).toDouble()); + scale*getItemValue(HorizontalLineItem::P_POSY).toDouble()); } /* ------------------------------------------------------------------------- */ @@ -164,11 +164,11 @@ EllipseItem::EllipseItem() std::unique_ptr<Geometry::IShape2D> EllipseItem::createShape(double scale) const { - double xcenter = scale*getChildValue(EllipseItem::P_XCENTER).toDouble(); - double ycenter = scale*getChildValue(EllipseItem::P_YCENTER).toDouble(); - double xradius = scale*getChildValue(EllipseItem::P_XRADIUS).toDouble(); - double yradius = scale*getChildValue(EllipseItem::P_YRADIUS).toDouble(); - double angle = scale*getChildValue(EllipseItem::P_ANGLE).toDouble(); + double xcenter = scale*getItemValue(EllipseItem::P_XCENTER).toDouble(); + double ycenter = scale*getItemValue(EllipseItem::P_YCENTER).toDouble(); + double xradius = scale*getItemValue(EllipseItem::P_XRADIUS).toDouble(); + double yradius = scale*getItemValue(EllipseItem::P_YRADIUS).toDouble(); + double angle = scale*getItemValue(EllipseItem::P_ANGLE).toDouble(); return GUIHelpers::make_unique<Geometry::Ellipse>(xcenter, ycenter, xradius, yradius, angle); } diff --git a/GUI/coregui/Models/MaterialItem.cpp b/GUI/coregui/Models/MaterialItem.cpp index 8ce631de40f5008bcfe4b03571e985fbec4ca208..f1cb5991836f01973dbf619818cd4c8dc32d07b6 100644 --- a/GUI/coregui/Models/MaterialItem.cpp +++ b/GUI/coregui/Models/MaterialItem.cpp @@ -43,12 +43,12 @@ MaterialItem::MaterialItem() QString MaterialItem::getIdentifier() const { - return getChildValue(P_IDENTIFIER).toString(); + return getItemValue(P_IDENTIFIER).toString(); } QColor MaterialItem::getColor() const { - ColorProperty color_property = getChildValue(P_COLOR).value<ColorProperty>(); + ColorProperty color_property = getItemValue(P_COLOR).value<ColorProperty>(); return color_property.getColor(); } diff --git a/GUI/coregui/Models/MaterialModel.cpp b/GUI/coregui/Models/MaterialModel.cpp index 1956392e437eb3288666b568a59cf831399850c4..cf8c168dcc725fc20fe0d4fdc7cb5ad226a3edae 100644 --- a/GUI/coregui/Models/MaterialModel.cpp +++ b/GUI/coregui/Models/MaterialModel.cpp @@ -47,7 +47,7 @@ MaterialItem *MaterialModel::addMaterial(const QString &name, double delta, doub refractiveIndexItem->setDelta(delta); refractiveIndexItem->setBeta(beta); - materialItem->setChildValue(MaterialItem::P_COLOR, MaterialUtils::suggestMaterialColorProperty(name).getVariant()); + materialItem->setItemValue(MaterialItem::P_COLOR, MaterialUtils::suggestMaterialColorProperty(name).getVariant()); return materialItem; } diff --git a/GUI/coregui/Models/ModelPath.cpp b/GUI/coregui/Models/ModelPath.cpp index 964bcbdd46859b3118c445306416ca7b82091bd2..0666e1b8ef4b9953692b1b856dc753f7d231a8c9 100644 --- a/GUI/coregui/Models/ModelPath.cpp +++ b/GUI/coregui/Models/ModelPath.cpp @@ -47,7 +47,7 @@ double ModelPath::getParameterValue(const SessionItem *item, const QString &name return getParameterValue(p_child, stripFirstField(name)); } if (item->isTag(head)) { - return item->getChildValue(head).toDouble(); + return item->getItemValue(head).toDouble(); } else { return 0.0; } diff --git a/GUI/coregui/Models/ParameterModelBuilder.cpp b/GUI/coregui/Models/ParameterModelBuilder.cpp index 4c8ec312e10498f08351c1261208de3e2a37e042..a143f66ea48a84f7c240f0fbbd5160d69c371fe6 100644 --- a/GUI/coregui/Models/ParameterModelBuilder.cpp +++ b/GUI/coregui/Models/ParameterModelBuilder.cpp @@ -187,7 +187,7 @@ QStandardItem *ParameterModelBuilder::iterateInstrumentItem(InstrumentItem *inst if (wavelengthDistribution->modelType() == Constants::DistributionNoneType) { addPropertyToParameterModel( standardItem, BeamItem::P_WAVELENGTH, BeamDistributionItem::P_CACHED_VALUE, - beamWavelength->getChildValue(BeamDistributionItem::P_CACHED_VALUE), + beamWavelength->getItemValue(BeamDistributionItem::P_CACHED_VALUE), beamWavelength); } else { addDisabledProperty(standardItem, BeamItem::P_WAVELENGTH); @@ -202,7 +202,7 @@ QStandardItem *ParameterModelBuilder::iterateInstrumentItem(InstrumentItem *inst if (inclinationDistribution->modelType() == Constants::DistributionNoneType) { addPropertyToParameterModel( standardItem, BeamItem::P_INCLINATION_ANGLE, BeamDistributionItem::P_CACHED_VALUE, - inclinationAngle->getChildValue(BeamDistributionItem::P_CACHED_VALUE), + inclinationAngle->getItemValue(BeamDistributionItem::P_CACHED_VALUE), inclinationAngle); } else { addDisabledProperty(standardItem, BeamItem::P_INCLINATION_ANGLE); @@ -216,7 +216,7 @@ QStandardItem *ParameterModelBuilder::iterateInstrumentItem(InstrumentItem *inst if (azimuthalDistribution->modelType() == Constants::DistributionNoneType) { addPropertyToParameterModel( standardItem, BeamItem::P_AZIMUTHAL_ANGLE, BeamDistributionItem::P_CACHED_VALUE, - azimuthalAngle->getChildValue(BeamDistributionItem::P_CACHED_VALUE), + azimuthalAngle->getItemValue(BeamDistributionItem::P_CACHED_VALUE), azimuthalAngle); } else { addDisabledProperty(standardItem, BeamItem::P_AZIMUTHAL_ANGLE); diff --git a/GUI/coregui/Models/ParticleCompositionItem.cpp b/GUI/coregui/Models/ParticleCompositionItem.cpp index 8dc833209d7ec5c34ac3804f4142d6dfa64e00c0..0b1f764987b1a5b76746dddc23c00f2b23dfb981 100644 --- a/GUI/coregui/Models/ParticleCompositionItem.cpp +++ b/GUI/coregui/Models/ParticleCompositionItem.cpp @@ -44,7 +44,7 @@ ParticleCompositionItem::ParticleCompositionItem() [this](SessionItem *parent) { if (parent && (parent->modelType() == Constants::ParticleCompositionType || parent->modelType() == Constants::ParticleDistributionType)) { - setChildValue(ParticleItem::P_ABUNDANCE, 1.0); + setItemValue(ParticleItem::P_ABUNDANCE, 1.0); getItem(ParticleItem::P_ABUNDANCE)->setEnabled(false); } else { getItem(ParticleItem::P_ABUNDANCE)->setEnabled(true); @@ -54,7 +54,7 @@ ParticleCompositionItem::ParticleCompositionItem() std::unique_ptr<ParticleComposition> ParticleCompositionItem::createParticleComposition() const { - double abundance = getChildValue(ParticleItem::P_ABUNDANCE).toDouble(); + double abundance = getItemValue(ParticleItem::P_ABUNDANCE).toDouble(); auto P_composition = GUIHelpers::make_unique<ParticleComposition>(); P_composition->setAbundance(abundance); QVector<SessionItem *> children = childItems(); diff --git a/GUI/coregui/Models/ParticleCoreShellItem.cpp b/GUI/coregui/Models/ParticleCoreShellItem.cpp index 4f7fd9fcafbf0c8d8eb86fcf9764e11fbf3fdaa5..23334111a1cfb9d0225a20493049780a6a8aa3aa 100644 --- a/GUI/coregui/Models/ParticleCoreShellItem.cpp +++ b/GUI/coregui/Models/ParticleCoreShellItem.cpp @@ -47,7 +47,7 @@ ParticleCoreShellItem::ParticleCoreShellItem() if (name == "OBSOLETE_P_PORT" && parent()) { if (parent()->modelType() == Constants::ParticleCompositionType || parent()->modelType() == Constants::ParticleDistributionType) { - setChildValue(ParticleItem::P_ABUNDANCE, 1.0); + setItemValue(ParticleItem::P_ABUNDANCE, 1.0); getItem(ParticleItem::P_ABUNDANCE)->setEnabled(false); } } @@ -56,7 +56,7 @@ ParticleCoreShellItem::ParticleCoreShellItem() std::unique_ptr<ParticleCoreShell> ParticleCoreShellItem::createParticleCoreShell() const { - double abundance = getChildValue(ParticleItem::P_ABUNDANCE).toDouble(); + double abundance = getItemValue(ParticleItem::P_ABUNDANCE).toDouble(); auto children = childItems(); std::unique_ptr<Particle> P_core {}; std::unique_ptr<Particle> P_shell {}; diff --git a/GUI/coregui/Models/ParticleDistributionItem.cpp b/GUI/coregui/Models/ParticleDistributionItem.cpp index f95d12b8751149f07cc76762b093d02eec5804c9..7264e5e334a5bc50f08f51a2df576f0d883bd351 100644 --- a/GUI/coregui/Models/ParticleDistributionItem.cpp +++ b/GUI/coregui/Models/ParticleDistributionItem.cpp @@ -77,17 +77,17 @@ std::unique_ptr<ParticleDistribution> ParticleDistributionItem::createParticleDi auto P_distribution = TransformToDomain::createDistribution(*distr_item); - auto prop = getChildValue(ParticleDistributionItem::P_DISTRIBUTED_PARAMETER) + auto prop = getItemValue(ParticleDistributionItem::P_DISTRIBUTED_PARAMETER) .value<ComboProperty>(); QString par_name = prop.getValue(); std::string domain_par = ModelPath::translateParameterName(this, par_name); int nbr_samples - = distr_item->getChildValue(DistributionItem::P_NUMBER_OF_SAMPLES).toInt(); + = distr_item->getItemValue(DistributionItem::P_NUMBER_OF_SAMPLES).toInt(); double sigma_factor - = distr_item->getChildValue(DistributionItem::P_SIGMA_FACTOR).toDouble(); + = distr_item->getItemValue(DistributionItem::P_SIGMA_FACTOR).toDouble(); ParameterDistribution par_distr(domain_par, *P_distribution, nbr_samples, sigma_factor); auto result = GUIHelpers::make_unique<ParticleDistribution>(*P_particle, par_distr); - double abundance = getChildValue(ParticleItem::P_ABUNDANCE).toDouble(); + double abundance = getItemValue(ParticleItem::P_ABUNDANCE).toDouble(); result->setAbundance(abundance); return result; } @@ -96,7 +96,7 @@ void ParticleDistributionItem::updateParameterList() { if (!isTag(P_DISTRIBUTED_PARAMETER)) return; - QVariant par_prop = getChildValue(P_DISTRIBUTED_PARAMETER); + QVariant par_prop = getItemValue(P_DISTRIBUTED_PARAMETER); auto combo_prop = par_prop.value<ComboProperty>(); QString cached_par = combo_prop.getCachedValue(); if (!combo_prop.cacheContainsGUIValue()) { @@ -120,7 +120,7 @@ void ParticleDistributionItem::updateParameterList() } else { updated_prop.setValue(NO_SELECTION); } - setChildValue(P_DISTRIBUTED_PARAMETER, updated_prop.getVariant()); + setItemValue(P_DISTRIBUTED_PARAMETER, updated_prop.getVariant()); } QStringList ParticleDistributionItem::getChildParameterNames() const diff --git a/GUI/coregui/Models/ParticleItem.cpp b/GUI/coregui/Models/ParticleItem.cpp index 87602fb11b5ddde80a4633601ca579837b7c06e0..aab137f0455ca2d80b74938866bb320d2c9c3bdd 100644 --- a/GUI/coregui/Models/ParticleItem.cpp +++ b/GUI/coregui/Models/ParticleItem.cpp @@ -54,7 +54,7 @@ std::unique_ptr<Particle> ParticleItem::createParticle() const auto P_material = TransformToDomain::createDomainMaterial(*this); auto P_particle = GUIHelpers::make_unique<Particle>(*P_material); - double abundance = getChildValue(ParticleItem::P_ABUNDANCE).toDouble(); + double abundance = getItemValue(ParticleItem::P_ABUNDANCE).toDouble(); P_particle->setAbundance(abundance); auto ffItem = static_cast<FormFactorItem*>(getGroupItem(ParticleItem::P_FORM_FACTOR)); diff --git a/GUI/coregui/Models/RectangularDetectorItem.cpp b/GUI/coregui/Models/RectangularDetectorItem.cpp index e5b64f8cef5ead174e9903117952807d0d182d36..8437250bb19f5b0da1c75b98a414fba2c3683ddc 100644 --- a/GUI/coregui/Models/RectangularDetectorItem.cpp +++ b/GUI/coregui/Models/RectangularDetectorItem.cpp @@ -69,7 +69,7 @@ RectangularDetectorItem::RectangularDetectorItem() getGroupItem(P_X_AXIS)->getItem(BasicAxisItem::P_TITLE)->setVisible(false); getGroupItem(P_X_AXIS)->getItem(BasicAxisItem::P_MIN)->setVisible(false); - getGroupItem(P_X_AXIS)->setChildValue(BasicAxisItem::P_MAX, default_detector_width); + getGroupItem(P_X_AXIS)->setItemValue(BasicAxisItem::P_MAX, default_detector_width); getGroupItem(P_X_AXIS)->getItem(BasicAxisItem::P_MAX)->setDisplayName(QStringLiteral("Width")); getGroupItem(P_X_AXIS)->getItem(BasicAxisItem::P_MAX) ->setToolTip(QStringLiteral("Width of the detector in mm")); @@ -77,7 +77,7 @@ RectangularDetectorItem::RectangularDetectorItem() addGroupProperty(P_Y_AXIS, Constants::BasicAxisType); getGroupItem(P_Y_AXIS)->getItem(BasicAxisItem::P_TITLE)->setVisible(false); getGroupItem(P_Y_AXIS)->getItem(BasicAxisItem::P_MIN)->setVisible(false); - getGroupItem(P_Y_AXIS)->setChildValue(BasicAxisItem::P_MAX, default_detector_height); + getGroupItem(P_Y_AXIS)->setItemValue(BasicAxisItem::P_MAX, default_detector_height); getGroupItem(P_Y_AXIS)->getItem(BasicAxisItem::P_MAX)->setDisplayName(QStringLiteral("Height")); getGroupItem(P_Y_AXIS)->getItem(BasicAxisItem::P_MAX) ->setToolTip(QStringLiteral("Height of the detector in mm")); @@ -97,10 +97,10 @@ RectangularDetectorItem::RectangularDetectorItem() // alignment parameters addGroupProperty(P_NORMAL, Constants::VectorType); - getGroupItem(P_NORMAL)->setChildValue(VectorItem::P_X, default_detector_distance); + getGroupItem(P_NORMAL)->setItemValue(VectorItem::P_X, default_detector_distance); addGroupProperty(P_DIRECTION, Constants::VectorType); - getGroupItem(P_DIRECTION)->setChildValue(VectorItem::P_Y, -1.0); + getGroupItem(P_DIRECTION)->setItemValue(VectorItem::P_Y, -1.0); addProperty(P_U0, default_detector_width/2.)->setToolTip(tooltip_u0); addProperty(P_V0, 0.0)->setToolTip(tooltip_v0); @@ -125,14 +125,14 @@ std::unique_ptr<IDetector2D> RectangularDetectorItem::createDetector() const auto x_axis = dynamic_cast<BasicAxisItem *>( getGroupItem(RectangularDetectorItem::P_X_AXIS)); Q_ASSERT(x_axis); - int n_x = x_axis->getChildValue(BasicAxisItem::P_NBINS).toInt(); - double width = x_axis->getChildValue(BasicAxisItem::P_MAX).toDouble(); + int n_x = x_axis->getItemValue(BasicAxisItem::P_NBINS).toInt(); + double width = x_axis->getItemValue(BasicAxisItem::P_MAX).toDouble(); auto y_axis = dynamic_cast<BasicAxisItem *>( getGroupItem(RectangularDetectorItem::P_Y_AXIS)); Q_ASSERT(y_axis); - int n_y = y_axis->getChildValue(BasicAxisItem::P_NBINS).toInt(); - double height = y_axis->getChildValue(BasicAxisItem::P_MAX).toDouble(); + int n_y = y_axis->getItemValue(BasicAxisItem::P_NBINS).toInt(); + double height = y_axis->getItemValue(BasicAxisItem::P_MAX).toDouble(); // std::unique_ptr<RectangularDetector> result(new RectangularDetector(100, 20.0, 100, 20.0)); // result->setPerpendicularToSampleX(1000.0, 10.0, 0.0); @@ -141,16 +141,16 @@ std::unique_ptr<IDetector2D> RectangularDetectorItem::createDetector() const // distance and alighnment - double u0 = getChildValue(P_U0).toDouble(); - double v0 = getChildValue(P_V0).toDouble(); - double dbeam_u0 = getChildValue(P_DBEAM_U0).toDouble(); - double dbeam_v0 = getChildValue(P_DBEAM_V0).toDouble(); - double distance = getChildValue(P_DISTANCE).toDouble(); + double u0 = getItemValue(P_U0).toDouble(); + double v0 = getItemValue(P_V0).toDouble(); + double dbeam_u0 = getItemValue(P_DBEAM_U0).toDouble(); + double dbeam_v0 = getItemValue(P_DBEAM_V0).toDouble(); + double distance = getItemValue(P_DISTANCE).toDouble(); kvector_t normal = getNormalVector(); kvector_t direction = getDirectionVector(); - ComboProperty alignment = getChildValue(P_ALIGNMENT).value<ComboProperty>(); + ComboProperty alignment = getItemValue(P_ALIGNMENT).value<ComboProperty>(); if (alignment.getValue() == Constants::ALIGNMENT_GENERIC) { result->setPosition(normal, u0, v0, direction); @@ -187,13 +187,13 @@ std::unique_ptr<IResolutionFunction2D> RectangularDetectorItem::createResolution void RectangularDetectorItem::setDetectorAlignment(const QString &alignment) { ComboProperty combo_property - = getChildValue(RectangularDetectorItem::P_ALIGNMENT).value<ComboProperty>(); + = getItemValue(RectangularDetectorItem::P_ALIGNMENT).value<ComboProperty>(); if(!combo_property.getValues().contains(alignment)) { throw GUIHelpers::Error("RectangularDetectorItem::setDetectorAlignment -> Unexpected alignment"); } combo_property.setValue(alignment); - setChildValue(RectangularDetectorItem::P_ALIGNMENT, combo_property.getVariant()); + setItemValue(RectangularDetectorItem::P_ALIGNMENT, combo_property.getVariant()); } @@ -201,7 +201,7 @@ void RectangularDetectorItem::setDetectorAlignment(const QString &alignment) void RectangularDetectorItem::update_properties_appearance() { // hiding all alignment properties - ComboProperty alignment = getChildValue(P_ALIGNMENT).value<ComboProperty>(); + ComboProperty alignment = getItemValue(P_ALIGNMENT).value<ComboProperty>(); QStringList prop_list; prop_list << P_NORMAL << P_DIRECTION << P_U0 << P_V0 << P_DBEAM_U0 << P_DBEAM_V0 << P_DISTANCE; foreach(auto prop, prop_list) { diff --git a/GUI/coregui/Models/RefractiveIndexItem.cpp b/GUI/coregui/Models/RefractiveIndexItem.cpp index 32d33583ea3061e8fb2484fa12a2f0814451dec1..529aef46bca22cddfc3f6e7078177fda459cef7c 100644 --- a/GUI/coregui/Models/RefractiveIndexItem.cpp +++ b/GUI/coregui/Models/RefractiveIndexItem.cpp @@ -38,24 +38,24 @@ QString RefractiveIndexItem::itemLabel() const double RefractiveIndexItem::getDelta() const { - return getChildValue(P_DELTA).value<ScientificDoubleProperty>().getValue(); + return getItemValue(P_DELTA).value<ScientificDoubleProperty>().getValue(); } void RefractiveIndexItem::setDelta(double delta) { - ScientificDoubleProperty scd_property = getChildValue(P_DELTA).value<ScientificDoubleProperty>(); + ScientificDoubleProperty scd_property = getItemValue(P_DELTA).value<ScientificDoubleProperty>(); scd_property.setValue(delta); - setChildValue(P_DELTA, scd_property.getVariant()); + setItemValue(P_DELTA, scd_property.getVariant()); } double RefractiveIndexItem::getBeta() const { - return getChildValue(P_BETA).value<ScientificDoubleProperty>().getValue(); + return getItemValue(P_BETA).value<ScientificDoubleProperty>().getValue(); } void RefractiveIndexItem::setBeta(double beta) { - ScientificDoubleProperty scd_property = getChildValue(P_BETA).value<ScientificDoubleProperty>(); + ScientificDoubleProperty scd_property = getItemValue(P_BETA).value<ScientificDoubleProperty>(); scd_property.setValue(beta); - setChildValue(P_BETA, scd_property.getVariant()); + setItemValue(P_BETA, scd_property.getVariant()); } diff --git a/GUI/coregui/Models/ResolutionFunctionItems.cpp b/GUI/coregui/Models/ResolutionFunctionItems.cpp index 2de5fb342c56ef72d49dc47bac11b0c2e8fe56d3..f3b3d3c542b7a340da5e2f70002ee9b2ae953274 100644 --- a/GUI/coregui/Models/ResolutionFunctionItems.cpp +++ b/GUI/coregui/Models/ResolutionFunctionItems.cpp @@ -54,7 +54,7 @@ ResolutionFunction2DGaussianItem::ResolutionFunction2DGaussianItem() IResolutionFunction2D *ResolutionFunction2DGaussianItem::createResolutionFunction(double scale) const { - double sigma_x = getChildValue(P_SIGMA_X).toDouble(); - double sigma_y = getChildValue(P_SIGMA_Y).toDouble(); + double sigma_x = getItemValue(P_SIGMA_X).toDouble(); + double sigma_y = getItemValue(P_SIGMA_Y).toDouble(); return new ResolutionFunction2DGaussian(sigma_x*scale, sigma_y*scale); } diff --git a/GUI/coregui/Models/RotationItems.cpp b/GUI/coregui/Models/RotationItems.cpp index c399720979db742fec342295fae617847d4450a7..afb2286228acedfa6c834f1db5b19bca8b8d5b1c 100644 --- a/GUI/coregui/Models/RotationItems.cpp +++ b/GUI/coregui/Models/RotationItems.cpp @@ -29,7 +29,7 @@ XRotationItem::XRotationItem() IRotation *XRotationItem::createRotation() const { - double alpha = Units::deg2rad(getChildValue(P_ANGLE).toDouble() ); + double alpha = Units::deg2rad(getItemValue(P_ANGLE).toDouble() ); return new RotationX(alpha); } @@ -45,7 +45,7 @@ YRotationItem::YRotationItem() IRotation *YRotationItem::createRotation() const { - double alpha = Units::deg2rad(getChildValue(P_ANGLE).toDouble() ); + double alpha = Units::deg2rad(getItemValue(P_ANGLE).toDouble() ); return new RotationY(alpha); } @@ -61,7 +61,7 @@ ZRotationItem::ZRotationItem() IRotation *ZRotationItem::createRotation() const { - double alpha = Units::deg2rad(getChildValue(P_ANGLE).toDouble() ); + double alpha = Units::deg2rad(getItemValue(P_ANGLE).toDouble() ); return new RotationZ(alpha); } @@ -81,8 +81,8 @@ EulerRotationItem::EulerRotationItem() IRotation *EulerRotationItem::createRotation() const { - double alpha = Units::deg2rad(getChildValue(P_ALPHA).toDouble() ); - double beta = Units::deg2rad(getChildValue(P_BETA).toDouble() ); - double gamma = Units::deg2rad(getChildValue(P_GAMMA).toDouble() ); + double alpha = Units::deg2rad(getItemValue(P_ALPHA).toDouble() ); + double beta = Units::deg2rad(getItemValue(P_BETA).toDouble() ); + double gamma = Units::deg2rad(getItemValue(P_GAMMA).toDouble() ); return new RotationEuler(alpha, beta, gamma); } diff --git a/GUI/coregui/Models/SampleModel.cpp b/GUI/coregui/Models/SampleModel.cpp index ad5e430d933eaea40e5d5c62028115ae2d6ffa2d..4ae7eefec66202856ff52620e7f1ceba1b24943b 100644 --- a/GUI/coregui/Models/SampleModel.cpp +++ b/GUI/coregui/Models/SampleModel.cpp @@ -71,7 +71,7 @@ void SampleModel::exploreForMaterials(const QModelIndex &parentIndex) || item->modelType() == Constants::ParticleType) { qDebug() << " found item" << item->modelType(); MaterialProperty material_property - = item->getChildValue(LayerItem::P_MATERIAL).value<MaterialProperty>(); + = item->getItemValue(LayerItem::P_MATERIAL).value<MaterialProperty>(); if (material_property.getIdentifier() == m_material_identifier) { // item->setRegisteredProperty(LayerItem::P_MATERIAL, // material_property.getVariant()); diff --git a/GUI/coregui/Models/SessionItem.cpp b/GUI/coregui/Models/SessionItem.cpp index f88608377e411cafa3431cfe4109b5002953c858..1bb2bae4f79598ae6ea730f8389f9a91af944bc2 100644 --- a/GUI/coregui/Models/SessionItem.cpp +++ b/GUI/coregui/Models/SessionItem.cpp @@ -349,7 +349,7 @@ bool SessionItem::setValue(QVariant value) QString SessionItem::itemName() const { if (isTag(P_NAME)) { - return getChildValue(P_NAME).toString(); + return getItemValue(P_NAME).toString(); } else { return displayName(); } @@ -358,7 +358,7 @@ QString SessionItem::itemName() const void SessionItem::setItemName(const QString &name) { if (isTag(P_NAME)) { - setChildValue(P_NAME, name); + setItemValue(P_NAME, name); } else { addProperty(P_NAME, name); } @@ -505,7 +505,7 @@ bool SessionItem::isTag(const QString &name) const return getTagInfo(name).isValid(); } -QVariant SessionItem::getChildValue(const QString &tag) const +QVariant SessionItem::getItemValue(const QString &tag) const { if (!isTag(tag)) throw GUIHelpers::Error( @@ -515,7 +515,7 @@ QVariant SessionItem::getChildValue(const QString &tag) const return getItem(tag)->value(); } -void SessionItem::setChildValue(const QString &tag, const QVariant &variant) +void SessionItem::setItemValue(const QString &tag, const QVariant &variant) { // check if variant of previous property coincides with new one if (!isTag(tag)) diff --git a/GUI/coregui/Models/SessionItem.h b/GUI/coregui/Models/SessionItem.h index 786a733bae8f97cce42562ba732f069a92e69152..4e9bcc4217b1c575e8a56ea874df28c5f611d728 100644 --- a/GUI/coregui/Models/SessionItem.h +++ b/GUI/coregui/Models/SessionItem.h @@ -92,8 +92,8 @@ public: bool isTag(const QString &name) const; - QVariant getChildValue(const QString &tag) const; - void setChildValue(const QString &tag, const QVariant &variant); + QVariant getItemValue(const QString &tag) const; + void setItemValue(const QString &tag, const QVariant &variant); SessionItem *setGroupProperty(const QString &name, const QString &value) const; SessionItem *getGroupItem(const QString &name, const QString &type = QString()) const; diff --git a/GUI/coregui/Models/SphericalDetectorItem.cpp b/GUI/coregui/Models/SphericalDetectorItem.cpp index 520cd30c120a515dc2f1251227c30c47ae05e16b..8f5b2def1632f59894fb50da626e53f8c6187c86 100644 --- a/GUI/coregui/Models/SphericalDetectorItem.cpp +++ b/GUI/coregui/Models/SphericalDetectorItem.cpp @@ -30,13 +30,13 @@ SphericalDetectorItem::SphericalDetectorItem() { addGroupProperty(P_PHI_AXIS, Constants::BasicAxisType); getGroupItem(P_PHI_AXIS)->getItem(BasicAxisItem::P_TITLE)->setVisible(false); - getGroupItem(P_PHI_AXIS)->setChildValue(BasicAxisItem::P_MIN, -1.0); - getGroupItem(P_PHI_AXIS)->setChildValue(BasicAxisItem::P_MAX, 1.0); + getGroupItem(P_PHI_AXIS)->setItemValue(BasicAxisItem::P_MIN, -1.0); + getGroupItem(P_PHI_AXIS)->setItemValue(BasicAxisItem::P_MAX, 1.0); addGroupProperty(P_ALPHA_AXIS, Constants::BasicAxisType); getGroupItem(P_ALPHA_AXIS)->getItem(BasicAxisItem::P_TITLE)->setVisible(false); - getGroupItem(P_ALPHA_AXIS)->setChildValue(BasicAxisItem::P_MIN, 0.0); - getGroupItem(P_ALPHA_AXIS)->setChildValue(BasicAxisItem::P_MAX, 2.0); + getGroupItem(P_ALPHA_AXIS)->setItemValue(BasicAxisItem::P_MIN, 0.0); + getGroupItem(P_ALPHA_AXIS)->setItemValue(BasicAxisItem::P_MAX, 2.0); addGroupProperty(P_RESOLUTION_FUNCTION, Constants::ResolutionFunctionGroup); setGroupProperty(P_RESOLUTION_FUNCTION, Constants::ResolutionFunctionNoneType); @@ -52,20 +52,20 @@ std::unique_ptr<IDetector2D> SphericalDetectorItem::createDetector() const auto x_axis = dynamic_cast<BasicAxisItem *>( getGroupItem(SphericalDetectorItem::P_PHI_AXIS)); Q_ASSERT(x_axis); - int n_x = x_axis->getChildValue(BasicAxisItem::P_NBINS).toInt(); + int n_x = x_axis->getItemValue(BasicAxisItem::P_NBINS).toInt(); double x_min - = Units::deg2rad(x_axis->getChildValue(BasicAxisItem::P_MIN).toDouble()); + = Units::deg2rad(x_axis->getItemValue(BasicAxisItem::P_MIN).toDouble()); double x_max - = Units::deg2rad(x_axis->getChildValue(BasicAxisItem::P_MAX).toDouble()); + = Units::deg2rad(x_axis->getItemValue(BasicAxisItem::P_MAX).toDouble()); auto y_axis = dynamic_cast<BasicAxisItem *>( getGroupItem(SphericalDetectorItem::P_ALPHA_AXIS)); Q_ASSERT(y_axis); - int n_y = y_axis->getChildValue(BasicAxisItem::P_NBINS).toInt(); + int n_y = y_axis->getItemValue(BasicAxisItem::P_NBINS).toInt(); double y_min - = Units::deg2rad(y_axis->getChildValue(BasicAxisItem::P_MIN).toDouble()); + = Units::deg2rad(y_axis->getItemValue(BasicAxisItem::P_MIN).toDouble()); double y_max - = Units::deg2rad(y_axis->getChildValue(BasicAxisItem::P_MAX).toDouble()); + = Units::deg2rad(y_axis->getItemValue(BasicAxisItem::P_MAX).toDouble()); result->setDetectorParameters(n_x, x_min, x_max, n_y, y_min, y_max); diff --git a/GUI/coregui/Models/TransformFromDomain.cpp b/GUI/coregui/Models/TransformFromDomain.cpp index 4ca1bb56a68b6ef22d0aac0ede002d831e54b806..f378e44fbedcbc3b259e46105f7c35d2f4c4b9b8 100644 --- a/GUI/coregui/Models/TransformFromDomain.cpp +++ b/GUI/coregui/Models/TransformFromDomain.cpp @@ -83,13 +83,13 @@ void setDistribution(SessionItem *item, ParameterDistribution par_distr, void TransformFromDomain::setItemFromSample(SessionItem *item, const InterferenceFunctionRadialParaCrystal *sample) { - item->setChildValue(InterferenceFunctionRadialParaCrystalItem::P_PEAK_DISTANCE, + item->setItemValue(InterferenceFunctionRadialParaCrystalItem::P_PEAK_DISTANCE, sample->getPeakDistance()); - item->setChildValue(InterferenceFunctionRadialParaCrystalItem::P_DAMPING_LENGTH, + item->setItemValue(InterferenceFunctionRadialParaCrystalItem::P_DAMPING_LENGTH, sample->getDampingLength()); - item->setChildValue(InterferenceFunctionRadialParaCrystalItem::P_DOMAIN_SIZE, + item->setItemValue(InterferenceFunctionRadialParaCrystalItem::P_DOMAIN_SIZE, sample->getDomainSize()); - item->setChildValue(InterferenceFunctionRadialParaCrystalItem::P_KAPPA, + item->setItemValue(InterferenceFunctionRadialParaCrystalItem::P_KAPPA, sample->getKappa()); const IFTDistribution1D *ipdf = sample->getProbabilityDistribution(); @@ -105,13 +105,13 @@ void TransformFromDomain::setItemFromSample(SessionItem *item, Lattice2DParameters lattice_params = sample->getLatticeParameters(); set2DLatticeParameters(item, lattice_params, lattice_item); - item->setChildValue(InterferenceFunction2DParaCrystalItem::P_DAMPING_LENGTH, + item->setItemValue(InterferenceFunction2DParaCrystalItem::P_DAMPING_LENGTH, sample->getDampingLength()); - item->setChildValue(InterferenceFunction2DParaCrystalItem::P_DOMAIN_SIZE1, + item->setItemValue(InterferenceFunction2DParaCrystalItem::P_DOMAIN_SIZE1, sample->getDomainSizes()[0]); - item->setChildValue(InterferenceFunction2DParaCrystalItem::P_DOMAIN_SIZE2, + item->setItemValue(InterferenceFunction2DParaCrystalItem::P_DOMAIN_SIZE2, sample->getDomainSizes()[1]); - item->setChildValue(InterferenceFunction2DParaCrystalItem::P_XI_INTEGRATION, + item->setItemValue(InterferenceFunction2DParaCrystalItem::P_XI_INTEGRATION, sample->getIntegrationOverXi()); std::vector<const IFTDistribution2D *> pdfs = sample->getProbabilityDistributions(); @@ -128,9 +128,9 @@ void TransformFromDomain::setItemFromSample(SessionItem *item, const InterferenceFunction1DLattice *sample) { Lattice1DParameters lattice_params = sample->getLatticeParameters(); - item->setChildValue(InterferenceFunction1DLatticeItem::P_LENGTH, + item->setItemValue(InterferenceFunction1DLatticeItem::P_LENGTH, lattice_params.m_length); - item->setChildValue(InterferenceFunction1DLatticeItem::P_ROTATION_ANGLE, + item->setItemValue(InterferenceFunction1DLatticeItem::P_ROTATION_ANGLE, Units::rad2deg(lattice_params.m_xi)); const IFTDecayFunction1D *pdf = sample->getDecayFunction(); @@ -155,7 +155,7 @@ void TransformFromDomain::setItemFromSample(SessionItem *item, void TransformFromDomain::setItemFromSample(SessionItem *layerItem, const Layer *layer, const LayerInterface *top_interface) { - layerItem->setChildValue(LayerItem::P_THICKNESS, layer->getThickness()); + layerItem->setItemValue(LayerItem::P_THICKNESS, layer->getThickness()); layerItem->setGroupProperty(LayerItem::P_ROUGHNESS, Constants::LayerZeroRoughnessType); if (top_interface) { @@ -170,9 +170,9 @@ void TransformFromDomain::setItemFromSample(SessionItem *layerItem, const Layer void TransformFromDomain::setItemFromSample(SessionItem *item, const LayerRoughness *sample) { - item->setChildValue(LayerBasicRoughnessItem::P_SIGMA, sample->getSigma()); - item->setChildValue(LayerBasicRoughnessItem::P_HURST, sample->getHurstParameter()); - item->setChildValue(LayerBasicRoughnessItem::P_LATERAL_CORR_LENGTH, + item->setItemValue(LayerBasicRoughnessItem::P_SIGMA, sample->getSigma()); + item->setItemValue(LayerBasicRoughnessItem::P_HURST, sample->getHurstParameter()); + item->setItemValue(LayerBasicRoughnessItem::P_LATERAL_CORR_LENGTH, sample->getLatteralCorrLength()); } @@ -180,16 +180,16 @@ void TransformFromDomain::setItemFromSample(SessionItem *item, const LayerRoughn void TransformFromDomain::setItemFromSample(SessionItem *item, const ParticleDistribution *sample) { - item->setChildValue(ParticleItem::P_ABUNDANCE, sample->getAbundance()); + item->setItemValue(ParticleItem::P_ABUNDANCE, sample->getAbundance()); ParameterDistribution par_distr = sample->getParameterDistribution(); QString main_distr_par_name = QString::fromStdString(par_distr.getMainParameterName()); ComboProperty combo_property - = item->getChildValue(ParticleDistributionItem::P_DISTRIBUTED_PARAMETER) + = item->getItemValue(ParticleDistributionItem::P_DISTRIBUTED_PARAMETER) .value<ComboProperty>(); combo_property.setCachedValue(main_distr_par_name); combo_property.setCacheContainsGUIFlag(false); - item->setChildValue(ParticleDistributionItem::P_DISTRIBUTED_PARAMETER, + item->setItemValue(ParticleDistributionItem::P_DISTRIBUTED_PARAMETER, combo_property.getVariant()); QString group_name = ParticleDistributionItem::P_DISTRIBUTION; @@ -302,16 +302,16 @@ void TransformFromDomain::setItemFromSample(SphericalDetectorItem *detectorItem, BasicAxisItem *phiAxisItem = dynamic_cast<BasicAxisItem *>( detectorItem->getGroupItem(SphericalDetectorItem::P_PHI_AXIS)); Q_ASSERT(phiAxisItem); - phiAxisItem->setChildValue(BasicAxisItem::P_NBINS, (int)phi_axis.getSize()); - phiAxisItem->setChildValue(BasicAxisItem::P_MIN, Units::rad2deg(phi_axis.getMin())); - phiAxisItem->setChildValue(BasicAxisItem::P_MAX, Units::rad2deg(phi_axis.getMax())); + phiAxisItem->setItemValue(BasicAxisItem::P_NBINS, (int)phi_axis.getSize()); + phiAxisItem->setItemValue(BasicAxisItem::P_MIN, Units::rad2deg(phi_axis.getMin())); + phiAxisItem->setItemValue(BasicAxisItem::P_MAX, Units::rad2deg(phi_axis.getMax())); BasicAxisItem *alphaAxisItem = dynamic_cast<BasicAxisItem *>( detectorItem->getGroupItem(SphericalDetectorItem::P_ALPHA_AXIS)); Q_ASSERT(alphaAxisItem); - alphaAxisItem->setChildValue(BasicAxisItem::P_NBINS, (int)alpha_axis.getSize()); - alphaAxisItem->setChildValue(BasicAxisItem::P_MIN, Units::rad2deg(alpha_axis.getMin())); - alphaAxisItem->setChildValue(BasicAxisItem::P_MAX, Units::rad2deg(alpha_axis.getMax())); + alphaAxisItem->setItemValue(BasicAxisItem::P_NBINS, (int)alpha_axis.getSize()); + alphaAxisItem->setItemValue(BasicAxisItem::P_MIN, Units::rad2deg(alpha_axis.getMin())); + alphaAxisItem->setItemValue(BasicAxisItem::P_MAX, Units::rad2deg(alpha_axis.getMax())); // detector resolution if (const IDetectorResolution *p_resfunc = detector.getDetectorResolutionFunction()) { @@ -323,9 +323,9 @@ void TransformFromDomain::setItemFromSample(SphericalDetectorItem *detectorItem, SessionItem *item = detectorItem->setGroupProperty(SphericalDetectorItem::P_RESOLUTION_FUNCTION, Constants::ResolutionFunction2DGaussianType); - item->setChildValue(ResolutionFunction2DGaussianItem::P_SIGMA_X, + item->setItemValue(ResolutionFunction2DGaussianItem::P_SIGMA_X, Units::rad2deg(resfunc->getSigmaX())); - item->setChildValue(ResolutionFunction2DGaussianItem::P_SIGMA_Y, + item->setItemValue(ResolutionFunction2DGaussianItem::P_SIGMA_Y, Units::rad2deg(resfunc->getSigmaY())); } else { throw GUIHelpers::Error("TransformFromDomain::setItemFromSample(" @@ -350,69 +350,69 @@ void TransformFromDomain::setItemFromSample(RectangularDetectorItem *detectorIte BasicAxisItem *xAxisItem = dynamic_cast<BasicAxisItem *>( detectorItem->getGroupItem(RectangularDetectorItem::P_X_AXIS)); Q_ASSERT(xAxisItem); - xAxisItem->setChildValue(BasicAxisItem::P_NBINS, (int)detector.getNbinsX()); - xAxisItem->setChildValue(BasicAxisItem::P_MAX, detector.getWidth()); + xAxisItem->setItemValue(BasicAxisItem::P_NBINS, (int)detector.getNbinsX()); + xAxisItem->setItemValue(BasicAxisItem::P_MAX, detector.getWidth()); BasicAxisItem *yAxisItem = dynamic_cast<BasicAxisItem *>( detectorItem->getGroupItem(RectangularDetectorItem::P_Y_AXIS)); Q_ASSERT(yAxisItem); - yAxisItem->setChildValue(BasicAxisItem::P_NBINS, (int)detector.getNbinsY()); - yAxisItem->setChildValue(BasicAxisItem::P_MAX, detector.getHeight()); + yAxisItem->setItemValue(BasicAxisItem::P_NBINS, (int)detector.getNbinsY()); + yAxisItem->setItemValue(BasicAxisItem::P_MAX, detector.getHeight()); if(detector.getDetectorArrangment() == RectangularDetector::GENERIC) { detectorItem->setDetectorAlignment(Constants::ALIGNMENT_GENERIC); kvector_t normal = detector.getNormalVector(); - detectorItem->getGroupItem(RectangularDetectorItem::P_NORMAL)->setChildValue( + detectorItem->getGroupItem(RectangularDetectorItem::P_NORMAL)->setItemValue( VectorItem::P_X, normal.x()); - detectorItem->getGroupItem(RectangularDetectorItem::P_NORMAL)->setChildValue( + detectorItem->getGroupItem(RectangularDetectorItem::P_NORMAL)->setItemValue( VectorItem::P_Y, normal.y()); - detectorItem->getGroupItem(RectangularDetectorItem::P_NORMAL)->setChildValue( + detectorItem->getGroupItem(RectangularDetectorItem::P_NORMAL)->setItemValue( VectorItem::P_Z, normal.z()); kvector_t direction = detector.getDirectionVector(); - detectorItem->getGroupItem(RectangularDetectorItem::P_DIRECTION)->setChildValue( + detectorItem->getGroupItem(RectangularDetectorItem::P_DIRECTION)->setItemValue( VectorItem::P_X, direction.x()); - detectorItem->getGroupItem(RectangularDetectorItem::P_DIRECTION)->setChildValue( + detectorItem->getGroupItem(RectangularDetectorItem::P_DIRECTION)->setItemValue( VectorItem::P_Y, direction.y()); - detectorItem->getGroupItem(RectangularDetectorItem::P_DIRECTION)->setChildValue( + detectorItem->getGroupItem(RectangularDetectorItem::P_DIRECTION)->setItemValue( VectorItem::P_Z, direction.z()); - detectorItem->setChildValue(RectangularDetectorItem::P_U0, detector.getU0()); - detectorItem->setChildValue(RectangularDetectorItem::P_V0, detector.getV0()); + detectorItem->setItemValue(RectangularDetectorItem::P_U0, detector.getU0()); + detectorItem->setItemValue(RectangularDetectorItem::P_V0, detector.getV0()); } else if (detector.getDetectorArrangment() == RectangularDetector::PERPENDICULAR_TO_SAMPLE) { detectorItem->setDetectorAlignment(Constants::ALIGNMENT_TO_SAMPLE); - detectorItem->setChildValue(RectangularDetectorItem::P_DISTANCE, + detectorItem->setItemValue(RectangularDetectorItem::P_DISTANCE, detector.getDistance()); - detectorItem->setChildValue(RectangularDetectorItem::P_U0, detector.getU0()); - detectorItem->setChildValue(RectangularDetectorItem::P_V0, detector.getV0()); + detectorItem->setItemValue(RectangularDetectorItem::P_U0, detector.getU0()); + detectorItem->setItemValue(RectangularDetectorItem::P_V0, detector.getV0()); } else if (detector.getDetectorArrangment() == RectangularDetector::PERPENDICULAR_TO_DIRECT_BEAM) { detectorItem->setDetectorAlignment(Constants::ALIGNMENT_TO_DIRECT_BEAM); - detectorItem->setChildValue(RectangularDetectorItem::P_DISTANCE, + detectorItem->setItemValue(RectangularDetectorItem::P_DISTANCE, detector.getDistance()); - detectorItem->setChildValue(RectangularDetectorItem::P_DBEAM_U0, detector.getU0()); - detectorItem->setChildValue(RectangularDetectorItem::P_DBEAM_V0, detector.getV0()); + detectorItem->setItemValue(RectangularDetectorItem::P_DBEAM_U0, detector.getU0()); + detectorItem->setItemValue(RectangularDetectorItem::P_DBEAM_V0, detector.getV0()); } else if (detector.getDetectorArrangment() == RectangularDetector::PERPENDICULAR_TO_REFLECTED_BEAM) { detectorItem->setDetectorAlignment(Constants::ALIGNMENT_TO_REFLECTED_BEAM); - detectorItem->setChildValue(RectangularDetectorItem::P_DISTANCE, + detectorItem->setItemValue(RectangularDetectorItem::P_DISTANCE, detector.getDistance()); - detectorItem->setChildValue(RectangularDetectorItem::P_U0, detector.getU0()); - detectorItem->setChildValue(RectangularDetectorItem::P_V0, detector.getV0()); + detectorItem->setItemValue(RectangularDetectorItem::P_U0, detector.getU0()); + detectorItem->setItemValue(RectangularDetectorItem::P_V0, detector.getV0()); } else if (detector.getDetectorArrangment() == RectangularDetector::PERPENDICULAR_TO_REFLECTED_BEAM_DPOS) { detectorItem->setDetectorAlignment(Constants::ALIGNMENT_TO_REFLECTED_BEAM_DPOS); - detectorItem->setChildValue(RectangularDetectorItem::P_DISTANCE, + detectorItem->setItemValue(RectangularDetectorItem::P_DISTANCE, detector.getDistance()); - detectorItem->setChildValue(RectangularDetectorItem::P_DBEAM_U0, + detectorItem->setItemValue(RectangularDetectorItem::P_DBEAM_U0, detector.getDirectBeamU0()); - detectorItem->setChildValue(RectangularDetectorItem::P_DBEAM_V0, + detectorItem->setItemValue(RectangularDetectorItem::P_DBEAM_V0, detector.getDirectBeamV0()); } else { @@ -431,9 +431,9 @@ void TransformFromDomain::setItemFromSample(RectangularDetectorItem *detectorIte SessionItem *item = detectorItem->setGroupProperty(RectangularDetectorItem::P_RESOLUTION_FUNCTION, Constants::ResolutionFunction2DGaussianType); - item->setChildValue(ResolutionFunction2DGaussianItem::P_SIGMA_X, + item->setItemValue(ResolutionFunction2DGaussianItem::P_SIGMA_X, resfunc->getSigmaX()); - item->setChildValue(ResolutionFunction2DGaussianItem::P_SIGMA_Y, + item->setItemValue(ResolutionFunction2DGaussianItem::P_SIGMA_Y, resfunc->getSigmaY()); } else { throw GUIHelpers::Error("TransformFromDomain::setItemFromSample(" @@ -465,22 +465,22 @@ void TransformFromDomain::setDetectorMasks(DetectorItem *detectorItem, const GIS const Geometry::IShape2D *shape = detectorMask->getMaskShape(i_mask, mask_value); if(const Geometry::Ellipse *ellipse = dynamic_cast<const Geometry::Ellipse *>(shape)) { EllipseItem *ellipseItem = new EllipseItem(); - ellipseItem->setChildValue(EllipseItem::P_XCENTER, Units::rad2deg(ellipse->getCenterX())); - ellipseItem->setChildValue(EllipseItem::P_YCENTER, Units::rad2deg(ellipse->getCenterY())); - ellipseItem->setChildValue(EllipseItem::P_XRADIUS, Units::rad2deg(ellipse->getRadiusX())); - ellipseItem->setChildValue(EllipseItem::P_YRADIUS, Units::rad2deg(ellipse->getRadiusY())); - ellipseItem->setChildValue(EllipseItem::P_ANGLE, Units::rad2deg(ellipse->getTheta())); - ellipseItem->setChildValue(MaskItem::P_MASK_VALUE, mask_value); + ellipseItem->setItemValue(EllipseItem::P_XCENTER, Units::rad2deg(ellipse->getCenterX())); + ellipseItem->setItemValue(EllipseItem::P_YCENTER, Units::rad2deg(ellipse->getCenterY())); + ellipseItem->setItemValue(EllipseItem::P_XRADIUS, Units::rad2deg(ellipse->getRadiusX())); + ellipseItem->setItemValue(EllipseItem::P_YRADIUS, Units::rad2deg(ellipse->getRadiusY())); + ellipseItem->setItemValue(EllipseItem::P_ANGLE, Units::rad2deg(ellipse->getTheta())); + ellipseItem->setItemValue(MaskItem::P_MASK_VALUE, mask_value); containerItem->insertItem(0, ellipseItem); } else if(const Geometry::Rectangle *rectangle = dynamic_cast<const Geometry::Rectangle *>(shape)) { RectangleItem *rectangleItem = new RectangleItem(); - rectangleItem->setChildValue(RectangleItem::P_XLOW, Units::rad2deg(rectangle->getXlow())); - rectangleItem->setChildValue(RectangleItem::P_YLOW, Units::rad2deg(rectangle->getYlow())); - rectangleItem->setChildValue(RectangleItem::P_XUP, Units::rad2deg(rectangle->getXup())); - rectangleItem->setChildValue(RectangleItem::P_YUP, Units::rad2deg(rectangle->getYup())); - rectangleItem->setChildValue(MaskItem::P_MASK_VALUE, mask_value); + rectangleItem->setItemValue(RectangleItem::P_XLOW, Units::rad2deg(rectangle->getXlow())); + rectangleItem->setItemValue(RectangleItem::P_YLOW, Units::rad2deg(rectangle->getYlow())); + rectangleItem->setItemValue(RectangleItem::P_XUP, Units::rad2deg(rectangle->getXup())); + rectangleItem->setItemValue(RectangleItem::P_YUP, Units::rad2deg(rectangle->getYup())); + rectangleItem->setItemValue(MaskItem::P_MASK_VALUE, mask_value); containerItem->insertItem(0, rectangleItem); } @@ -490,32 +490,32 @@ void TransformFromDomain::setDetectorMasks(DetectorItem *detectorItem, const GIS polygon->getPoints(xpos, ypos); for(size_t i_point=0; i_point<xpos.size(); ++i_point) { PolygonPointItem *pointItem = new PolygonPointItem(); - pointItem->setChildValue(PolygonPointItem::P_POSX, Units::rad2deg(xpos[i_point])); - pointItem->setChildValue(PolygonPointItem::P_POSY, Units::rad2deg(ypos[i_point])); + pointItem->setItemValue(PolygonPointItem::P_POSX, Units::rad2deg(xpos[i_point])); + pointItem->setItemValue(PolygonPointItem::P_POSY, Units::rad2deg(ypos[i_point])); polygonItem->insertItem(-1, pointItem); } - polygonItem->setChildValue(MaskItem::P_MASK_VALUE, mask_value); - polygonItem->setChildValue(PolygonItem::P_ISCLOSED, true); + polygonItem->setItemValue(MaskItem::P_MASK_VALUE, mask_value); + polygonItem->setItemValue(PolygonItem::P_ISCLOSED, true); containerItem->insertItem(0, polygonItem); } else if(const Geometry::VerticalLine *vline = dynamic_cast<const Geometry::VerticalLine *>(shape)) { VerticalLineItem *lineItem = new VerticalLineItem(); - lineItem->setChildValue(VerticalLineItem::P_POSX, Units::rad2deg(vline->getXpos())); - lineItem->setChildValue(MaskItem::P_MASK_VALUE, mask_value); + lineItem->setItemValue(VerticalLineItem::P_POSX, Units::rad2deg(vline->getXpos())); + lineItem->setItemValue(MaskItem::P_MASK_VALUE, mask_value); containerItem->insertItem(0, lineItem); } else if(const Geometry::HorizontalLine *hline = dynamic_cast<const Geometry::HorizontalLine *>(shape)) { HorizontalLineItem *lineItem = new HorizontalLineItem(); - lineItem->setChildValue(HorizontalLineItem::P_POSY, Units::rad2deg(hline->getYpos())); - lineItem->setChildValue(MaskItem::P_MASK_VALUE, mask_value); + lineItem->setItemValue(HorizontalLineItem::P_POSY, Units::rad2deg(hline->getYpos())); + lineItem->setItemValue(MaskItem::P_MASK_VALUE, mask_value); containerItem->insertItem(0, lineItem); } else if(const Geometry::InfinitePlane *plane = dynamic_cast<const Geometry::InfinitePlane *>(shape)) { Q_UNUSED(plane); MaskAllItem *planeItem = new MaskAllItem(); - planeItem->setChildValue(MaskItem::P_MASK_VALUE, mask_value); + planeItem->setItemValue(MaskItem::P_MASK_VALUE, mask_value); containerItem->insertItem(-1, planeItem); } else { @@ -565,33 +565,33 @@ void SetPDF1D(SessionItem *item, const IFTDistribution1D *ipdf, QString group_na if (const FTDistribution1DCauchy *pdf = dynamic_cast<const FTDistribution1DCauchy *>(ipdf)) { SessionItem *pdfItem = item->setGroupProperty(group_name, Constants::FTDistribution1DCauchyType); - pdfItem->setChildValue(FTDistribution1DCauchyItem::P_CORR_LENGTH, pdf->getOmega()); + pdfItem->setItemValue(FTDistribution1DCauchyItem::P_CORR_LENGTH, pdf->getOmega()); } else if (const FTDistribution1DGauss *pdf = dynamic_cast<const FTDistribution1DGauss *>(ipdf)) { SessionItem *pdfItem = item->setGroupProperty(group_name, Constants::FTDistribution1DGaussType); - pdfItem->setChildValue(FTDistribution1DGaussItem::P_CORR_LENGTH, pdf->getOmega()); + pdfItem->setItemValue(FTDistribution1DGaussItem::P_CORR_LENGTH, pdf->getOmega()); } else if (const FTDistribution1DGate *pdf = dynamic_cast<const FTDistribution1DGate *>(ipdf)) { SessionItem *pdfItem = item->setGroupProperty(group_name, Constants::FTDistribution1DGateType); - pdfItem->setChildValue(FTDistribution1DGateItem::P_CORR_LENGTH, pdf->getOmega()); + pdfItem->setItemValue(FTDistribution1DGateItem::P_CORR_LENGTH, pdf->getOmega()); } else if (const FTDistribution1DTriangle *pdf = dynamic_cast<const FTDistribution1DTriangle *>(ipdf)) { SessionItem *pdfItem = item->setGroupProperty(group_name, Constants::FTDistribution1DTriangleType); - pdfItem->setChildValue(FTDistribution1DTriangleItem::P_CORR_LENGTH, + pdfItem->setItemValue(FTDistribution1DTriangleItem::P_CORR_LENGTH, pdf->getOmega()); } else if (const FTDistribution1DCosine *pdf = dynamic_cast<const FTDistribution1DCosine *>(ipdf)) { SessionItem *pdfItem = item->setGroupProperty(group_name, Constants::FTDistribution1DCosineType); - pdfItem->setChildValue(FTDistribution1DCosineItem::P_CORR_LENGTH, pdf->getOmega()); + pdfItem->setItemValue(FTDistribution1DCosineItem::P_CORR_LENGTH, pdf->getOmega()); } else if (const FTDistribution1DVoigt *pdf = dynamic_cast<const FTDistribution1DVoigt *>(ipdf)) { SessionItem *pdfItem = item->setGroupProperty(group_name, Constants::FTDistribution1DVoigtType); - pdfItem->setChildValue(FTDistribution1DVoigtItem::P_CORR_LENGTH, pdf->getOmega()); - pdfItem->setChildValue(FTDistribution1DVoigtItem::P_ETA, pdf->getEta()); + pdfItem->setItemValue(FTDistribution1DVoigtItem::P_CORR_LENGTH, pdf->getOmega()); + pdfItem->setItemValue(FTDistribution1DVoigtItem::P_ETA, pdf->getEta()); } else { throw GUIHelpers::Error("TransformFromDomain::setPDF1D: -> Error"); } @@ -603,53 +603,53 @@ void setPDF2D(SessionItem *item, const IFTDistribution2D *pdf, QString group_nam = dynamic_cast<const FTDistribution2DCauchy *>(pdf)) { SessionItem *pdfItem = item->setGroupProperty(group_name, Constants::FTDistribution2DCauchyType); - pdfItem->setChildValue(FTDistribution2DCauchyItem::P_CORR_LENGTH_X, + pdfItem->setItemValue(FTDistribution2DCauchyItem::P_CORR_LENGTH_X, pdf_cauchy->getCoherenceLengthX()); - pdfItem->setChildValue(FTDistribution2DCauchyItem::P_CORR_LENGTH_Y, + pdfItem->setItemValue(FTDistribution2DCauchyItem::P_CORR_LENGTH_Y, pdf_cauchy->getCoherenceLengthY()); - pdfItem->setChildValue(FTDistribution2DCauchyItem::P_GAMMA, + pdfItem->setItemValue(FTDistribution2DCauchyItem::P_GAMMA, Units::rad2deg(pdf_cauchy->getGamma())); } else if (const FTDistribution2DGauss *pdf_gauss = dynamic_cast<const FTDistribution2DGauss *>(pdf)) { SessionItem *pdfItem = item->setGroupProperty(group_name, Constants::FTDistribution2DGaussType); - pdfItem->setChildValue(FTDistribution2DGaussItem::P_CORR_LENGTH_X, + pdfItem->setItemValue(FTDistribution2DGaussItem::P_CORR_LENGTH_X, pdf_gauss->getCoherenceLengthX()); - pdfItem->setChildValue(FTDistribution2DGaussItem::P_CORR_LENGTH_Y, + pdfItem->setItemValue(FTDistribution2DGaussItem::P_CORR_LENGTH_Y, pdf_gauss->getCoherenceLengthY()); - pdfItem->setChildValue(FTDistribution2DGaussItem::P_GAMMA, + pdfItem->setItemValue(FTDistribution2DGaussItem::P_GAMMA, Units::rad2deg(pdf_gauss->getGamma())); } else if (const FTDistribution2DGate *pdf_gate = dynamic_cast<const FTDistribution2DGate *>(pdf)) { SessionItem *pdfItem = item->setGroupProperty(group_name, Constants::FTDistribution2DGateType); - pdfItem->setChildValue(FTDistribution2DGateItem::P_CORR_LENGTH_X, + pdfItem->setItemValue(FTDistribution2DGateItem::P_CORR_LENGTH_X, pdf_gate->getCoherenceLengthX()); - pdfItem->setChildValue(FTDistribution2DGateItem::P_CORR_LENGTH_Y, + pdfItem->setItemValue(FTDistribution2DGateItem::P_CORR_LENGTH_Y, pdf_gate->getCoherenceLengthY()); - pdfItem->setChildValue(FTDistribution2DGateItem::P_GAMMA, + pdfItem->setItemValue(FTDistribution2DGateItem::P_GAMMA, Units::rad2deg(pdf_gate->getGamma())); } else if (const FTDistribution2DCone *pdf_cone = dynamic_cast<const FTDistribution2DCone *>(pdf)) { SessionItem *pdfItem = item->setGroupProperty(group_name, Constants::FTDistribution2DConeType); - pdfItem->setChildValue(FTDistribution2DConeItem::P_CORR_LENGTH_X, + pdfItem->setItemValue(FTDistribution2DConeItem::P_CORR_LENGTH_X, pdf_cone->getCoherenceLengthX()); - pdfItem->setChildValue(FTDistribution2DConeItem::P_CORR_LENGTH_Y, + pdfItem->setItemValue(FTDistribution2DConeItem::P_CORR_LENGTH_Y, pdf_cone->getCoherenceLengthY()); - pdfItem->setChildValue(FTDistribution2DConeItem::P_GAMMA, + pdfItem->setItemValue(FTDistribution2DConeItem::P_GAMMA, Units::rad2deg(pdf_cone->getGamma())); } else if (const FTDistribution2DVoigt *pdf_voigt = dynamic_cast<const FTDistribution2DVoigt *>(pdf)) { SessionItem *pdfItem = item->setGroupProperty(group_name, Constants::FTDistribution2DVoigtType); - pdfItem->setChildValue(FTDistribution2DVoigtItem::P_CORR_LENGTH_X, + pdfItem->setItemValue(FTDistribution2DVoigtItem::P_CORR_LENGTH_X, pdf_voigt->getCoherenceLengthX()); - pdfItem->setChildValue(FTDistribution2DVoigtItem::P_CORR_LENGTH_Y, + pdfItem->setItemValue(FTDistribution2DVoigtItem::P_CORR_LENGTH_Y, pdf_voigt->getCoherenceLengthY()); - pdfItem->setChildValue(FTDistribution2DVoigtItem::P_GAMMA, + pdfItem->setItemValue(FTDistribution2DVoigtItem::P_GAMMA, Units::rad2deg(pdf_voigt->getGamma())); - pdfItem->setChildValue(FTDistribution2DVoigtItem::P_ETA, pdf_voigt->getEta()); + pdfItem->setItemValue(FTDistribution2DVoigtItem::P_ETA, pdf_voigt->getEta()); } else { throw GUIHelpers::Error("TransformFromDomain::setPDF2D: -> Error"); } @@ -660,24 +660,24 @@ void SetDecayFunction1D(SessionItem *item, const IFTDecayFunction1D *ipdf, QStri if (const FTDecayFunction1DCauchy *pdf = dynamic_cast<const FTDecayFunction1DCauchy *>(ipdf)) { SessionItem *pdfItem = item->setGroupProperty(group_name, Constants::FTDecayFunction1DCauchyType); - pdfItem->setChildValue(FTDecayFunction1DItem::P_DECAY_LENGTH, pdf->getOmega()); + pdfItem->setItemValue(FTDecayFunction1DItem::P_DECAY_LENGTH, pdf->getOmega()); } else if (const FTDecayFunction1DGauss *pdf = dynamic_cast<const FTDecayFunction1DGauss *>(ipdf)) { SessionItem *pdfItem = item->setGroupProperty(group_name, Constants::FTDecayFunction1DGaussType); - pdfItem->setChildValue(FTDecayFunction1DItem::P_DECAY_LENGTH, pdf->getOmega()); + pdfItem->setItemValue(FTDecayFunction1DItem::P_DECAY_LENGTH, pdf->getOmega()); } else if (const FTDecayFunction1DTriangle *pdf = dynamic_cast<const FTDecayFunction1DTriangle *>(ipdf)) { SessionItem *pdfItem = item->setGroupProperty(group_name, Constants::FTDecayFunction1DTriangleType); - pdfItem->setChildValue(FTDecayFunction1DItem::P_DECAY_LENGTH, + pdfItem->setItemValue(FTDecayFunction1DItem::P_DECAY_LENGTH, pdf->getOmega()); } else if (const FTDecayFunction1DVoigt *pdf = dynamic_cast<const FTDecayFunction1DVoigt *>(ipdf)) { SessionItem *pdfItem = item->setGroupProperty(group_name, Constants::FTDecayFunction1DVoigtType); - pdfItem->setChildValue(FTDecayFunction1DItem::P_DECAY_LENGTH, pdf->getOmega()); - pdfItem->setChildValue(FTDecayFunction1DVoigtItem::P_ETA, pdf->getEta()); + pdfItem->setItemValue(FTDecayFunction1DItem::P_DECAY_LENGTH, pdf->getOmega()); + pdfItem->setItemValue(FTDecayFunction1DVoigtItem::P_ETA, pdf->getEta()); } else { throw GUIHelpers::Error("TransformFromDomain::SetDecayFunction1D: -> Error"); } @@ -689,33 +689,33 @@ void SetDecayFunction2D(SessionItem *item, const IFTDecayFunction2D *pdf, QStrin = dynamic_cast<const FTDecayFunction2DCauchy *>(pdf)) { SessionItem *pdfItem = item->setGroupProperty(group_name, Constants::FTDecayFunction2DCauchyType); - pdfItem->setChildValue(FTDecayFunction2DItem::P_DECAY_LENGTH_X, + pdfItem->setItemValue(FTDecayFunction2DItem::P_DECAY_LENGTH_X, pdf_cauchy->getDecayLengthX()); - pdfItem->setChildValue(FTDecayFunction2DItem::P_DECAY_LENGTH_Y, + pdfItem->setItemValue(FTDecayFunction2DItem::P_DECAY_LENGTH_Y, pdf_cauchy->getDecayLengthY()); - pdfItem->setChildValue(FTDecayFunction2DItem::P_GAMMA, + pdfItem->setItemValue(FTDecayFunction2DItem::P_GAMMA, Units::rad2deg(pdf_cauchy->getGamma())); } else if (const FTDecayFunction2DGauss *pdf_gauss = dynamic_cast<const FTDecayFunction2DGauss *>(pdf)) { SessionItem *pdfItem = item->setGroupProperty(group_name, Constants::FTDecayFunction2DGaussType); - pdfItem->setChildValue(FTDecayFunction2DItem::P_DECAY_LENGTH_X, + pdfItem->setItemValue(FTDecayFunction2DItem::P_DECAY_LENGTH_X, pdf_gauss->getDecayLengthX()); - pdfItem->setChildValue(FTDecayFunction2DItem::P_DECAY_LENGTH_Y, + pdfItem->setItemValue(FTDecayFunction2DItem::P_DECAY_LENGTH_Y, pdf_gauss->getDecayLengthY()); - pdfItem->setChildValue(FTDecayFunction2DItem::P_GAMMA, + pdfItem->setItemValue(FTDecayFunction2DItem::P_GAMMA, Units::rad2deg(pdf_gauss->getGamma())); } else if (const FTDecayFunction2DVoigt *pdf_voigt = dynamic_cast<const FTDecayFunction2DVoigt *>(pdf)) { SessionItem *pdfItem = item->setGroupProperty(group_name, Constants::FTDecayFunction2DVoigtType); - pdfItem->setChildValue(FTDecayFunction2DItem::P_DECAY_LENGTH_X, + pdfItem->setItemValue(FTDecayFunction2DItem::P_DECAY_LENGTH_X, pdf_voigt->getDecayLengthX()); - pdfItem->setChildValue(FTDecayFunction2DItem::P_DECAY_LENGTH_Y, + pdfItem->setItemValue(FTDecayFunction2DItem::P_DECAY_LENGTH_Y, pdf_voigt->getDecayLengthY()); - pdfItem->setChildValue(FTDecayFunction2DItem::P_GAMMA, + pdfItem->setItemValue(FTDecayFunction2DItem::P_GAMMA, Units::rad2deg(pdf_voigt->getGamma())); - pdfItem->setChildValue(FTDecayFunction2DVoigtItem::P_ETA, pdf_voigt->getEta()); + pdfItem->setItemValue(FTDecayFunction2DVoigtItem::P_ETA, pdf_voigt->getEta()); } else { throw GUIHelpers::Error("TransformFromDomain::SetDecayFunction2D: -> Error"); } @@ -728,25 +728,25 @@ void set2DLatticeParameters(SessionItem *item, Lattice2DParameters lattice_param lattice_params.m_angle)) { lattice_item = item->setGroupProperty(InterferenceFunction2DLatticeItem::P_LATTICE_TYPE, Constants::SquareLatticeType); - lattice_item->setChildValue(SquareLatticeTypeItem::P_LATTICE_LENGTH, + lattice_item->setItemValue(SquareLatticeTypeItem::P_LATTICE_LENGTH, lattice_params.m_length_1); } else if (TransformFromDomain::isHexagonalLattice( lattice_params.m_length_1, lattice_params.m_length_2, lattice_params.m_angle)) { lattice_item = item->setGroupProperty(InterferenceFunction2DLatticeItem::P_LATTICE_TYPE, Constants::HexagonalLatticeType); - lattice_item->setChildValue(HexagonalLatticeTypeItem::P_LATTICE_LENGTH, + lattice_item->setItemValue(HexagonalLatticeTypeItem::P_LATTICE_LENGTH, lattice_params.m_length_1); } else { lattice_item = item->setGroupProperty(InterferenceFunction2DLatticeItem::P_LATTICE_TYPE, Constants::BasicLatticeType); - lattice_item->setChildValue(BasicLatticeTypeItem::P_LATTICE_LENGTH1, + lattice_item->setItemValue(BasicLatticeTypeItem::P_LATTICE_LENGTH1, lattice_params.m_length_1); - lattice_item->setChildValue(BasicLatticeTypeItem::P_LATTICE_LENGTH2, + lattice_item->setItemValue(BasicLatticeTypeItem::P_LATTICE_LENGTH2, lattice_params.m_length_2); - lattice_item->setChildValue(BasicLatticeTypeItem::P_LATTICE_ANGLE, + lattice_item->setItemValue(BasicLatticeTypeItem::P_LATTICE_ANGLE, Units::rad2deg(lattice_params.m_angle)); } - item->setChildValue(InterferenceFunction2DLatticeItem::P_ROTATION_ANGLE, + item->setItemValue(InterferenceFunction2DLatticeItem::P_ROTATION_ANGLE, Units::rad2deg(lattice_params.m_xi)); } @@ -757,36 +757,36 @@ void setDistribution(SessionItem *item, ParameterDistribution par_distr, SessionItem *pdfItem = 0; if (const DistributionGate *distr = dynamic_cast<const DistributionGate *>(p_distribution)) { pdfItem = item->setGroupProperty(group_name, Constants::DistributionGateType); - pdfItem->setChildValue(DistributionGateItem::P_MIN, factor*distr->getMin()); - pdfItem->setChildValue(DistributionGateItem::P_MAX, factor*distr->getMax()); + pdfItem->setItemValue(DistributionGateItem::P_MIN, factor*distr->getMin()); + pdfItem->setItemValue(DistributionGateItem::P_MAX, factor*distr->getMax()); } else if (const DistributionLorentz *distr = dynamic_cast<const DistributionLorentz *>(p_distribution)) { pdfItem = item->setGroupProperty(group_name, Constants::DistributionLorentzType); - pdfItem->setChildValue(DistributionLorentzItem::P_MEAN, factor*distr->getMean()); - pdfItem->setChildValue(DistributionLorentzItem::P_HWHM, factor*distr->getHWHM()); + pdfItem->setItemValue(DistributionLorentzItem::P_MEAN, factor*distr->getMean()); + pdfItem->setItemValue(DistributionLorentzItem::P_HWHM, factor*distr->getHWHM()); } else if (const DistributionGaussian *distr = dynamic_cast<const DistributionGaussian *>(p_distribution)) { pdfItem = item->setGroupProperty(group_name, Constants::DistributionGaussianType); - pdfItem->setChildValue(DistributionGaussianItem::P_MEAN, factor*distr->getMean()); - pdfItem->setChildValue(DistributionGaussianItem::P_STD_DEV, factor*distr->getStdDev()); + pdfItem->setItemValue(DistributionGaussianItem::P_MEAN, factor*distr->getMean()); + pdfItem->setItemValue(DistributionGaussianItem::P_STD_DEV, factor*distr->getStdDev()); } else if (const DistributionLogNormal *distr = dynamic_cast<const DistributionLogNormal *>(p_distribution)) { pdfItem = item->setGroupProperty(group_name, Constants::DistributionLogNormalType); - pdfItem->setChildValue(DistributionLogNormalItem::P_MEDIAN, factor*distr->getMedian()); - pdfItem->setChildValue(DistributionLogNormalItem::P_SCALE_PAR, + pdfItem->setItemValue(DistributionLogNormalItem::P_MEDIAN, factor*distr->getMedian()); + pdfItem->setItemValue(DistributionLogNormalItem::P_SCALE_PAR, distr->getScalePar()); } else if (const DistributionCosine *distr = dynamic_cast<const DistributionCosine *>(p_distribution)) { pdfItem = item->setGroupProperty(group_name, Constants::DistributionCosineType); - pdfItem->setChildValue(DistributionCosineItem::P_MEAN, factor*distr->getMean()); - pdfItem->setChildValue(DistributionCosineItem::P_SIGMA, factor*distr->getSigma()); + pdfItem->setItemValue(DistributionCosineItem::P_MEAN, factor*distr->getMean()); + pdfItem->setItemValue(DistributionCosineItem::P_SIGMA, factor*distr->getSigma()); } else { throw GUIHelpers::Error("TransformFromDomain::setDistribution: -> unknown distribution"); } if (pdfItem) { - pdfItem->setChildValue(DistributionItem::P_NUMBER_OF_SAMPLES, + pdfItem->setItemValue(DistributionItem::P_NUMBER_OF_SAMPLES, (int)par_distr.getNbrSamples()); - pdfItem->setChildValue(DistributionItem::P_SIGMA_FACTOR, + pdfItem->setItemValue(DistributionItem::P_SIGMA_FACTOR, par_distr.getSigmaFactor()); } } diff --git a/GUI/coregui/Models/TransformToDomain.cpp b/GUI/coregui/Models/TransformToDomain.cpp index ca5fbc4764ae8d2593ca5ab9bc8020469fb1f085..dbf274379b812fd46543b9dd4f01719bdca2371c 100644 --- a/GUI/coregui/Models/TransformToDomain.cpp +++ b/GUI/coregui/Models/TransformToDomain.cpp @@ -60,10 +60,10 @@ std::unique_ptr<IMaterial> TransformToDomain::createDomainMaterial(const Session MaterialProperty material_property; if (item.modelType() == Constants::ParticleType) { material_property - = item.getChildValue(ParticleItem::P_MATERIAL).value<MaterialProperty>(); + = item.getItemValue(ParticleItem::P_MATERIAL).value<MaterialProperty>(); } else if (item.modelType() == Constants::LayerType) { material_property - = item.getChildValue(LayerItem::P_MATERIAL).value<MaterialProperty>(); + = item.getItemValue(LayerItem::P_MATERIAL).value<MaterialProperty>(); } if (!material_property.isDefined()) throw GUIHelpers::Error( @@ -76,7 +76,7 @@ std::unique_ptr<MultiLayer> TransformToDomain::createMultiLayer(const SessionIte { auto P_multilayer = GUIHelpers::make_unique<MultiLayer>(); auto cross_corr_length - = item.getChildValue(MultiLayerItem::P_CROSS_CORR_LENGTH).toDouble(); + = item.getItemValue(MultiLayerItem::P_CROSS_CORR_LENGTH).toDouble(); if (cross_corr_length > 0) P_multilayer->setCrossCorrLength(cross_corr_length); return P_multilayer; @@ -85,7 +85,7 @@ std::unique_ptr<MultiLayer> TransformToDomain::createMultiLayer(const SessionIte std::unique_ptr<Layer> TransformToDomain::createLayer(const SessionItem &item) { auto P_layer = GUIHelpers::make_unique<Layer>(); - auto thickness = item.getChildValue(LayerItem::P_THICKNESS).toDouble(); + auto thickness = item.getItemValue(LayerItem::P_THICKNESS).toDouble(); P_layer->setThickness(thickness); auto P_material = createDomainMaterial(item); P_layer->setMaterial(*P_material); @@ -99,9 +99,9 @@ TransformToDomain::createLayerRoughness(const SessionItem &roughnessItem) return nullptr; } else if (roughnessItem.modelType() == Constants::LayerBasicRoughnessType) { return GUIHelpers::make_unique<LayerRoughness>( - roughnessItem.getChildValue(LayerBasicRoughnessItem::P_SIGMA).toDouble(), - roughnessItem.getChildValue(LayerBasicRoughnessItem::P_HURST).toDouble(), - roughnessItem.getChildValue(LayerBasicRoughnessItem::P_LATERAL_CORR_LENGTH) + roughnessItem.getItemValue(LayerBasicRoughnessItem::P_SIGMA).toDouble(), + roughnessItem.getItemValue(LayerBasicRoughnessItem::P_HURST).toDouble(), + roughnessItem.getItemValue(LayerBasicRoughnessItem::P_LATERAL_CORR_LENGTH) .toDouble()); } else { throw GUIHelpers::Error("TransformToDomain::createLayerRoughness() -> Error."); @@ -112,7 +112,7 @@ std::unique_ptr<ParticleLayout> TransformToDomain::createParticleLayout(const SessionItem &item) { auto P_layout = GUIHelpers::make_unique<ParticleLayout>(); - auto prop = item.getChildValue(ParticleLayoutItem::P_APPROX).value<ComboProperty>(); + auto prop = item.getItemValue(ParticleLayoutItem::P_APPROX).value<ComboProperty>(); QString approximation = prop.getValue(); if (approximation == QString("Decoupling Approximation")) { P_layout->setApproximation(ILayout::DA); @@ -120,7 +120,7 @@ TransformToDomain::createParticleLayout(const SessionItem &item) P_layout->setApproximation(ILayout::SSCA); } auto total_density - = item.getChildValue(ParticleLayoutItem::P_TOTAL_DENSITY).value<double>(); + = item.getItemValue(ParticleLayoutItem::P_TOTAL_DENSITY).value<double>(); P_layout->setTotalParticleSurfaceDensity(total_density); return P_layout; } @@ -163,15 +163,15 @@ TransformToDomain::createInterferenceFunction(const SessionItem &item) std::unique_ptr<IInterferenceFunction> P_result{}; if (item.modelType() == Constants::InterferenceFunctionRadialParaCrystalType) { double peak_distance - = item.getChildValue(InterferenceFunctionRadialParaCrystalItem::P_PEAK_DISTANCE) + = item.getItemValue(InterferenceFunctionRadialParaCrystalItem::P_PEAK_DISTANCE) .toDouble(); double damping_length - = item.getChildValue( + = item.getItemValue( InterferenceFunctionRadialParaCrystalItem::P_DAMPING_LENGTH).toDouble(); double domain_size - = item.getChildValue(InterferenceFunctionRadialParaCrystalItem::P_DOMAIN_SIZE) + = item.getItemValue(InterferenceFunctionRadialParaCrystalItem::P_DOMAIN_SIZE) .toDouble(); - double kappa = item.getChildValue( + double kappa = item.getItemValue( InterferenceFunctionRadialParaCrystalItem::P_KAPPA).toDouble(); auto P_iff = GUIHelpers::make_unique<InterferenceFunctionRadialParaCrystal>(peak_distance, damping_length); @@ -190,20 +190,20 @@ TransformToDomain::createInterferenceFunction(const SessionItem &item) Q_ASSERT(latticeItem); double length_1 {0.0}, length_2 {0.0}, alpha_lattice {0.0}; if (latticeItem->modelType() == Constants::BasicLatticeType) { - length_1 = latticeItem->getChildValue(BasicLatticeTypeItem::P_LATTICE_LENGTH1) + length_1 = latticeItem->getItemValue(BasicLatticeTypeItem::P_LATTICE_LENGTH1) .toDouble(); - length_2 = latticeItem->getChildValue(BasicLatticeTypeItem::P_LATTICE_LENGTH2) + length_2 = latticeItem->getItemValue(BasicLatticeTypeItem::P_LATTICE_LENGTH2) .toDouble(); alpha_lattice = Units::deg2rad( - latticeItem->getChildValue(BasicLatticeTypeItem::P_LATTICE_ANGLE) + latticeItem->getItemValue(BasicLatticeTypeItem::P_LATTICE_ANGLE) .toDouble()); } else if (latticeItem->modelType() == Constants::SquareLatticeType) { - length_1 = latticeItem->getChildValue(SquareLatticeTypeItem::P_LATTICE_LENGTH) + length_1 = latticeItem->getItemValue(SquareLatticeTypeItem::P_LATTICE_LENGTH) .toDouble(); length_2 = length_1; alpha_lattice = Units::PI / 2.0; } else if (latticeItem->modelType() == Constants::HexagonalLatticeType) { - length_1 = latticeItem->getChildValue( + length_1 = latticeItem->getItemValue( HexagonalLatticeTypeItem::P_LATTICE_LENGTH).toDouble(); length_2 = length_1; alpha_lattice = 2 * Units::PI / 3.0; @@ -214,17 +214,17 @@ TransformToDomain::createInterferenceFunction(const SessionItem &item) auto P_iff = GUIHelpers::make_unique<InterferenceFunction2DParaCrystal>( length_1, length_2, alpha_lattice, Units::deg2rad( - item.getChildValue(InterferenceFunction2DParaCrystalItem::P_ROTATION_ANGLE) + item.getItemValue(InterferenceFunction2DParaCrystalItem::P_ROTATION_ANGLE) .toDouble()), - item.getChildValue(InterferenceFunction2DParaCrystalItem::P_DAMPING_LENGTH) + item.getItemValue(InterferenceFunction2DParaCrystalItem::P_DAMPING_LENGTH) .toDouble()); P_iff->setDomainSizes( - item.getChildValue(InterferenceFunction2DParaCrystalItem::P_DOMAIN_SIZE1) + item.getItemValue(InterferenceFunction2DParaCrystalItem::P_DOMAIN_SIZE1) .toDouble(), - item.getChildValue(InterferenceFunction2DParaCrystalItem::P_DOMAIN_SIZE2) + item.getItemValue(InterferenceFunction2DParaCrystalItem::P_DOMAIN_SIZE2) .toDouble()); P_iff->setIntegrationOverXi( - item.getChildValue(InterferenceFunction2DParaCrystalItem::P_XI_INTEGRATION) + item.getItemValue(InterferenceFunction2DParaCrystalItem::P_XI_INTEGRATION) .toBool()); auto pdf1Item = item.getGroupItem(InterferenceFunction2DParaCrystalItem::P_PDF1); @@ -243,9 +243,9 @@ TransformToDomain::createInterferenceFunction(const SessionItem &item) P_result = std::move(P_iff); } else if (item.modelType() == Constants::InterferenceFunction1DLatticeType) { double length = - item.getChildValue(InterferenceFunction1DLatticeItem::P_LENGTH).toDouble(); + item.getItemValue(InterferenceFunction1DLatticeItem::P_LENGTH).toDouble(); double angle = Units::deg2rad( - item.getChildValue(InterferenceFunction1DLatticeItem::P_ROTATION_ANGLE) + item.getItemValue(InterferenceFunction1DLatticeItem::P_ROTATION_ANGLE) .toDouble()); auto P_iff = GUIHelpers::make_unique<InterferenceFunction1DLattice>(length, angle); auto pdfItem = item.getGroupItem(InterferenceFunction1DLatticeItem::P_DECAY_FUNCTION); @@ -261,20 +261,20 @@ TransformToDomain::createInterferenceFunction(const SessionItem &item) double length_1 {0.0}, length_2 {0.0}, angle {0.0}; if (latticeItem->modelType() == Constants::BasicLatticeType) { - length_1 = latticeItem->getChildValue(BasicLatticeTypeItem::P_LATTICE_LENGTH1) + length_1 = latticeItem->getItemValue(BasicLatticeTypeItem::P_LATTICE_LENGTH1) .toDouble(); - length_2 = latticeItem->getChildValue(BasicLatticeTypeItem::P_LATTICE_LENGTH2) + length_2 = latticeItem->getItemValue(BasicLatticeTypeItem::P_LATTICE_LENGTH2) .toDouble(); angle = Units::deg2rad( - latticeItem->getChildValue(BasicLatticeTypeItem::P_LATTICE_ANGLE) + latticeItem->getItemValue(BasicLatticeTypeItem::P_LATTICE_ANGLE) .toDouble()); } else if (latticeItem->modelType() == Constants::SquareLatticeType) { - length_1 = latticeItem->getChildValue(SquareLatticeTypeItem::P_LATTICE_LENGTH) + length_1 = latticeItem->getItemValue(SquareLatticeTypeItem::P_LATTICE_LENGTH) .toDouble(); length_2 = length_1; angle = Units::PI / 2.0; } else if (latticeItem->modelType() == Constants::HexagonalLatticeType) { - length_1 = latticeItem->getChildValue( + length_1 = latticeItem->getItemValue( HexagonalLatticeTypeItem::P_LATTICE_LENGTH).toDouble(); length_2 = length_1; angle = 2 * Units::PI / 3.0; @@ -282,7 +282,7 @@ TransformToDomain::createInterferenceFunction(const SessionItem &item) throw GUIHelpers::Error("TransformToDomain::createInterferenceFunction() -> Error"); } double xi = Units::deg2rad( - item.getChildValue(InterferenceFunction2DLatticeItem::P_ROTATION_ANGLE) + item.getItemValue(InterferenceFunction2DLatticeItem::P_ROTATION_ANGLE) .toDouble()); auto P_iff = GUIHelpers::make_unique<InterferenceFunction2DLattice>(length_1, length_2, angle, xi); @@ -393,7 +393,7 @@ void TransformToDomain::addMasksToSimulation(const SessionItem &detector_item, for(int i_row = maskContainerItem->childItems().size(); i_row>0; --i_row) { if(auto maskItem = dynamic_cast<MaskItem *>(maskContainerItem->childItems().at(i_row-1))) { std::unique_ptr<Geometry::IShape2D > shape(maskItem->createShape(scale)); - bool mask_value = maskItem->getChildValue(MaskItem::P_MASK_VALUE).toBool(); + bool mask_value = maskItem->getItemValue(MaskItem::P_MASK_VALUE).toBool(); simulation->addMask(*shape, mask_value); } } @@ -426,9 +426,9 @@ void TransformToDomain::setTransformationInfo(IParticle *result, const SessionIt void TransformToDomain::setPositionInfo(IParticle *result, const SessionItem &item) { SessionItem *pos_item = item.getGroupItem(ParticleItem::P_POSITION); - double pos_x = pos_item->getChildValue(VectorItem::P_X).toDouble(); - double pos_y = pos_item->getChildValue(VectorItem::P_Y).toDouble(); - double pos_z = pos_item->getChildValue(VectorItem::P_Z).toDouble(); + double pos_x = pos_item->getItemValue(VectorItem::P_X).toDouble(); + double pos_y = pos_item->getItemValue(VectorItem::P_Y).toDouble(); + double pos_z = pos_item->getItemValue(VectorItem::P_Z).toDouble(); result->setPosition(pos_x, pos_y, pos_z); } diff --git a/GUI/coregui/Models/VectorItem.cpp b/GUI/coregui/Models/VectorItem.cpp index d6629c2964f8f9c856a4228d46993f785d9c5615..8d86681425191d94362c1cb3f0094a589d331d3e 100644 --- a/GUI/coregui/Models/VectorItem.cpp +++ b/GUI/coregui/Models/VectorItem.cpp @@ -29,15 +29,15 @@ VectorItem::VectorItem() QString VectorItem::itemLabel() const { - return QString("(%1, %2, %3)").arg(getChildValue(P_X).toDouble()) - .arg(getChildValue(P_Y).toDouble()) - .arg(getChildValue(P_Z).toDouble()); + return QString("(%1, %2, %3)").arg(getItemValue(P_X).toDouble()) + .arg(getItemValue(P_Y).toDouble()) + .arg(getItemValue(P_Z).toDouble()); } kvector_t VectorItem::getVector() const { - return kvector_t(getChildValue(P_X).toDouble(), - getChildValue(P_Y).toDouble(), - getChildValue(P_Z).toDouble()); + return kvector_t(getItemValue(P_X).toDouble(), + getItemValue(P_Y).toDouble(), + getItemValue(P_Z).toDouble()); } diff --git a/GUI/coregui/Views/FitWidgets/FitParameterWidget.cpp b/GUI/coregui/Views/FitWidgets/FitParameterWidget.cpp index 4231d9bd57190a4e8593332ef34ca0118a18bb99..3364b9beb5d572b4e2798f1f810baa7a92c52b11 100644 --- a/GUI/coregui/Views/FitWidgets/FitParameterWidget.cpp +++ b/GUI/coregui/Views/FitWidgets/FitParameterWidget.cpp @@ -253,7 +253,7 @@ void FitParameterWidget::onParameterSelectionChanged(const QItemSelection &selec QModelIndex newSelection = QModelIndex(); if (index.isValid() && index.parent().isValid()) { SessionItem *val = m_fitModel->itemForIndex(index); - QString link = val->getChildValue(FitParameterLinkItem::P_LINK).toString(); + QString link = val->getItemValue(FitParameterLinkItem::P_LINK).toString(); QStandardItem *t = m_selectorModel->getItemFromPath(link); newSelection = m_selectorModel->indexFromItem(t); } diff --git a/GUI/coregui/Views/FitWidgets/RunFitWidget.cpp b/GUI/coregui/Views/FitWidgets/RunFitWidget.cpp index a8d4743393386aa73170fc8ba5f4391c122392ea..b942c0590bb6add802c21016282be16a73947fb2 100644 --- a/GUI/coregui/Views/FitWidgets/RunFitWidget.cpp +++ b/GUI/coregui/Views/FitWidgets/RunFitWidget.cpp @@ -169,7 +169,7 @@ std::shared_ptr<FitSuite> RunFitWidget::init_test_fitsuite() SessionItem *parameter = m_fitModel->itemForIndex(child); for (int j = 0; j < m_fitModel->rowCount(child); j++) { SessionItem *link = m_fitModel->itemForIndex(m_fitModel->index(j,0,child)); - QString value = link->getChildValue(FitParameterLinkItem::P_LINK).toString(); + QString value = link->getItemValue(FitParameterLinkItem::P_LINK).toString(); value = value.replace("Position Offset/X", "PositionX"); value = value.replace("Position Offset/Y", "PositionY"); value = value.replace("Position Offset/Z", "PositionZ"); @@ -181,9 +181,9 @@ std::shared_ptr<FitSuite> RunFitWidget::init_test_fitsuite() std::string translated = "*" + value.toStdString(); std::cout << translated; std::cout.flush(); - double min = parameter->getChildValue(FitParameterItem::P_MIN).toDouble(); - double max = parameter->getChildValue(FitParameterItem::P_MAX).toDouble(); - double init = parameter->getChildValue(FitParameterItem::P_INIT).toDouble(); + double min = parameter->getItemValue(FitParameterItem::P_MIN).toDouble(); + double max = parameter->getItemValue(FitParameterItem::P_MAX).toDouble(); + double init = parameter->getItemValue(FitParameterItem::P_INIT).toDouble(); AttLimits limits; if (min==max && min < init) { limits = AttLimits::lowerLimited(min); diff --git a/GUI/coregui/Views/InfoWidgets/DistributionWidget.cpp b/GUI/coregui/Views/InfoWidgets/DistributionWidget.cpp index 779c67e2d3120c8ef8e0b5327f0d4da471b379ae..e361efbae7c6e5174c48e6f4a3838bf8ae56cc36 100644 --- a/GUI/coregui/Views/InfoWidgets/DistributionWidget.cpp +++ b/GUI/coregui/Views/InfoWidgets/DistributionWidget.cpp @@ -132,9 +132,9 @@ void DistributionWidget::plotItem() if (m_item->itemName() != Constants::DistributionNoneType && !exceptionThrown) { int numberOfSamples - = m_item->getChildValue(DistributionItem::P_NUMBER_OF_SAMPLES).toInt(); + = m_item->getItemValue(DistributionItem::P_NUMBER_OF_SAMPLES).toInt(); double sigmafactor - = m_item->getChildValue(DistributionItem::P_SIGMA_FACTOR).toDouble(); + = m_item->getItemValue(DistributionItem::P_SIGMA_FACTOR).toDouble(); QVector<double> xBar; QVector<double> x; @@ -173,7 +173,7 @@ void DistributionWidget::plotItem() } else if(!exceptionThrown) { QVector<double> xPos; QVector<double> yPos; - xPos.push_back(m_item->getChildValue(DistributionNoneItem::P_VALUE).toDouble()); + xPos.push_back(m_item->getItemValue(DistributionNoneItem::P_VALUE).toDouble()); yPos.push_back(1); QCPBars *bars = new QCPBars(m_plot->xAxis, m_plot->yAxis); bars->setWidth(gap_between_bars); diff --git a/GUI/coregui/Views/InstrumentWidgets/DetectorMaskDelegate.cpp b/GUI/coregui/Views/InstrumentWidgets/DetectorMaskDelegate.cpp index 4bdf1ac60260a8168b241588d1e2107cd82d2438..48870179fb204f67edcae7feffed383d9ad7fc41 100644 --- a/GUI/coregui/Views/InstrumentWidgets/DetectorMaskDelegate.cpp +++ b/GUI/coregui/Views/InstrumentWidgets/DetectorMaskDelegate.cpp @@ -66,7 +66,7 @@ void DetectorMaskDelegate::createIntensityDataItem() Q_ASSERT(m_intensityItem); m_intensityItem->getItem(IntensityDataItem::P_PROJECTIONS_FLAG)->setEnabled(false); - m_intensityItem->setChildValue(IntensityDataItem::P_IS_INTERPOLATED, + m_intensityItem->setItemValue(IntensityDataItem::P_IS_INTERPOLATED, false); // ComboProperty gradient @@ -79,11 +79,11 @@ void DetectorMaskDelegate::createIntensityDataItem() AmplitudeAxisItem *zAxisItem = dynamic_cast<AmplitudeAxisItem *>( m_intensityItem->getGroupItem(IntensityDataItem::P_ZAXIS)); - zAxisItem->setChildValue(BasicAxisItem::P_IS_VISIBLE, false); - zAxisItem->setChildValue(BasicAxisItem::P_MIN, 0.0); - zAxisItem->setChildValue(BasicAxisItem::P_MAX, 2.0); - zAxisItem->setChildValue(AmplitudeAxisItem::P_IS_LOGSCALE, false); - zAxisItem->setChildValue(AmplitudeAxisItem::P_LOCK_MIN_MAX, true); + zAxisItem->setItemValue(BasicAxisItem::P_IS_VISIBLE, false); + zAxisItem->setItemValue(BasicAxisItem::P_MIN, 0.0); + zAxisItem->setItemValue(BasicAxisItem::P_MAX, 2.0); + zAxisItem->setItemValue(AmplitudeAxisItem::P_IS_LOGSCALE, false); + zAxisItem->setItemValue(AmplitudeAxisItem::P_LOCK_MIN_MAX, true); m_intensityItem->setOutputData(createOutputData(m_detectorItem)); } @@ -115,20 +115,20 @@ DetectorMaskDelegate::createOutputData(DetectorItem *detectorItem) auto x_axis = dynamic_cast<BasicAxisItem *>( subDetector->getGroupItem(SphericalDetectorItem::P_PHI_AXIS)); Q_ASSERT(x_axis); - int n_x = x_axis->getChildValue(BasicAxisItem::P_NBINS).toInt(); + int n_x = x_axis->getItemValue(BasicAxisItem::P_NBINS).toInt(); double x_min - = x_axis->getChildValue(BasicAxisItem::P_MIN).toDouble(); + = x_axis->getItemValue(BasicAxisItem::P_MIN).toDouble(); double x_max - = x_axis->getChildValue(BasicAxisItem::P_MAX).toDouble(); + = x_axis->getItemValue(BasicAxisItem::P_MAX).toDouble(); auto y_axis = dynamic_cast<BasicAxisItem *>( subDetector->getGroupItem(SphericalDetectorItem::P_ALPHA_AXIS)); Q_ASSERT(y_axis); - int n_y = y_axis->getChildValue(BasicAxisItem::P_NBINS).toInt(); + int n_y = y_axis->getItemValue(BasicAxisItem::P_NBINS).toInt(); double y_min - = y_axis->getChildValue(BasicAxisItem::P_MIN).toDouble(); + = y_axis->getItemValue(BasicAxisItem::P_MIN).toDouble(); double y_max - = y_axis->getChildValue(BasicAxisItem::P_MAX).toDouble(); + = y_axis->getItemValue(BasicAxisItem::P_MAX).toDouble(); result->addAxis("x", n_x, x_min, x_max); result->addAxis("y", n_y, y_min, y_max); @@ -137,20 +137,20 @@ DetectorMaskDelegate::createOutputData(DetectorItem *detectorItem) auto x_axis = dynamic_cast<BasicAxisItem *>( subDetector->getGroupItem(RectangularDetectorItem::P_X_AXIS)); Q_ASSERT(x_axis); - int n_x = x_axis->getChildValue(BasicAxisItem::P_NBINS).toInt(); + int n_x = x_axis->getItemValue(BasicAxisItem::P_NBINS).toInt(); double x_min - = x_axis->getChildValue(BasicAxisItem::P_MIN).toDouble(); + = x_axis->getItemValue(BasicAxisItem::P_MIN).toDouble(); double x_max - = x_axis->getChildValue(BasicAxisItem::P_MAX).toDouble(); + = x_axis->getItemValue(BasicAxisItem::P_MAX).toDouble(); auto y_axis = dynamic_cast<BasicAxisItem *>( subDetector->getGroupItem(RectangularDetectorItem::P_Y_AXIS)); Q_ASSERT(y_axis); - int n_y = y_axis->getChildValue(BasicAxisItem::P_NBINS).toInt(); + int n_y = y_axis->getItemValue(BasicAxisItem::P_NBINS).toInt(); double y_min - = y_axis->getChildValue(BasicAxisItem::P_MIN).toDouble(); + = y_axis->getItemValue(BasicAxisItem::P_MIN).toDouble(); double y_max - = y_axis->getChildValue(BasicAxisItem::P_MAX).toDouble(); + = y_axis->getItemValue(BasicAxisItem::P_MAX).toDouble(); result->addAxis("x", n_x, x_min, x_max); result->addAxis("y", n_y, y_min, y_max); diff --git a/GUI/coregui/Views/InstrumentWidgets/RectangularDetectorWidget.cpp b/GUI/coregui/Views/InstrumentWidgets/RectangularDetectorWidget.cpp index 13d7cf29724e4b2f72fdc494117fd0c43fa605b1..24631295cc0c2959a413c5a5b1a96ad9186e2721 100644 --- a/GUI/coregui/Views/InstrumentWidgets/RectangularDetectorWidget.cpp +++ b/GUI/coregui/Views/InstrumentWidgets/RectangularDetectorWidget.cpp @@ -174,7 +174,7 @@ void RectangularDetectorWidget::init_alignment_editors() m_directionEditor->hide(); ComboProperty alignment - = m_detectorItem->getChildValue(RectangularDetectorItem::P_ALIGNMENT) + = m_detectorItem->getItemValue(RectangularDetectorItem::P_ALIGNMENT) .value<ComboProperty>(); diff --git a/GUI/coregui/Views/IntensityDataWidgets/ColorMapPlot.cpp b/GUI/coregui/Views/IntensityDataWidgets/ColorMapPlot.cpp index 1b9ec9afa948a8b18850896df56312794385d346..da93700c5057699e1ceeeb6885f45d3319762cc8 100644 --- a/GUI/coregui/Views/IntensityDataWidgets/ColorMapPlot.cpp +++ b/GUI/coregui/Views/IntensityDataWidgets/ColorMapPlot.cpp @@ -309,7 +309,7 @@ void ColorMapPlot::onPropertyChanged(const QString &property_name) m_customPlot->replot(); } else if (property_name == IntensityDataItem::P_PROJECTIONS_FLAG) { showLinesOverTheMap( - m_item->getChildValue(IntensityDataItem::P_PROJECTIONS_FLAG).toBool()); + m_item->getItemValue(IntensityDataItem::P_PROJECTIONS_FLAG).toBool()); } } @@ -370,7 +370,7 @@ void ColorMapPlot::onSubItemPropertyChanged(const QString &property_group, } else if (property_name == BasicAxisItem::P_IS_VISIBLE) { setColorScaleVisible(m_item->getGroupItem(IntensityDataItem::P_ZAXIS) - ->getChildValue(BasicAxisItem::P_IS_VISIBLE).toBool()); + ->getItemValue(BasicAxisItem::P_IS_VISIBLE).toBool()); } m_customPlot->replot(); } @@ -510,7 +510,7 @@ void ColorMapPlot::plotItem(IntensityDataItem *intensityItem) } setColorScaleVisible(intensityItem->getGroupItem(IntensityDataItem::P_ZAXIS) - ->getChildValue(BasicAxisItem::P_IS_VISIBLE).toBool()); + ->getItemValue(BasicAxisItem::P_IS_VISIBLE).toBool()); m_colorMap->setGradient(m_gradient_map[intensityItem->getGradient()]); diff --git a/GUI/coregui/Views/IntensityDataWidgets/IntensityDataPlotWidget.cpp b/GUI/coregui/Views/IntensityDataWidgets/IntensityDataPlotWidget.cpp index 794f5ce3872f0c483bf4050536ffaffbf6c4c57c..f90eb8ea92390fae7ffb0e85d97e54ade5a07e75 100644 --- a/GUI/coregui/Views/IntensityDataWidgets/IntensityDataPlotWidget.cpp +++ b/GUI/coregui/Views/IntensityDataWidgets/IntensityDataPlotWidget.cpp @@ -115,7 +115,7 @@ void IntensityDataPlotWidget::setItem(IntensityDataItem *item) [this](const QString &name) { if(name == IntensityDataItem::P_PROJECTIONS_FLAG) { - showProjections(m_item->getChildValue(IntensityDataItem::P_PROJECTIONS_FLAG).toBool()); + showProjections(m_item->getItemValue(IntensityDataItem::P_PROJECTIONS_FLAG).toBool()); } }); // connect(m_item, SIGNAL(propertyChanged(QString)), @@ -179,7 +179,7 @@ void IntensityDataPlotWidget::savePlot(const QString &dirname) { Q_ASSERT(m_item); - bool projections_flag = m_item->getChildValue(IntensityDataItem::P_PROJECTIONS_FLAG).toBool(); + bool projections_flag = m_item->getItemValue(IntensityDataItem::P_PROJECTIONS_FLAG).toBool(); if(projections_flag) m_centralPlot->showLinesOverTheMap(false); @@ -217,13 +217,13 @@ void IntensityDataPlotWidget::showProjections(bool flag) void IntensityDataPlotWidget::onPropertyPanelAction(bool flag) { Q_ASSERT(m_item); - m_item->setChildValue(IntensityDataItem::P_PROPERTY_PANEL_FLAG, flag); + m_item->setItemValue(IntensityDataItem::P_PROPERTY_PANEL_FLAG, flag); } void IntensityDataPlotWidget::onProjectionsAction(bool flag) { Q_ASSERT(m_item); - m_item->setChildValue(IntensityDataItem::P_PROJECTIONS_FLAG, flag); + m_item->setItemValue(IntensityDataItem::P_PROJECTIONS_FLAG, flag); } @@ -232,8 +232,8 @@ void IntensityDataPlotWidget::showContextMenu(const QPoint &point) Q_ASSERT(m_item); QMenu menu; - m_propertyPanelAction->setChecked(m_item->getChildValue(IntensityDataItem::P_PROPERTY_PANEL_FLAG).toBool()); - m_projectionsAction->setChecked(m_item->getChildValue(IntensityDataItem::P_PROJECTIONS_FLAG).toBool()); + m_propertyPanelAction->setChecked(m_item->getItemValue(IntensityDataItem::P_PROPERTY_PANEL_FLAG).toBool()); + m_projectionsAction->setChecked(m_item->getItemValue(IntensityDataItem::P_PROJECTIONS_FLAG).toBool()); menu.addAction(m_propertyPanelAction); menu.addAction(m_projectionsAction); @@ -269,7 +269,7 @@ void IntensityDataPlotWidget::setupContextMenuActions() void IntensityDataPlotWidget::updateItem(IntensityDataItem *item) { - showProjections(item->getChildValue(IntensityDataItem::P_PROJECTIONS_FLAG).toBool()); + showProjections(item->getItemValue(IntensityDataItem::P_PROJECTIONS_FLAG).toBool()); } //! sets sizes of top and bottom splitters to have correct sizes of vertical histogram (on the left) and color map diff --git a/GUI/coregui/Views/IntensityDataWidgets/IntensityDataWidget.cpp b/GUI/coregui/Views/IntensityDataWidgets/IntensityDataWidget.cpp index 92a6be456f8a20049f9e5b601330031f8c0843c0..77d6528e014ef72258e11a714ee60750932a7c31 100644 --- a/GUI/coregui/Views/IntensityDataWidgets/IntensityDataWidget.cpp +++ b/GUI/coregui/Views/IntensityDataWidgets/IntensityDataWidget.cpp @@ -78,8 +78,8 @@ void IntensityDataWidget::setItem(IntensityDataItem *item) void IntensityDataWidget::togglePropertyPanel() { if(m_currentItem) { - bool current_flag = m_currentItem->getChildValue(IntensityDataItem::P_PROPERTY_PANEL_FLAG).toBool(); - m_currentItem->setChildValue(IntensityDataItem::P_PROPERTY_PANEL_FLAG, !current_flag); + bool current_flag = m_currentItem->getItemValue(IntensityDataItem::P_PROPERTY_PANEL_FLAG).toBool(); + m_currentItem->setItemValue(IntensityDataItem::P_PROPERTY_PANEL_FLAG, !current_flag); } } @@ -96,14 +96,14 @@ void IntensityDataWidget::setPropertyPanelVisible(bool visible) void IntensityDataWidget::updateItem(IntensityDataItem *item) { - setPropertyPanelVisible(item->getChildValue(IntensityDataItem::P_PROPERTY_PANEL_FLAG).toBool()); + setPropertyPanelVisible(item->getItemValue(IntensityDataItem::P_PROPERTY_PANEL_FLAG).toBool()); ModelMapper *mapper = new ModelMapper(this); mapper->setItem(item); mapper->setOnPropertyChange( [this](const QString &name) { if(name == IntensityDataItem::P_PROPERTY_PANEL_FLAG) { - setPropertyPanelVisible(m_currentItem->getChildValue(IntensityDataItem::P_PROPERTY_PANEL_FLAG).toBool()); + setPropertyPanelVisible(m_currentItem->getItemValue(IntensityDataItem::P_PROPERTY_PANEL_FLAG).toBool()); } }); } @@ -111,8 +111,8 @@ void IntensityDataWidget::updateItem(IntensityDataItem *item) void IntensityDataWidget::toggleProjections() { if(m_currentItem) { - bool current_flag = m_currentItem->getChildValue(IntensityDataItem::P_PROJECTIONS_FLAG).toBool(); - m_currentItem->setChildValue(IntensityDataItem::P_PROJECTIONS_FLAG, !current_flag); + bool current_flag = m_currentItem->getItemValue(IntensityDataItem::P_PROJECTIONS_FLAG).toBool(); + m_currentItem->setItemValue(IntensityDataItem::P_PROJECTIONS_FLAG, !current_flag); } } diff --git a/GUI/coregui/Views/MaskWidgets/EllipseView.cpp b/GUI/coregui/Views/MaskWidgets/EllipseView.cpp index 5592325cda4027904d94634243f7c6e885c07bee..cb7873f58fceccb4cf60b23f1afceb35374df238 100644 --- a/GUI/coregui/Views/MaskWidgets/EllipseView.cpp +++ b/GUI/coregui/Views/MaskWidgets/EllipseView.cpp @@ -43,14 +43,14 @@ EllipseView::EllipseView() void EllipseView::onChangedX() { m_block_on_property_change = true; - m_item->setChildValue(EllipseItem::P_XCENTER, fromSceneX(this->x())); + m_item->setItemValue(EllipseItem::P_XCENTER, fromSceneX(this->x())); m_block_on_property_change = false; } void EllipseView::onChangedY() { m_block_on_property_change = true; - m_item->setChildValue(EllipseItem::P_YCENTER, fromSceneY(this->y())); + m_item->setItemValue(EllipseItem::P_YCENTER, fromSceneY(this->y())); m_block_on_property_change = false; } @@ -102,7 +102,7 @@ void EllipseView::onSizeHandleElementRequest(bool going_to_resize) void EllipseView::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) { painter->setRenderHints(QPainter::Antialiasing); - bool mask_value = m_item->getChildValue(MaskItem::P_MASK_VALUE).toBool(); + bool mask_value = m_item->getItemValue(MaskItem::P_MASK_VALUE).toBool(); painter->setBrush(MaskEditorHelper::getMaskBrush(mask_value)); painter->setPen(MaskEditorHelper::getMaskPen(mask_value)); painter->drawEllipse(m_mask_rect); @@ -138,27 +138,27 @@ void EllipseView::mouseMoveEvent(QGraphicsSceneMouseEvent *event) QPointF centerInScene = mapToScene(center); if(m_activeHandleElement->getHandleType() == SizeHandleElement::RESIZE) { - m_item->setChildValue(EllipseItem::P_XCENTER, fromSceneX(centerInScene.x())); - m_item->setChildValue(EllipseItem::P_YCENTER, fromSceneY(centerInScene.y())); + m_item->setItemValue(EllipseItem::P_XCENTER, fromSceneX(centerInScene.x())); + m_item->setItemValue(EllipseItem::P_YCENTER, fromSceneY(centerInScene.y())); - m_item->setChildValue(EllipseItem::P_XRADIUS, + m_item->setItemValue(EllipseItem::P_XRADIUS, (fromSceneX(centerInScene.x()+width/2.) - fromSceneX(centerInScene.x()-width/2.))/2.); - m_item->setChildValue(EllipseItem::P_YRADIUS, + m_item->setItemValue(EllipseItem::P_YRADIUS, (fromSceneY(centerInScene.y()-height/2.) - fromSceneY(centerInScene.y()+height/2.))/2.); } else if(m_activeHandleElement->getHandleType() == SizeHandleElement::RESIZE_HEIGHT) { - m_item->setChildValue(EllipseItem::P_YCENTER, fromSceneY(centerInScene.y())); - m_item->setChildValue(EllipseItem::P_YRADIUS, + m_item->setItemValue(EllipseItem::P_YCENTER, fromSceneY(centerInScene.y())); + m_item->setItemValue(EllipseItem::P_YRADIUS, (fromSceneY(centerInScene.y()-height/2.) - fromSceneY(centerInScene.y()+height/2.))/2.); } else if(m_activeHandleElement->getHandleType() == SizeHandleElement::RESIZE_WIDTH) { - m_item->setChildValue(EllipseItem::P_XCENTER, fromSceneX(centerInScene.x())); - m_item->setChildValue(EllipseItem::P_XRADIUS, + m_item->setItemValue(EllipseItem::P_XCENTER, fromSceneX(centerInScene.x())); + m_item->setItemValue(EllipseItem::P_XRADIUS, (fromSceneX(centerInScene.x()+width/2.) - fromSceneX(centerInScene.x()-width/2.))/2.); } diff --git a/GUI/coregui/Views/MaskWidgets/IMaskView.cpp b/GUI/coregui/Views/MaskWidgets/IMaskView.cpp index 75d3f2292f90bb53f6ed5f09c41a6024088a9ba7..97cbcce49042ede5c49d930d0cd52a7f8c4cb000 100644 --- a/GUI/coregui/Views/MaskWidgets/IMaskView.cpp +++ b/GUI/coregui/Views/MaskWidgets/IMaskView.cpp @@ -106,12 +106,12 @@ void IMaskView::setSceneAdaptor(const ISceneAdaptor *adaptor) double IMaskView::par(const QString &property_name) const { - return m_item->getChildValue(property_name).toReal(); + return m_item->getItemValue(property_name).toReal(); } qreal IMaskView::toSceneX(const QString &property_name) const { - return toSceneX(m_item->getChildValue(property_name).toReal()); + return toSceneX(m_item->getItemValue(property_name).toReal()); } qreal IMaskView::toSceneX(qreal value) const @@ -123,7 +123,7 @@ qreal IMaskView::toSceneX(qreal value) const qreal IMaskView::toSceneY(const QString &property_name) const { - return toSceneY(m_item->getChildValue(property_name).toReal()); + return toSceneY(m_item->getItemValue(property_name).toReal()); } qreal IMaskView::toSceneY(qreal value) const diff --git a/GUI/coregui/Views/MaskWidgets/LineViews.cpp b/GUI/coregui/Views/MaskWidgets/LineViews.cpp index 4ac22146c5030cd66197dec84a8db1af1ae0dbe4..cc7ebd1f38a10d619477867fd713da74e26c28f7 100644 --- a/GUI/coregui/Views/MaskWidgets/LineViews.cpp +++ b/GUI/coregui/Views/MaskWidgets/LineViews.cpp @@ -39,7 +39,7 @@ VerticalLineView::VerticalLineView() void VerticalLineView::onChangedX() { m_block_on_property_change = true; - m_item->setChildValue(VerticalLineItem::P_POSX, fromSceneX(this->x())); + m_item->setItemValue(VerticalLineItem::P_POSX, fromSceneX(this->x())); m_block_on_property_change = false; } @@ -64,7 +64,7 @@ void VerticalLineView::update_view() void VerticalLineView::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) { - bool mask_value = m_item->getChildValue(MaskItem::P_MASK_VALUE).toBool(); + bool mask_value = m_item->getItemValue(MaskItem::P_MASK_VALUE).toBool(); painter->setBrush(MaskEditorHelper::getMaskBrush(mask_value)); painter->setPen(MaskEditorHelper::getMaskPen(mask_value)); painter->drawRect(QRectF(-mask_visible_width/2., 0.0, mask_visible_width, @@ -105,7 +105,7 @@ HorizontalLineView::HorizontalLineView() void HorizontalLineView::onChangedY() { m_block_on_property_change = true; - m_item->setChildValue(HorizontalLineItem::P_POSY, fromSceneY(this->y())); + m_item->setItemValue(HorizontalLineItem::P_POSY, fromSceneY(this->y())); m_block_on_property_change = false; } @@ -130,7 +130,7 @@ void HorizontalLineView::update_view() void HorizontalLineView::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) { - bool mask_value = m_item->getChildValue(MaskItem::P_MASK_VALUE).toBool(); + bool mask_value = m_item->getItemValue(MaskItem::P_MASK_VALUE).toBool(); painter->setBrush(MaskEditorHelper::getMaskBrush(mask_value)); painter->setPen(MaskEditorHelper::getMaskPen(mask_value)); painter->drawRect(QRectF( 0.0, -mask_visible_width/2., m_bounding_rect.width(), diff --git a/GUI/coregui/Views/MaskWidgets/MaskEditorActions.cpp b/GUI/coregui/Views/MaskWidgets/MaskEditorActions.cpp index b51872aefeddfad6750e5097f95029974a700564..74f773ec537442c8b942b2c91fe5f98b76a63dab 100644 --- a/GUI/coregui/Views/MaskWidgets/MaskEditorActions.cpp +++ b/GUI/coregui/Views/MaskWidgets/MaskEditorActions.cpp @@ -87,8 +87,8 @@ void MaskEditorActions::onToggleMaskValueAction() Q_ASSERT(m_selectionModel); foreach(QModelIndex itemIndex, m_selectionModel->selectedIndexes()) { if(SessionItem *item = m_maskModel->itemForIndex(itemIndex)) { - bool old_value = item->getChildValue(MaskItem::P_MASK_VALUE).toBool(); - item->setChildValue(MaskItem::P_MASK_VALUE, !old_value); + bool old_value = item->getItemValue(MaskItem::P_MASK_VALUE).toBool(); + item->setItemValue(MaskItem::P_MASK_VALUE, !old_value); } } } diff --git a/GUI/coregui/Views/MaskWidgets/MaskGraphicsScene.cpp b/GUI/coregui/Views/MaskWidgets/MaskGraphicsScene.cpp index b52f7602a066a499b63dacc531c7145de1de541a..0751d6c062ea0593a590f30437dadcdfa46be222 100644 --- a/GUI/coregui/Views/MaskWidgets/MaskGraphicsScene.cpp +++ b/GUI/coregui/Views/MaskWidgets/MaskGraphicsScene.cpp @@ -583,7 +583,7 @@ void MaskGraphicsScene::processRectangleItem(QGraphicsSceneMouseEvent *event) if(!m_currentItem && line.length() > min_distance_to_create_rect) { m_currentItem = m_maskModel->insertNewItem(Constants::RectangleMaskType, m_maskContainerIndex, 0); - m_currentItem->setChildValue(MaskItem::P_MASK_VALUE, + m_currentItem->setItemValue(MaskItem::P_MASK_VALUE, m_context.getMaskValue()); setItemName(m_currentItem); } @@ -601,10 +601,10 @@ void MaskGraphicsScene::processRectangleItem(QGraphicsSceneMouseEvent *event) // m_currentItem->setRegisteredProperty( // RectangleItem::P_HEIGHT, m_adaptor->fromSceneY(ymin) - m_adaptor->fromSceneY(ymax)); - m_currentItem->setChildValue(RectangleItem::P_XLOW, m_adaptor->fromSceneX(xmin)); - m_currentItem->setChildValue(RectangleItem::P_YLOW, m_adaptor->fromSceneY(ymax)); - m_currentItem->setChildValue(RectangleItem::P_XUP, m_adaptor->fromSceneX(xmax)); - m_currentItem->setChildValue(RectangleItem::P_YUP, m_adaptor->fromSceneY(ymin)); + m_currentItem->setItemValue(RectangleItem::P_XLOW, m_adaptor->fromSceneX(xmin)); + m_currentItem->setItemValue(RectangleItem::P_YLOW, m_adaptor->fromSceneY(ymax)); + m_currentItem->setItemValue(RectangleItem::P_XUP, m_adaptor->fromSceneX(xmax)); + m_currentItem->setItemValue(RectangleItem::P_YUP, m_adaptor->fromSceneY(ymin)); } } @@ -620,7 +620,7 @@ void MaskGraphicsScene::processEllipseItem(QGraphicsSceneMouseEvent *event) if(!m_currentItem && line.length() > min_distance_to_create_rect) { m_currentItem = m_maskModel->insertNewItem(Constants::EllipseMaskType, m_maskContainerIndex, 0); - m_currentItem->setChildValue(MaskItem::P_MASK_VALUE, + m_currentItem->setItemValue(MaskItem::P_MASK_VALUE, m_context.getMaskValue()); setItemName(m_currentItem); } @@ -631,13 +631,13 @@ void MaskGraphicsScene::processEllipseItem(QGraphicsSceneMouseEvent *event) qreal ymin = std::min(click_pos.y(), mouse_pos.y()); qreal ymax = std::max(click_pos.y(), mouse_pos.y()); - m_currentItem->setChildValue(EllipseItem::P_XCENTER, + m_currentItem->setItemValue(EllipseItem::P_XCENTER, m_adaptor->fromSceneX(xmin + (xmax-xmin)/2.)); - m_currentItem->setChildValue(EllipseItem::P_YCENTER, + m_currentItem->setItemValue(EllipseItem::P_YCENTER, m_adaptor->fromSceneY(ymin + (ymax-ymin)/2.)); - m_currentItem->setChildValue( + m_currentItem->setItemValue( EllipseItem::P_XRADIUS, (m_adaptor->fromSceneX(xmax) - m_adaptor->fromSceneX(xmin))/2.); - m_currentItem->setChildValue( + m_currentItem->setItemValue( EllipseItem::P_YRADIUS, (m_adaptor->fromSceneY(ymin) - m_adaptor->fromSceneY(ymax))/2.); } @@ -651,7 +651,7 @@ void MaskGraphicsScene::processPolygonItem(QGraphicsSceneMouseEvent *event) setDrawingInProgress(true); m_currentItem = m_maskModel->insertNewItem(Constants::PolygonMaskType, m_maskContainerIndex, 0); - m_currentItem->setChildValue(MaskItem::P_MASK_VALUE, m_context.getMaskValue()); + m_currentItem->setItemValue(MaskItem::P_MASK_VALUE, m_context.getMaskValue()); m_selectionModel->clearSelection(); m_selectionModel->select(m_maskModel->indexOfItem(m_currentItem), QItemSelectionModel::Select); setItemName(m_currentItem); @@ -670,8 +670,8 @@ void MaskGraphicsScene::processPolygonItem(QGraphicsSceneMouseEvent *event) m_maskModel->indexOfItem(m_currentItem)); QPointF click_pos = event->buttonDownScenePos(Qt::LeftButton); - point->setChildValue(PolygonPointItem::P_POSX, m_adaptor->fromSceneX(click_pos.x())); - point->setChildValue(PolygonPointItem::P_POSY, m_adaptor->fromSceneY(click_pos.y())); + point->setItemValue(PolygonPointItem::P_POSX, m_adaptor->fromSceneX(click_pos.x())); + point->setItemValue(PolygonPointItem::P_POSY, m_adaptor->fromSceneY(click_pos.y())); } void MaskGraphicsScene::processLineItem(QGraphicsSceneMouseEvent *event) @@ -688,7 +688,7 @@ void MaskGraphicsScene::processLineItem(QGraphicsSceneMouseEvent *event) m_selectionModel->clearSelection(); m_selectionModel->select(m_maskModel->indexOfItem(m_currentItem), QItemSelectionModel::Select); setItemName(m_currentItem); - m_currentItem->setChildValue(MaskItem::P_MASK_VALUE, + m_currentItem->setItemValue(MaskItem::P_MASK_VALUE, m_context.getMaskValue()); setDrawingInProgress(false); @@ -698,7 +698,7 @@ void MaskGraphicsScene::processVerticalLineItem(const QPointF &pos) { m_currentItem = m_maskModel->insertNewItem(Constants::VerticalLineMaskType, m_maskContainerIndex, 0); - m_currentItem->setChildValue(VerticalLineItem::P_POSX, + m_currentItem->setItemValue(VerticalLineItem::P_POSX, m_adaptor->fromSceneX(pos.x())); } @@ -706,7 +706,7 @@ void MaskGraphicsScene::processHorizontalLineItem(const QPointF &pos) { m_currentItem = m_maskModel->insertNewItem(Constants::HorizontalLineMaskType, m_maskContainerIndex, 0); - m_currentItem->setChildValue(HorizontalLineItem::P_POSY, + m_currentItem->setItemValue(HorizontalLineItem::P_POSY, m_adaptor->fromSceneY(pos.y())); } diff --git a/GUI/coregui/Views/MaskWidgets/MaskResultsPresenter.cpp b/GUI/coregui/Views/MaskWidgets/MaskResultsPresenter.cpp index f18d4b79784428294ef35989c9b469d3683aefb5..4d0485022397b1d0aab93f2a2cd2cbb132d49ec6 100644 --- a/GUI/coregui/Views/MaskWidgets/MaskResultsPresenter.cpp +++ b/GUI/coregui/Views/MaskWidgets/MaskResultsPresenter.cpp @@ -61,7 +61,7 @@ void MaskResultsPresenter::setShowMaskMode() if (OutputData<double> *maskedData = createMaskPresentation()) { backup_data(); m_intensityDataItem->setOutputData(maskedData); - m_intensityDataItem->setChildValue(IntensityDataItem::P_IS_INTERPOLATED, false); + m_intensityDataItem->setItemValue(IntensityDataItem::P_IS_INTERPOLATED, false); } else { m_dataBackup.reset(); } @@ -72,7 +72,7 @@ void MaskResultsPresenter::setOriginalMode() { if (m_dataBackup) { m_intensityDataItem->setOutputData(m_dataBackup->clone()); - m_intensityDataItem->setChildValue(IntensityDataItem::P_IS_INTERPOLATED, + m_intensityDataItem->setItemValue(IntensityDataItem::P_IS_INTERPOLATED, m_interpolation_flag_backup); } } @@ -80,7 +80,7 @@ void MaskResultsPresenter::setOriginalMode() void MaskResultsPresenter::backup_data() { m_interpolation_flag_backup - = m_intensityDataItem->getChildValue(IntensityDataItem::P_IS_INTERPOLATED).toBool(); + = m_intensityDataItem->getItemValue(IntensityDataItem::P_IS_INTERPOLATED).toBool(); m_dataBackup.reset(m_intensityDataItem->getOutputData()->clone()); } @@ -102,7 +102,7 @@ OutputData<double> *MaskResultsPresenter::createMaskPresentation() const std::unique_ptr<Geometry::IShape2D> shape = item->createShape(); if (shape) { detectorMask.addMask(*shape.get(), - item->getChildValue(MaskItem::P_MASK_VALUE).toBool()); + item->getItemValue(MaskItem::P_MASK_VALUE).toBool()); } } } diff --git a/GUI/coregui/Views/MaskWidgets/PolygonPointView.cpp b/GUI/coregui/Views/MaskWidgets/PolygonPointView.cpp index 60751b5881a1bb4428da812aace5bff5956955cc..f729df6d3539aae46a5506739677650bc2e1066e 100644 --- a/GUI/coregui/Views/MaskWidgets/PolygonPointView.cpp +++ b/GUI/coregui/Views/MaskWidgets/PolygonPointView.cpp @@ -36,8 +36,8 @@ QRectF PolygonPointView::boundingRect() const void PolygonPointView::updateParameterizedItem(const QPointF &pos) { - m_item->setChildValue(PolygonPointItem::P_POSX, fromSceneX(pos.x())); - m_item->setChildValue(PolygonPointItem::P_POSY, fromSceneY(pos.y())); + m_item->setItemValue(PolygonPointItem::P_POSX, fromSceneX(pos.x())); + m_item->setItemValue(PolygonPointItem::P_POSY, fromSceneY(pos.y())); } void PolygonPointView::update_view() diff --git a/GUI/coregui/Views/MaskWidgets/PolygonView.cpp b/GUI/coregui/Views/MaskWidgets/PolygonView.cpp index 2153e5c6b27baa4e9928ca29b59f0be9dc323d5c..d8f2d270417d512d2d50503142f9e63b423da917 100644 --- a/GUI/coregui/Views/MaskWidgets/PolygonView.cpp +++ b/GUI/coregui/Views/MaskWidgets/PolygonView.cpp @@ -83,7 +83,7 @@ bool PolygonView::closePolygonIfNecessary() childItem->setAcceptHoverEvents(false); childItem->setCursor(Qt::SizeAllCursor); } - m_item->setChildValue(PolygonItem::P_ISCLOSED, true); + m_item->setItemValue(PolygonItem::P_ISCLOSED, true); update(); } return isClosedPolygon(); @@ -96,7 +96,7 @@ void PolygonView::onClosePolygonRequest(bool value) bool PolygonView::isClosedPolygon() { - return m_item->getChildValue(PolygonItem::P_ISCLOSED).toBool(); + return m_item->getItemValue(PolygonItem::P_ISCLOSED).toBool(); } void PolygonView::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) @@ -104,7 +104,7 @@ void PolygonView::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWi Q_ASSERT(m_item); painter->setRenderHints(QPainter::Antialiasing); - bool mask_value = m_item->getChildValue(MaskItem::P_MASK_VALUE).toBool(); + bool mask_value = m_item->getItemValue(MaskItem::P_MASK_VALUE).toBool(); painter->setBrush(MaskEditorHelper::getMaskBrush(mask_value)); painter->setPen(MaskEditorHelper::getMaskPen(mask_value)); @@ -158,8 +158,8 @@ void PolygonView::update_polygon() m_polygon.clear(); foreach (SessionItem *item, m_item->getChildrenOfType(Constants::PolygonPointType)) { - qreal px = toSceneX(item->getChildValue(PolygonPointItem::P_POSX).toReal()); - qreal py = toSceneY(item->getChildValue(PolygonPointItem::P_POSY).toReal()); + qreal px = toSceneX(item->getItemValue(PolygonPointItem::P_POSX).toReal()); + qreal py = toSceneY(item->getItemValue(PolygonPointItem::P_POSY).toReal()); m_polygon << QPointF(px, py); } diff --git a/GUI/coregui/Views/MaskWidgets/RectangleView.cpp b/GUI/coregui/Views/MaskWidgets/RectangleView.cpp index 293551b39fe55688d5cdf03fc16a8fe55a3536d7..97804c5f673faa3d4dc5712ead74ce9f122752db 100644 --- a/GUI/coregui/Views/MaskWidgets/RectangleView.cpp +++ b/GUI/coregui/Views/MaskWidgets/RectangleView.cpp @@ -44,8 +44,8 @@ void RectangleView::onChangedX() { m_block_on_property_change = true; // m_item->setRegisteredProperty(RectangleItem::P_POSX, fromSceneX(this->x())); - m_item->setChildValue(RectangleItem::P_XLOW, fromSceneX(this->x())); - m_item->setChildValue(RectangleItem::P_XUP, fromSceneX(this->x() + m_mask_rect.width())); + m_item->setItemValue(RectangleItem::P_XLOW, fromSceneX(this->x())); + m_item->setItemValue(RectangleItem::P_XUP, fromSceneX(this->x() + m_mask_rect.width())); m_block_on_property_change = false; } @@ -53,8 +53,8 @@ void RectangleView::onChangedY() { m_block_on_property_change = true; // m_item->setRegisteredProperty(RectangleItem::P_POSY, fromSceneY(this->y())); - m_item->setChildValue(RectangleItem::P_YLOW, fromSceneY(this->y() + m_mask_rect.height())); - m_item->setChildValue(RectangleItem::P_YUP, fromSceneY(this->y())); + m_item->setItemValue(RectangleItem::P_YLOW, fromSceneY(this->y() + m_mask_rect.height())); + m_item->setItemValue(RectangleItem::P_YUP, fromSceneY(this->y())); m_block_on_property_change = false; } @@ -103,7 +103,7 @@ void RectangleView::onSizeHandleElementRequest(bool going_to_resize) void RectangleView::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) { // painter->setRenderHints(QPainter::Antialiasing); - bool mask_value = m_item->getChildValue(MaskItem::P_MASK_VALUE).toBool(); + bool mask_value = m_item->getItemValue(MaskItem::P_MASK_VALUE).toBool(); painter->setBrush(MaskEditorHelper::getMaskBrush(mask_value)); painter->setPen(MaskEditorHelper::getMaskPen(mask_value)); painter->drawRect(m_mask_rect); @@ -139,10 +139,10 @@ void RectangleView::mouseMoveEvent(QGraphicsSceneMouseEvent *event) // fromSceneX(xmax) - fromSceneX(xmin)); // m_item->setRegisteredProperty(RectangleItem::P_HEIGHT, // fromSceneY(ymin) - fromSceneY(ymax)); - m_item->setChildValue(RectangleItem::P_XLOW, fromSceneX(xmin)); - m_item->setChildValue(RectangleItem::P_YLOW, fromSceneY(ymax)); - m_item->setChildValue(RectangleItem::P_XUP, fromSceneX(xmax)); - m_item->setChildValue(RectangleItem::P_YUP, fromSceneY(ymin)); + m_item->setItemValue(RectangleItem::P_XLOW, fromSceneX(xmin)); + m_item->setItemValue(RectangleItem::P_YLOW, fromSceneY(ymax)); + m_item->setItemValue(RectangleItem::P_XUP, fromSceneX(xmax)); + m_item->setItemValue(RectangleItem::P_YUP, fromSceneY(ymin)); @@ -151,8 +151,8 @@ void RectangleView::mouseMoveEvent(QGraphicsSceneMouseEvent *event) // m_item->setRegisteredProperty(RectangleItem::P_HEIGHT, // fromSceneY(ymin) - fromSceneY(ymax)); - m_item->setChildValue(RectangleItem::P_YLOW, fromSceneY(ymax)); - m_item->setChildValue(RectangleItem::P_YUP, fromSceneY(ymin)); + m_item->setItemValue(RectangleItem::P_YLOW, fromSceneY(ymax)); + m_item->setItemValue(RectangleItem::P_YUP, fromSceneY(ymin)); } else if(m_activeHandleElement->getHandleType() == SizeHandleElement::RESIZE_WIDTH) { @@ -160,8 +160,8 @@ void RectangleView::mouseMoveEvent(QGraphicsSceneMouseEvent *event) // m_item->setRegisteredProperty(RectangleItem::P_WIDTH, // fromSceneX(xmax) - fromSceneX(xmin)); - m_item->setChildValue(RectangleItem::P_XLOW, fromSceneX(xmin)); - m_item->setChildValue(RectangleItem::P_XUP, fromSceneX(xmax)); + m_item->setItemValue(RectangleItem::P_XLOW, fromSceneX(xmin)); + m_item->setItemValue(RectangleItem::P_XUP, fromSceneX(xmax)); } update_view(); diff --git a/GUI/coregui/Views/MaterialEditor/MaterialEditorToolBar.cpp b/GUI/coregui/Views/MaterialEditor/MaterialEditorToolBar.cpp index c33c6caedd83be0d06588ac2d5886864a3a03d91..1e4136bf04f1c1aaee8d07529ab99b79ecf68789 100644 --- a/GUI/coregui/Views/MaterialEditor/MaterialEditorToolBar.cpp +++ b/GUI/coregui/Views/MaterialEditor/MaterialEditorToolBar.cpp @@ -94,7 +94,7 @@ void MaterialEditorToolBar::onCloneMaterialAction() QModelIndex selectedIndex = selected.front(); const MaterialItem *origMaterial =m_materialModel->getMaterial(selectedIndex); SessionItem *clonedMaterial = m_materialModel->copyParameterizedItem(origMaterial, 0); - clonedMaterial->setChildValue(MaterialItem::P_IDENTIFIER, QUuid::createUuid().toString()); + clonedMaterial->setItemValue(MaterialItem::P_IDENTIFIER, QUuid::createUuid().toString()); clonedMaterial->setItemName(origMaterial->itemName()+" (clone)"); } diff --git a/GUI/coregui/Views/PropertyEditor/UniversalPropertyEditor.cpp b/GUI/coregui/Views/PropertyEditor/UniversalPropertyEditor.cpp index 02f07a3f71ee94919bad93f03ca5aed9c1abbf0e..6af2cf6e2d081fe543368d6f101b5875831b9762 100644 --- a/GUI/coregui/Views/PropertyEditor/UniversalPropertyEditor.cpp +++ b/GUI/coregui/Views/PropertyEditor/UniversalPropertyEditor.cpp @@ -178,7 +178,7 @@ void UniversalPropertyEditor::onPropertyChanged(const QString &property_name) QtVariantProperty *variant_property = m_item_to_propertyname_to_qtvariantproperty[m_item][property_name]; if(variant_property) { - QVariant property_value = m_item->getChildValue(property_name); + QVariant property_value = m_item->getItemValue(property_name); disconnect(m_item, SIGNAL(propertyChanged(QString)), this, SLOT(onPropertyChanged(QString))); @@ -212,7 +212,7 @@ void UniversalPropertyEditor::onSubItemPropertyChanged(const QString &property_g if(subItem){ QtVariantProperty *variant_property = m_item_to_propertyname_to_qtvariantproperty[subItem][property_name]; if(variant_property) { - QVariant property_value = subItem->getChildValue(property_name); + QVariant property_value = subItem->getItemValue(property_name); disconnect(m_item, SIGNAL(propertyChanged(QString)), this, SLOT(onPropertyChanged(QString))); diff --git a/GUI/coregui/Views/SampleDesigner/DesignerScene.cpp b/GUI/coregui/Views/SampleDesigner/DesignerScene.cpp index 31ea30a7f7e851ee56267ef144e83bee8ebffb18..26d72c5fc3c1523b200b17d8f8533f3e28f4f4e7 100644 --- a/GUI/coregui/Views/SampleDesigner/DesignerScene.cpp +++ b/GUI/coregui/Views/SampleDesigner/DesignerScene.cpp @@ -446,9 +446,9 @@ void DesignerScene::dropEvent(QGraphicsSceneDragDropEvent *event) // propagating drop coordinates to SessionItem QRectF boundingRect = DesignerHelper::getDefaultBoundingRect(new_item->modelType()); - new_item->setChildValue(SessionGraphicsItem::P_XPOS, + new_item->setItemValue(SessionGraphicsItem::P_XPOS, event->scenePos().x() - boundingRect.width() / 2); - new_item->setChildValue(SessionGraphicsItem::P_YPOS, + new_item->setItemValue(SessionGraphicsItem::P_YPOS, event->scenePos().y() - boundingRect.height() / 2); } else if (GUIExamplesFactory::isValidExampleName(mimeData->getClassName())) { diff --git a/GUI/coregui/Views/SampleDesigner/ILayerView.cpp b/GUI/coregui/Views/SampleDesigner/ILayerView.cpp index de759ecbc0f434727635fe99be7458d327a2a20e..0f9ebfe4736cb3552584e19392cd0445e75c4b24 100644 --- a/GUI/coregui/Views/SampleDesigner/ILayerView.cpp +++ b/GUI/coregui/Views/SampleDesigner/ILayerView.cpp @@ -50,7 +50,7 @@ void ILayerView::onPropertyChange(const QString &propertyName) Q_ASSERT(m_item); if (propertyName == LayerItem::P_THICKNESS) { m_rect.setHeight(DesignerHelper::nanometerToScreen( - m_item->getChildValue(LayerItem::P_THICKNESS).toDouble())); + m_item->getItemValue(LayerItem::P_THICKNESS).toDouble())); setPortCoordinates(); update(); emit heightChanged(); @@ -70,7 +70,7 @@ void ILayerView::onPropertyChange(const QString &propertyName) void ILayerView::updateColor() { if(m_item && m_item->isTag(LayerItem::P_MATERIAL)) { - QVariant v = m_item->getChildValue(LayerItem::P_MATERIAL); + QVariant v = m_item->getItemValue(LayerItem::P_MATERIAL); if (v.isValid()) { MaterialProperty mp = v.value<MaterialProperty>(); setColor(mp.getColor()); diff --git a/GUI/coregui/Views/SampleDesigner/IView.cpp b/GUI/coregui/Views/SampleDesigner/IView.cpp index 857ba0923175e4291dfadf1aee23b181c906b47b..2ed7ea7ef556957e8685d147850893debb47f501 100644 --- a/GUI/coregui/Views/SampleDesigner/IView.cpp +++ b/GUI/coregui/Views/SampleDesigner/IView.cpp @@ -29,17 +29,17 @@ void IView::setParameterizedItem(SessionItem *item) { if (item) { m_item = item; - setX(m_item->getChildValue(SessionGraphicsItem::P_XPOS).toReal()); - setY(m_item->getChildValue(SessionGraphicsItem::P_YPOS).toReal()); + setX(m_item->getItemValue(SessionGraphicsItem::P_XPOS).toReal()); + setY(m_item->getItemValue(SessionGraphicsItem::P_YPOS).toReal()); ModelMapper *mapper = new ModelMapper(this); mapper->setItem(item); mapper->setOnPropertyChange( [this] (const QString &name) { if (name == SessionGraphicsItem::P_XPOS) { - setX(m_item->getChildValue(SessionGraphicsItem::P_XPOS).toReal()); + setX(m_item->getItemValue(SessionGraphicsItem::P_XPOS).toReal()); } else if (name == SessionGraphicsItem::P_YPOS) { - setY(m_item->getChildValue(SessionGraphicsItem::P_YPOS).toReal()); + setY(m_item->getItemValue(SessionGraphicsItem::P_YPOS).toReal()); } }); connect(m_item, SIGNAL(propertyChanged(const QString &)), this, @@ -58,11 +58,11 @@ void IView::addView(IView *childView, int row) void IView::onChangedX() { Q_ASSERT(m_item); - m_item->setChildValue(SessionGraphicsItem::P_XPOS, x()); + m_item->setItemValue(SessionGraphicsItem::P_XPOS, x()); } void IView::onChangedY() { Q_ASSERT(m_item); - m_item->setChildValue(SessionGraphicsItem::P_YPOS, y()); + m_item->setItemValue(SessionGraphicsItem::P_YPOS, y()); } diff --git a/Tests/UnitTests/TestGUI/TestFTDistributionItems.h b/Tests/UnitTests/TestGUI/TestFTDistributionItems.h index 9eaec0b4c92213922b62a8555f0b66eb43c6bcbd..4897f08a5ab6484c43c0f950e8652e3b141ebda1 100644 --- a/Tests/UnitTests/TestGUI/TestFTDistributionItems.h +++ b/Tests/UnitTests/TestGUI/TestFTDistributionItems.h @@ -19,7 +19,7 @@ inline void TestFTDistributionItems::test_FTDistribution1DCauchy() { // to domain FTDistribution1DCauchyItem item; - item.setChildValue(FTDistribution1DItem::P_CORR_LENGTH, 2.0); + item.setItemValue(FTDistribution1DItem::P_CORR_LENGTH, 2.0); FTDistribution1DCauchy *pdf = dynamic_cast<FTDistribution1DCauchy *>(item.createFTDistribution()); QVERIFY(pdf->getOmega() == 2.0); delete pdf; @@ -27,8 +27,8 @@ inline void TestFTDistributionItems::test_FTDistribution1DCauchy() // from domain FTDistribution1DCauchy pdf2(3.0); FTDistribution1DCauchyItem item2; - item2.setChildValue(FTDistribution1DGaussItem::P_CORR_LENGTH, pdf2.getOmega()); - QVERIFY(item2.getChildValue(FTDistribution1DGaussItem::P_CORR_LENGTH) == 3.0); + item2.setItemValue(FTDistribution1DGaussItem::P_CORR_LENGTH, pdf2.getOmega()); + QVERIFY(item2.getItemValue(FTDistribution1DGaussItem::P_CORR_LENGTH) == 3.0); } #endif diff --git a/Tests/UnitTests/TestGUI/TestFormFactorItems.h b/Tests/UnitTests/TestGUI/TestFormFactorItems.h index 432f08acd0246915399d1cfd187f9721a27d855b..6ec81cebc0fc791762dac34814d0fae040d4d4a3 100644 --- a/Tests/UnitTests/TestGUI/TestFormFactorItems.h +++ b/Tests/UnitTests/TestGUI/TestFormFactorItems.h @@ -21,10 +21,10 @@ inline void TestFormFactorItems::test_AnisoPyramidItem() { // to domain AnisoPyramidItem item; - item.setChildValue(AnisoPyramidItem::P_LENGTH, 20.0); - item.setChildValue(AnisoPyramidItem::P_WIDTH, 16.0); - item.setChildValue(AnisoPyramidItem::P_HEIGHT, 13.0); - item.setChildValue(AnisoPyramidItem::P_ALPHA, 60.0); + item.setItemValue(AnisoPyramidItem::P_LENGTH, 20.0); + item.setItemValue(AnisoPyramidItem::P_WIDTH, 16.0); + item.setItemValue(AnisoPyramidItem::P_HEIGHT, 13.0); + item.setItemValue(AnisoPyramidItem::P_ALPHA, 60.0); auto P_ff = item.createFormFactor(); FormFactorAnisoPyramid *p_ff = dynamic_cast<FormFactorAnisoPyramid *>(P_ff.get()); QVERIFY(p_ff); diff --git a/Tests/UnitTests/TestGUI/TestLayerRoughnessItems.h b/Tests/UnitTests/TestGUI/TestLayerRoughnessItems.h index 5b57580b74739b2da460ef362f9b0b3bb2badca4..77c80875e49308ce923607643480533e3f9728d0 100644 --- a/Tests/UnitTests/TestGUI/TestLayerRoughnessItems.h +++ b/Tests/UnitTests/TestGUI/TestLayerRoughnessItems.h @@ -18,14 +18,14 @@ private slots: inline void TestLayerRoughnessItems::test_LayerRoughnessToDomain() { LayerBasicRoughnessItem roughnessItem; - roughnessItem.setChildValue(LayerBasicRoughnessItem::P_SIGMA, 10.0); - roughnessItem.setChildValue(LayerBasicRoughnessItem::P_HURST, 20.0); - roughnessItem.setChildValue(LayerBasicRoughnessItem::P_LATERAL_CORR_LENGTH, 30.0); + roughnessItem.setItemValue(LayerBasicRoughnessItem::P_SIGMA, 10.0); + roughnessItem.setItemValue(LayerBasicRoughnessItem::P_HURST, 20.0); + roughnessItem.setItemValue(LayerBasicRoughnessItem::P_LATERAL_CORR_LENGTH, 30.0); auto P_roughness = TransformToDomain::createLayerRoughness(roughnessItem); - QCOMPARE(P_roughness->getSigma(), roughnessItem.getChildValue(LayerBasicRoughnessItem::P_SIGMA).toDouble()); - QCOMPARE(P_roughness->getHurstParameter(), roughnessItem.getChildValue(LayerBasicRoughnessItem::P_HURST).toDouble()); - QCOMPARE(P_roughness->getLatteralCorrLength(), roughnessItem.getChildValue(LayerBasicRoughnessItem::P_LATERAL_CORR_LENGTH).toDouble()); + QCOMPARE(P_roughness->getSigma(), roughnessItem.getItemValue(LayerBasicRoughnessItem::P_SIGMA).toDouble()); + QCOMPARE(P_roughness->getHurstParameter(), roughnessItem.getItemValue(LayerBasicRoughnessItem::P_HURST).toDouble()); + QCOMPARE(P_roughness->getLatteralCorrLength(), roughnessItem.getItemValue(LayerBasicRoughnessItem::P_LATERAL_CORR_LENGTH).toDouble()); LayerZeroRoughnessItem zeroRoughnessItem; QVERIFY(TransformToDomain::createLayerRoughness(zeroRoughnessItem) == nullptr); @@ -36,9 +36,9 @@ inline void TestLayerRoughnessItems::test_LayerRoughnessFromDomain() LayerRoughness roughness(10.0, 20.0, 30.0); LayerBasicRoughnessItem roughnessItem; TransformFromDomain::setItemFromSample(&roughnessItem, &roughness); - QCOMPARE(roughness.getSigma(), roughnessItem.getChildValue(LayerBasicRoughnessItem::P_SIGMA).toDouble()); - QCOMPARE(roughness.getHurstParameter(), roughnessItem.getChildValue(LayerBasicRoughnessItem::P_HURST).toDouble()); - QCOMPARE(roughness.getLatteralCorrLength(), roughnessItem.getChildValue(LayerBasicRoughnessItem::P_LATERAL_CORR_LENGTH).toDouble()); + QCOMPARE(roughness.getSigma(), roughnessItem.getItemValue(LayerBasicRoughnessItem::P_SIGMA).toDouble()); + QCOMPARE(roughness.getHurstParameter(), roughnessItem.getItemValue(LayerBasicRoughnessItem::P_HURST).toDouble()); + QCOMPARE(roughness.getLatteralCorrLength(), roughnessItem.getItemValue(LayerBasicRoughnessItem::P_LATERAL_CORR_LENGTH).toDouble()); } diff --git a/Tests/UnitTests/TestGUI/TestMapper.h b/Tests/UnitTests/TestGUI/TestMapper.h index 599fc6991efdf40f5d5e257c3aad15b948bf7408..e5836e5dd41477ab854c9bbce19a3c2961eb7a95 100644 --- a/Tests/UnitTests/TestGUI/TestMapper.h +++ b/Tests/UnitTests/TestGUI/TestMapper.h @@ -58,11 +58,11 @@ inline void TestMapper::test_Inference2DRotationAngleToggle() layout->index(), -1, ParticleLayoutItem::T_INTERFERENCE); // rotation (xi) should be disabled if integration is on - inference->setChildValue(InterferenceFunction2DParaCrystalItem::P_XI_INTEGRATION, true); + inference->setItemValue(InterferenceFunction2DParaCrystalItem::P_XI_INTEGRATION, true); QVERIFY(inference->getItem(InterferenceFunction2DParaCrystalItem::P_ROTATION_ANGLE)->isEnabled() == false); // rotation (xi) should be enabled if integration is off - inference->setChildValue(InterferenceFunction2DParaCrystalItem::P_XI_INTEGRATION, false); + inference->setItemValue(InterferenceFunction2DParaCrystalItem::P_XI_INTEGRATION, false); QVERIFY(!inference->getItem(InterferenceFunction2DParaCrystalItem::P_ROTATION_ANGLE)->isEnabled() == false); } @@ -76,16 +76,16 @@ inline void TestMapper::test_instrumentAlignmentPropertyVisibility() SessionItem *rectangular = detector->getGroupItem(DetectorItem::P_DETECTOR); - ComboProperty alignment = rectangular->getChildValue(RectangularDetectorItem::P_ALIGNMENT) + ComboProperty alignment = rectangular->getItemValue(RectangularDetectorItem::P_ALIGNMENT) .value<ComboProperty>(); // generic has some more items visible alignment.setValue(Constants::ALIGNMENT_GENERIC); - rectangular->setChildValue(RectangularDetectorItem::P_ALIGNMENT, QVariant::fromValue<ComboProperty>(alignment)); + rectangular->setItemValue(RectangularDetectorItem::P_ALIGNMENT, QVariant::fromValue<ComboProperty>(alignment)); QVERIFY(rectangular->getItem(RectangularDetectorItem::P_NORMAL)->isVisible()); // should be disabled if we switch alignment.setValue(Constants::ALIGNMENT_TO_REFLECTED_BEAM); - rectangular->setChildValue(RectangularDetectorItem::P_ALIGNMENT, QVariant::fromValue<ComboProperty>(alignment)); + rectangular->setItemValue(RectangularDetectorItem::P_ALIGNMENT, QVariant::fromValue<ComboProperty>(alignment)); QVERIFY(rectangular->getItem(RectangularDetectorItem::P_NORMAL)->isVisible() == false); } diff --git a/Tests/UnitTests/TestGUI/TestParaCrystalItems.h b/Tests/UnitTests/TestGUI/TestParaCrystalItems.h index 85a1502f511097026baeb7daa2620dca23c3f28e..71c92fc8ab2e092fb34b3285b7c12727e0b4e1a5 100644 --- a/Tests/UnitTests/TestGUI/TestParaCrystalItems.h +++ b/Tests/UnitTests/TestGUI/TestParaCrystalItems.h @@ -21,14 +21,14 @@ inline void TestParaCrystalItems::test_Para1D_InitialState() QCOMPARE(item.itemName(), Constants::InterferenceFunctionRadialParaCrystalType); QCOMPARE(item.getChildrenOfType(Constants::GroupItemType).size(), 1); - QCOMPARE(item.getChildValue(InterferenceFunctionRadialParaCrystalItem::P_PEAK_DISTANCE).toDouble(), 20.0*Units::nanometer); - QCOMPARE(item.getChildValue(InterferenceFunctionRadialParaCrystalItem::P_DAMPING_LENGTH).toDouble(), 1000.0*Units::micrometer); - QCOMPARE(item.getChildValue(InterferenceFunctionRadialParaCrystalItem::P_DOMAIN_SIZE).toDouble(), 20.0*Units::micrometer); - QCOMPARE(item.getChildValue(InterferenceFunctionRadialParaCrystalItem::P_KAPPA).toDouble(), 0.0); + QCOMPARE(item.getItemValue(InterferenceFunctionRadialParaCrystalItem::P_PEAK_DISTANCE).toDouble(), 20.0*Units::nanometer); + QCOMPARE(item.getItemValue(InterferenceFunctionRadialParaCrystalItem::P_DAMPING_LENGTH).toDouble(), 1000.0*Units::micrometer); + QCOMPARE(item.getItemValue(InterferenceFunctionRadialParaCrystalItem::P_DOMAIN_SIZE).toDouble(), 20.0*Units::micrometer); + QCOMPARE(item.getItemValue(InterferenceFunctionRadialParaCrystalItem::P_KAPPA).toDouble(), 0.0); QCOMPARE(item.getGroupItem(InterferenceFunctionRadialParaCrystalItem::P_PDF)->modelType(), Constants::FTDistribution1DCauchyType); - GroupProperty_t group_property = item.getChildValue(InterferenceFunctionRadialParaCrystalItem::P_PDF).value<GroupProperty_t>(); + GroupProperty_t group_property = item.getItemValue(InterferenceFunctionRadialParaCrystalItem::P_PDF).value<GroupProperty_t>(); QCOMPARE(group_property->type(), GroupProperty::SELECTABLE); } diff --git a/Tests/UnitTests/TestGUI/TestParameterizedItem.h b/Tests/UnitTests/TestGUI/TestParameterizedItem.h index ca71a1693bed5af98fb0dc9ab4d34cc2b2fa0d9a..10ca31c6675e1874682bdfa8d7f54d2841feee0b 100644 --- a/Tests/UnitTests/TestGUI/TestParameterizedItem.h +++ b/Tests/UnitTests/TestGUI/TestParameterizedItem.h @@ -36,20 +36,20 @@ inline void TestParameterizedItem::test_registerProperty() // QList<QVariant> arguments = spy.takeFirst(); // QCOMPARE(arguments.size(), 1); // QCOMPARE(arguments.at(0).toString(), property_name); - QCOMPARE(item.getChildValue(property_name).toDouble(), value); + QCOMPARE(item.getItemValue(property_name).toDouble(), value); // QCOMPARE(spy.count(), 0); // setting property value double new_value(2.0); - item.setChildValue(property_name, new_value); + item.setItemValue(property_name, new_value); // QCOMPARE(spy.count(), 1); // arguments = spy.takeFirst(); // QCOMPARE(arguments.size(), 1); // QCOMPARE(arguments.at(0).toString(), property_name); - QCOMPARE(item.getChildValue(property_name).toDouble(), new_value); + QCOMPARE(item.getItemValue(property_name).toDouble(), new_value); // setting property value to wrong QVariant - QVERIFY_THROW(item.setChildValue(property_name, QString("aaa")), GUIHelpers::Error); + QVERIFY_THROW(item.setItemValue(property_name, QString("aaa")), GUIHelpers::Error); // attempt to register already existing property // QVERIFY_THROW(item.registerProperty(property_name, 1.0), GUIHelpers::Error);