コード例 #1
0
        public object ToMultibodyOutput()
        {
            if (KinematicJointPair != null)
            {
                if (KinematicJointPair.JointType == DataRep.KinematicJoint.KinematicJointType.PRISMATIC || KinematicJointPair.JointType == DataRep.KinematicJoint.KinematicJointType.CYLINDRICAL || KinematicJointPair.JointType == DataRep.KinematicJoint.KinematicJointType.REVOLUTE)   // Joint_One_Axis_Given
                {
                    Multibody.ModelAssemblyJointsJoint_One_Axis_Given joint = new Multibody.ModelAssemblyJointsJoint_One_Axis_Given();
                    joint.ComponentA = new Multibody.ModelAssemblyJointsJoint_One_Axis_GivenComponentA();
                    joint.ComponentA.ComponentID = Src.DisplayID;
                    joint.ComponentA.Location_MetricID = SrcPortID;
                    joint.ComponentB = new Multibody.ModelAssemblyJointsJoint_One_Axis_GivenComponentB();
                    joint.ComponentB.ComponentID = Dst.DisplayID;
                    joint.ComponentB.Location_MetricID = DstPortID;
                    joint.ID = KinematicJointPair.XmlID;

                    if (KinematicJointPair.JointType == DataRep.KinematicJoint.KinematicJointType.PRISMATIC)
                        joint.Type = Multibody.ModelAssemblyJointsJoint_One_Axis_GivenType.Translational;
                    else if (KinematicJointPair.JointType == DataRep.KinematicJoint.KinematicJointType.REVOLUTE)
                        joint.Type = Multibody.ModelAssemblyJointsJoint_One_Axis_GivenType.Revolute;
                    else
                        joint.Type = Multibody.ModelAssemblyJointsJoint_One_Axis_GivenType.Cylindrical;

                    joint.Geometry = new Multibody.ModelAssemblyJointsJoint_One_Axis_GivenGeometry();
                    joint.Geometry.MetricID = UtilityHelpers.MakeUdmID();
                    joint.Geometry.Type = "Vector";

                    return joint;
                }
                else    // Joint_Locations_Only
                {
                    Multibody.ModelAssemblyJointsJoint_Locations_Only joint = new Multibody.ModelAssemblyJointsJoint_Locations_Only();
                    joint.ComponentA = new Multibody.ModelAssemblyJointsJoint_Locations_OnlyComponentA();
                    joint.ComponentA.ComponentID = Src.DisplayID;
                    joint.ComponentA.Location_MetricID = SrcPortID;
                    joint.ComponentB = new Multibody.ModelAssemblyJointsJoint_Locations_OnlyComponentB();
                    joint.ComponentB.ComponentID = Dst.DisplayID;
                    joint.ComponentB.Location_MetricID = DstPortID;
                    joint.ID = KinematicJointPair.XmlID;

                    if (KinematicJointPair.JointType == DataRep.KinematicJoint.KinematicJointType.SPHERICAL)
                    {
                        joint.Type = Multibody.ModelAssemblyJointsJoint_Locations_OnlyType.Spherical;
                    }
                    else
                    {
                        joint.Type = Multibody.ModelAssemblyJointsJoint_Locations_OnlyType.Fixed;
                    }


                    return joint;
                }
            }
            else
                return null;
        }
コード例 #2
0
ファイル: CADEdge.cs プロジェクト: landunin/meta-core
        public object ToMultibodyOutput()
        {
            if (KinematicJointPair != null)
            {
                if (KinematicJointPair.JointType == DataRep.KinematicJoint.KinematicJointType.PRISMATIC || KinematicJointPair.JointType == DataRep.KinematicJoint.KinematicJointType.CYLINDRICAL || KinematicJointPair.JointType == DataRep.KinematicJoint.KinematicJointType.REVOLUTE)   // Joint_One_Axis_Given
                {
                    Multibody.ModelAssemblyJointsJoint_One_Axis_Given joint = new Multibody.ModelAssemblyJointsJoint_One_Axis_Given();
                    joint.ComponentA                   = new Multibody.ModelAssemblyJointsJoint_One_Axis_GivenComponentA();
                    joint.ComponentA.ComponentID       = Src.DisplayID;
                    joint.ComponentA.Location_MetricID = SrcPortID;
                    joint.ComponentB                   = new Multibody.ModelAssemblyJointsJoint_One_Axis_GivenComponentB();
                    joint.ComponentB.ComponentID       = Dst.DisplayID;
                    joint.ComponentB.Location_MetricID = DstPortID;
                    joint.ID = KinematicJointPair.XmlID;

                    if (KinematicJointPair.JointType == DataRep.KinematicJoint.KinematicJointType.PRISMATIC)
                    {
                        joint.Type = Multibody.ModelAssemblyJointsJoint_One_Axis_GivenType.Translational;
                    }
                    else if (KinematicJointPair.JointType == DataRep.KinematicJoint.KinematicJointType.REVOLUTE)
                    {
                        joint.Type = Multibody.ModelAssemblyJointsJoint_One_Axis_GivenType.Revolute;
                    }
                    else
                    {
                        joint.Type = Multibody.ModelAssemblyJointsJoint_One_Axis_GivenType.Cylindrical;
                    }

                    joint.Geometry          = new Multibody.ModelAssemblyJointsJoint_One_Axis_GivenGeometry();
                    joint.Geometry.MetricID = UtilityHelpers.MakeUdmID();
                    joint.Geometry.Type     = "Vector";

                    return(joint);
                }
                else    // Joint_Locations_Only
                {
                    Multibody.ModelAssemblyJointsJoint_Locations_Only joint = new Multibody.ModelAssemblyJointsJoint_Locations_Only();
                    joint.ComponentA                   = new Multibody.ModelAssemblyJointsJoint_Locations_OnlyComponentA();
                    joint.ComponentA.ComponentID       = Src.DisplayID;
                    joint.ComponentA.Location_MetricID = SrcPortID;
                    joint.ComponentB                   = new Multibody.ModelAssemblyJointsJoint_Locations_OnlyComponentB();
                    joint.ComponentB.ComponentID       = Dst.DisplayID;
                    joint.ComponentB.Location_MetricID = DstPortID;
                    joint.ID = KinematicJointPair.XmlID;

                    if (KinematicJointPair.JointType == DataRep.KinematicJoint.KinematicJointType.SPHERICAL)
                    {
                        joint.Type = Multibody.ModelAssemblyJointsJoint_Locations_OnlyType.Spherical;
                    }
                    else
                    {
                        joint.Type = Multibody.ModelAssemblyJointsJoint_Locations_OnlyType.Fixed;
                    }


                    return(joint);
                }
            }
            else
            {
                return(null);
            }
        }