// ------------------------------------------------------------------------------
// <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.GeometryResource
{
	public partial class @IfcCompositeCurveSegment : IIfcCompositeCurveSegment
	{

		[CrossSchemaAttribute(typeof(IIfcCompositeCurveSegment), 1)]
		Ifc4.Interfaces.IfcTransitionCode IIfcCompositeCurveSegment.Transition 
		{ 
			get
			{
				//## Custom code to handle enumeration of Transition
				//##
				switch (Transition)
				{
					case IfcTransitionCode.CONTINUOUS:
						return Ifc4.Interfaces.IfcTransitionCode.CONTINUOUS;
					case IfcTransitionCode.CONTSAMEGRADIENT:
						return Ifc4.Interfaces.IfcTransitionCode.CONTSAMEGRADIENT;
					case IfcTransitionCode.CONTSAMEGRADIENTSAMECURVATURE:
						return Ifc4.Interfaces.IfcTransitionCode.CONTSAMEGRADIENTSAMECURVATURE;
					case IfcTransitionCode.DISCONTINUOUS:
						return Ifc4.Interfaces.IfcTransitionCode.DISCONTINUOUS;
					
					default:
						throw new System.ArgumentOutOfRangeException();
				}
			} 
			set
			{
				//## Custom code to handle setting of enumeration of Transition
				//##
				switch (value)
				{
					case Ifc4.Interfaces.IfcTransitionCode.DISCONTINUOUS:
						Transition = IfcTransitionCode.DISCONTINUOUS;
						return;
					case Ifc4.Interfaces.IfcTransitionCode.CONTINUOUS:
						Transition = IfcTransitionCode.CONTINUOUS;
						return;
					case Ifc4.Interfaces.IfcTransitionCode.CONTSAMEGRADIENT:
						Transition = IfcTransitionCode.CONTSAMEGRADIENT;
						return;
					case Ifc4.Interfaces.IfcTransitionCode.CONTSAMEGRADIENTSAMECURVATURE:
						Transition = IfcTransitionCode.CONTSAMEGRADIENTSAMECURVATURE;
						return;
					default:
						throw new System.ArgumentOutOfRangeException();
				}
				
			}
		}

		[CrossSchemaAttribute(typeof(IIfcCompositeCurveSegment), 2)]
		Ifc4.MeasureResource.IfcBoolean IIfcCompositeCurveSegment.SameSense 
		{ 
			get
			{
				return new Ifc4.MeasureResource.IfcBoolean(SameSense);
			} 
			set
			{
				SameSense = new MeasureResource.IfcBoolean(value);
				
			}
		}

		[CrossSchemaAttribute(typeof(IIfcCompositeCurveSegment), 3)]
		IIfcCurve IIfcCompositeCurveSegment.ParentCurve 
		{ 
			get
			{
				return ParentCurve;
			} 
			set
			{
				ParentCurve = value as IfcCurve;
				
			}
		}
		IEnumerable<IIfcCompositeCurve> IIfcCompositeCurveSegment.UsingCurves 
		{ 
			get
			{
				return Model.Instances.Where<IIfcCompositeCurve>(e => e.Segments != null &&  e.Segments.Contains(this), "Segments", this);
			} 
		}
		Ifc4.GeometryResource.IfcDimensionCount IIfcCompositeCurveSegment.Dim 
		{
			get 
			{
				return new Ifc4.GeometryResource.IfcDimensionCount(Dim);
			}
		}

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