本文整理汇总了C++中XmlTree::setAttribute方法的典型用法代码示例。如果您正苦于以下问题:C++ XmlTree::setAttribute方法的具体用法?C++ XmlTree::setAttribute怎么用?C++ XmlTree::setAttribute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XmlTree
的用法示例。
在下文中一共展示了XmlTree::setAttribute方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: writeSettings
void Warp::writeSettings( const WarpList &warps, const DataTargetRef &target )
{
// create default <profile> (profiles are not yet supported)
XmlTree profile;
profile.setTag( "profile" );
profile.setAttribute( "name", "default" );
//
for( unsigned i = 0; i < warps.size(); ++i ) {
// create <map>
XmlTree map;
map.setTag( "map" );
map.setAttribute( "id", i + 1 );
map.setAttribute( "display", 1 ); // not supported yet
// create <warp>
map.push_back( warps[i]->toXml() );
// add map to profile
profile.push_back( map );
}
// create config document and root <warpconfig>
XmlTree doc;
doc.setTag( "warpconfig" );
doc.setAttribute( "version", "1.0" );
doc.setAttribute( "profile", "default" );
// add profile to root
doc.push_back( profile );
// write file
doc.write( target );
}
示例2:
XmlTree VDFbo::toXml() const {
XmlTree xml;
xml.setTag("details");
xml.setAttribute("path", mFilePathOrText);
xml.setAttribute("width", mVDSettings->mFboWidth);
xml.setAttribute("height", mVDSettings->mFboHeight);
xml.setAttribute("shadername", mShaderName);
xml.setAttribute("inputtextureindex", mInputTextureIndex);
return xml;
}
示例3:
XmlTree WarpPerspectiveBilinear::toXml() const
{
XmlTree xml = WarpBilinear::toXml();
// set corners
for(unsigned i=0;i<4;++i) {
Vec2f corner = mWarp->getControlPoint(i);
XmlTree cp;
cp.setTag("corner");
cp.setAttribute("x", corner.x);
cp.setAttribute("y", corner.y);
xml.push_back(cp);
}
return xml;
}
示例4: toXml
XmlTree Warp::toXml() const
{
XmlTree xml;
xml.setTag( "warp" );
switch( mType ) {
case BILINEAR:
xml.setAttribute( "method", "bilinear" );
break;
case PERSPECTIVE:
xml.setAttribute( "method", "perspective" );
break;
case PERSPECTIVE_BILINEAR:
xml.setAttribute( "method", "perspectivebilinear" );
break;
default:
xml.setAttribute( "method", "unknown" );
break;
}
xml.setAttribute( "width", mControlsX );
xml.setAttribute( "height", mControlsY );
xml.setAttribute( "brightness", mBrightness );
// add <controlpoint> tags (column-major)
std::vector<vec2>::const_iterator itr;
for( itr = mPoints.begin(); itr != mPoints.end(); ++itr ) {
XmlTree cp;
cp.setTag( "controlpoint" );
cp.setAttribute( "x", ( *itr ).x );
cp.setAttribute( "y", ( *itr ).y );
xml.push_back( cp );
}
// add <blend> parameters
XmlTree blend;
blend.setTag( "blend" );
blend.setAttribute( "exponent", mExponent );
{
XmlTree edges;
edges.setTag( "edges" );
edges.setAttribute( "left", mEdges.x );
edges.setAttribute( "top", mEdges.y );
edges.setAttribute( "right", mEdges.z );
edges.setAttribute( "bottom", mEdges.w );
blend.push_back( edges );
XmlTree gamma;
gamma.setTag( "gamma" );
gamma.setAttribute( "red", mGamma.x );
gamma.setAttribute( "green", mGamma.y );
gamma.setAttribute( "blue", mGamma.z );
blend.push_back( gamma );
XmlTree luminance;
luminance.setTag( "luminance" );
luminance.setAttribute( "red", mLuminance.x );
luminance.setAttribute( "green", mLuminance.y );
luminance.setAttribute( "blue", mLuminance.z );
blend.push_back( luminance );
}
xml.push_back( blend );
return xml;
}