コード例 #1
0
        public MeshEdge CreateMeshEdge(Vertex vertex1, Vertex vertex2, CreateOption createOption = CreateOption.ReuseExisting)
        {
            if (false)            //!vertices.Contains(vertex1) || !vertices.Contains(vertex2))
            {
                throw new ArgumentException("the two vertices must be in the vertices list before a mesh edge can be made between them.");
            }

            if (vertex1 == vertex2)
            {
                throw new ArgumentException("Your input vertices must not be the same vertex.");
            }

            if (createOption == CreateOption.ReuseExisting)
            {
                MeshEdge existingMeshEdge = vertex1.GetMeshEdgeConnectedToVertex(vertex2);
                if (existingMeshEdge != null)
                {
                    return(existingMeshEdge);
                }
            }

            MeshEdge createdMeshEdge = new MeshEdge(vertex1, vertex2);

            MeshEdges.Add(createdMeshEdge);

            return(createdMeshEdge);
        }
コード例 #2
0
ファイル: Mesh.cs プロジェクト: glocklueng/agg-sharp
		public MeshEdge CreateMeshEdge(Vertex vertex1, Vertex vertex2, CreateOption createOption = CreateOption.ReuseExisting)
		{
			if (false)//!vertices.Contains(vertex1) || !vertices.Contains(vertex2))
			{
				throw new ArgumentException("the two vertices must be in the vertices list before a mesh edge can be made between them.");
			}

			if (vertex1 == vertex2)
			{
				throw new ArgumentException("Your input vertices must not be the same vertex.");
			}

			if (createOption == CreateOption.ReuseExisting)
			{
				MeshEdge existingMeshEdge = vertex1.GetMeshEdgeConnectedToVertex(vertex2);
				if (existingMeshEdge != null)
				{
					return existingMeshEdge;
				}
			}

			MeshEdge createdMeshEdge = new MeshEdge(vertex1, vertex2);

			MeshEdges.Add(createdMeshEdge);

			return createdMeshEdge;
		}