Beispiel #1
0
        private bool TryAdd(PointTriangle t)
        {
            List <ushort> newIds = new List <ushort>();

            ushort x = t._x.PMXID;
            ushort y = t._y.PMXID;
            ushort z = t._z.PMXID;

            if (!_nodes.Contains(x) && !newIds.Contains(x))
            {
                newIds.Add(x);
            }
            if (!_nodes.Contains(y) && !newIds.Contains(y))
            {
                newIds.Add(y);
            }
            if (!_nodes.Contains(z) && !newIds.Contains(z))
            {
                newIds.Add(z);
            }

            //There's a limit of 10 matrices per group...
            if (newIds.Count + _nodes.Count <= 10)
            {
                AddTriangle(t);
                return(true);
            }
            return(false);
        }
Beispiel #2
0
 private void AddTriangle(PointTriangle t)
 {
     _triangles.Add(t);
     if (!_nodes.Contains(t._x.PMXID))
     {
         _nodes.Add(t._x.PMXID);
     }
     if (!_nodes.Contains(t._y.PMXID))
     {
         _nodes.Add(t._y.PMXID);
     }
     if (!_nodes.Contains(t._z.PMXID))
     {
         _nodes.Add(t._z.PMXID);
     }
 }