[mapguide-users] Topology.net and mapguide

Jackie Ng jumpinjackie at gmail.com
Thu Jan 14 19:26:41 EST 2010


A C# interface is just a collection of methods and properties that any
extending class must implement.  Think of it as a 100% abstract class.

To use a relevant example, FDO is a bunch of interfaces. FDO providers
implement these interfaces. The end result is that we (the client
application) only have to care about the interface and not about the various
underlying implementations in the FDO providers.

Most of the time, there is usually some class in the library that provides a
default implementation of the interface. Look for any class in your library
that implements IVertexListGraph, that's probably what you're meant to pass
in. 

- Jackie


Jamo wrote:
> 
> Anyone able to help me with these C# interface things? I've never really
> had to use one yet or if I have i've done it by accident....?
> 
> I think an Interface is like a conversion from one type to another, is
> this correct?
> 
> This code works: which is great I can get all adjacent vertecies....
> 
> public void main()
>     {
>         AdjacencyGraph<int, TaggedEdge<int, string>> g = new
> AdjacencyGraph<int, TaggedEdge<int, string>>();
>         g.AddVerticesAndEdge(new TaggedEdge<int, string>(1, 2, "To Train
> Station"));
>         g.AddVerticesAndEdge(new TaggedEdge<int, string>(2, 3, "To
> Subway"));
>         g.AddVerticesAndEdge(new TaggedEdge<int, string>(3, 4, "To
> Work"));
>         g.AddVerticesAndEdge(new TaggedEdge<int, string>(2, 4, "To
> Lunch"));
> 
>         foreach (var vert in g.OutEdges(2))
>             Response.Write(vert.Tag + "<br />");
>     }
> 
> However I would now like to try the DijkstraShortestPathAlgorithm ...
> 
> 
> AdjacencyGraph<int, TaggedEdge<int, string>> g = new AdjacencyGraph<int,
> TaggedEdge<int, string>>();
>         g.AddVerticesAndEdge(new TaggedEdge<int, string>(1, 2, "To Train
> Station"));
>         g.AddVerticesAndEdge(new TaggedEdge<int, string>(2, 3, "To
> Subway"));
>         g.AddVerticesAndEdge(new TaggedEdge<int, string>(3, 4, "To
> Work"));
>         g.AddVerticesAndEdge(new TaggedEdge<int, string>(2, 4, "To
> Lunch"));
> 
>         IVertexAndEdgeListGraph<int,TaggedEdge<int, string>> test = g;
>         IDictionary<TaggedEdge<int, string>,double> a = new
> Dictionary<TaggedEdge<int,string>,double>();
>         //a.Values.Add(1);
>         a.Keys.Add(new TaggedEdge<int,string>(1,4,"route"));
>         DijkstraShortestPathAlgorithm<int, TaggedEdge<int, string>> Dij =
> new DijkstraShortestPathAlgorithm<int, TaggedEdge<int, string>>(test, a);
> 
> 
> I've got no idea what I'm meant to feed the class in order to start
> performing shortest route calcs ?
> 
> How would I get an IVertexListGraph ? and is the adjacency graph actually
> a graph object?
> 
> Has anyone used this, I've seen topology.net referred to a few times in
> these forums?
> 

-- 
View this message in context: http://n2.nabble.com/Topology-net-and-mapguide-tp4289752p4396323.html
Sent from the MapGuide Users mailing list archive at Nabble.com.


More information about the mapguide-users mailing list