// ------------------------------------------------------------------------------
// <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.GeometricModelResource
{
	public partial class @IfcBooleanResult : IIfcBooleanResult
	{

		[CrossSchemaAttribute(typeof(IIfcBooleanResult), 1)]
		Ifc4.Interfaces.IfcBooleanOperator IIfcBooleanResult.Operator 
		{ 
			get
			{
				//## Custom code to handle enumeration of Operator
				//##
				switch (Operator)
				{
					case IfcBooleanOperator.DIFFERENCE:
						return Ifc4.Interfaces.IfcBooleanOperator.DIFFERENCE;
					case IfcBooleanOperator.INTERSECTION:
						return Ifc4.Interfaces.IfcBooleanOperator.INTERSECTION;
					case IfcBooleanOperator.UNION:
						return Ifc4.Interfaces.IfcBooleanOperator.UNION;
					
					default:
						throw new System.ArgumentOutOfRangeException();
				}
			} 
			set
			{
				//## Custom code to handle setting of enumeration of Operator
				//##
				switch (value)
				{
					case Ifc4.Interfaces.IfcBooleanOperator.UNION:
						Operator = IfcBooleanOperator.UNION;
						return;
					case Ifc4.Interfaces.IfcBooleanOperator.INTERSECTION:
						Operator = IfcBooleanOperator.INTERSECTION;
						return;
					case Ifc4.Interfaces.IfcBooleanOperator.DIFFERENCE:
						Operator = IfcBooleanOperator.DIFFERENCE;
						return;
					default:
						throw new System.ArgumentOutOfRangeException();
				}
				
			}
		}

		[CrossSchemaAttribute(typeof(IIfcBooleanResult), 2)]
		IIfcBooleanOperand IIfcBooleanResult.FirstOperand 
		{ 
			get
			{
				if (FirstOperand == null) return null;
				var ifcbooleanresult = FirstOperand as IfcBooleanResult;
				if (ifcbooleanresult != null) 
					return ifcbooleanresult;
				var ifccsgprimitive3d = FirstOperand as IfcCsgPrimitive3D;
				if (ifccsgprimitive3d != null) 
					return ifccsgprimitive3d;
				var ifchalfspacesolid = FirstOperand as IfcHalfSpaceSolid;
				if (ifchalfspacesolid != null) 
					return ifchalfspacesolid;
				var ifcsolidmodel = FirstOperand as IfcSolidModel;
				if (ifcsolidmodel != null) 
					return ifcsolidmodel;
				var ifctessellatedfaceset = FirstOperand as IfcTessellatedFaceSet;
				if (ifctessellatedfaceset != null) 
					return ifctessellatedfaceset;
				return null;
			} 
			set
			{
				if (value == null)
				{
					FirstOperand = null;
					return;
				}	
				var ifcbooleanresult = value as IfcBooleanResult;
				if (ifcbooleanresult != null) 
				{
					FirstOperand = ifcbooleanresult;
					return;
				}
				var ifccsgprimitive3d = value as IfcCsgPrimitive3D;
				if (ifccsgprimitive3d != null) 
				{
					FirstOperand = ifccsgprimitive3d;
					return;
				}
				var ifchalfspacesolid = value as IfcHalfSpaceSolid;
				if (ifchalfspacesolid != null) 
				{
					FirstOperand = ifchalfspacesolid;
					return;
				}
				var ifcsolidmodel = value as IfcSolidModel;
				if (ifcsolidmodel != null) 
				{
					FirstOperand = ifcsolidmodel;
					return;
				}
				var ifctessellatedfaceset = value as IfcTessellatedFaceSet;
				if (ifctessellatedfaceset != null) 
				{
					FirstOperand = ifctessellatedfaceset;
					return;
				}
				
			}
		}

		[CrossSchemaAttribute(typeof(IIfcBooleanResult), 3)]
		IIfcBooleanOperand IIfcBooleanResult.SecondOperand 
		{ 
			get
			{
				if (SecondOperand == null) return null;
				var ifcbooleanresult = SecondOperand as IfcBooleanResult;
				if (ifcbooleanresult != null) 
					return ifcbooleanresult;
				var ifccsgprimitive3d = SecondOperand as IfcCsgPrimitive3D;
				if (ifccsgprimitive3d != null) 
					return ifccsgprimitive3d;
				var ifchalfspacesolid = SecondOperand as IfcHalfSpaceSolid;
				if (ifchalfspacesolid != null) 
					return ifchalfspacesolid;
				var ifcsolidmodel = SecondOperand as IfcSolidModel;
				if (ifcsolidmodel != null) 
					return ifcsolidmodel;
				var ifctessellatedfaceset = SecondOperand as IfcTessellatedFaceSet;
				if (ifctessellatedfaceset != null) 
					return ifctessellatedfaceset;
				return null;
			} 
			set
			{
				if (value == null)
				{
					SecondOperand = null;
					return;
				}	
				var ifcbooleanresult = value as IfcBooleanResult;
				if (ifcbooleanresult != null) 
				{
					SecondOperand = ifcbooleanresult;
					return;
				}
				var ifccsgprimitive3d = value as IfcCsgPrimitive3D;
				if (ifccsgprimitive3d != null) 
				{
					SecondOperand = ifccsgprimitive3d;
					return;
				}
				var ifchalfspacesolid = value as IfcHalfSpaceSolid;
				if (ifchalfspacesolid != null) 
				{
					SecondOperand = ifchalfspacesolid;
					return;
				}
				var ifcsolidmodel = value as IfcSolidModel;
				if (ifcsolidmodel != null) 
				{
					SecondOperand = ifcsolidmodel;
					return;
				}
				var ifctessellatedfaceset = value as IfcTessellatedFaceSet;
				if (ifctessellatedfaceset != null) 
				{
					SecondOperand = ifctessellatedfaceset;
					return;
				}
				
			}
		}
		Ifc4.GeometryResource.IfcDimensionCount Ifc4.GeometricModelResource.IfcBooleanOperand.Dim 
		{
			get 
			{
				return new Ifc4.GeometryResource.IfcDimensionCount(Dim);
			}
		}

	//## Custom code
	//##
	}
}