static void Main(string[] args) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); var clientId = Properties.Settings.Default.ClientId; if (string.IsNullOrWhiteSpace(clientId) == false) { LicenseService.Activate(clientId, @"Inspector"); } string filePath; if (args.Length > 0) { filePath = Path.GetFullPath(args[0]); } else { var dialog = new OpenFileDialog(); dialog.CheckPathExists = true; dialog.Title = @"Select Svf Model File"; dialog.Filter = @"Autodesk Forge 3D Model|*.svf;*.svfzip|All Files|*.*"; dialog.Multiselect = false; if (dialog.ShowDialog() != DialogResult.OK) { return; } filePath = dialog.FileName; } try { using (new ProgressHelper(@"Loading ...")) { var svf = filePath.EndsWith(@"zip") ? SvfDatabase.LoadFromZipFile(filePath) : SvfDatabase.LoadFromSvfFile(filePath); Application.Run(new FormApp(svf, filePath)); } } catch (Exception e) { MessageBox.Show(e.Message, @"Exception", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private TreeNode LoadNode(TreeNodeCollection treeNodes, SvfDatabase reader, SvfNode propNode, int depth) { //var treeNode = new TreeNode($"([{nodeId}]{propNode.Category}) {propNode.Name}"); var treeNode = new TreeNode($"{propNode.Name}"); treeNode.Tag = propNode; foreach (var childNode in propNode.Children) { LoadNode(treeNode.Nodes, reader, childNode, depth++); } treeNodes.Add(treeNode); return(treeNode); }
static void Main(string[] args) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); string filePath; if (args.Length > 0) { filePath = Path.GetFullPath(args[0]); } else { var dialog = new OpenFileDialog(); dialog.CheckPathExists = true; dialog.Title = @"Select Svf Model File"; dialog.Filter = @"Autodesk Forge 3D Model|*.svf;*.svfzip|All Files|*.*"; dialog.Multiselect = false; if (dialog.ShowDialog() != DialogResult.OK) { return; } filePath = dialog.FileName; } try { using (new ProgressHelper(null, @"Loading ...")) { using (var svfDb = SvfDatabase.LoadFrom(filePath)) { Application.Run(new FormApp(svfDb, filePath)); } } } catch (Exception e) { MessageBox.Show(e.Message, @"Exception", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
public FormApp(SvfDatabase svfDb, string svfFilePath) : this() { _SvfDb = svfDb ?? throw new ArgumentNullException(nameof(svfDb)); _SvfFilePath = svfFilePath ?? throw new ArgumentNullException(nameof(svfFilePath)); }