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


C++ Measurement::getName方法代码示例

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


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

示例1: computeMeasurementScaleFactor

/**
 * For measurement based scaling, we average the scale factors across the different marker pairs used.
 * For each marker pair, the scale factor is computed by dividing the average distance between the pair 
 * in the experimental marker data by the distance between the pair on the model.
 */
double ModelScaler::computeMeasurementScaleFactor(const SimTK::State& s, const Model& aModel, const MarkerData& aMarkerData, const Measurement& aMeasurement) const
{
    double scaleFactor = 0;
    cout << "Measurement '" << aMeasurement.getName() << "'" << endl;
    if(aMeasurement.getNumMarkerPairs()==0) return SimTK::NaN;
    for(int i=0; i<aMeasurement.getNumMarkerPairs(); i++) {
        const MarkerPair& pair = aMeasurement.getMarkerPair(i);
        string name1, name2;
        pair.getMarkerNames(name1, name2);
        double modelLength = takeModelMeasurement(s, aModel, name1, name2, aMeasurement.getName());
        double experimentalLength = takeExperimentalMarkerMeasurement(aMarkerData, name1, name2, aMeasurement.getName());
        if(SimTK::isNaN(modelLength) || SimTK::isNaN(experimentalLength)) return SimTK::NaN;
        cout << "\tpair " << i << " (" << name1 << ", " << name2 << "): model = " << modelLength << ", experimental = " << experimentalLength << endl;
        scaleFactor += experimentalLength / modelLength;
    }
    scaleFactor /= aMeasurement.getNumMarkerPairs();
    cout << "\toverall scale factor = " << scaleFactor << endl;
    return scaleFactor;
}
开发者ID:chrisdembia,项目名称:opensim-core,代码行数:24,代码来源:ModelScaler.cpp

示例2: writeXML

void VectorMeas::writeXML(XMLWriter& w)
{
    // Vector
    w.tagStart(w.buildTagName(SWE_PREFIX, ELT_VECTOR));

    // definition attribute
    char defUri[80];
    if (this->Definition != NULL)
    {
        buildDefUrl(this->Definition, defUri);
        w.tagField(w.buildTagName(NULL, ATT_DEFINITION), defUri);
    }

    // ref frame attribute
    if (this->RefFrame != NULL)
    {
        buildDefUrl(this->RefFrame, defUri);
        w.tagField(w.buildTagName(NULL, ATT_REFRAME), defUri);
    }

    w.tagEnd(true, false);

    // label
    if (this->Label != NULL)
        w.writeNode(w.buildTagName(SWE_PREFIX, ELT_LABEL), this->Label);

    // coordinates
    for (int i = 0; i < numCoords; i++)
    {
        Measurement* m = coords[i];
        w.tagStart(w.buildTagName(SWE_PREFIX, ELT_COORDINATE));
        w.tagField(w.buildTagName(NULL, ATT_NAME), m->getName());
        w.tagEnd(true, false);
        m->writeXML(w);
        w.tagClose();
    }

    w.tagClose();
}
开发者ID:opensensorhub,项目名称:osh-arduino,代码行数:39,代码来源:Measurement.cpp


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