예제 #1
0
        static int XwVectorsFindOrAdd(XwVector vector, IList <Vector> list)
        {
            Vector v = vector.ToOptVector();

            int index = 0;

            for (; index < list.Count; index++)
            {
                if (XwVector.NearEqual(vector, new XwVector(list[index])))
                {
                    break;
                }
            }

            if (index >= list.Count)
            {
                list.Add(v);
            }

            return(index);
        }
예제 #2
0
        static int XwVectorsFindOrAdd(Vector vector, IList <XwVector> list)
        {
            XwVector v = new XwVector(vector);

            int index = 0;

            for (; index < list.Count; index++)
            {
                if (XwVector.NearEqual(v, list[index]))
                {
                    break;
                }
            }

            if (index >= list.Count)
            {
                list.Add(v);
            }

            return(index);
        }