private void ExpectOppositeEdgesAreDifferent(VerticalPrismalSurface surface, IPolysurfaceVertex v1, IPolysurfaceVertex v2)
        {
            var edge1 = surface.GetEdge(v1, v2);
            var edge2 = surface.GetEdge(v2, v1);

            Expect(edge1, Is.Not.EqualTo(edge2));
        }
        public IPolysurfaceEdge GetEdge(IPolysurfaceVertex source, IPolysurfaceVertex target)
        {
            var nativeSource = (TransformedVertex)source;
            var nativeTarget = (TransformedVertex)target;

            return(new TransformedEdge(_localSurface.GetEdge(nativeSource.LocalVertex, nativeTarget.LocalVertex), this));
        }
        private void ExpectGetEdgeReturnsCorrectEdge(VerticalPrismalSurface surface, IPolysurfaceVertex v1, IPolysurfaceVertex v2)
        {
            var edge1 = surface.GetEdge(v1, v2);

            Expect(edge1, Is.Not.Null);
            Expect(edge1.Source, Is.EqualTo(v1));
            Expect(edge1.Target, Is.EqualTo(v2));

            var edge2 = surface.GetEdge(v2, v1);

            Expect(edge2, Is.Not.Null);
            Expect(edge2.Source, Is.EqualTo(v2));
            Expect(edge2.Target, Is.EqualTo(v1));
        }
        public IPolysurfaceEdge GetEdge(IPolysurfaceVertex source, IPolysurfaceVertex target)
        {
            var sourceV = (Vertex)source;
            var targetV = (Vertex)target;

            if (sourceV.Parent != this)
            {
                throw new ArgumentException("Vertices must belong to this surface", "source");
            }

            if (targetV.Parent != this)
            {
                throw new ArgumentException("Vertices must belong to this surface", "target");
            }

            return(Vertex.GetEdge(sourceV, targetV));
        }
 public bool Equals(IPolysurfaceVertex other)
 {
     return(Equals(other as TransformedVertex));
 }
 public TransformedVertex(IPolysurfaceVertex localVertex, TransformedPolysurface parent)
 {
     _localVertex = localVertex;
     _parent      = parent;
 }
Ejemplo n.º 7
0
 public IPolysurfaceEdge GetEdge(IPolysurfaceVertex source, IPolysurfaceVertex target)
 {
     throw new NotImplementedException();
 }
 public static IEnumerable <IPolysurfaceFace> Faces(this IPolysurfaceVertex @this)
 {
     return(@this.Edges.Select(e => e.RightFace));
 }
Ejemplo n.º 9
0
 public bool Equals(IPolysurfaceVertex other)
 {
     return(base.Equals(other));
 }
Ejemplo n.º 10
0
 public IPolysurfaceEdge GetEdge(IPolysurfaceVertex source, IPolysurfaceVertex target)
 {
     return(Vertex.GetEdge((Vertex)source, (Vertex)target));
 }
Ejemplo n.º 11
0
 public bool Equals(IPolysurfaceVertex other)
 {
     return(Equals(other as Vertex));
 }
        private void ExpectOppositeEdgesAreEqualAsUndirected(VerticalPrismalSurface surface, IPolysurfaceVertex v1, IPolysurfaceVertex v2)
        {
            var edge1 = surface.GetEdge(v1, v2);
            var edge2 = surface.GetEdge(v2, v1);

            Expect(edge1, Is.EqualTo(edge2).Using(surface.UndirectedEdgeComparer));
        }
        private void ExpectTwoConstructionsOfEdgeCoincide(VerticalPrismalSurface surface, IPolysurfaceVertex v1, IPolysurfaceVertex v2)
        {
            var edge1 = surface.GetEdge(v1, v2);
            var edge2 = v1.Edges.Where(e => e.Target.Equals(v2)).Single();

            Expect(edge1, Is.EqualTo(edge2));
            Expect(edge1, Is.EqualTo(edge2).Using(surface.UndirectedEdgeComparer));
        }