Exemplo n.º 1
0
        private bool TryAdd(PointTriangle t)
        {
            List <ushort> newIds = new List <ushort>();

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

            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 <= _nodeCountMax)
            {
                AddTriangle(t);
                return(true);
            }

            return(false);
        }
Exemplo n.º 2
0
 private void AddTriangle(PointTriangle t)
 {
     _triangles.Add(t);
     if (!_nodes.Contains(t._x.NodeID))
     {
         _nodes.Add(t._x.NodeID);
     }
     if (!_nodes.Contains(t._y.NodeID))
     {
         _nodes.Add(t._y.NodeID);
     }
     if (!_nodes.Contains(t._z.NodeID))
     {
         _nodes.Add(t._z.NodeID);
     }
 }
Exemplo n.º 3
0
        private bool TryAdd(PointTriangle t)
        {
            List<ushort> newIds = new List<ushort>();

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

            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 <= _nodeCountMax)
            {
                AddTriangle(t);
                return true;
            }
            return false;
        }
Exemplo n.º 4
0
 private void AddTriangle(PointTriangle t)
 {
     _triangles.Add(t);
     if (!_nodes.Contains(t._x.NodeID)) _nodes.Add(t._x.NodeID);
     if (!_nodes.Contains(t._y.NodeID)) _nodes.Add(t._y.NodeID);
     if (!_nodes.Contains(t._z.NodeID)) _nodes.Add(t._z.NodeID);
 }