本文整理汇总了C++中Dof::getValue方法的典型用法代码示例。如果您正苦于以下问题:C++ Dof::getValue方法的具体用法?C++ Dof::getValue怎么用?C++ Dof::getValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dof
的用法示例。
在下文中一共展示了Dof::getValue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: output
bool FileInfoSkel<SkeletonType>::saveFile( const char* _fName) const {
using namespace std;
ofstream output(_fName);
if(output.fail()){
cout<<"Unable to save file "<<_fName<<endl;
return false;
}
output<<fixed<<setprecision(6);
int _numLinks = mSkel->mNumNodes;
output<<"dofs {\n";
for(int i=0; i<mSkel->getNumDofs(); i++){
Dof *d = mSkel->getDof(i);
if(d->getJoint()->getChildNode()->getSkelIndex() >= _numLinks) break;
output<<'\t'<<d->getName()<<" { "<<d->getValue()<<", "<<d->getMin()<<", "<<d->getMax()<<" }\n";
}
output<<unitlength<<" { 1.0, 1.0, 1.0 }\n";
output<<"}\n";
// masses
output<<"\nmass {\n";
for(int i=0; i<mSkel->mNumNodes; i++){
if(i>=_numLinks) break;
string massname = mSkel->getNode(i)->getName();
massname += "_mass";
output<<massname<<" { "<<mSkel->getNode(i)->getMass()<<" }\n";
}
output<<"}\n";
// nodes
saveBodyNodeTree(mSkel->mRoot, output, _numLinks);
// markers
output<<"\nmarkers {\n";
for(int i=0; i<mSkel->getNumMarkers(); i++){
if(mSkel->getMarker(i)->getNode()->getSkelIndex()>=_numLinks) break;
string hname = mSkel->getMarker(i)->getName();
if(hname.empty()){
ostringstream ss;
ss<<"marker"<<i;
hname = ss.str();
}
Eigen::Vector3d lc = mSkel->getMarker(i)->getLocalCoords();
output<<hname<<" { "<<"<"<<lc[0]<<", "<<lc[1]<<", "<<lc[2]<<">, "<<i<<", "<<mSkel->getMarker(i)->getNode()->getName()<<" } "<<endl;
}
output<<"}\n";
cout<<"\n";
return true;
}