本文整理汇总了C++中xml::Attribute::SetValue方法的典型用法代码示例。如果您正苦于以下问题:C++ Attribute::SetValue方法的具体用法?C++ Attribute::SetValue怎么用?C++ Attribute::SetValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xml::Attribute
的用法示例。
在下文中一共展示了Attribute::SetValue方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ProtoSerialize
void ActorRigid::ProtoSerialize(XML::Node& CurrentRoot) const
{
XML::Node ActorNode = CurrentRoot.AppendChild("ActorRigid");
if (!ActorNode) { ThrowSerialError("create ActorRigidNode");}
XML::Attribute Version = ActorNode.AppendAttribute("Version");
if (Version)
{ Version.SetValue(1); }
else
{ SerializeError("Create set Version on ActorRigid node", SerializableName()); }
XML::Attribute ActorName = ActorNode.AppendAttribute("Name");
ActorName.SetValue(this->GetName());
XML::Attribute ActorFile = ActorNode.AppendAttribute("File");
ActorFile.SetValue(this->GraphicsObject->getMesh()->getName());
XML::Attribute ActorGroup = ActorNode.AppendAttribute("Group");
ActorGroup.SetValue(this->GraphicsObject->getMesh()->getGroup());
if( !(ActorName && ActorFile && ActorGroup) )
{ ThrowSerialError("creating ActorRigid Attributes");}
XML::Node LinearMovementFactor = ActorNode.AppendChild("LinearMovementFactor");
if (!LinearMovementFactor) { ThrowSerialError("create LinearMovementFactor Node"); }
this->GetLinearMovementFactor().ProtoSerialize(LinearMovementFactor);
XML::Node AngularMovementFactor = ActorNode.AppendChild("AngularMovementFactor");
if (!AngularMovementFactor) { ThrowSerialError("create AngularMovementFactor Node"); }
this->GetAngularMovementFactor().ProtoSerialize(AngularMovementFactor);
ActorBase::ProtoSerialize(ActorNode);
}
示例2: ProtoSerialize
void GearConstraint::ProtoSerialize(XML::Node& CurrentRoot) const
{
XML::Node P2PNode = CurrentRoot.AppendChild(this->GearConstraint::SerializableName()); // The base node all the base constraint stuff will go in
if (!P2PNode)
{ SerializeError("Create P2PNode", SerializableName()); }
XML::Attribute VerAttr = P2PNode.AppendAttribute("Version");
XML::Attribute RatioAttr = P2PNode.AppendAttribute("Ratio");
if( VerAttr && RatioAttr )
{
VerAttr.SetValue(1);
RatioAttr.SetValue(this->GetRotationRatio());
}else{
SerializeError("Create P2PNode Attributes", SerializableName());
}
XML::Node ActorANode = P2PNode.AppendChild("ActorA");
if (!ActorANode)
{ SerializeError("Create ActorANode", SerializableName()); }
this->GetAxisA().ProtoSerialize(ActorANode);
XML::Node ActorBNode = P2PNode.AppendChild("ActorB");
if (!ActorBNode)
{ SerializeError("Create ActorBNode", SerializableName()); }
this->GetAxisB().ProtoSerialize(ActorBNode);
this->Constraint::ProtoSerialize(P2PNode);
}
示例3: ProtoSerialize
void CapsuleCollisionShape::ProtoSerialize(XML::Node& CurrentRoot) const
{
XML::Node CollisionNode = CurrentRoot.AppendChild(this->CapsuleCollisionShape::SerializableName());
if (!CollisionNode) { SerializeError("create CollisionNode",this->CapsuleCollisionShape::SerializableName());}
XML::Attribute Version = CollisionNode.AppendAttribute("Version");
if (Version)
{ Version.SetValue(1); }
else
{ SerializeError("Create Version Attribute", SerializableName()); }
/*
XML::Attribute RadiusAttr = CollisionNode.AppendAttribute("Radius");
if (RadiusAttr)
{ RadiusAttr.SetValue(this->GetCleanRadius()); }
else
{ SerializeError("Create RadiusAttr Attribute", SerializableName()); }
XML::Attribute HeightAttr = CollisionNode.AppendAttribute("Height");
if (HeightAttr)
{ HeightAttr.SetValue(this->GetCleanHeight()); }
else
{ SerializeError("Create HeightAttr Attribute", SerializableName()); }
*/
XML::Attribute AxisAttr = CollisionNode.AppendAttribute("Axis");
if (AxisAttr)
{ AxisAttr.SetValue(this->GetUpStandardAxis()); }
else
{ SerializeError("Create AxisAttr Attribute", SerializableName()); }
this->PrimitiveCollisionShape::ProtoSerialize(CollisionNode);
}
示例4: ProtoSerialize
void WorldObject::ProtoSerialize(XML::Node& CurrentRoot) const
{
XML::Node WorldObjectNode = CurrentRoot.AppendChild("WorldObject");
if (!WorldObjectNode) { ThrowSerialError("create WorldObjectNode");}
XML::Node LocationNode = WorldObjectNode.AppendChild("Location");
if (!LocationNode) { ThrowSerialError("create LocationNode"); }
this->GetLocation().ProtoSerialize(LocationNode);
XML::Node ScalingNode = WorldObjectNode.AppendChild("Scaling");
if (!ScalingNode) { ThrowSerialError("create ScalingNode"); }
this->GetScaling().ProtoSerialize(ScalingNode);
this->GetGraphicsSettings()->ProtoSerialize(WorldObjectNode);
this->GetPhysicsSettings()->ProtoSerialize(WorldObjectNode);
XML::Attribute WorldObjectName = WorldObjectNode.AppendAttribute("Name");
WorldObjectName.SetValue(this->GetName());
XML::Attribute WorldObjectVersion = WorldObjectNode.AppendAttribute("Version");
WorldObjectVersion.SetValue(1);
XML::Attribute WorldObjectIsInWorld = WorldObjectNode.AppendAttribute("IsInWorld");
WorldObjectIsInWorld.SetValue(this->IsInWorld());
if ( !(WorldObjectName && WorldObjectVersion && WorldObjectIsInWorld) )
{ ThrowSerialError("create WorldObjectNode Attributes"); }
/*XML::Attribute WorldObjectSoundSetName = WorldObjectNode.AppendAttribute("SoundSet");
if(this->GetSounds())
{
WorldObjectSoundSetName.SetValue(this->GetSounds()->GetName());
}else{
WorldObjectSoundSetName.SetValue("");
}//*/
}
示例5: ProtoSerialize
void AreaEffect::ProtoSerialize(XML::Node& CurrentRoot) const
{
XML::Node AreaEffectNode = CurrentRoot.AppendChild("AreaEffect");
if (!AreaEffectNode) { ThrowSerialError("create AreaEffectNode");}
XML::Attribute AreaEffectVersion = AreaEffectNode.AppendAttribute("Version");
AreaEffectVersion.SetValue(1);
NonStaticWorldObject::ProtoSerialize(AreaEffectNode);
}
示例6: ProtoSerialize
void MeshCollisionShape::ProtoSerialize(XML::Node& CurrentRoot) const
{
XML::Node CollisionNode = CurrentRoot.AppendChild(this->MeshCollisionShape::GetSerializableName());
if (!CollisionNode) { SerializeError("create CollisionNode",this->MeshCollisionShape::GetSerializableName());}
XML::Attribute Version = CollisionNode.AppendAttribute("Version");
if (Version)
{ Version.SetValue(1); }
else
{ SerializeError("Create Version Attribute", GetSerializableName()); }
this->CollisionShape::ProtoSerialize(CollisionNode);
}
示例7: SaveShapesToXMLFile
void CollisionShapeManager::SaveShapesToXMLFile(const String& FileName, ShapeVector& ShapesToSave)
{
XML::Document ShapesDoc;
XML::Node DeclNode = ShapesDoc.AppendChild(XML::NodeDeclaration);
XML::Attribute VerAttrib = DeclNode.AppendAttribute("version");
if( DeclNode.SetName("xml") && VerAttrib.SetValue("1.0") ) {
XML::Node ShapesRoot = ShapesDoc.AppendChild( "ShapesRoot" );
for( ShapeVectorIterator ShapeIt = ShapesToSave.begin() ; ShapeIt != ShapesToSave.end() ; ++ShapeIt )
{
(*ShapeIt)->ProtoSerialize( ShapesRoot );
}
/// @todo Replace this stack allocated stream for one initialized from the Resource Manager, after the system is ready.
Resource::FileStream SettingsStream(FileName,".",Resource::SF_Truncate | Resource::SF_Write);
ShapesDoc.Save(SettingsStream,"\t",XML::FormatIndent);
}else{
MEZZ_EXCEPTION(ExceptionBase::INVALID_STATE_EXCEPTION,"Failed to create XML document declaration for file \"" + FileName + "\".");
}
}