public override IModel Create(XbimSchemaVersion ifcVersion, XbimStoreType storageType) { var factory = GetFactory(ifcVersion); if (storageType == XbimStoreType.EsentDatabase) { return(EsentModel.CreateTemporaryModel(factory)); } throw new NotSupportedException($"{storageType} is not a supported Storage Type"); }
/// <summary> /// Creates a new model store, with the consumer choosing the implementation /// </summary> /// <param name="ifcVersion"></param> /// <param name="storageType"></param> /// <returns></returns> public override IModel Create(XbimSchemaVersion ifcVersion, XbimStoreType storageType) { var factory = GetFactory(ifcVersion); if (storageType == XbimStoreType.EsentDatabase) { return(EsentModel.CreateTemporaryModel(factory)); } return(new MemoryModel(factory)); }
/// <summary> /// Creat the federated file /// </summary> /// <param name="author">Author name</param> /// <param name="organisation">Orgsnisation Name</param> /// <param name="prjName">Project Name</param> /// <param name="ifcVersion">Ifc schema version</param> /// <param name="storage">Type of xbim file store</param> public void Create(string author, string organisation, string prjName = null, IfcSchemaVersion ifcVersion = IfcSchemaVersion.Ifc4, XbimStoreType storage = XbimStoreType.InMemoryModel ) { var creds = new XbimEditorCredentials { ApplicationIdentifier = "xBIM", ApplicationDevelopersName = "xBIM Team", EditorsFamilyName = author, EditorsOrganisationName = organisation, ApplicationVersion = "1.0" }; _fedModel = IfcStore.Create(creds, ifcVersion, storage); //create in memory using (var txn = _fedModel.BeginTransaction()) { var project = _fedModel.Instances.New <IfcProject>(); project.Name = prjName ?? "Undefined"; txn.Commit(); } }
/// <summary> /// Constructor used to create a new model for edit /// </summary> /// <param name="storageType"></param> /// <param name="ifcVersion"></param> /// <param name="editorDetails"></param> protected IfcStore(XbimStoreType storageType, XbimSchemaVersion ifcVersion, XbimEditorCredentials editorDetails) : this() { var model = ModelProvider.Create(ifcVersion, storageType); AssignModel(model, editorDetails, ifcVersion); }
public static IfcStore Create(XbimSchemaVersion ifcVersion, XbimStoreType storageType) { return(new IfcStore(storageType, ifcVersion, null)); }
public static IfcStore Create(XbimEditorCredentials editorDetails, XbimSchemaVersion ifcVersion, XbimStoreType storageType) { return(new IfcStore(storageType, ifcVersion, editorDetails)); }
public override IModel Create(XbimSchemaVersion ifcVersion, XbimStoreType storageType) { var factory = GetFactory(ifcVersion); return(new MemoryModel(factory)); }
public abstract IModel Create(XbimSchemaVersion ifcVersion, XbimStoreType storageType);