Example #1
0
        /// <summary>
        /// Serves as a hash function for a <see cref="T:DoubleConnectedEdgeList.Vertex"/> object.
        /// </summary>
        /// <returns>A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a
        /// hash table.</returns>
        public override int GetHashCode()
        {
            HalfEdge.OriginDestinationComparer edgeComparer = new HalfEdge.OriginDestinationComparer();

            int hash = 17;

            hash *= (31 + Position.GetHashCode());
            foreach (HalfEdge edge in IncidentEdges)
            {
                hash *= (31 + edgeComparer.GetHashCode(edge));
            }
            return(hash);
        }
Example #2
0
        /// <summary>
        /// Serves as a hash function for a <see cref="T:DoubleConnectedEdgeList.Face"/> object.
        /// </summary>
        /// <returns>A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a
        /// hash table.</returns>
        public override int GetHashCode()
        {
            HalfEdge.OriginDestinationComparer edgeComparer = new HalfEdge.OriginDestinationComparer();

            int hash = 17;

            hash *= (31 + MeshIdx.GetHashCode());
            hash *= (31 + Normal.GetHashCode());
            foreach (HalfEdge edge in OuterComponents)
            {
                hash *= (31 + edgeComparer.GetHashCode(edge));
            }
            return(hash);
        }