BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Manages a local parameter pool, and a tree of child pools. More...
Public Member Functions | |
IParametricComponent (const IParametricComponent &other) | |
IParametricComponent (const std::string &name="") | |
virtual | ~IParametricComponent () |
virtual ParameterPool * | createParameterTree () const |
Creates new parameter pool, with all local parameters and those of its children. More... | |
const std::string & | getName () const |
virtual void | onChange () |
Action to be taken in inherited class when a parameter has changed. More... | |
IParametricComponent & | operator= (const IParametricComponent &other)=delete |
RealParameter * | parameter (const std::string &name) const |
Returns parameter with given 'name'. More... | |
ParameterPool * | parameterPool () const |
Returns pointer to the parameter pool. More... | |
std::string | parametersToString () const |
Returns multiline string representing available parameters. More... | |
RealParameter & | registerParameter (const std::string &name, double *parpointer) |
void | registerVector (const std::string &base_name, kvector_t *p_vec, const std::string &units="nm") |
void | removeParameter (const std::string &name) |
void | removeVector (const std::string &base_name) |
void | setName (const std::string &name) |
void | setParameterValue (const std::string &name, double value) |
void | setVectorValue (const std::string &base_name, kvector_t value) |
Static Public Member Functions | |
static std::string | XComponentName (const std::string &base_name) |
static std::string | YComponentName (const std::string &base_name) |
static std::string | ZComponentName (const std::string &base_name) |
Private Attributes | |
std::string | m_name |
std::unique_ptr< ParameterPool > | m_pool |
parameter pool (kind of pointer-to-implementation) More... | |
Manages a local parameter pool, and a tree of child pools.
Definition at line 30 of file IParametricComponent.h.
IParametricComponent::IParametricComponent | ( | const std::string & | name = "" | ) |
Definition at line 22 of file IParametricComponent.cpp.
IParametricComponent::IParametricComponent | ( | const IParametricComponent & | other | ) |
Definition at line 27 of file IParametricComponent.cpp.
References ParameterPool::empty(), getName(), and parameterPool().
|
virtualdefault |
|
virtual |
Creates new parameter pool, with all local parameters and those of its children.
Reimplemented in INode.
Definition at line 36 of file IParametricComponent.cpp.
References getName(), and m_pool.
Referenced by parametersToString(), ParameterUtils::poolParameterUnits(), and setParameterValue().
|
inline |
Definition at line 70 of file IParametricComponent.h.
References m_name.
Referenced by Beam::Beam(), ConvolutionDetectorResolution::ConvolutionDetectorResolution(), IDetector::IDetector(), Instrument::Instrument(), IParametricComponent(), SampleBuilderNode::SampleBuilderNode(), Layer::clone(), INode::copyNumber(), createParameterTree(), IFormFactor::createSlicedFormFactor(), SampleToPython::defineInterferenceFunctions(), INode::displayName(), Beam::operator=(), SampleBuilderNode::operator=(), GUIObjectBuilder::populateInstrumentModel(), PyImportAssistant::populateModels(), GUIDomainSampleVisitor::populateSampleModel(), registerParameter(), IFormFactor::sliceFormFactor(), and GUIDomainSampleVisitor::visit().
|
inlinevirtual |
Action to be taken in inherited class when a parameter has changed.
Reimplemented in IProfileRipple, Lattice3D, InterferenceFunction3DLattice, InterferenceFunction2DLattice, FormFactorSphereLogNormalRadius, FormFactorSphereGaussianRadius, FormFactorGaussSphere, ISawtoothRipple, ICosineRipple, IProfileRectangularRipple, FormFactorTruncatedSpheroid, FormFactorTruncatedSphere, FormFactorTruncatedCube, FormFactorTetrahedron, FormFactorPyramid, FormFactorPrism6, FormFactorPrism3, FormFactorLongBoxLorentz, FormFactorLongBoxGauss, FormFactorIcosahedron, FormFactorHollowSphere, FormFactorHemiEllipsoid, FormFactorFullSpheroid, FormFactorFullSphere, FormFactorEllipsoidalCylinder, FormFactorDodecahedron, FormFactorCylinder, FormFactorCuboctahedron, FormFactorCone6, FormFactorCone, FormFactorCantellatedCube, FormFactorBox, FormFactorAnisoPyramid, and Lattice2D.
Definition at line 59 of file IParametricComponent.h.
Referenced by Lattice2D::onChange(), and registerParameter().
|
delete |
RealParameter * IParametricComponent::parameter | ( | const std::string & | name | ) | const |
Returns parameter with given 'name'.
Definition at line 86 of file IParametricComponent.cpp.
References m_pool, and RealSpace::Particles::name().
Referenced by DepthProbeSimulation::initialize(), SpecularSimulation::initialize(), Lattice3D::initialize(), IParticle::registerAbundance(), ParticleLayout::registerParticleDensity(), IParticle::registerPosition(), Layer::registerThickness(), Lattice2D::setRotationEnabled(), and DistributionLogNormal::setUnits().
|
inline |
Returns pointer to the parameter pool.
Definition at line 39 of file IParametricComponent.h.
References m_pool.
Referenced by INode::INode(), IParametricComponent(), pyfmt2::argumentList(), SampleBuilderNode::borrow_builder_parameters(), SampleBuilderNode::reset(), and IDistribution1D::setUnits().
std::string IParametricComponent::parametersToString | ( | ) | const |
Returns multiline string representing available parameters.
Definition at line 43 of file IParametricComponent.cpp.
References createParameterTree().
RealParameter & IParametricComponent::registerParameter | ( | const std::string & | name, |
double * | parpointer | ||
) |
Definition at line 51 of file IParametricComponent.cpp.
References getName(), m_pool, RealSpace::Particles::name(), and onChange().
Referenced by BasicLattice2D::BasicLattice2D(), Beam::Beam(), CylindersInBABuilder::CylindersInBABuilder(), DetectionProperties::DetectionProperties(), HexagonalLattice2D::HexagonalLattice2D(), IInterferenceFunction::IInterferenceFunction(), INode::INode(), InterferenceFunction1DLattice::InterferenceFunction1DLattice(), InterferenceFunction2DParaCrystal::InterferenceFunction2DParaCrystal(), InterferenceFunctionHardDisk::InterferenceFunctionHardDisk(), InterferenceFunctionRadialParaCrystal::InterferenceFunctionRadialParaCrystal(), InterferenceFunctionTwin::InterferenceFunctionTwin(), Lattice2D::Lattice2D(), LayerRoughness::LayerRoughness(), MultiLayer::MultiLayer(), ParticleDistribution::ParticleDistribution(), PlainMultiLayerBySLDBuilder::PlainMultiLayerBySLDBuilder(), ResolutionFunction2DGaussian::ResolutionFunction2DGaussian(), ResonatorBuilder::ResonatorBuilder(), SquareLattice2D::SquareLattice2D(), TriangularRippleBuilder::TriangularRippleBuilder(), IParticle::registerAbundance(), ParticleLayout::registerParticleDensity(), Layer::registerThickness(), registerVector(), ParticleLayout::registerWeight(), and Lattice2D::setRotationEnabled().
void IParametricComponent::registerVector | ( | const std::string & | base_name, |
kvector_t * | p_vec, | ||
const std::string & | units = "nm" |
||
) |
Definition at line 57 of file IParametricComponent.cpp.
References ModelView::Utils::base_name(), registerParameter(), RealParameter::setUnit(), XComponentName(), YComponentName(), and ZComponentName().
Referenced by Beam::Beam(), DetectionProperties::DetectionProperties(), InterferenceFunctionTwin::InterferenceFunctionTwin(), MultiLayer::MultiLayer(), Lattice3D::initialize(), and IParticle::registerPosition().
void IParametricComponent::removeParameter | ( | const std::string & | name | ) |
Definition at line 91 of file IParametricComponent.cpp.
References m_pool, and RealSpace::Particles::name().
Referenced by IParticle::registerAbundance(), ParticleLayout::registerParticleDensity(), Layer::registerThickness(), removeVector(), and Lattice2D::setRotationEnabled().
void IParametricComponent::removeVector | ( | const std::string & | base_name | ) |
Definition at line 96 of file IParametricComponent.cpp.
References ModelView::Utils::base_name(), removeParameter(), XComponentName(), YComponentName(), and ZComponentName().
Referenced by IParticle::registerPosition().
|
inline |
Definition at line 69 of file IParametricComponent.h.
References m_name, and RealSpace::Particles::name().
Referenced by BasicLattice2D::BasicLattice2D(), Beam::Beam(), ConvolutionDetectorResolution::ConvolutionDetectorResolution(), Crystal::Crystal(), DetectionProperties::DetectionProperties(), DistributionHandler::DistributionHandler(), FormFactorCoreShell::FormFactorCoreShell(), FormFactorCrystal::FormFactorCrystal(), FormFactorDecoratorMaterial::FormFactorDecoratorMaterial(), FormFactorDecoratorPositionFactor::FormFactorDecoratorPositionFactor(), FormFactorDecoratorRotation::FormFactorDecoratorRotation(), FormFactorWeighted::FormFactorWeighted(), HexagonalLattice2D::HexagonalLattice2D(), IDetector::IDetector(), INode::INode(), Instrument::Instrument(), InterferenceFunction1DLattice::InterferenceFunction1DLattice(), InterferenceFunction2DLattice::InterferenceFunction2DLattice(), InterferenceFunction2DParaCrystal::InterferenceFunction2DParaCrystal(), InterferenceFunction2DSuperLattice::InterferenceFunction2DSuperLattice(), InterferenceFunction3DLattice::InterferenceFunction3DLattice(), InterferenceFunctionFinite2DLattice::InterferenceFunctionFinite2DLattice(), InterferenceFunctionFinite3DLattice::InterferenceFunctionFinite3DLattice(), InterferenceFunctionHardDisk::InterferenceFunctionHardDisk(), InterferenceFunctionNone::InterferenceFunctionNone(), InterferenceFunctionRadialParaCrystal::InterferenceFunctionRadialParaCrystal(), InterferenceFunctionTwin::InterferenceFunctionTwin(), ISampleBuilder::ISampleBuilder(), IsGISAXSDetector::IsGISAXSDetector(), Lattice3D::Lattice3D(), Layer::Layer(), LayerInterface::LayerInterface(), LayerRoughness::LayerRoughness(), MultiLayer::MultiLayer(), ParticleCoreShell::ParticleCoreShell(), ParticleDistribution::ParticleDistribution(), ParticleLayout::ParticleLayout(), RectangularDetector::RectangularDetector(), ResolutionFunction2DGaussian::ResolutionFunction2DGaussian(), SampleBuilderNode::SampleBuilderNode(), SphericalDetector::SphericalDetector(), SquareLattice2D::SquareLattice2D(), Layer::clone(), LayersWithAbsorptionBuilder::createSampleByIndex(), Basic2DParaCrystalBuilder::createSampleByIndex(), ParticleInVacuumBuilder::createSampleByIndex(), SimpleMagneticRotationBuilder::createSampleByIndex(), DepthProbeSimulation::initialize(), GISASSimulation::initialize(), OffSpecularSimulation::initialize(), SpecularSimulation::initialize(), SpecularDetector1D::initialize(), MesoCrystal::initialize(), Particle::initialize(), ParticleComposition::initialize(), Beam::operator=(), SampleBuilderNode::operator=(), SampleBuilderNode::reset(), and SampleBuilderNode::setSBN().
void IParametricComponent::setParameterValue | ( | const std::string & | name, |
double | value | ||
) |
Definition at line 65 of file IParametricComponent.cpp.
References createParameterTree(), m_pool, RealSpace::Particles::name(), and ParameterPool::setMatchedParametersValue().
Referenced by AsymRippleBuilder::buildSample(), and setVectorValue().
void IParametricComponent::setVectorValue | ( | const std::string & | base_name, |
kvector_t | value | ||
) |
Definition at line 78 of file IParametricComponent.cpp.
References ModelView::Utils::base_name(), setParameterValue(), BasicVector3D< T >::x(), XComponentName(), BasicVector3D< T >::y(), YComponentName(), BasicVector3D< T >::z(), and ZComponentName().
|
static |
Definition at line 103 of file IParametricComponent.cpp.
References ModelView::Utils::base_name().
Referenced by Lattice3D::initialize(), IParticle::registerPosition(), registerVector(), removeVector(), setVectorValue(), and VectorParameterTranslator::translate().
|
static |
Definition at line 108 of file IParametricComponent.cpp.
References ModelView::Utils::base_name().
Referenced by registerVector(), removeVector(), setVectorValue(), and VectorParameterTranslator::translate().
|
static |
Definition at line 113 of file IParametricComponent.cpp.
References ModelView::Utils::base_name().
Referenced by registerVector(), removeVector(), setVectorValue(), and VectorParameterTranslator::translate().
|
private |
Definition at line 73 of file IParametricComponent.h.
|
private |
parameter pool (kind of pointer-to-implementation)
Definition at line 74 of file IParametricComponent.h.
Referenced by createParameterTree(), parameter(), parameterPool(), registerParameter(), removeParameter(), and setParameterValue().