当前位置: 首页>>代码示例>>C++>>正文


C++ IAlgorithm_sptr::getProperties方法代码示例

本文整理汇总了C++中mantid::api::IAlgorithm_sptr::getProperties方法的典型用法代码示例。如果您正苦于以下问题:C++ IAlgorithm_sptr::getProperties方法的具体用法?C++ IAlgorithm_sptr::getProperties怎么用?C++ IAlgorithm_sptr::getProperties使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在mantid::api::IAlgorithm_sptr的用法示例。


在下文中一共展示了IAlgorithm_sptr::getProperties方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: setAlgorithm

/**
 * Set the algorithm pointer
 * @param alg :: A pointer to the algorithm
 */
void AlgorithmDialog::setAlgorithm(Mantid::API::IAlgorithm_sptr alg) {
  m_algorithm = alg;
  m_algName = QString::fromStdString(alg->name());
  m_algProperties.clear();
  m_tied_properties.clear();
  std::vector<Mantid::Kernel::Property *>::const_iterator iend =
      alg->getProperties().end();
  for (std::vector<Mantid::Kernel::Property *>::const_iterator itr =
           alg->getProperties().begin();
       itr != iend; ++itr) {
    Mantid::Kernel::Property *p = *itr;
    if (dynamic_cast<Mantid::API::IWorkspaceProperty *>(p) ||
        p->direction() != Mantid::Kernel::Direction::Output) {
      m_algProperties.append(QString::fromStdString(p->name()));
    }
  }

  m_validators.clear();
  m_noValidation.clear();
}
开发者ID:DanNixon,项目名称:mantid,代码行数:24,代码来源:AlgorithmDialog.cpp

示例2: updateAlgorithm

/**
     Upadates the non-default algorithm properties in the history.
     @param alg :: Pointer to the algorthm
*/
void InputHistoryImpl::updateAlgorithm(Mantid::API::IAlgorithm_sptr alg)
{
    const std::vector< Property* >& props = alg->getProperties();
    QList< PropertyData > prop_hist_list;
    for(std::vector< Property* >::const_iterator prop=props.begin();prop!=props.end();++prop)
    if (!(*prop)->isDefault())
    {
        PropertyData prop_hist(QString::fromStdString((*prop)->name()),QString::fromStdString((*prop)->value()));
        prop_hist_list.push_back(prop_hist);
    }
    else
    {
        PropertyData prop_hist(QString::fromStdString((*prop)->name()),"");
        prop_hist_list.push_back(prop_hist);
    }
    m_history[QString::fromStdString(alg->name())] = prop_hist_list;
}
开发者ID:jkrueger1,项目名称:mantid,代码行数:21,代码来源:InputHistory.cpp


注:本文中的mantid::api::IAlgorithm_sptr::getProperties方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。