/// <summary>
 /// Compares two objects for geomtric equality
 /// </summary>
 /// <param name="a"></param>
 /// <param name="b">object to compare with</param>
 /// <returns></returns>
 public static bool GeometricEquals(this IfcAxis2Placement2D a, IfcAxis2Placement2D b)
 {
     if (a.Equals(b)) return true;
     double precision = b.ModelOf.ModelFactors.Precision;
     return a.P[0].IsEqual(b.P[0],precision) && 
         a.P[1].IsEqual(b.P[1],precision) && 
         a.Location.GeometricEquals(b.Location);
 }
 static public IfcAxis2Placement2D Create(this IfcAxis2Placement2D ax, IfcCartesianPoint centre, IfcDirection xAxisDirection)
 {
     IfcAxis2Placement2D ax2 = new IfcAxis2Placement2D()
     {
         RefDirection = xAxisDirection,
         Location = centre
     };
     return ax2;
 }
 public override void IfcParse(int propIndex, IPropertyValue value)
 {
     switch (propIndex)
     {
         case 0:
         case 1:
             base.IfcParse(propIndex, value);
             break;
         case 2:
             _position = (IfcAxis2Placement2D) value.EntityVal;
             break;
         default:
             this.HandleUnexpectedAttribute(propIndex, value); break;
     }
 }