コード例 #1
0
        public ControlMeshSelection Clone()
        {
            var clone = new ControlMeshSelection();

            CopyTo(clone);
            return(clone);
        }
コード例 #2
0
        public void CopyTo(ControlMeshSelection other)
        {
            if (other == null)
            {
                return;
            }

            if (Points != null)
            {
                if (other.Points == null || Points.Length != other.Points.Length)
                {
                    other.Points = new SelectState[Points.Length];
                }
                Array.Copy(Points, other.Points, Points.Length);
            }

            if (Edges != null)
            {
                if (other.Edges == null || Edges.Length != other.Edges.Length)
                {
                    other.Edges = new SelectState[Edges.Length];
                }
                Array.Copy(Edges, other.Edges, Edges.Length);
            }

            if (Polygons != null)
            {
                if (other.Polygons == null || Polygons.Length != other.Polygons.Length)
                {
                    other.Polygons = new SelectState[Polygons.Length];
                }
                Array.Copy(Polygons, other.Polygons, Polygons.Length);
            }
        }
コード例 #3
0
        public bool Equals(ControlMeshSelection other)
        {
            if (Points != null)
            {
                for (var p = 0; p < Points.Length; p++)
                {
                    if (Points[p] != other.Points[p])
                    {
                        return(false);
                    }
                }
            }

            if (other.Edges != null)
            {
                for (var e = 0; e < Edges.Length; e++)
                {
                    if (Edges[e] != other.Edges[e])
                    {
                        return(false);
                    }
                }
            }

            if (other.Polygons != null)
            {
                for (var e = 0; e < Polygons.Length; e++)
                {
                    if (Polygons[e] != other.Polygons[e])
                    {
                        return(false);
                    }
                }
            }
            return(true);
        }