Exemplo n.º 1
0
        static void Main(string[] args)
        {
            FilePaths filePaths = ArgParser.Parse(args);

            AssimpInterpreter interpreter = new AssimpInterpreter();

            Structure structure = interpreter.Interpret(filePaths.inFile);

            NodeGraph nodeGraph = null;

            // Voxel solution.
            if (filePaths.voxelSolution)
            {
                nodeGraph = VoxelGridGraphGenerator.GenerateNodeGraph(structure);
            }
            // Mesh solution.
            else
            {
                List <NodeGraph> nodeGraphs = new List <NodeGraph>();
                for (int i = 0; i < structure.components.Count; i++)
                {
                    NodeGraph n = ComponentGraphGenerator.GenerateComponentNodeGraph(structure.components[i]);
                    nodeGraphs.Add(n);
                }
                nodeGraph = GraphUnifier.UnifyGraphs(nodeGraphs);
            }

            XMLCreator.writeXML(nodeGraph, filePaths.outFile);
        }
Exemplo n.º 2
0
        /*
         * Generates a nodeGraph using the componentNodeGraph + UnifyNodeGraphs strategy.
         */
        static NodeGraph GenerateNodeGraph(Structure structure)
        {
            List <NodeGraph> nodeGraphs = new List <NodeGraph>();

            foreach (Component component in structure.components)
            {
                nodeGraphs.Add(ComponentGraphGenerator.GenerateComponentNodeGraph(component));
            }

            return(GraphUnifier.UnifyGraphs(nodeGraphs));
        }