本文整理汇总了C++中Matrix4d::toString方法的典型用法代码示例。如果您正苦于以下问题:C++ Matrix4d::toString方法的具体用法?C++ Matrix4d::toString怎么用?C++ Matrix4d::toString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Matrix4d
的用法示例。
在下文中一共展示了Matrix4d::toString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: serialize
XMLNode* Keyframe::serialize() const
{
XMLElement* node = new XMLElement( "Keyframe" );
String kfId; kfId.sprintf( "%d", _id );
XMLAttribute* attr = new XMLAttribute( "id", kfId );
node->addChild( attr );
XMLElement* element;
// the pose:
element = new XMLElement( "Pose" );
Matrix4d mat;
EigenBridge::toCVT( mat, _pose.transformation() );
element->addChild( new XMLText( mat.toString() ) );
node->addChild( element );
if( hasImage() ){
if( !FileSystem::exists( "keyframe_images" ) ){
FileSystem::mkdir( "keyframe_images" );
}
String filename;
filename.sprintf( "keyframe_images/keyframe_%06d.cvtraw", _id );
_img->save( filename );
element = new XMLElement( "Image" );
element->addChild( new XMLAttribute( "file", filename ) );
node->addChild( element );
}
// measurements:
XMLElement* meas = new XMLElement( "Measurements" );
MeasurementIterator it = _featMeas.begin();
const MeasurementIterator itEnd = _featMeas.end();
XMLAttribute* featId;
String val;
while( it != itEnd ){
element = new XMLElement( "Measurement" );
// the id:
val.sprintf( "%d", it->first );
featId = new XMLAttribute( "featureId", val );
element->addChild( featId );
element->addChild( it->second.serialize() );
meas->addChild( element );
++it;
}
node->addChild( meas );
return node;
}