Skip to content
Snippets Groups Projects
Commit 5dd00bae authored by Van Herck, Walter's avatar Van Herck, Walter
Browse files

Attach ParticleDistributionView

parent 53cebe22
No related branches found
No related tags found
No related merge requests found
...@@ -50,6 +50,14 @@ GroupPropertyRegistry::SelectableGroupMap_t initializeSelectableGroupMap() ...@@ -50,6 +50,14 @@ GroupPropertyRegistry::SelectableGroupMap_t initializeSelectableGroupMap()
detectors[Constants::PhiAlphaDetectorType] = "[Phi, Alpha] plane"; detectors[Constants::PhiAlphaDetectorType] = "[Phi, Alpha] plane";
result[Constants::DetectorGroup] = detectors; result[Constants::DetectorGroup] = detectors;
QMap<QString, QString> distributions;
distributions[Constants::DistributionGateType] = "Gate distribution";
distributions[Constants::DistributionLorentzType] = "Lorentz distribution";
distributions[Constants::DistributionGaussianType] = "Gaussian distribution";
distributions[Constants::DistributionLogNormalType] = "Log Normal distribution";
distributions[Constants::DistributionCosineType] = "Cosine distribution";
result[Constants::DistributionGroup] = distributions;
QMap<QString, QString> pdfs_1d; QMap<QString, QString> pdfs_1d;
pdfs_1d[Constants::FTDistribution1DCauchyType] = "Cauchy 1D"; pdfs_1d[Constants::FTDistribution1DCauchyType] = "Cauchy 1D";
pdfs_1d[Constants::FTDistribution1DGaussType] = "Gauss 1D"; pdfs_1d[Constants::FTDistribution1DGaussType] = "Gauss 1D";
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include "RotationItems.h" #include "RotationItems.h"
#include "ParticleCoreShellItem.h" #include "ParticleCoreShellItem.h"
#include "ParticleDistributionItem.h" #include "ParticleDistributionItem.h"
#include "DistributionItem.h"
#include "InterferenceFunctionItems.h" #include "InterferenceFunctionItems.h"
#include "InstrumentItem.h" #include "InstrumentItem.h"
#include "BeamItem.h" #include "BeamItem.h"
...@@ -89,6 +90,12 @@ ItemFactory::ItemMap_t initializeItemMap() { ...@@ -89,6 +90,12 @@ ItemFactory::ItemMap_t initializeItemMap() {
result[Constants::DetectorType] = &createInstance<DetectorItem>; result[Constants::DetectorType] = &createInstance<DetectorItem>;
result[Constants::PhiAlphaDetectorType] = &createInstance<PhiAlphaDetectorItem>; result[Constants::PhiAlphaDetectorType] = &createInstance<PhiAlphaDetectorItem>;
result[Constants::DistributionGateType] = &createInstance<DistributionGateItem>;
result[Constants::DistributionLorentzType] = &createInstance<DistributionLorentzItem>;
result[Constants::DistributionGaussianType] = &createInstance<DistributionGaussianItem>;
result[Constants::DistributionLogNormalType] = &createInstance<DistributionLogNormalItem>;
result[Constants::DistributionCosineType] = &createInstance<DistributionCosineItem>;
result[Constants::FTDistribution1DCauchyType] = &createInstance<FTDistribution1DCauchyItem>; result[Constants::FTDistribution1DCauchyType] = &createInstance<FTDistribution1DCauchyItem>;
result[Constants::FTDistribution1DGaussType] = &createInstance<FTDistribution1DGaussItem>; result[Constants::FTDistribution1DGaussType] = &createInstance<FTDistribution1DGaussItem>;
result[Constants::FTDistribution1DGateType] = &createInstance<FTDistribution1DGateItem>; result[Constants::FTDistribution1DGateType] = &createInstance<FTDistribution1DGateItem>;
......
...@@ -33,14 +33,11 @@ ParticleDistributionItem::ParticleDistributionItem(ParameterizedItem *parent) ...@@ -33,14 +33,11 @@ ParticleDistributionItem::ParticleDistributionItem(ParameterizedItem *parent)
par_name << "Radius" << "Height"; par_name << "Radius" << "Height";
registerProperty(P_DISTRIBUTED_PARAMETER, par_name.getVariant()); registerProperty(P_DISTRIBUTED_PARAMETER, par_name.getVariant());
registerGroupProperty(P_DISTRIBUTION, Constants::DistributionGroup); registerGroupProperty(P_DISTRIBUTION, Constants::DistributionGroup);
registerProperty(P_SAMPLE_NUMBER, 5.0); registerProperty(P_SAMPLE_NUMBER, 5);
registerProperty(P_SIGMA_FACTOR, 2.0); registerProperty(P_SIGMA_FACTOR, 2.0);
addToValidChildren(Constants::ParticleType, PortInfo::Port0); addToValidChildren(Constants::ParticleType, PortInfo::Port0);
addToValidChildren(Constants::ParticleCoreShellType, PortInfo::Port0); addToValidChildren(Constants::ParticleCoreShellType, PortInfo::Port0);
setPropertyAppearance(ParameterizedItem::P_NAME,
PropertyAttribute::VisibleProperty);
} }
ParticleDistributionItem::~ParticleDistributionItem() ParticleDistributionItem::~ParticleDistributionItem()
......
...@@ -146,7 +146,10 @@ QRectF DesignerHelper::getDefaultBoundingRect(const QString &name) ...@@ -146,7 +146,10 @@ QRectF DesignerHelper::getDefaultBoundingRect(const QString &name)
else if (name==Constants::TransformationType) { else if (name==Constants::TransformationType) {
return QRectF(0, 0, getDefaultTransformationWidth(), getDefaultTransformationHeight()); return QRectF(0, 0, getDefaultTransformationWidth(), getDefaultTransformationHeight());
} }
else if (name.startsWith(Constants::FormFactorType) || name==Constants::ParticleType || name==Constants::ParticleCoreShellType) { else if (name.startsWith(Constants::FormFactorType)
|| name==Constants::ParticleType
|| name==Constants::ParticleCoreShellType
|| name==Constants::ParticleDistributionType) {
return QRectF(0, 0, getDefaultParticleWidth(), getDefaultParticleHeight()); return QRectF(0, 0, getDefaultParticleWidth(), getDefaultParticleHeight());
} }
else if (name.startsWith("InterferenceFunction")) { else if (name.startsWith("InterferenceFunction")) {
......
...@@ -11,8 +11,7 @@ ParticleDistributionView::ParticleDistributionView(QGraphicsItem *parent) ...@@ -11,8 +11,7 @@ ParticleDistributionView::ParticleDistributionView(QGraphicsItem *parent)
setColor(DesignerHelper::getDefaultParticleColor()); setColor(DesignerHelper::getDefaultParticleColor());
setRectangle(DesignerHelper::getDefaultBoundingRect(Constants::ParticleDistributionType)); setRectangle(DesignerHelper::getDefaultBoundingRect(Constants::ParticleDistributionType));
addPort("out", NodeEditorPort::Output, NodeEditorPort::FormFactor); addPort("out", NodeEditorPort::Output, NodeEditorPort::FormFactor);
addPort("core", NodeEditorPort::Input, NodeEditorPort::FormFactor); addPort("particle", NodeEditorPort::Input, NodeEditorPort::FormFactor);
addPort("shell", NodeEditorPort::Input, NodeEditorPort::FormFactor);
m_roundpar = 5; m_roundpar = 5;
m_label_vspace = 45; m_label_vspace = 45;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment