Canguro.Commands.Model.JoinCmd.Intersect C# (CSharp) Метод

Intersect() публичный статический Метод

public static Intersect ( Canguro model, IList joints, IList lines ) : void
model Canguro
joints IList
lines IList
Результат void
        public static void Intersect(Canguro.Model.Model model, IList<Joint> joints, IList<LineElement> lines)
        {
            System.Windows.Forms.Cursor cursor = System.Windows.Forms.Cursor.Current;
            System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;

            try
            {
                int nJoints = (joints == null) ? 0 : joints.Count;
                int nLines = (lines == null) ? 0 : lines.Count;

                Joint joint;
                for (int i = 0; i < nLines; i++)
                {
                    System.Windows.Forms.Application.DoEvents();
                    for (int j = i + 1; j < nLines; j++)
                        if (lines[i] != null && lines[j] != null)
                        {
                            joint = Intersect(model, lines[i], lines[j]);
                            if (joint != null)
                                joints.Add(joint);
                        }
                }

                //for (int i = 0; i < nJoints; i++)
                //{
                //    Joint joint = joints[i];
                //    if (joint != null)
                foreach (LineElement line in lines)
                    if (line != null)
                    {
                        SplitCmd.Split(line, joints, model);
                        System.Windows.Forms.Application.DoEvents();
                    }
                //}
            }
            finally
            {
                System.Windows.Forms.Cursor.Current = cursor;
            }
        }

Same methods

JoinCmd::Intersect ( Canguro model, LineElement l1, LineElement l2 ) : Joint

Usage Example

Пример #1
0
        public override void Run(Canguro.Controller.CommandServices services)
        {
            List <Item>        selecton = services.GetSelection();
            List <Joint>       joints   = new List <Joint>();
            List <LineElement> lines    = new List <LineElement>();

            foreach (Item item in selecton)
            {
                if (item is Joint)
                {
                    joints.Add((Joint)item);
                }
                else if (item is LineElement)
                {
                    lines.Add((LineElement)item);
                }
            }

            JoinCmd.Intersect(services.Model, joints, lines);
        }