// ------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool Xbim.CodeGeneration 
//  
//     Changes to this file may cause incorrect behaviour and will be lost if
//     the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------

using Xbim.Ifc4.Interfaces;
using System.Collections.Generic;
using System.Linq;
using Xbim.Common;

//## Custom using statements
//##

// ReSharper disable once CheckNamespace
namespace Xbim.Ifc4x3.ConstraintResource
{
	public partial class @IfcObjective : IIfcObjective
	{

		[CrossSchemaAttribute(typeof(IIfcObjective), 8)]
		IItemSet<IIfcConstraint> IIfcObjective.BenchmarkValues 
		{ 
			get
			{
			
				return new Common.Collections.ProxyItemSet<IfcConstraint, IIfcConstraint>(BenchmarkValues);
			} 
		}

		[CrossSchemaAttribute(typeof(IIfcObjective), 9)]
		Ifc4.Interfaces.IfcLogicalOperatorEnum? IIfcObjective.LogicalAggregator 
		{ 
			get
			{
				//## Custom code to handle enumeration of LogicalAggregator
				//##
				switch (LogicalAggregator)
				{
					case IfcLogicalOperatorEnum.LOGICALAND:
						return Ifc4.Interfaces.IfcLogicalOperatorEnum.LOGICALAND;
					case IfcLogicalOperatorEnum.LOGICALNOTAND:
						return Ifc4.Interfaces.IfcLogicalOperatorEnum.LOGICALNOTAND;
					case IfcLogicalOperatorEnum.LOGICALNOTOR:
						return Ifc4.Interfaces.IfcLogicalOperatorEnum.LOGICALNOTOR;
					case IfcLogicalOperatorEnum.LOGICALOR:
						return Ifc4.Interfaces.IfcLogicalOperatorEnum.LOGICALOR;
					case IfcLogicalOperatorEnum.LOGICALXOR:
						return Ifc4.Interfaces.IfcLogicalOperatorEnum.LOGICALXOR;
					case null: 
						return null;
					
					default:
						throw new System.ArgumentOutOfRangeException();
				}
			} 
			set
			{
				//## Custom code to handle setting of enumeration of LogicalAggregator
				//##
				switch (value)
				{
					case Ifc4.Interfaces.IfcLogicalOperatorEnum.LOGICALAND:
						LogicalAggregator = IfcLogicalOperatorEnum.LOGICALAND;
						return;
					case Ifc4.Interfaces.IfcLogicalOperatorEnum.LOGICALOR:
						LogicalAggregator = IfcLogicalOperatorEnum.LOGICALOR;
						return;
					case Ifc4.Interfaces.IfcLogicalOperatorEnum.LOGICALXOR:
						LogicalAggregator = IfcLogicalOperatorEnum.LOGICALXOR;
						return;
					case Ifc4.Interfaces.IfcLogicalOperatorEnum.LOGICALNOTAND:
						LogicalAggregator = IfcLogicalOperatorEnum.LOGICALNOTAND;
						return;
					case Ifc4.Interfaces.IfcLogicalOperatorEnum.LOGICALNOTOR:
						LogicalAggregator = IfcLogicalOperatorEnum.LOGICALNOTOR;
						return;
					
					case null:
						LogicalAggregator = null;
						return;
					default:
						throw new System.ArgumentOutOfRangeException();
				}
				
			}
		}

		[CrossSchemaAttribute(typeof(IIfcObjective), 10)]
		Ifc4.Interfaces.IfcObjectiveEnum IIfcObjective.ObjectiveQualifier 
		{ 
			get
			{
				//## Custom code to handle enumeration of ObjectiveQualifier
				//##
				switch (ObjectiveQualifier)
				{
					case IfcObjectiveEnum.CODECOMPLIANCE:
						return Ifc4.Interfaces.IfcObjectiveEnum.CODECOMPLIANCE;
					case IfcObjectiveEnum.CODEWAIVER:
						return Ifc4.Interfaces.IfcObjectiveEnum.CODEWAIVER;
					case IfcObjectiveEnum.DESIGNINTENT:
						return Ifc4.Interfaces.IfcObjectiveEnum.DESIGNINTENT;
					case IfcObjectiveEnum.EXTERNAL:
						return Ifc4.Interfaces.IfcObjectiveEnum.EXTERNAL;
					case IfcObjectiveEnum.HEALTHANDSAFETY:
						return Ifc4.Interfaces.IfcObjectiveEnum.HEALTHANDSAFETY;
					case IfcObjectiveEnum.MERGECONFLICT:
						return Ifc4.Interfaces.IfcObjectiveEnum.MERGECONFLICT;
					case IfcObjectiveEnum.MODELVIEW:
						return Ifc4.Interfaces.IfcObjectiveEnum.MODELVIEW;
					case IfcObjectiveEnum.PARAMETER:
						return Ifc4.Interfaces.IfcObjectiveEnum.PARAMETER;
					case IfcObjectiveEnum.REQUIREMENT:
						return Ifc4.Interfaces.IfcObjectiveEnum.REQUIREMENT;
					case IfcObjectiveEnum.SPECIFICATION:
						return Ifc4.Interfaces.IfcObjectiveEnum.SPECIFICATION;
					case IfcObjectiveEnum.TRIGGERCONDITION:
						return Ifc4.Interfaces.IfcObjectiveEnum.TRIGGERCONDITION;
					case IfcObjectiveEnum.USERDEFINED:
						//## Optional custom handling of ObjectiveQualifier == .USERDEFINED. 
						//##
						return Ifc4.Interfaces.IfcObjectiveEnum.USERDEFINED;
					case IfcObjectiveEnum.NOTDEFINED:
						return Ifc4.Interfaces.IfcObjectiveEnum.NOTDEFINED;
					
					default:
						throw new System.ArgumentOutOfRangeException();
				}
			} 
			set
			{
				//## Custom code to handle setting of enumeration of ObjectiveQualifier
				//##
				switch (value)
				{
					case Ifc4.Interfaces.IfcObjectiveEnum.CODECOMPLIANCE:
						ObjectiveQualifier = IfcObjectiveEnum.CODECOMPLIANCE;
						return;
					case Ifc4.Interfaces.IfcObjectiveEnum.CODEWAIVER:
						ObjectiveQualifier = IfcObjectiveEnum.CODEWAIVER;
						return;
					case Ifc4.Interfaces.IfcObjectiveEnum.DESIGNINTENT:
						ObjectiveQualifier = IfcObjectiveEnum.DESIGNINTENT;
						return;
					case Ifc4.Interfaces.IfcObjectiveEnum.EXTERNAL:
						ObjectiveQualifier = IfcObjectiveEnum.EXTERNAL;
						return;
					case Ifc4.Interfaces.IfcObjectiveEnum.HEALTHANDSAFETY:
						ObjectiveQualifier = IfcObjectiveEnum.HEALTHANDSAFETY;
						return;
					case Ifc4.Interfaces.IfcObjectiveEnum.MERGECONFLICT:
						ObjectiveQualifier = IfcObjectiveEnum.MERGECONFLICT;
						return;
					case Ifc4.Interfaces.IfcObjectiveEnum.MODELVIEW:
						ObjectiveQualifier = IfcObjectiveEnum.MODELVIEW;
						return;
					case Ifc4.Interfaces.IfcObjectiveEnum.PARAMETER:
						ObjectiveQualifier = IfcObjectiveEnum.PARAMETER;
						return;
					case Ifc4.Interfaces.IfcObjectiveEnum.REQUIREMENT:
						ObjectiveQualifier = IfcObjectiveEnum.REQUIREMENT;
						return;
					case Ifc4.Interfaces.IfcObjectiveEnum.SPECIFICATION:
						ObjectiveQualifier = IfcObjectiveEnum.SPECIFICATION;
						return;
					case Ifc4.Interfaces.IfcObjectiveEnum.TRIGGERCONDITION:
						ObjectiveQualifier = IfcObjectiveEnum.TRIGGERCONDITION;
						return;
					case Ifc4.Interfaces.IfcObjectiveEnum.USERDEFINED:
						ObjectiveQualifier = IfcObjectiveEnum.USERDEFINED;
						return;
					case Ifc4.Interfaces.IfcObjectiveEnum.NOTDEFINED:
						ObjectiveQualifier = IfcObjectiveEnum.NOTDEFINED;
						return;
					default:
						throw new System.ArgumentOutOfRangeException();
				}
				
			}
		}

		[CrossSchemaAttribute(typeof(IIfcObjective), 11)]
		Ifc4.MeasureResource.IfcLabel? IIfcObjective.UserDefinedQualifier 
		{ 
			get
			{
				if (!UserDefinedQualifier.HasValue) return null;
				return new Ifc4.MeasureResource.IfcLabel(UserDefinedQualifier.Value);
			} 
			set
			{
				UserDefinedQualifier = value.HasValue ? 
					new MeasureResource.IfcLabel(value.Value) :  
					 new MeasureResource.IfcLabel?() ;
				
			}
		}
	//## Custom code
	//##
	}
}