private static void AssertUniScaledOrtho(ICoordinateSystemEntity csEntity) { if (csEntity.IsUniscaledOrtho()) { return; } if (csEntity.IsScaledOrtho()) { throw new System.ArgumentException(string.Format(Properties.Resources.NotSupported, "Non Uniform Scaling", "Text")); } else { throw new System.ArgumentException(string.Format(Properties.Resources.NotSupported, "Shear Transform", "Text")); } }
private static IConeEntity CylinderByRadiusHeightCore(ICoordinateSystemEntity contextCoordinateSystem, double radius, double height) { string kMethod = "Cylinder.ByRadiusHeight"; if (radius.LessThanOrEqualTo(0.0)) { throw new System.ArgumentException(string.Format(Properties.Resources.LessThanZero, "radius"), "radius"); } if (height.LessThanOrEqualTo(0.0)) { throw new System.ArgumentException(string.Format(Properties.Resources.LessThanZero, "height"), "height"); } if (null == contextCoordinateSystem) { throw new System.ArgumentNullException("contextCoordinateSystem"); } if (!contextCoordinateSystem.IsUniscaledOrtho()) { if (contextCoordinateSystem.IsScaledOrtho()) { throw new System.ArgumentException(string.Format(Properties.Resources.InvalidInput, "Non Uniform Scaled CoordinateSystem", kMethod)); } else { throw new System.ArgumentException(string.Format(Properties.Resources.InvalidInput, "Shear CoordinateSystem", kMethod)); } } IConeEntity entity = HostFactory.Factory.ConeByRadiusLength(contextCoordinateSystem, radius, radius, height); if (null == entity) { throw new System.Exception(string.Format(Properties.Resources.OperationFailed, kMethod)); } return(entity); }
private static void AssertUniScaledOrtho(ICoordinateSystemEntity csEntity) { if (csEntity.IsUniscaledOrtho()) return; if (csEntity.IsScaledOrtho()) throw new System.ArgumentException(string.Format(Properties.Resources.NotSupported, "Non Uniform Scaling", "Text")); else throw new System.ArgumentException(string.Format(Properties.Resources.NotSupported, "Shear Transform", "Text")); }
private static IConeEntity CylinderByRadiusHeightCore(ICoordinateSystemEntity contextCoordinateSystem, double radius, double height) { string kMethod = "Cylinder.ByRadiusHeight"; if (radius.LessThanOrEqualTo(0.0)) throw new System.ArgumentException(string.Format(Properties.Resources.LessThanZero, "radius"), "radius"); if (height.LessThanOrEqualTo(0.0)) throw new System.ArgumentException(string.Format(Properties.Resources.LessThanZero, "height"), "height"); if (null == contextCoordinateSystem) throw new System.ArgumentNullException("contextCoordinateSystem"); if (!contextCoordinateSystem.IsUniscaledOrtho()) { if(contextCoordinateSystem.IsScaledOrtho()) throw new System.ArgumentException(string.Format(Properties.Resources.InvalidInput, "Non Uniform Scaled CoordinateSystem", kMethod)); else throw new System.ArgumentException(string.Format(Properties.Resources.InvalidInput, "Shear CoordinateSystem", kMethod)); } IConeEntity entity = HostFactory.Factory.ConeByRadiusLength(contextCoordinateSystem, radius, radius, height); if (null == entity) throw new System.Exception(string.Format(Properties.Resources.OperationFailed, kMethod)); return entity; }