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


C# AnimatTools.GetChildString方法代码示例

本文整理汇总了C#中AnimatTools.GetChildString方法的典型用法代码示例。如果您正苦于以下问题:C# AnimatTools.GetChildString方法的具体用法?C# AnimatTools.GetChildString怎么用?C# AnimatTools.GetChildString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AnimatTools的用法示例。


在下文中一共展示了AnimatTools.GetChildString方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: LoadData

        public override void LoadData(ref AnimatTools.Interfaces.StdXml oXml)
        {
            base.LoadData(ref oXml);

             oXml.IntoElem();

            if(oXml.FindChildElement("MuscleID", false))
            {
              string strMuscleID = oXml.GetChildString("MuscleID");
              if(m_doOrganism != null && strMuscleID.Trim().Length > 0)
                {
                    AnimatTools.DataObjects.Physical.BodyPart rbPart = (AnimatTools.DataObjects.Physical.BodyPart) m_doOrganism.FindBodyPart(strMuscleID, false);
                    if(rbPart != null)
                        m_thMuscle = new AnimatTools.TypeHelpers.LinkedBodyPartList(m_doOrganism, rbPart, m_tpBodyPartType);
                }
            }
            else
                m_thMuscle = new AnimatTools.TypeHelpers.LinkedBodyPartList(m_doOrganism, null, m_tpBodyPartType);

            m_strMuscleLengthData = oXml.GetChildString("MuscleLengthData", m_strMuscleLengthData);

            if(oXml.FindChildElement("Conductance", false))
                m_snConductance.LoadData(ref oXml, "Conductance");

            if(oXml.FindChildElement("RestPotential", false))
                m_snRestPotential.LoadData(ref oXml, "RestPotential");

            oXml.OutOfElem();
        }
开发者ID:NeuroRoboticTech,项目名称:AnimatLabVersion1,代码行数:29,代码来源:InverseMuscleDynamics.cs

示例2: LoadData

        public override void LoadData(ref AnimatTools.DataObjects.Simulation dsSim, ref AnimatTools.DataObjects.Physical.PhysicalStructure doStructure, ref AnimatTools.Interfaces.StdXml oXml)
        {
            m_aryChildBodies.Clear();

            oXml.IntoElem(); //'Into RigidBody Element

            m_strID = oXml.GetChildString("ID");
            m_strName = oXml.GetChildString("Name", m_strID);
            m_strDescription = oXml.GetChildString("Description", "");

            if(m_strName.Trim().Length == 0)
                m_strName = m_strID;

            if(oXml.FindChildElement("Color", false))
            {
                System.Drawing.Color oColor = Util.LoadColor(ref oXml, "Color");
                this.Alpha = oColor.A;
                this.Color = oColor;
            }

            if(oXml.FindChildElement("MuscleAttachments", false))
            {
                oXml.IntoElem();

                oXml.AddChildElement("Description", m_strDescription);

                if(oXml.NumberOfChildren() > 2)
                    throw new System.Exception("The standard spring can not have more than 2 attachment points.");
                else if(oXml.NumberOfChildren() == 2)
                {
                    oXml.FindChildByIndex(0);
                    m_strPrimaryAttachID = oXml.GetChildString();
                    oXml.FindChildByIndex(1);
                    m_strSecondaryAttachID = oXml.GetChildString();
                }
                else if(oXml.NumberOfChildren() == 1)
                {
                    oXml.FindChildByIndex(0);
                    m_strPrimaryAttachID = oXml.GetChildString();
                }
                else
                {
                    m_strPrimaryAttachID = "";
                    m_strSecondaryAttachID = "";
                }

                oXml.OutOfElem();
            }
            else
            {
                if(oXml.FindChildElement("PrimaryAttachmentID", false))
                    m_strPrimaryAttachID = oXml.GetChildString("PrimaryAttachmentID");

                if(oXml.FindChildElement("SecondaryAttachmentID", false))
                    m_strSecondaryAttachID = oXml.GetChildString("SecondaryAttachmentID");
            }

            m_snNaturalLength.LoadData(ref oXml, "NaturalLength");
            m_snStiffness.LoadData(ref oXml, "Stiffness");
            m_snDamping.LoadData(ref oXml, "Damping");

            m_bEnabled = oXml.GetChildBool("Enabled", m_bEnabled);
            m_bVisible = oXml.GetChildBool("IsVisible", m_bVisible);

            oXml.OutOfElem(); //Outof RigidBody Element
        }
开发者ID:NeuroRoboticTech,项目名称:AnimatLabVersion1,代码行数:66,代码来源:Spring.cs

示例3: LoadData

        public override void LoadData(ref AnimatTools.DataObjects.Simulation dsSim, ref AnimatTools.DataObjects.Physical.PhysicalStructure doStructure, ref AnimatTools.Interfaces.StdXml oXml)
        {
            m_aryChildBodies.Clear();

            oXml.IntoElem(); //'Into RigidBody Element

            m_strID = oXml.GetChildString("ID");
            m_strName = oXml.GetChildString("Name", m_strID);
            m_bVisible = oXml.GetChildBool("IsVisible", m_bVisible);

            if(m_strID.Trim().Length == 0)
                m_strID = System.Guid.NewGuid().ToString();

            if(m_strName.Trim().Length == 0)
                m_strName = m_strID;

            if(oXml.FindChildElement("Color", false))
            {
                System.Drawing.Color oColor = Util.LoadColor(ref oXml, "Color");
                this.Alpha = oColor.A;
                this.Color = oColor;
            }

            m_fRadius = oXml.GetChildFloat("Radius", m_fRadius);
            //m_fHeight = oXml.GetChildFloat("Height", m_fHeight);

            if(oXml.FindChildElement("Direction",false))
            {
                this.m_v3Direction = new Vector3();
                Vec3d vDirection = Util.LoadVec3d(ref oXml, "Direction", this);
                m_v3Direction.X = (float)vDirection.X;
                m_v3Direction.Y = (float)vDirection.Y;
                m_v3Direction.Z = (float)vDirection.Z;
            }
            if(oXml.FindChildElement("OrientationMatrix", false))
            {
                m_mtxOrientation = Util_DX.LoadMatrix(ref oXml, "OrientationMatrix");
                m_v3Rotation = Util_DX.DecomposeXYZRotationMatrix(Orientation);
                this.Rotation = new Vec3d(null,Geometry.RadianToDegree(m_v3Rotation.X),Geometry.RadianToDegree(m_v3Rotation.Y),Geometry.RadianToDegree(m_v3Rotation.Z));
            }

            if(oXml.FindChildElement("TranslationMatrix",false))
                m_mtxTranslation = Util_DX.LoadMatrix(ref oXml,"TranslationMatrix");

            oXml.OutOfElem(); //Outof RigidBody Element
        }
开发者ID:NeuroRoboticTech,项目名称:AnimatLabVersion1,代码行数:46,代码来源:MuscleAttachment.cs

示例4: LoadData

        public override void LoadData(ref AnimatTools.Interfaces.StdXml oXml)
        {
            base.LoadData(ref oXml);

            oXml.IntoElem();

            if(oXml.FindChildElement("PrimaryAttachmentID", false))
            {
              string strAttachID = oXml.GetChildString("PrimaryAttachmentID");
                if(m_doStructure != null && strAttachID.Trim().Length > 0)
                {
                    AnimatTools.DataObjects.Physical.BodyPart rbPart = (AnimatTools.DataObjects.Physical.BodyPart) m_doStructure.FindBodyPart(strAttachID, false);
                    if(rbPart != null)
                        m_thPrimaryAttachment = new AnimatTools.TypeHelpers.LinkedBodyPartList(m_doStructure, rbPart, m_tpBodyPartType);
                }
            }
            else
                m_thPrimaryAttachment = new AnimatTools.TypeHelpers.LinkedBodyPartList(m_doStructure, null, m_tpBodyPartType);

            if(oXml.FindChildElement("SecondaryAttachmentID", false))
            {
                string strAttachID = oXml.GetChildString("SecondaryAttachmentID");
                if(m_doStructure != null && strAttachID.Trim().Length > 0)
                {
                    AnimatTools.DataObjects.Physical.BodyPart rbPart = (AnimatTools.DataObjects.Physical.BodyPart) m_doStructure.FindBodyPart(strAttachID, false);
                    if(rbPart != null)
                        m_thSecondaryAttachment = new AnimatTools.TypeHelpers.LinkedBodyPartList(m_doStructure, rbPart, m_tpBodyPartType);
                }
            }
            else
                m_thSecondaryAttachment = new AnimatTools.TypeHelpers.LinkedBodyPartList(m_doStructure, null, m_tpBodyPartType);

            m_fltProportionalGain = oXml.GetChildFloat("PGain", m_fltProportionalGain);
            m_fltDerivativeGain = oXml.GetChildFloat("DGain", m_fltDerivativeGain);
            m_fltIntegratorGain = oXml.GetChildFloat("IGain", m_fltIntegratorGain);
            m_fltMaxIntegratorValue = oXml.GetChildFloat("MaxIValue", m_fltMaxIntegratorValue);
            m_snVelocity.LoadData(ref oXml, "Velocity");
            m_snMaxForce.LoadData(ref oXml, "MaxForce");

            SetPositionUnits();
            oXml.OutOfElem();
        }
开发者ID:NeuroRoboticTech,项目名称:AnimatLabVersion1,代码行数:42,代码来源:VelocityClamp.cs

示例5: LoadData

        public override void LoadData(ref AnimatTools.DataObjects.Simulation dsSim, ref AnimatTools.DataObjects.Physical.PhysicalStructure doStructure, ref AnimatTools.Interfaces.StdXml oXml)
        {
            base.LoadData (ref dsSim, ref doStructure, ref oXml);

            oXml.IntoElem();
            m_fltHeight = oXml.GetChildFloat("Height", m_fltHeight);
            m_strHeightFieldImage = oXml.GetChildString("HeightFieldImage", m_strHeightFieldImage);

            if(oXml.FindChildElement("MapLocation", false))
                m_vMapLocation = Util.LoadVec3d(ref oXml, "MapLocation", this);

            if(oXml.FindChildElement("MapSize", false))
                m_vMapSize = Util.LoadVec3d(ref oXml, "MapSize", this);

            m_fltMapScale = oXml.GetChildFloat("MapScale", m_fltMapScale);
            oXml.OutOfElem(); //out of body
        }
开发者ID:NeuroRoboticTech,项目名称:AnimatLabVersion1,代码行数:17,代码来源:Plane.cs

示例6: LoadData

        public override void LoadData(ref AnimatTools.DataObjects.Simulation dsSim, ref AnimatTools.DataObjects.Physical.PhysicalStructure doStructure, ref AnimatTools.Interfaces.StdXml oXml)
        {
            base.LoadData(ref dsSim, ref doStructure, ref oXml);

            oXml.IntoElem(); //'Into RigidBody Element

            if(oXml.FindChildElement("NaturalLength", false))
                m_snNaturalLength.LoadData(ref oXml, "NaturalLength");

            m_snStiffness.LoadData(ref oXml, "Stiffness");
            m_snDamping.LoadData(ref oXml, "Damping");

            //This code converts old versions of the spring code into
            //the new version that has multiple attachment points
            if(oXml.FindChildElement("PrimaryAttachmentID", false))
            {
                m_aryAttachmentPointIDs.Clear();

                string strAttachID;
                if(oXml.FindChildElement("PrimaryAttachmentID", false))
                {
                    strAttachID = oXml.GetChildString("PrimaryAttachmentID");
                    m_aryAttachmentPointIDs.Add(strAttachID);
                }

                if(oXml.FindChildElement("SecondaryAttachmentID", false))
                {
                    strAttachID = oXml.GetChildString("SecondaryAttachmentID");
                    m_aryAttachmentPointIDs.Add(strAttachID);
                }
            }

            if(oXml.FindChildElement("ForceType", false))
                m_eForceType = (VortexAnimatTools.DataObjects.Physical.RigidBodies.MultiSegmentSpring.enumForceTypes) Enum.Parse(typeof(VortexAnimatTools.DataObjects.Physical.RigidBodies.MultiSegmentSpring.enumForceTypes), oXml.GetChildString("ForceType"), true);

            oXml.OutOfElem(); //Outof RigidBody Element
        }
开发者ID:NeuroRoboticTech,项目名称:AnimatLabVersion1,代码行数:37,代码来源:MultisegmentSpring.cs

示例7: LoadData

        public override void LoadData(ref AnimatTools.DataObjects.Simulation dsSim, ref AnimatTools.DataObjects.Physical.PhysicalStructure doStructure, ref AnimatTools.Interfaces.StdXml oXml)
        {
            base.LoadData(ref dsSim, ref doStructure, ref oXml);

            oXml.IntoElem(); //'Into RigidBody Element

            string strOdorTypeID = oXml.GetChildString("OdorTypeID", "");
            if(strOdorTypeID.Length > 0)
            {
                if(Util.Environment.OdorTypes.Contains(strOdorTypeID))
                    m_thOdorType.OdorType = Util.Environment.OdorTypes.GetItem(strOdorTypeID);
            }

            oXml.OutOfElem(); //Outof RigidBody Element
        }
开发者ID:NeuroRoboticTech,项目名称:AnimatLabVersion1,代码行数:15,代码来源:OdorSensor.cs

示例8: LoadMatrix

        public static Matrix LoadMatrix(ref AnimatTools.Interfaces.StdXml oXml, string strName)
        {
            string str = oXml.GetChildString(strName);
            string[] strMtxElem = str.Split(',');

            Matrix mtx = new Matrix();
            mtx.M11 = float.Parse(strMtxElem[0]);
            mtx.M12 = float.Parse(strMtxElem[1]);
            mtx.M13 = float.Parse(strMtxElem[2]);
            mtx.M14 = float.Parse(strMtxElem[3]);

            mtx.M21 = float.Parse(strMtxElem[4]);
            mtx.M22 = float.Parse(strMtxElem[5]);
            mtx.M23 = float.Parse(strMtxElem[6]);
            mtx.M24 = float.Parse(strMtxElem[7]);

            mtx.M31 = float.Parse(strMtxElem[8]);
            mtx.M32 = float.Parse(strMtxElem[9]);
            mtx.M33 = float.Parse(strMtxElem[10]);
            mtx.M34 = float.Parse(strMtxElem[11]);

            mtx.M41 = float.Parse(strMtxElem[12]);
            mtx.M42 = float.Parse(strMtxElem[13]);
            mtx.M43 = float.Parse(strMtxElem[14]);
            mtx.M44 = float.Parse(strMtxElem[15]);

            return mtx;
        }
开发者ID:NeuroRoboticTech,项目名称:AnimatLabVersion1,代码行数:28,代码来源:Util_DX.cs


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