本文整理汇总了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;
}
示例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();
}