31 throw std::runtime_error(
"BUG: not prepared to copy parameters of " +
getName());
45 std::ostringstream result;
47 result << *P_pool <<
"\n";
53 return m_pool->addParameter(
58 const std::string& units)
67 if (
name.find(
'*') == std::string::npos &&
name.find(
'/') == std::string::npos) {
71 if (
name.find(
'*') != std::string::npos)
74 P_pool->setParameterValue(
name, value);
Defines interface IParametricComponent.
Defines class ParameterPool.
Defines class RealParameter.
T z() const
Returns z-component in cartesian coordinate system.
T y() const
Returns y-component in cartesian coordinate system.
T x() const
Returns x-component in cartesian coordinate system.
Manages a local parameter pool, and a tree of child pools.
const std::string & getName() const
void setVectorValue(const std::string &base_name, kvector_t value)
virtual ParameterPool * createParameterTree() const
Creates new parameter pool, with all local parameters and those of its children.
void registerVector(const std::string &base_name, kvector_t *p_vec, const std::string &units="nm")
void setParameterValue(const std::string &name, double value)
std::string parametersToString() const
Returns multiline string representing available parameters.
ParameterPool * parameterPool() const
Returns pointer to the parameter pool.
static std::string XComponentName(const std::string &base_name)
void removeVector(const std::string &base_name)
static std::string ZComponentName(const std::string &base_name)
void removeParameter(const std::string &name)
RealParameter * parameter(const std::string &name) const
Returns parameter with given 'name'.
virtual void onChange()
Action to be taken in inherited class when a parameter has changed.
std::unique_ptr< ParameterPool > m_pool
parameter pool (kind of pointer-to-implementation)
IParametricComponent(const std::string &name="")
RealParameter & registerParameter(const std::string &name, double *parpointer)
virtual ~IParametricComponent()
static std::string YComponentName(const std::string &base_name)
Container with parameters for IParametricComponent object.
int setMatchedParametersValue(const std::string &wildcards, double value)
Sets value of the nonzero parameters that match pattern ('*' allowed), or throws.
Wraps a parameter of type double.
RealParameter & setUnit(const std::string &name)
MVVM_MODEL_EXPORT std::string base_name(const std::string &path)
Provide the filename of a file path.
QString const & name(EShape k)