本文整理汇总了C++中xml::Attribute::AsBool方法的典型用法代码示例。如果您正苦于以下问题:C++ Attribute::AsBool方法的具体用法?C++ Attribute::AsBool怎么用?C++ Attribute::AsBool使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xml::Attribute
的用法示例。
在下文中一共展示了Attribute::AsBool方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ProtoDeSerializeProperties
void SliderConstraint::ProtoDeSerializeProperties(const XML::Node& SelfRoot)
{
this->Constraint::ProtoDeSerializeProperties(SelfRoot);
XML::Attribute CurrAttrib;
XML::Node PropertiesNode = SelfRoot.GetChild( SliderConstraint::GetSerializableName() + "Properties" );
if( !PropertiesNode.Empty() ) {
if( PropertiesNode.GetAttribute("Version").AsInt() == 1 ) {
CurrAttrib = PropertiesNode.GetAttribute("UseFrameOffset");
if( !CurrAttrib.Empty() )
this->SetUseFrameOffset( CurrAttrib.AsBool() );
CurrAttrib = PropertiesNode.GetAttribute("UpperLinLimit");
if( !CurrAttrib.Empty() )
this->SetUpperLinLimit( CurrAttrib.AsReal() );
CurrAttrib = PropertiesNode.GetAttribute("UpperAngLimit");
if( !CurrAttrib.Empty() )
this->SetUpperAngLimit( CurrAttrib.AsReal() );
CurrAttrib = PropertiesNode.GetAttribute("LowerLinLimit");
if( !CurrAttrib.Empty() )
this->SetLowerLinLimit( CurrAttrib.AsReal() );
CurrAttrib = PropertiesNode.GetAttribute("LowerAngLimit");
if( !CurrAttrib.Empty() )
this->SetLowerAngLimit( CurrAttrib.AsReal() );
CurrAttrib = PropertiesNode.GetAttribute("PoweredLinMotor");
if( !CurrAttrib.Empty() )
this->SetPoweredLinMotor( CurrAttrib.AsBool() );
CurrAttrib = PropertiesNode.GetAttribute("PoweredAngMotor");
if( !CurrAttrib.Empty() )
this->SetPoweredAngMotor( CurrAttrib.AsBool() );
CurrAttrib = PropertiesNode.GetAttribute("TargetLinMotorVelocity");
if( !CurrAttrib.Empty() )
this->SetTargetLinMotorVelocity( CurrAttrib.AsReal() );
CurrAttrib = PropertiesNode.GetAttribute("TargetAngMotorVelocity");
if( !CurrAttrib.Empty() )
this->SetTargetAngMotorVelocity( CurrAttrib.AsReal() );
CurrAttrib = PropertiesNode.GetAttribute("MaxLinMotorForce");
if( !CurrAttrib.Empty() )
this->SetMaxLinMotorForce( CurrAttrib.AsReal() );
CurrAttrib = PropertiesNode.GetAttribute("MaxAngMotorForce");
if( !CurrAttrib.Empty() )
this->SetMaxAngMotorForce( CurrAttrib.AsReal() );
CurrAttrib = PropertiesNode.GetAttribute("SoftnessLimLin");
if( !CurrAttrib.Empty() )
this->SetSoftnessLimLin( CurrAttrib.AsReal() );
CurrAttrib = PropertiesNode.GetAttribute("SoftnessLimAng");
if( !CurrAttrib.Empty() )
this->SetSoftnessLimAng( CurrAttrib.AsReal() );
CurrAttrib = PropertiesNode.GetAttribute("SoftnessOrthoLin");
if( !CurrAttrib.Empty() )
this->SetSoftnessOrthoLin( CurrAttrib.AsReal() );
CurrAttrib = PropertiesNode.GetAttribute("SoftnessOrthoAng");
if( !CurrAttrib.Empty() )
this->SetSoftnessOrthoAng( CurrAttrib.AsReal() );
}else{
MEZZ_EXCEPTION(ExceptionBase::INVALID_VERSION_EXCEPTION,"Incompatible XML Version for " + ( SliderConstraint::GetSerializableName() + "Properties" ) + ": Not Version 1.");
}
}else{
MEZZ_EXCEPTION(ExceptionBase::II_IDENTITY_NOT_FOUND_EXCEPTION,SliderConstraint::GetSerializableName() + "Properties" + " was not found in the provided XML node, which was expected.");
}
}