private static void ProcessArgs(string [] args, ModelViewer modelViewer)
 {
     for (int i = 0; i < args.Length; ++i) {
         switch (args[i])
         {
             case "--mesh_file":
                 modelViewer.InitialModel = args[++i];
                 break;
             case "--repository_path":
                 modelViewer.RepositoryDirectoryList.Add(args[++i]);
                 break;
             case "--advanced":
                 modelViewer.AdvancedOptions = true;
                 break;
             default:
                 if (modelViewer.InitialModel == null)
                     modelViewer.InitialModel = args[i];
                 break;
         }
     }
 }
 public SetAssetRepositoryDialog(ModelViewer app)
 {
     this.app = app;
     InitializeComponent();
 }
        static void Main(string[] args)
        {
            string initialModel = null;
            if (args.Length > 0)
                initialModel = args[0];
            try
            {
                // Set the current directory to the the directory of the excutable
                String execDir = Application.ExecutablePath.Substring(0, Application.ExecutablePath.LastIndexOf(System.IO.Path.DirectorySeparatorChar));
                Directory.SetCurrentDirectory(execDir);
                // Changes the CurrentCulture of the current thread to the invariant culture.
                Thread.CurrentThread.CurrentCulture = new CultureInfo("", false);

                // Initialize logging
                if (!Directory.Exists(ConfigFolder))
                    Directory.CreateDirectory(ConfigFolder);
                if (!Directory.Exists(LogFolder))
                    Directory.CreateDirectory(LogFolder);
                LogUtil.InitializeLogging(Path.Combine(ConfigFolder, "LogConfig.xml"), "DefaultLogConfig.xml", FallbackLogfile);

                int processor = 1;
                foreach (ProcessThread thread in Process.GetCurrentProcess().Threads)
                {
                    thread.ProcessorAffinity = (IntPtr)processor;
                }

                ModelViewer modelViewer = new ModelViewer();

                string argsString = "";
                foreach (string arg in args)
                {
                    if (argsString.Length == 0)
                        argsString = arg;
                    else
                        argsString = argsString + " " + arg;
                }
                args = ParseArgumentString(argsString);
                ProcessArgs(args, modelViewer);

                modelViewer.Show();
                modelViewer.Start();

            }
            catch (FileNotFoundException ex)
            {
                // try logging the error here first, before Root is disposed of
                LogUtil.ExceptionLog.ErrorFormat("Caught file not found exception for {0}: {1}", ex.FileName, ex);
                throw;
            }
            catch (Exception ex)
            {
                // try logging the error here first, before Root is disposed of
                LogUtil.ExceptionLog.ErrorFormat("Caught exception: {0}", ex);
                throw;
            }
        }
 public BoneDisplay(ModelViewer parent)
     : this()
 {
     modelViewer = parent;
 }