// ------------------------------------------------------------------------------
// <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.Ifc2x3.MeasureResource;
using System;
using System.Collections.Generic;
using System.Linq;
using Xbim.Common;
using Xbim.Common.Exceptions;
using Xbim.Ifc2x3.ProfilePropertyResource;
//## Custom using statements
//##


namespace Xbim.Ifc2x3.ProfilePropertyResource
{
	[ExpressType("IfcStructuralProfileProperties", 683)]
	// ReSharper disable once PartialTypeWithSinglePart
	public  partial class @IfcStructuralProfileProperties : IfcGeneralProfileProperties, IInstantiableEntity, IContainsEntityReferences, IEquatable<@IfcStructuralProfileProperties>
	{

		//internal constructor makes sure that objects are not created outside of the model/ assembly controlled area
		internal IfcStructuralProfileProperties(IModel model, int label, bool activated) : base(model, label, activated)  
		{
		}

		#region Explicit attribute fields
		private IfcMomentOfInertiaMeasure? _torsionalConstantX;
		private IfcMomentOfInertiaMeasure? _momentOfInertiaYZ;
		private IfcMomentOfInertiaMeasure? _momentOfInertiaY;
		private IfcMomentOfInertiaMeasure? _momentOfInertiaZ;
		private IfcWarpingConstantMeasure? _warpingConstant;
		private IfcLengthMeasure? _shearCentreZ;
		private IfcLengthMeasure? _shearCentreY;
		private IfcAreaMeasure? _shearDeformationAreaZ;
		private IfcAreaMeasure? _shearDeformationAreaY;
		private IfcSectionModulusMeasure? _maximumSectionModulusY;
		private IfcSectionModulusMeasure? _minimumSectionModulusY;
		private IfcSectionModulusMeasure? _maximumSectionModulusZ;
		private IfcSectionModulusMeasure? _minimumSectionModulusZ;
		private IfcSectionModulusMeasure? _torsionalSectionModulus;
		private IfcLengthMeasure? _centreOfGravityInX;
		private IfcLengthMeasure? _centreOfGravityInY;
		#endregion
	
		#region Explicit attribute properties
		[EntityAttribute(8, EntityAttributeState.Optional, EntityAttributeType.None, EntityAttributeType.None, null, null, 8)]
		public IfcMomentOfInertiaMeasure? @TorsionalConstantX 
		{ 
			get 
			{
				if(_activated) return _torsionalConstantX;
				Activate();
				return _torsionalConstantX;
			} 
			set
			{
				SetValue( v =>  _torsionalConstantX = v, _torsionalConstantX, value,  "TorsionalConstantX", 8);
			} 
		}	
		[EntityAttribute(9, EntityAttributeState.Optional, EntityAttributeType.None, EntityAttributeType.None, null, null, 9)]
		public IfcMomentOfInertiaMeasure? @MomentOfInertiaYZ 
		{ 
			get 
			{
				if(_activated) return _momentOfInertiaYZ;
				Activate();
				return _momentOfInertiaYZ;
			} 
			set
			{
				SetValue( v =>  _momentOfInertiaYZ = v, _momentOfInertiaYZ, value,  "MomentOfInertiaYZ", 9);
			} 
		}	
		[EntityAttribute(10, EntityAttributeState.Optional, EntityAttributeType.None, EntityAttributeType.None, null, null, 10)]
		public IfcMomentOfInertiaMeasure? @MomentOfInertiaY 
		{ 
			get 
			{
				if(_activated) return _momentOfInertiaY;
				Activate();
				return _momentOfInertiaY;
			} 
			set
			{
				SetValue( v =>  _momentOfInertiaY = v, _momentOfInertiaY, value,  "MomentOfInertiaY", 10);
			} 
		}	
		[EntityAttribute(11, EntityAttributeState.Optional, EntityAttributeType.None, EntityAttributeType.None, null, null, 11)]
		public IfcMomentOfInertiaMeasure? @MomentOfInertiaZ 
		{ 
			get 
			{
				if(_activated) return _momentOfInertiaZ;
				Activate();
				return _momentOfInertiaZ;
			} 
			set
			{
				SetValue( v =>  _momentOfInertiaZ = v, _momentOfInertiaZ, value,  "MomentOfInertiaZ", 11);
			} 
		}	
		[EntityAttribute(12, EntityAttributeState.Optional, EntityAttributeType.None, EntityAttributeType.None, null, null, 12)]
		public IfcWarpingConstantMeasure? @WarpingConstant 
		{ 
			get 
			{
				if(_activated) return _warpingConstant;
				Activate();
				return _warpingConstant;
			} 
			set
			{
				SetValue( v =>  _warpingConstant = v, _warpingConstant, value,  "WarpingConstant", 12);
			} 
		}	
		[EntityAttribute(13, EntityAttributeState.Optional, EntityAttributeType.None, EntityAttributeType.None, null, null, 13)]
		public IfcLengthMeasure? @ShearCentreZ 
		{ 
			get 
			{
				if(_activated) return _shearCentreZ;
				Activate();
				return _shearCentreZ;
			} 
			set
			{
				SetValue( v =>  _shearCentreZ = v, _shearCentreZ, value,  "ShearCentreZ", 13);
			} 
		}	
		[EntityAttribute(14, EntityAttributeState.Optional, EntityAttributeType.None, EntityAttributeType.None, null, null, 14)]
		public IfcLengthMeasure? @ShearCentreY 
		{ 
			get 
			{
				if(_activated) return _shearCentreY;
				Activate();
				return _shearCentreY;
			} 
			set
			{
				SetValue( v =>  _shearCentreY = v, _shearCentreY, value,  "ShearCentreY", 14);
			} 
		}	
		[EntityAttribute(15, EntityAttributeState.Optional, EntityAttributeType.None, EntityAttributeType.None, null, null, 15)]
		public IfcAreaMeasure? @ShearDeformationAreaZ 
		{ 
			get 
			{
				if(_activated) return _shearDeformationAreaZ;
				Activate();
				return _shearDeformationAreaZ;
			} 
			set
			{
				SetValue( v =>  _shearDeformationAreaZ = v, _shearDeformationAreaZ, value,  "ShearDeformationAreaZ", 15);
			} 
		}	
		[EntityAttribute(16, EntityAttributeState.Optional, EntityAttributeType.None, EntityAttributeType.None, null, null, 16)]
		public IfcAreaMeasure? @ShearDeformationAreaY 
		{ 
			get 
			{
				if(_activated) return _shearDeformationAreaY;
				Activate();
				return _shearDeformationAreaY;
			} 
			set
			{
				SetValue( v =>  _shearDeformationAreaY = v, _shearDeformationAreaY, value,  "ShearDeformationAreaY", 16);
			} 
		}	
		[EntityAttribute(17, EntityAttributeState.Optional, EntityAttributeType.None, EntityAttributeType.None, null, null, 17)]
		public IfcSectionModulusMeasure? @MaximumSectionModulusY 
		{ 
			get 
			{
				if(_activated) return _maximumSectionModulusY;
				Activate();
				return _maximumSectionModulusY;
			} 
			set
			{
				SetValue( v =>  _maximumSectionModulusY = v, _maximumSectionModulusY, value,  "MaximumSectionModulusY", 17);
			} 
		}	
		[EntityAttribute(18, EntityAttributeState.Optional, EntityAttributeType.None, EntityAttributeType.None, null, null, 18)]
		public IfcSectionModulusMeasure? @MinimumSectionModulusY 
		{ 
			get 
			{
				if(_activated) return _minimumSectionModulusY;
				Activate();
				return _minimumSectionModulusY;
			} 
			set
			{
				SetValue( v =>  _minimumSectionModulusY = v, _minimumSectionModulusY, value,  "MinimumSectionModulusY", 18);
			} 
		}	
		[EntityAttribute(19, EntityAttributeState.Optional, EntityAttributeType.None, EntityAttributeType.None, null, null, 19)]
		public IfcSectionModulusMeasure? @MaximumSectionModulusZ 
		{ 
			get 
			{
				if(_activated) return _maximumSectionModulusZ;
				Activate();
				return _maximumSectionModulusZ;
			} 
			set
			{
				SetValue( v =>  _maximumSectionModulusZ = v, _maximumSectionModulusZ, value,  "MaximumSectionModulusZ", 19);
			} 
		}	
		[EntityAttribute(20, EntityAttributeState.Optional, EntityAttributeType.None, EntityAttributeType.None, null, null, 20)]
		public IfcSectionModulusMeasure? @MinimumSectionModulusZ 
		{ 
			get 
			{
				if(_activated) return _minimumSectionModulusZ;
				Activate();
				return _minimumSectionModulusZ;
			} 
			set
			{
				SetValue( v =>  _minimumSectionModulusZ = v, _minimumSectionModulusZ, value,  "MinimumSectionModulusZ", 20);
			} 
		}	
		[EntityAttribute(21, EntityAttributeState.Optional, EntityAttributeType.None, EntityAttributeType.None, null, null, 21)]
		public IfcSectionModulusMeasure? @TorsionalSectionModulus 
		{ 
			get 
			{
				if(_activated) return _torsionalSectionModulus;
				Activate();
				return _torsionalSectionModulus;
			} 
			set
			{
				SetValue( v =>  _torsionalSectionModulus = v, _torsionalSectionModulus, value,  "TorsionalSectionModulus", 21);
			} 
		}	
		[EntityAttribute(22, EntityAttributeState.Optional, EntityAttributeType.None, EntityAttributeType.None, null, null, 22)]
		public IfcLengthMeasure? @CentreOfGravityInX 
		{ 
			get 
			{
				if(_activated) return _centreOfGravityInX;
				Activate();
				return _centreOfGravityInX;
			} 
			set
			{
				SetValue( v =>  _centreOfGravityInX = v, _centreOfGravityInX, value,  "CentreOfGravityInX", 22);
			} 
		}	
		[EntityAttribute(23, EntityAttributeState.Optional, EntityAttributeType.None, EntityAttributeType.None, null, null, 23)]
		public IfcLengthMeasure? @CentreOfGravityInY 
		{ 
			get 
			{
				if(_activated) return _centreOfGravityInY;
				Activate();
				return _centreOfGravityInY;
			} 
			set
			{
				SetValue( v =>  _centreOfGravityInY = v, _centreOfGravityInY, value,  "CentreOfGravityInY", 23);
			} 
		}	
		#endregion




		#region IPersist implementation
		public override void Parse(int propIndex, IPropertyValue value, int[] nestedIndex)
		{
			switch (propIndex)
			{
				case 0: 
				case 1: 
				case 2: 
				case 3: 
				case 4: 
				case 5: 
				case 6: 
					base.Parse(propIndex, value, nestedIndex); 
					return;
				case 7: 
					_torsionalConstantX = value.RealVal;
					return;
				case 8: 
					_momentOfInertiaYZ = value.RealVal;
					return;
				case 9: 
					_momentOfInertiaY = value.RealVal;
					return;
				case 10: 
					_momentOfInertiaZ = value.RealVal;
					return;
				case 11: 
					_warpingConstant = value.RealVal;
					return;
				case 12: 
					_shearCentreZ = value.RealVal;
					return;
				case 13: 
					_shearCentreY = value.RealVal;
					return;
				case 14: 
					_shearDeformationAreaZ = value.RealVal;
					return;
				case 15: 
					_shearDeformationAreaY = value.RealVal;
					return;
				case 16: 
					_maximumSectionModulusY = value.RealVal;
					return;
				case 17: 
					_minimumSectionModulusY = value.RealVal;
					return;
				case 18: 
					_maximumSectionModulusZ = value.RealVal;
					return;
				case 19: 
					_minimumSectionModulusZ = value.RealVal;
					return;
				case 20: 
					_torsionalSectionModulus = value.RealVal;
					return;
				case 21: 
					_centreOfGravityInX = value.RealVal;
					return;
				case 22: 
					_centreOfGravityInY = value.RealVal;
					return;
				default:
					throw new XbimParserException(string.Format("Attribute index {0} is out of range for {1}", propIndex + 1, GetType().Name.ToUpper()));
			}
		}
		#endregion

		#region Equality comparers and operators
        public bool Equals(@IfcStructuralProfileProperties other)
	    {
	        return this == other;
	    }
        #endregion

		#region IContainsEntityReferences
		IEnumerable<IPersistEntity> IContainsEntityReferences.References 
		{
			get 
			{
				if (@ProfileDefinition != null)
					yield return @ProfileDefinition;
			}
		}
		#endregion

		#region Custom code (will survive code regeneration)
		//## Custom code
		//##
		#endregion
	}
}