コード例 #1
0
            public bool Equals(HalfEdge x, HalfEdge y)
            {
                if (x == null && y == null)
                {
                    return(true);
                }
                if (x == null || y == null)
                {
                    return(false);
                }

                return(
                    vertexComparer.Equals(x.Origin, y.Origin) &&
                    vertexComparer.Equals(x.Destination, y.Destination)
                    );
            }
コード例 #2
0
        /// <summary>
        /// Determines whether the specified <see cref="DoubleConnectedEdgeList.HalfEdge"/> is equal to the current <see cref="T:DoubleConnectedEdgeList.HalfEdge"/>.
        /// </summary>
        /// <param name="other">The <see cref="DoubleConnectedEdgeList.HalfEdge"/> to compare with the current <see cref="T:DoubleConnectedEdgeList.HalfEdge"/>.</param>
        /// <returns><c>true</c> if the specified <see cref="DoubleConnectedEdgeList.HalfEdge"/> is equal to the current
        /// <see cref="T:DoubleConnectedEdgeList.HalfEdge"/>; otherwise, <c>false</c>.</returns>
        public bool Equals(HalfEdge other)
        {
            OriginDestinationComparer edgeComparer = new OriginDestinationComparer();

            Vertex.PositionComparer       vertexComparer = new Vertex.PositionComparer();
            Face.MeshIdxAndNormalComparer faceComparer   = new Face.MeshIdxAndNormalComparer();

            return(
                vertexComparer.Equals(this.Origin, other.Origin) &&
                edgeComparer.Equals(this.Twin, other.Twin) &&
                edgeComparer.Equals(this.Previous, other.Previous) &&
                edgeComparer.Equals(this.Next, other.Next) &&
                faceComparer.Equals(this.IncidentFace, other.IncidentFace)
                );
        }