#region License Information /* HeuristicLab * Copyright (C) 2002-2015 Joseph Helm and Heuristic and Evolutionary Algorithms Laboratory (HEAL) * * This file is part of HeuristicLab. * * HeuristicLab is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * HeuristicLab is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with HeuristicLab. If not, see . */ #endregion using System; using SharpDX; using SharpDX.Toolkit.Graphics; namespace PackingPlanVisualizations { [Serializable] public struct VertexPositionColorNormal : IEquatable { [VertexElement("COLOR")] public Color Color; [VertexElement("SV_Position")] public Vector3 Position; [VertexElement("NORMAL")] public Vector3 Normal; public VertexPositionColorNormal(Color color, Vector3 position, Vector3 normal) { Position = position; Color = color; Normal = normal; } public static bool operator !=(VertexPositionColorNormal left, VertexPositionColorNormal right) { return !left.Equals(right); } public static bool operator ==(VertexPositionColorNormal left, VertexPositionColorNormal right) { return left.Equals(right); } public override bool Equals(object obj) { if (obj.GetType() == typeof (VertexPositionColorNormal)) return this.Equals((VertexPositionColorNormal)obj); else return false; } public bool Equals(VertexPositionColorNormal other) { return this.Normal == other.Normal && this.Position == other.Position && this.Color == other.Color; } public override int GetHashCode() { return this.Color.GetHashCode() * 3 + this.Normal.GetHashCode() * 7 + this.Position.GetHashCode() * 11; } public override string ToString() { return String.Format("VertexPositionColorNormal (Position: {0}; Color: {1}; Normal: {2})", this.Position, this.Color, this.Normal); } } }