예제 #1
0
        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"));
            }
        }
예제 #2
0
        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);
        }
예제 #3
0
파일: Text.cs 프로젝트: samuto/designscript
        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"));
        }
예제 #4
0
        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;
        }