Example #1
0
        /// <summary>
        /// Imports model(s) from the given source.
        /// </summary>
        /// <param name="source">The source where to load all objects from..</param>
        /// <param name="importOptions">The import options.</param>
        public Task <ImportedModelContainer> ImportAsync(ResourceLink source, ImportOptions importOptions)
        {
            IModelImporter importer = GetImporterBySource(source);

            if (importOptions == null)
            {
                importOptions = importer.CreateDefaultImportOptions();
            }

            // Start the loading task
            return(Task.Factory.StartNew <ImportedModelContainer>(() =>
            {
                return importer.ImportModel(source, importOptions);
            }));
        }
Example #2
0
        /// <summary>
        /// Creates an ImportOptions object by the given source.
        /// </summary>
        /// <param name="fileExtension">The extension of the file to be imported.</param>
        public ImportOptions CreateImportOptionsByFileType(string fileExtension)
        {
            IModelImporter importer = GetImporterByFileType(fileExtension);

            return(importer.CreateDefaultImportOptions());
        }
Example #3
0
        /// <summary>
        /// Creates an ImportOptions object by the given source.
        /// </summary>
        /// <param name="source">The source of the resource.</param>
        public ImportOptions CreateImportOptions(ResourceLink source)
        {
            IModelImporter importer = GetImporterBySource(source);

            return(importer.CreateDefaultImportOptions());
        }