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


C# Canguro.GetJoint方法代码示例

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


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

示例1: Run

        /// <summary>
        /// Executes the command. 
        /// Creates a series of connected Line Elements given at least 2 points. Each subsequent point given adds a new Line Element.
        /// </summary>
        /// <param name="services">CommandServices object to interact with the system</param>
        public override void Run(Canguro.Controller.CommandServices services)
        {
            LineElement line;
            Joint joint1, joint2;
            LineProps props = new StraightFrameProps();
            List<LineElement> newLines = new List<LineElement>();
            List<AreaElement> newAreas = new List<AreaElement>();

            services.GetProperties(Culture.Get("addLineProps"), props);

            joint1 = services.GetJoint(newLines);
            services.TrackingService = LineTrackingService.Instance;
            services.TrackingService.SetPoint(joint1.Position);

            try
            {
                while ((joint2 = services.GetJoint(newLines)) != null)
                {
                    if (joint2 != joint1)
                    {
                        services.Model.LineList.Add(line = new LineElement(props, joint1, joint2));
                        newLines.Add(line);
                        joint1 = joint2;
                        services.TrackingService.SetPoint(joint1.Position);
                        // Para que se refleje el cambio inmediatamente
                        services.Model.ChangeModel();
                    }
                }
            }
            catch (Canguro.Controller.CancelCommandException) { }
            if (newLines.Count == 0)
                services.Model.Undo.Rollback();
            else
                JoinCmd.Join(services.Model, new List<Joint>(), newLines, newAreas);
        }
开发者ID:rforsbach,项目名称:Treu-Structure,代码行数:40,代码来源:LineStripCmd.cs

示例2: Run

        /// <summary>
        /// Executes the command. 
        /// Creates one AreaElement.
        /// </summary>
        /// <param name="services">CommandServices object to interact with the system</param>
        public override void Run(Canguro.Controller.CommandServices services)
        {
            AreaElement area;
            List<Joint> joints = new List<Joint>();
            Joint joint1, joint2, joint3, joint4;
            AreaProps props = new AreaProps();
            List<LineElement> newLines = new List<LineElement>();

            try
            {
            services.GetProperties(Culture.Get("addAreaProps"), props);

            joint1 = services.GetJoint(newLines);
            services.TrackingService = PolygonTrackingService.Instance;
            services.TrackingService.SetPoint(joint1.Position);
            services.Model.ChangeModel();

            joint2 = services.GetJoint(newLines);
            services.TrackingService.SetPoint(joint2.Position);
            services.Model.ChangeModel();

            joint3 = services.GetJoint(newLines);
            services.TrackingService.SetPoint(joint3.Position);
            services.Model.ChangeModel();

            joint4 = services.GetJoint(newLines);
            if (joint4 != null)
                services.TrackingService.SetPoint(joint4.Position);

            services.Model.AreaList.Add(area = new AreaElement(props, joint1, joint2, joint3, joint4));
            services.Model.ChangeModel();

            }
            catch (Canguro.Controller.CancelCommandException) { }
            //if (newLines.Count == 0)
            //    services.Model.Undo.Rollback();
            //else
            //    JoinCmd.Join(services.Model, new List<Joint>(), newLines);
        }
开发者ID:rforsbach,项目名称:Treu-Structure,代码行数:44,代码来源:AddAreaCmd.cs

示例3: Run

        public override void Run(Canguro.Controller.CommandServices services)
        {
            Canguro.Model.UnitSystem.UnitSystemsManager.Instance.Enabled = false;
            try {
                Microsoft.DirectX.Vector3[] pivots = new Microsoft.DirectX.Vector3[3];

                // Get 3 Points

                Joint j1 = services.GetJoint((IList<LineElement>)null);
                services.TrackingService = Canguro.Controller.Tracking.LineTrackingService.Instance;
                services.TrackingService.SetPoint(j1.Position);
                services.Model.ChangeModel();

                Joint j2 = services.GetJoint((IList<LineElement>)null);
                services.TrackingService.SetPoint(j2.Position);
                services.Model.ChangeModel();
                Joint j3 = services.GetJoint((IList<LineElement>)null);
                services.TrackingService = null;
                services.Model.ChangeModel();

                pivots[0] = j1.Position;
                pivots[1] = j2.Position;
                pivots[2] = j3.Position;

                Vector3 v1 = pivots[0] - pivots[1];
                Vector3 v2 = pivots[1] - pivots[2];
                Vector3 N = Vector3.Cross(v1, v2);

                if (N.LengthSq() < 0.0001) // If Colinear, take perpendicular to the active view.
                    System.Windows.Forms.MessageBox.Show(Culture.Get("ColinearPoints"), Culture.Get("error"), System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Exclamation);
                else {
                    int segments = (int)services.GetSingle(Culture.Get("getSplitParts") + " [2-100]");
                    Vector3 C = calcCenter(pivots[0], pivots[1], pivots[2]);
                    MakeArc(services.Model, C, N, j1, j3, j2, segments);
                }
            } finally {
                Canguro.Model.UnitSystem.UnitSystemsManager.Instance.Enabled = true;
            }
        }
开发者ID:rforsbach,项目名称:Treu-Structure,代码行数:39,代码来源:ArcCircularCmd.cs

示例4: Run

        /// <summary>
        /// Executes the command. 
        /// Asks the User for parameters and adds the Load to all selected Joints.
        /// </summary>
        /// <param name="services">CommandServices object to interact with the system</param>
        public override void Run(Canguro.Controller.CommandServices services)
        {
            GroundDisplacementLoad load = new GroundDisplacementLoad();

            services.GetProperties(Title, load);

            Joint joint;
            while ((joint = services.GetJoint()) != null)
            {
                // TODO: Checar validez
                joint.Loads.Add(load);
                // Para que se refleje el cambio inmediatamente
                services.Model.ChangeModel();
            }
        }
开发者ID:rforsbach,项目名称:Treu-Structure,代码行数:20,代码来源:AddSpringDisplacementLoadCmd.cs

示例5: Run

        /// <summary>
        /// Executes the command. 
        /// Adds Joints in selected points until canceled.
        /// </summary>
        /// <param name="services">CommandServices object to interact with the system</param>
        public override void Run(Canguro.Controller.CommandServices services)
        {
            Joint joint;
            Microsoft.DirectX.Vector3 pt;
            Controller.Snap.Magnet m;
            bool showJoints = false;

            while ((joint = services.GetJoint((IList<LineElement>)null)) != null)
            {
                if (!showJoints)
                    Canguro.View.GraphicViewManager.Instance.ActiveView.ModelRenderer.RenderOptions.OptionsShown |= Canguro.View.Renderer.RenderOptions.ShowOptions.ShowJoints;

                showJoints = true;

                //pt = m.SnapPosition;
                //services.Model.JointList.Add(joint = new Joint(pt.X, pt.Y, pt.Z));
                //services.SnapPrimaryPoint = new Canguro.Controller.Snap.PointMagnet(joint);
                //// Para que se refleje el cambio inmediatamente
                services.Model.ChangeModel();
            }
        }
开发者ID:rforsbach,项目名称:Treu-Structure,代码行数:26,代码来源:AddJointCmd.cs


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