Canguro.Commands.Model.SplitCmd.Split C# (CSharp) Méthode

Split() static private méthode

Splits a line element and it's loads with an intermediate joint.
static private Split ( LineElement line, Joint joint, Canguro model ) : LineElement
line Canguro.Model.LineElement The line element to split
joint Joint The joint, which should be located inside the line element
model Canguro The Model object
Résultat Canguro.Model.LineElement
        internal static LineElement Split(LineElement line, Joint joint, Canguro.Model.Model model)
        {
            return Split(line, joint, getIntersection(line, joint), model);
        }

Same methods

SplitCmd::Split ( LineElement line, Joint joint, float intersectPos, Canguro model ) : LineElement
SplitCmd::Split ( LineElement line, IList joints, Canguro model ) : void

Usage Example

Exemple #1
0
        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;
            }
        }