public void GraphCanBeGeneratedFromCubeSurfaces()
            {
                using (Solid testcube = UnfoldTestUtils.SetupCube())
                {
                    var faces    = testcube.Faces;
                    var surfaces = faces.Select(x => x.SurfaceGeometry()).ToList();

                    Assert.AreEqual(surfaces.Count, 6);

                    var graph = ModelTopology.GenerateTopologyFromSurfaces(surfaces);

                    List <Object> face_objs = surfaces.Select(x => x as Object).ToList();

                    UnfoldTestUtils.GraphHasVertForEachFace(graph, face_objs);

                    UnfoldTestUtils.GraphHasCorrectNumberOfEdges(24, graph);

                    var sccs = GraphUtilities.TarjansAlgo <EdgeLikeEntity, FaceLikeEntity> .CycleDetect(graph, GraphUtilities.EdgeType.Graph);

                    UnfoldTestUtils.IsOneStronglyConnectedGraph(sccs);

                    foreach (IDisposable item in graph)
                    {
                        Console.WriteLine("disposing a graphnode");
                        item.Dispose();
                    }


                    foreach (IDisposable item in faces)
                    {
                        Console.WriteLine("disposing a face");
                        item.Dispose();
                    }
                }
            }
            public void GenBFSTreeFromArcLoft()
            {
                Surface testsweep = UnfoldTestUtils.SetupArcLoft();

                var surfaces = new List <Surface>()
                {
                    testsweep
                };
                //handle tesselation here
                var pointtuples = Tesselation.Tessellate(surfaces, -1, 512);
                //convert triangles to surfaces
                List <Surface> trisurfaces = pointtuples.Select(x => Surface.ByPerimeterPoints(new List <Point>()
                {
                    x[0], x[1], x[2]
                })).ToList();


                var graph = ModelTopology.GenerateTopologyFromSurfaces(trisurfaces);

                List <Object> face_objs = trisurfaces.Select(x => x as Object).ToList();

                UnfoldTestUtils.GraphHasVertForEachFace(graph, face_objs);

                var    nodereturn = ModelGraph.BFS <EdgeLikeEntity, FaceLikeEntity>(graph);
                object tree       = nodereturn;

                var casttree = tree as List <GraphVertex <EdgeLikeEntity, FaceLikeEntity> >;

                UnfoldTestUtils.GraphHasVertForEachFace(casttree, face_objs);
                UnfoldTestUtils.AssertAllFinishingTimesSet(graph);

                var sccs = GraphUtilities.TarjansAlgo <EdgeLikeEntity, FaceLikeEntity> .CycleDetect(casttree, GraphUtilities.EdgeType.Tree);

                UnfoldTestUtils.IsAcylic <EdgeLikeEntity, FaceLikeEntity>(sccs, casttree);
            }
            public void GraphCanBeGeneratedFromCubeFaces()
            {
                using (Solid testcube = UnfoldTestUtils.SetupCube())
                {
                    var faces = testcube.Faces.ToList();
                    Assert.AreEqual(faces.Count, 6);
                    List <GraphVertex <EdgeLikeEntity, FaceLikeEntity> > graph;
                    graph = ModelTopology.GenerateTopologyFromFaces(faces);

                    List <Object> face_objs = faces.Select(x => x as Object).ToList();

                    UnfoldTestUtils.GraphHasVertForEachFace(graph, face_objs);

                    UnfoldTestUtils.GraphHasCorrectNumberOfEdges(24, graph);

                    var sccs = GraphUtilities.TarjansAlgo <EdgeLikeEntity, FaceLikeEntity> .CycleDetect(graph, GraphUtilities.EdgeType.Graph);

                    UnfoldTestUtils.IsOneStronglyConnectedGraph(sccs);

                    //manual dispose of lists of Idisposeable, should implement graph type

                    foreach (IDisposable item in graph)
                    {
                        Console.WriteLine("disposing a graphnode");
                        item.Dispose();
                    }
                }
            }
            public void GenBFSTreeFromCubeFaces()
            {
                using (Solid testcube = UnfoldTestUtils.SetupCube())
                {
                    List <Face> faces = testcube.Faces.ToList();

                    var           graph     = ModelTopology.GenerateTopologyFromFaces(faces);
                    List <Object> face_objs = faces.Select(x => x as Object).ToList();

                    UnfoldTestUtils.GraphHasVertForEachFace(graph, face_objs);

                    UnfoldTestUtils.GraphHasCorrectNumberOfEdges(24, graph);

                    var    nodereturn = ModelGraph.BFS <EdgeLikeEntity, FaceLikeEntity>(graph);
                    object tree       = nodereturn;
                    var    casttree   = tree as List <GraphVertex <EdgeLikeEntity, FaceLikeEntity> >;

                    UnfoldTestUtils.GraphHasVertForEachFace(casttree, face_objs);
                    UnfoldTestUtils.GraphHasCorrectNumberOfTreeEdges(5, casttree);
                    UnfoldTestUtils.AssertAllFinishingTimesSet(graph);

                    var sccs = GraphUtilities.TarjansAlgo <EdgeLikeEntity, FaceLikeEntity> .CycleDetect(casttree, GraphUtilities.EdgeType.Tree);

                    UnfoldTestUtils.IsAcylic <EdgeLikeEntity, FaceLikeEntity>(sccs, casttree);

                    foreach (IDisposable item in graph)
                    {
                        Console.WriteLine("disposing a graphnode");
                        item.Dispose();
                    }


                    foreach (IDisposable item in faces)
                    {
                        Console.WriteLine("disposing a face");
                        item.Dispose();
                    }

                    foreach (IDisposable item in casttree)
                    {
                        Console.WriteLine("disposing a face");
                        item.Dispose();
                    }
                }
            }