当前位置: 首页>>代码示例>>C++>>正文


C++ Node::AppendChild方法代码示例

本文整理汇总了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);
    }
开发者ID:zester,项目名称:Mezzanine,代码行数:25,代码来源:worldobject.cpp

示例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);
    }
开发者ID:zester,项目名称:Mezzanine,代码行数:30,代码来源:actorrigid.cpp

示例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); }
 }
开发者ID:,项目名称:,代码行数:11,代码来源:

示例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);
    }
}
开发者ID:,项目名称:,代码行数:15,代码来源:

示例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);
        }
开发者ID:zester,项目名称:Mezzanine,代码行数:29,代码来源:gearconstraint.cpp

示例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);
        }
开发者ID:zester,项目名称:Mezzanine,代码行数:31,代码来源:capsulecollisionshape.cpp

示例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);
    }
开发者ID:,项目名称:,代码行数:9,代码来源:

示例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);
    }
开发者ID:zester,项目名称:Mezzanine,代码行数:10,代码来源:areaeffect.cpp

示例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);
            }
        }
开发者ID:,项目名称:,代码行数:21,代码来源:

示例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);
            }
        }
开发者ID:,项目名称:,代码行数:22,代码来源:

示例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);
            }
        }
开发者ID:,项目名称:,代码行数:22,代码来源:

示例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);
            }
        }
开发者ID:,项目名称:,代码行数:22,代码来源:

示例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);
            }
        }
开发者ID:,项目名称:,代码行数:23,代码来源:

示例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);
    }
开发者ID:zester,项目名称:Mezzanine,代码行数:14,代码来源:transform.cpp


注:本文中的xml::Node::AppendChild方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。