示例#1
0
        public ForkEventArgs(SplineBase spline, int pointIndex)
        {
            m_spline         = spline;
            m_nextCurveIndex = pointIndex / 3;
            SplineBranch[] branches = spline.GetBranches(pointIndex);
            if (branches == null || branches.Length == 0)
            {
                m_branches = new SplineBase[0];
            }
            else
            {
                List <SplineBase> branchList = new List <SplineBase>();
                for (int i = 0; i < branches.Length; ++i)
                {
                    SplineBranch branch = branches[i];
                    if (!branch.Inbound)
                    {
                        branchList.Add(spline.BranchToSpline(branch));
                    }
                }
                m_branches = branchList.ToArray();
            }

            if (m_nextCurveIndex >= spline.CurveCount)
            {
                if (m_branches.Length > 0)
                {
                    SelectBranchIndex = 0;
                }
                SelectBranchIndex = -1;
                m_nextCurveIndex  = -1;
            }
            else
            {
                SelectBranchIndex = -1;
            }
        }