Beispiel #1
0
        private void ExportToGltf(JobConfig config, RuntimeLog log, Action <int> progressCallback)
        {
            var features = new Dictionary <Common.Formats.Gltf.FeatureType, bool>();
            var options  = config.OutputOptions;

            if (options != null && options.Count > 0)
            {
                foreach (var option in options)
                {
                    if (Enum.TryParse(option, true, out Common.Formats.Gltf.FeatureType result))
                    {
                        features[result] = true;
                    }
                }
            }

            var setting = new Bimangle.ForgeEngine.Common.Formats.Gltf.Navisworks.ExportSetting();

            setting.OutputPath = config.OutputPath;
            setting.Features   = features?.Where(x => x.Value).Select(x => x.Key).ToList();

#if EXPRESS
            var exporter = new Bimangle.ForgeEngine.Navisworks.Express.Gltf.Exporter(App.GetHomePath());
#else
            var exporter = new Bimangle.ForgeEngine.Navisworks.Pro.Gltf.Exporter(App.GetHomePath());
#endif
            exporter.Export(setting, log, progressCallback, CancellationToken.None);
        }
Beispiel #2
0
 /// <summary>
 /// 开始导出
 /// </summary>
 /// <param name="setting"></param>
 /// <param name="progressCallback"></param>
 /// <param name="cancellationToken"></param>
 private void StartExport(ExportSetting setting, Action <int> progressCallback, CancellationToken cancellationToken)
 {
     using (var log = new RuntimeLog())
     {
         var exporter = new ExporterX(App.GetHomePath());
         exporter.Export(setting, log, progressCallback, cancellationToken);
     }
 }
Beispiel #3
0
 /// <summary>
 /// 开始导出
 /// </summary>
 /// <param name="localConfig"></param>
 /// <param name="features"></param>
 /// <param name="progressCallback"></param>
 /// <param name="cancellationToken"></param>
 private void StartExport(AppConfigGltf localConfig, Dictionary <FeatureType, bool> features, Action <int> progressCallback, CancellationToken cancellationToken)
 {
     using (var log = new RuntimeLog())
     {
         var featureList = features?.Where(x => x.Value).Select(x => x.Key).ToList() ?? new List <FeatureType>();
         var exporter    = new ExporterX(App.GetHomePath());
         exporter.Export(localConfig.LastTargetPath, featureList, log, progressCallback, cancellationToken);
     }
 }