// ------------------------------------------------------------------------------
// <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 @IfcRepresentationMap : IIfcRepresentationMap
	{

		[CrossSchemaAttribute(typeof(IIfcRepresentationMap), 1)]
		IIfcAxis2Placement IIfcRepresentationMap.MappingOrigin 
		{ 
			get
			{
				if (MappingOrigin == null) return null;
				var ifcaxis2placement2d = MappingOrigin as IfcAxis2Placement2D;
				if (ifcaxis2placement2d != null) 
					return ifcaxis2placement2d;
				var ifcaxis2placement3d = MappingOrigin as IfcAxis2Placement3D;
				if (ifcaxis2placement3d != null) 
					return ifcaxis2placement3d;
				return null;
			} 
			set
			{
				if (value == null)
				{
					MappingOrigin = null;
					return;
				}	
				var ifcaxis2placement2d = value as IfcAxis2Placement2D;
				if (ifcaxis2placement2d != null) 
				{
					MappingOrigin = ifcaxis2placement2d;
					return;
				}
				var ifcaxis2placement3d = value as IfcAxis2Placement3D;
				if (ifcaxis2placement3d != null) 
				{
					MappingOrigin = ifcaxis2placement3d;
					return;
				}
				
			}
		}

		[CrossSchemaAttribute(typeof(IIfcRepresentationMap), 2)]
		IIfcRepresentation IIfcRepresentationMap.MappedRepresentation 
		{ 
			get
			{
				return MappedRepresentation;
			} 
			set
			{
				MappedRepresentation = value as RepresentationResource.IfcRepresentation;
				
			}
		}
		IEnumerable<IIfcShapeAspect> IIfcRepresentationMap.HasShapeAspects 
		{ 
			get
			{
				return Model.Instances.Where<IIfcShapeAspect>(e => (e.PartOfProductDefinitionShape as IfcRepresentationMap) == this, "PartOfProductDefinitionShape", this);
			} 
		}
		IEnumerable<IIfcMappedItem> IIfcRepresentationMap.MapUsage 
		{ 
			get
			{
				return Model.Instances.Where<IIfcMappedItem>(e => (e.MappingSource as IfcRepresentationMap) == this, "MappingSource", this);
			} 
		}
	//## Custom code
	//##
	}
}