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


C# AnimatTools.IntoElem方法代码示例

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


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

示例1: 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);

            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,代码行数:45,代码来源:Sensor.cs

示例2: 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_vGraphicsBoxSize = Util.LoadVec3d(ref oXml, "GraphicsBoxSize", this);
            oXml.OutOfElem(); //out of body
        }
开发者ID:NeuroRoboticTech,项目名称:AnimatLabVersion1,代码行数:8,代码来源:Box.cs

示例3: 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();

            oXml.IntoChildElement("Constraint");
            m_fltMinAngle = oXml.GetAttribFloat("Low");
            m_fltMaxAngle = oXml.GetAttribFloat("High");
            oXml.OutOfElem(); //out of Constraint

            m_snMinAngle.SetFromValue(Util.RadiansToDegrees(m_fltMinAngle), AnimatTools.Framework.ScaledNumber.enumNumericScale.None);
            m_snMaxAngle.SetFromValue(Util.RadiansToDegrees(m_fltMaxAngle), AnimatTools.Framework.ScaledNumber.enumNumericScale.None);

            m_bEnableMotor = oXml.GetChildBool("EnableMotor");
            m_bServoMotor = oXml.GetChildBool("ServoMotor", m_bServoMotor);
            m_fltServoGain = oXml.GetChildFloat("ServoGain", m_fltServoGain);

            //based on whether this is a servo motor or not the incoming data type will change.
            if(m_bServoMotor)
                m_thIncomingDataType = new AnimatTools.DataObjects.DataType("Position", "Position", "rad", "rad", -3.142, 3.142, ScaledNumber.enumNumericScale.None, ScaledNumber.enumNumericScale.None);
            else
                m_thIncomingDataType = new AnimatTools.DataObjects.DataType("DesiredVelocity", "Desired Velocity", "m/s", "m/s", -5, 5, ScaledNumber.enumNumericScale.None, ScaledNumber.enumNumericScale.None);

            if(oXml.FindChildElement("MaxTorque", false))
                m_snMaxTorque.LoadData(ref oXml, "MaxTorque");

            if(oXml.FindChildElement("MaxVelocity", false))
                m_snMaxTorque.LoadData(ref oXml, "MaxVelocity");

            //			if(oXml.FindChildElement("RotationAxis", false))
            //			{
            //				Vec3d vTmp = Util.LoadVec3d(ref oXml, "RotationAxis", this);
            //				m_v3Axis = new Vector3((float)vTmp.X, (float)vTmp.Y, (float)vTmp.Z);
            //			}

            m_v3Axis = new Vector3(0,0,1);
            oXml.OutOfElem(); //out of body
        }
开发者ID:NeuroRoboticTech,项目名称:AnimatLabVersion1,代码行数:39,代码来源:Hinge_New.cs

示例4: SaveDataColumnToXml

 public override void SaveDataColumnToXml(ref AnimatTools.Interfaces.StdXml oXml)
 {
     oXml.IntoElem();
     oXml.AddChildElement("StimulusID", this.ID);
     oXml.OutOfElem();
 }
开发者ID:NeuroRoboticTech,项目名称:AnimatLabVersion1,代码行数:6,代码来源:InverseMuscleDynamics.cs

示例5: 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

示例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();
                m_fHalfAngle = oXml.GetChildFloat("ConstraintHalfAngle");
                Vec3d v = Util.LoadVec3d(ref oXml,"ConstraintAxis",null);
            //				this.Damping.ActualValue = oXml.GetChildFloat("Damping");
            //				this.Stiffness.ActualValue = oXml.GetChildFloat("Stiffness");

                this.m_v3Rotation.X = (float)v.X;
                this.m_v3Rotation.Y = (float)v.Y;
                this.m_v3Rotation.Z = (float)v.Z;
            oXml.OutOfElem();
        }
开发者ID:NeuroRoboticTech,项目名称:AnimatLabVersion1,代码行数:15,代码来源:BallSocket.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();

            //get the color of the body
            if(oXml.FindChildElement("Color"))
            {
                System.Drawing.Color oColor = Util.LoadColor(ref oXml, "Color");

                this.Alpha = oColor.A;
                this.Color = oColor;
            }

            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);
            }

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

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

示例8: 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_fLowerRadius = oXml.GetChildFloat("LowerRadius");
            m_fUpperRadius = oXml.GetChildFloat("UpperRadius");
            m_fHeight = oXml.GetChildFloat("Height");
            m_snHeight.ActualValue = m_fHeight;

            oXml.OutOfElem(); //out of body
        }
开发者ID:NeuroRoboticTech,项目名称:AnimatLabVersion1,代码行数:13,代码来源:Cone.cs

示例9: SaveData

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

            oXml.IntoElem();
            oXml.AddChildElement("Height", m_fltHeight);
            oXml.AddChildElement("HeightFieldImage", m_strHeightFieldImage);
            Util.SaveVector(ref oXml, "MapLocation", m_vMapLocation);
            Util.SaveVector(ref oXml, "MapSize", m_vMapSize);
            oXml.AddChildElement("MapScale", m_fltMapScale);
            oXml.OutOfElem(); //out of body
        }
开发者ID:NeuroRoboticTech,项目名称:AnimatLabVersion1,代码行数:12,代码来源:Plane.cs

示例10: 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

示例11: SaveData

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

            oXml.IntoElem(); //Into RigidBody Element

            m_snNaturalLength.SaveData(ref oXml, "NaturalLength");
            m_snStiffness.SaveData(ref oXml, "Stiffness");
            m_snDamping.SaveData(ref oXml, "Damping");
            oXml.AddChildElement("ForceType", m_eForceType.ToString());

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

示例12: 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

示例13: SaveData

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

            oXml.IntoElem(); //Into RigidBody Element

            m_StimTension.SaveData(ref oXml, "StimulusTension");
            m_LengthTension.SaveData(ref oXml, "LengthTension");
            m_snKse.SaveData(ref oXml, "Kse");
            m_snKpe.SaveData(ref oXml, "Kpe");
            m_snB.SaveData(ref oXml, "B");
            m_snPeLengthPercentage.SaveData(ref oXml, "PeLength");
            m_snMinPeLengthPercentage.SaveData(ref oXml, "MinPeLength");
            m_snIbDischargeConstant.SaveData(ref oXml, "IbDischarge");

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

示例14: 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

            m_StimTension.LoadData(ref oXml, "StimulusTension", "StimTension");
            m_LengthTension.LoadData(ref oXml, "LengthTension", "LengthTension");
            m_snKse.LoadData(ref oXml, "Kse");
            m_snKpe.LoadData(ref oXml, "Kpe");
            m_snB.LoadData(ref oXml, "B");

            if(oXml.FindChildElement("PeLength", false))
            {
                m_snPeLengthPercentage.LoadData(ref oXml, "PeLength");
                m_snMinPeLengthPercentage.LoadData(ref oXml, "MinPeLength");
            }

            //			if(oXml.FindChildElement("IbDischarge", false))
            //				m_snIbDischargeConstant.LoadData(ref oXml, "IbDischarge");

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

示例15: SaveData

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

            oXml.IntoElem();
            Util.SaveVector(ref oXml, "CollisionBoxSize", new Vec3d(null, m_vGraphicsBoxSize.X, m_vGraphicsBoxSize.Y, m_vGraphicsBoxSize.Z));
            Util.SaveVector(ref oXml, "GraphicsBoxSize", new Vec3d(null, m_vGraphicsBoxSize.X, m_vGraphicsBoxSize.Y, m_vGraphicsBoxSize.Z));

            oXml.OutOfElem(); //out of body
        }
开发者ID:NeuroRoboticTech,项目名称:AnimatLabVersion1,代码行数:10,代码来源:Box.cs


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