Ejemplo n.º 1
0
/** Set an attribute for the function
 *
 * @param attName :: The name of the attribute to set
 * @param att :: The attribute to set
 */
void BSpline::setAttribute(const std::string &attName,
                           const API::IFunction::Attribute &att) {
  bool isUniform = attName == "Uniform" && att.asBool();

  storeAttributeValue(attName, att);

  if (attName == "BreakPoints" || isUniform || attName == "StartX" ||
      attName == "EndX") {
    resetKnots();
  } else if (attName == "NBreak" || attName == "Order") {
    resetGSLObjects();
    resetParameters();
    resetKnots();
  }
}
/**
 *  Set a value to a named attribute
 *  @param name :: The name of the attribute
 *  @param value :: The value of the attribute
 */
void ResolutionConvolvedCrossSection::setAttribute(
    const std::string &name, const API::IFunction::Attribute &value) {
    storeAttributeValue(name, value);
    const std::string fgModelName = getAttribute(FOREGROUND_ATTR).asString();
    const std::string convolutionType = getAttribute(RESOLUTION_ATTR).asString();

    if (!convolutionType.empty() && !fgModelName.empty()) {
        setupResolutionFunction(convolutionType, fgModelName);
    }
    if (name == SIMULATION_ATTR)
        m_simulation = value.asBool();
    else if (name != FOREGROUND_ATTR && name != RESOLUTION_ATTR) {
        m_convolution->setAttribute(name, value);
    }
}