本文整理汇总了C++中xml::Node::AppendChild方法的典型用法代码示例。如果您正苦于以下问题:C++ Node::AppendChild方法的具体用法?C++ Node::AppendChild怎么用?C++ Node::AppendChild使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xml::Node
的用法示例。
在下文中一共展示了Node::AppendChild方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ProtoSerialize
void NonStaticWorldObject::ProtoSerialize(XML::Node& CurrentRoot) const
{
XML::Node NonStaticWorldObjectNode = CurrentRoot.AppendChild("NonStaticWorldObject");
if (!NonStaticWorldObjectNode) { ThrowSerialError("create NonStaticWorldObjectNode");}
XML::Attribute Version = NonStaticWorldObjectNode.AppendAttribute("Version");
Version.SetValue(1);
XML::Node OrientationNode = NonStaticWorldObjectNode.AppendChild("Orientation");
if(!OrientationNode) { ThrowSerialError("create OrientationNode"); }
this->GetOrientation().ProtoSerialize(OrientationNode);
// if actor node is in scenemanager just save a name
/*if( Entresol::GetSingletonPtr()->GetSceneManager()->GetNode( this->ObjectWorldNode->GetName() ) )
{
XML::Attribute NonStaticWorldObjectNodeAttrib = NonStaticWorldObjectNode.AppendAttribute("WorldNode");
if(!NonStaticWorldObjectNodeAttrib.SetValue(this->ObjectWorldNode->GetName()))
{ThrowSerialError("store WorldNode Name");}
}else{
SloppyProtoSerialize( *(this->ObjectWorldNode),NonStaticWorldObjectNode); //Serialization performed in older style
}// */
WorldObject::ProtoSerialize(NonStaticWorldObjectNode);
}
示例2: 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);
}
示例3: AppendCurrentSettings
void GraphicsManager::AppendCurrentSettings(XML::Node& SettingsRootNode)
{
// Create the Group node to be returned
XML::Node CurrentSettings = SettingsRootNode.AppendChild("Current");
// Create and initialize the rendersystem settings
XML::Node RenderSystemNode = CurrentSettings.AppendChild("RenderSystem");
RenderSystemNode.AppendAttribute("Name").SetValue( this->GetShortenedRenderSystemName(CurrRenderSys) );
// Create and initialize the window configuration
for( GameWindowIterator WinIt = this->BeginGameWindow() ; WinIt != this->EndGameWindow() ; ++WinIt )
{ (*WinIt)->ProtoSerialize(CurrentSettings); }
}
示例4: ProtoSerializeProperties
void LevelZone::ProtoSerializeProperties(XML::Node& SelfRoot) const
{
this->AreaEffect::ProtoSerializeProperties(SelfRoot);
XML::Node PropertiesNode = SelfRoot.AppendChild( LevelZone::GetSerializableName() + "Properties" );
if( PropertiesNode.AppendAttribute("Version").SetValue("1") )
{
XML::Node ZoneSizeNode = PropertiesNode.AppendChild("ZoneSize");
this->ZoneSize.ProtoSerialize( ZoneSizeNode );
return;
}else{
SerializeError("Create XML Attribute Values",LevelZone::GetSerializableName() + "Properties",true);
}
}
示例5: 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);
}
示例6: 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);
}
示例7: ProtoSerialize
void WorldProxy::ProtoSerialize(XML::Node& ParentNode) const
{
XML::Node SelfRoot = ParentNode.AppendChild(this->GetDerivedSerializableName());
if( !SelfRoot.AppendAttribute("InWorld").SetValue( this->IsInWorld() ? "true" : "false" ) ) {
SerializeError("Create XML Attribute Values",WorldProxy::GetSerializableName(),true);
}
this->ProtoSerializeImpl(SelfRoot);
}
示例8: 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);
}
示例9: ProtoSerializeEvents
void Widget::ProtoSerializeEvents(XML::Node& SelfRoot) const
{
XML::Node EventsNode = SelfRoot.AppendChild( "Events" );
if( EventsNode.AppendAttribute("Version").SetValue("1") ) {
for( ConstEventIterator EvIt = this->Events.begin() ; EvIt != this->Events.end() ; ++EvIt )
{
XML::Node BindingNode = EventsNode.AppendChild( "Event" );
if( BindingNode.AppendAttribute("Version").SetValue("1") &&
BindingNode.AppendAttribute("Name").SetValue( (*EvIt).first ) )
{
continue;
}else{
SerializeError("Create XML Version Attribute","Event",true);
}
}
}else{
SerializeError("Create XML Version Attribute","Events",true);
}
}
示例10: ProtoSerializeStateGroupBindings
void Widget::ProtoSerializeStateGroupBindings(XML::Node& SelfRoot) const
{
XML::Node BindingsNode = SelfRoot.AppendChild( "StateGroupBindings" );
if( BindingsNode.AppendAttribute("Version").SetValue("1") ) {
for( ConstStateLayerGroupIterator BindingIt = this->StateGroupBindings.begin() ; BindingIt != this->StateGroupBindings.end() ; ++BindingIt )
{
XML::Node BindingNode = BindingsNode.AppendChild( "StateGroupBinding" );
if( BindingNode.AppendAttribute("Version").SetValue("1") &&
BindingNode.AppendAttribute("StateID").SetValue( (*BindingIt).first ) &&
BindingNode.AppendAttribute("LayerGroupID").SetValue( (*BindingIt).second->GetGroupID() ) )
{
continue;
}else{
SerializeError("Create XML Version Attribute","StateGroupBinding",true);
}
}
}else{
SerializeError("Create XML Version Attribute","StateGroupBindings",true);
}
}
示例11: ProtoSerializeButtonBindings
void TabSet::ProtoSerializeButtonBindings(XML::Node& SelfRoot) const
{
XML::Node BindingsNode = SelfRoot.AppendChild( "SubSetBindings" );
if( BindingsNode.AppendAttribute("Version").SetValue("1") ) {
for( ConstTabbedSubSetIterator BindingIt = this->SubSetBindings.begin() ; BindingIt != this->SubSetBindings.end() ; ++BindingIt )
{
XML::Node BindingNode = BindingsNode.AppendChild( "SubSetBinding" );
if( BindingNode.AppendAttribute("Version").SetValue("1") &&
BindingNode.AppendAttribute("ConfigID").SetValue( (*BindingIt).second ) &&
BindingNode.AppendAttribute("ButtonName").SetValue( (*BindingIt).first->GetName() ) )
{
continue;
}else{
SerializeError("Create XML Version Attribute","SubSetBinding",true);
}
}
}else{
SerializeError("Create XML Version Attribute","SubSetBindings",true);
}
}
示例12: ProtoSerializeCustomParameters
void ParticleAffector::ProtoSerializeCustomParameters(XML::Node& SelfRoot) const
{
XML::Node CustomParametersNode = SelfRoot.AppendChild( "CustomParameters" );
if( CustomParametersNode.AppendAttribute("Version").SetValue("1") )
{
for( NameValuePairMap::const_iterator ParamIt = this->CustomAffectorParameters.begin() ; ParamIt != this->CustomAffectorParameters.end() ; ++ParamIt )
{
XML::Node CustomParamNode = CustomParametersNode.AppendChild( "CustomParam" );
if( CustomParamNode.AppendAttribute("Version").SetValue("1") &&
CustomParamNode.AppendAttribute("ParamName").SetValue( (*ParamIt).first ) &&
CustomParamNode.AppendAttribute("ParamValue").SetValue( (*ParamIt).second ) )
{
return;
}else{
SerializeError("Create XML Attribute Values",ParticleAffector::GetSerializableName() + "CustomParameters",true);
}
}
}else{
SerializeError("Create XML Attribute Values",ParticleAffector::GetSerializableName() + "CustomParameters",true);
}
}
示例13: ProtoSerializeGroupButtons
void RadioButton::ProtoSerializeGroupButtons(XML::Node& SelfRoot) const
{
XML::Node ButtonsNode = SelfRoot.AppendChild( "GroupButtons" );
if( ButtonsNode.AppendAttribute("Version").SetValue("1") ) {
RadioButtonGroup::ConstRadioButtonIterator ButBeg = this->ButtonGroup->RadioButtonBegin();
RadioButtonGroup::ConstRadioButtonIterator ButEnd = this->ButtonGroup->RadioButtonEnd();
for( RadioButtonGroup::ConstRadioButtonIterator ButIt = ButBeg ; ButIt != ButEnd ; ++ButIt )
{
XML::Node ButtonNode = ButtonsNode.AppendChild( "GroupButton" );
if( ButtonNode.AppendAttribute("Version").SetValue("1") &&
ButtonNode.AppendAttribute("GroupButtonName").SetValue( (*ButIt)->GetName() ) )
{
continue;
}else{
SerializeError("Create XML Version Attribute","GroupButton",true);
}
}
}else{
SerializeError("Create XML Version Attribute","GroupButtons",true);
}
}
示例14: ProtoSerialize
void Transform::ProtoSerialize(XML::Node& CurrentRoot) const
{
XML::Node TransformNode = CurrentRoot.AppendChild(SerializableName()); // The base node all the base constraint stuff will go in
if (!TransformNode)
{ SerializeError("Create TransformNode", SerializableName()); }
Mezzanine::XML::Attribute Version = TransformNode.AppendAttribute("Version"); // Version
if (!Version)
{ SerializeError("Create Version", SerializableName()); }
Version.SetValue(1);
this->Location.ProtoSerialize(TransformNode);
this->Rotation.ProtoSerialize(TransformNode);
}