protected IFCImportOptions(IDictionary <String, String> options) { string intent = GetNamedStringOption(options, "Intent"); if (!string.IsNullOrWhiteSpace(intent)) { IFCImportIntent intentTemp; if (!Enum.TryParse <IFCImportIntent>(intent, out intentTemp)) { intentTemp = IFCImportIntent.Reference; } Intent = intentTemp; } string action = GetNamedStringOption(options, "Action"); if (!string.IsNullOrWhiteSpace(action)) { IFCImportAction actionTemp; if (!Enum.TryParse <IFCImportAction>(action, out actionTemp)) { actionTemp = IFCImportAction.Open; } Action = actionTemp; } bool?process3DGeometry = GetNamedBooleanOption(options, "Process3DGeometry"); if (process3DGeometry.HasValue) { Process3DGeometry = process3DGeometry.Value; } // We have two Boolean options that control how we process bounding box geometry. They work together as follows: // 1. AlwaysProcessBoundingBoxGeometry set to true: always import the bounding box geometry. // 2. If AlwaysProcessBoundingBoxGeometry is not set, or set to false: // 2a. If ProcessBoundingBoxGeometry is not set or set to true, import the bounding box geometry if there is no other representation available. // 2b. If ProcessBoundingBoxGeometry is set to false, completely ignore the bounding box geometry. bool?processBoundingBoxGeometry = GetNamedBooleanOption(options, "ProcessBoundingBoxGeometry"); bool?alwaysProcessBoundingBoxGeometry = GetNamedBooleanOption(options, "AlwaysProcessBoundingBoxGeometry"); if (alwaysProcessBoundingBoxGeometry.HasValue && alwaysProcessBoundingBoxGeometry.Value) { ProcessBoundingBoxGeometry = IFCProcessBBoxOptions.Always; } else if (processBoundingBoxGeometry.HasValue) { ProcessBoundingBoxGeometry = processBoundingBoxGeometry.Value ? IFCProcessBBoxOptions.NoOtherGeometry : IFCProcessBBoxOptions.Never; } else { ProcessBoundingBoxGeometry = IFCProcessBBoxOptions.NoOtherGeometry; } // The following 2 options control whether containers will get a copy of the geometry of its contained parts. We have two options, // one for Zones, and one for generic containers. These are currently API-only options. bool?createDuplicateZoneGeometry = GetNamedBooleanOption(options, "CreateDuplicateZoneGeometry"); if (createDuplicateZoneGeometry.HasValue) { CreateDuplicateZoneGeometry = createDuplicateZoneGeometry.Value; } bool?createDuplicateContainerGeometry = GetNamedBooleanOption(options, "CreateDuplicateContainerGeometry"); if (createDuplicateContainerGeometry.HasValue) { CreateDuplicateContainerGeometry = createDuplicateContainerGeometry.Value; } bool?verboseLogging = GetNamedBooleanOption(options, "VerboseLogging"); if (verboseLogging.HasValue) { VerboseLogging = verboseLogging.Value; } bool?forceImport = GetNamedBooleanOption(options, "ForceImport"); if (forceImport.HasValue) { ForceImport = forceImport.Value; } bool?createLinkInstanceOnly = GetNamedBooleanOption(options, "CreateLinkInstanceOnly"); if (createLinkInstanceOnly.HasValue) { CreateLinkInstanceOnly = createLinkInstanceOnly.Value; } string revitLinkFileName = GetNamedStringOption(options, "RevitLinkFileName"); if (!string.IsNullOrWhiteSpace(revitLinkFileName)) { RevitLinkFileName = revitLinkFileName; } Int64?fileSize = GetNamedInt64Option(options, "FileSize", false); if (fileSize.HasValue) { OriginalFileSize = fileSize.Value; } Int64?timestamp = GetNamedInt64Option(options, "FileModifiedTime", true); if (timestamp.HasValue) { OriginalTimeStamp = OriginalTimeStamp.AddSeconds(timestamp.Value); } }
protected IFCImportOptions(IDictionary<String, String> options) { string intent = GetNamedStringOption(options, "Intent"); if (!string.IsNullOrWhiteSpace(intent)) { IFCImportIntent intentTemp; if (!Enum.TryParse<IFCImportIntent>(intent, out intentTemp)) intentTemp = IFCImportIntent.Reference; Intent = intentTemp; } string action = GetNamedStringOption(options, "Action"); if (!string.IsNullOrWhiteSpace(action)) { IFCImportAction actionTemp; if (!Enum.TryParse<IFCImportAction>(action, out actionTemp)) actionTemp = IFCImportAction.Open; Action = actionTemp; } bool? process3DGeometry = GetNamedBooleanOption(options, "Process3DGeometry"); if (process3DGeometry.HasValue) Process3DGeometry = process3DGeometry.Value; bool? processBoundingBoxGeometry = GetNamedBooleanOption(options, "ProcessBoundingBoxGeometry"); if (processBoundingBoxGeometry.HasValue) ProcessBoundingBoxGeometry = processBoundingBoxGeometry.Value; bool? verboseLogging = GetNamedBooleanOption(options, "VerboseLogging"); if (verboseLogging.HasValue) VerboseLogging = verboseLogging.Value; bool? forceImport = GetNamedBooleanOption(options, "ForceImport"); if (forceImport.HasValue) ForceImport = forceImport.Value; bool? createLinkInstanceOnly = GetNamedBooleanOption(options, "CreateLinkInstanceOnly"); if (createLinkInstanceOnly.HasValue) CreateLinkInstanceOnly = createLinkInstanceOnly.Value; string revitLinkFileName = GetNamedStringOption(options, "RevitLinkFileName"); if (!string.IsNullOrWhiteSpace(revitLinkFileName)) RevitLinkFileName = revitLinkFileName; Int64? fileSize = GetNamedInt64Option(options, "FileSize", false); if (fileSize.HasValue) OriginalFileSize = fileSize.Value; Int64? timestamp = GetNamedInt64Option(options, "FileModifiedTime", true); if (timestamp.HasValue) OriginalTimeStamp = OriginalTimeStamp.AddSeconds(timestamp.Value); }
protected IFCImportOptions(IDictionary <String, String> options) { // "Intent": covers what the import operation is intended to create. // The two options are: // "Reference": create lightweight objects intended to be used for reference only. // This is the option supported by Link IFC. // "Parametric": attempt to create intelligent objects that can be maximally flexible. // This option is still supported only by internal Open IFC code. string intent = OptionsUtil.GetNamedStringOption(options, "Intent"); if (!string.IsNullOrWhiteSpace(intent)) { IFCImportIntent intentTemp; if (!Enum.TryParse <IFCImportIntent>(intent, out intentTemp)) { intentTemp = IFCImportIntent.Reference; } Intent = intentTemp; } // "Action": covers how the data is intended to be stored. // Options: // "Open": Create a new file with the data in it. // "Link": Create a new file with the data in it, and then link that into an existing document. string action = OptionsUtil.GetNamedStringOption(options, "Action"); if (!string.IsNullOrWhiteSpace(action)) { IFCImportAction actionTemp; if (!Enum.TryParse <IFCImportAction>(action, out actionTemp)) { actionTemp = IFCImportAction.Open; } Action = actionTemp; } // We have two Boolean options that control how we process bounding box geometry. They work together as follows: // 1. AlwaysProcessBoundingBoxGeometry set to true: always import the bounding box geometry. // 2. If AlwaysProcessBoundingBoxGeometry is not set, or set to false: // 2a. If ProcessBoundingBoxGeometry is not set or set to true, import the bounding box geometry if there is no other representation available. // 2b. If ProcessBoundingBoxGeometry is set to false, completely ignore the bounding box geometry. bool?processBoundingBoxGeometry = OptionsUtil.GetNamedBooleanOption(options, "ProcessBoundingBoxGeometry"); bool?alwaysProcessBoundingBoxGeometry = OptionsUtil.GetNamedBooleanOption(options, "AlwaysProcessBoundingBoxGeometry"); if (alwaysProcessBoundingBoxGeometry.HasValue && alwaysProcessBoundingBoxGeometry.Value) { ProcessBoundingBoxGeometry = IFCProcessBBoxOptions.Always; } else if (processBoundingBoxGeometry.HasValue) { ProcessBoundingBoxGeometry = processBoundingBoxGeometry.Value ? IFCProcessBBoxOptions.NoOtherGeometry : IFCProcessBBoxOptions.Never; } else { ProcessBoundingBoxGeometry = IFCProcessBBoxOptions.NoOtherGeometry; } // The following 2 options control whether containers will get a copy of the geometry of its contained parts. We have two options, // one for Zones, and one for generic containers. These are currently API-only options. bool?createDuplicateZoneGeometry = OptionsUtil.GetNamedBooleanOption(options, "CreateDuplicateZoneGeometry"); if (createDuplicateZoneGeometry.HasValue) { CreateDuplicateZoneGeometry = createDuplicateZoneGeometry.Value; } bool?createDuplicateContainerGeometry = OptionsUtil.GetNamedBooleanOption(options, "CreateDuplicateContainerGeometry"); if (createDuplicateContainerGeometry.HasValue) { CreateDuplicateContainerGeometry = createDuplicateContainerGeometry.Value; } bool?useStreamlinedOptions = OptionsUtil.GetNamedBooleanOption(options, "UseStreamlinedOptions"); if (useStreamlinedOptions.HasValue) { UseStreamlinedOptions = useStreamlinedOptions.Value; } bool?disableLogging = OptionsUtil.GetNamedBooleanOption(options, "DisableLogging"); if (disableLogging.HasValue) { DisableLogging = disableLogging.Value; } bool?verboseLogging = OptionsUtil.GetNamedBooleanOption(options, "VerboseLogging"); if (verboseLogging.HasValue) { VerboseLogging = verboseLogging.Value; } bool?forceImport = OptionsUtil.GetNamedBooleanOption(options, "ForceImport"); if (forceImport.HasValue) { ForceImport = forceImport.Value; } bool?createLinkInstanceOnly = OptionsUtil.GetNamedBooleanOption(options, "CreateLinkInstanceOnly"); if (createLinkInstanceOnly.HasValue) { CreateLinkInstanceOnly = createLinkInstanceOnly.Value; } string revitLinkFileName = OptionsUtil.GetNamedStringOption(options, "RevitLinkFileName"); if (!string.IsNullOrWhiteSpace(revitLinkFileName)) { RevitLinkFileName = revitLinkFileName; } Int64?fileSize = OptionsUtil.GetNamedInt64Option(options, "FileSize", false); if (fileSize.HasValue) { OriginalFileSize = fileSize.Value; } Int64?timestamp = OptionsUtil.GetNamedInt64Option(options, "FileModifiedTime", true); if (timestamp.HasValue) { OriginalTimeStamp = OriginalTimeStamp.AddSeconds(timestamp.Value); } }
protected IFCImportOptions(IDictionary <String, String> options) { string intent = GetNamedStringOption(options, "Intent"); if (!string.IsNullOrWhiteSpace(intent)) { IFCImportIntent intentTemp; if (!Enum.TryParse <IFCImportIntent>(intent, out intentTemp)) { intentTemp = IFCImportIntent.Reference; } Intent = intentTemp; } string action = GetNamedStringOption(options, "Action"); if (!string.IsNullOrWhiteSpace(action)) { IFCImportAction actionTemp; if (!Enum.TryParse <IFCImportAction>(action, out actionTemp)) { actionTemp = IFCImportAction.Open; } Action = actionTemp; } bool?process3DGeometry = GetNamedBooleanOption(options, "Process3DGeometry"); if (process3DGeometry.HasValue) { Process3DGeometry = process3DGeometry.Value; } bool?processBoundingBoxGeometry = GetNamedBooleanOption(options, "ProcessBoundingBoxGeometry"); if (processBoundingBoxGeometry.HasValue) { ProcessBoundingBoxGeometry = processBoundingBoxGeometry.Value; } bool?verboseLogging = GetNamedBooleanOption(options, "VerboseLogging"); if (verboseLogging.HasValue) { VerboseLogging = verboseLogging.Value; } bool?forceImport = GetNamedBooleanOption(options, "ForceImport"); if (forceImport.HasValue) { ForceImport = forceImport.Value; } bool?createLinkInstanceOnly = GetNamedBooleanOption(options, "CreateLinkInstanceOnly"); if (createLinkInstanceOnly.HasValue) { CreateLinkInstanceOnly = createLinkInstanceOnly.Value; } string revitLinkFileName = GetNamedStringOption(options, "RevitLinkFileName"); if (!string.IsNullOrWhiteSpace(revitLinkFileName)) { RevitLinkFileName = revitLinkFileName; } Int64?fileSize = GetNamedInt64Option(options, "FileSize", false); if (fileSize.HasValue) { OriginalFileSize = fileSize.Value; } Int64?timestamp = GetNamedInt64Option(options, "FileModifiedTime", true); if (timestamp.HasValue) { OriginalTimeStamp = OriginalTimeStamp.AddSeconds(timestamp.Value); } }