Пример #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);
        }
Пример #2
0
        /*
         * Fetches output path, using the GetPath method.
         * Also has handling for when a output file of that name already exists.
         */
        public static string GetOutputPath(string relativeOutputPath)
        {
            string outputFilePath = ArgParser.GetPath(relativeOutputPath);

            if (File.Exists(outputFilePath))
            {
                throw new ArgumentException("Output file " + outputFilePath + " already exists. System exit.");
            }
            return(outputFilePath);
        }
Пример #3
0
        /*
         * Fetches input path, using the GetPath method.
         * Also has handling for when a input file is not found.
         */
        public static string GetInputPath(string relativeInputPath)
        {
            string inputPath = ArgParser.GetPath(relativeInputPath);

            if (File.Exists(inputPath))
            {
                return(inputPath);
            }
            else
            {
                throw new ArgumentException("file " + inputPath + " does not exist. System exit");
            }
        }