//
        // Ensure that the input set of shapes meets the desired application and template parameters.
        //
        public static bool VerifyInputParameters(List<ShapeType> shapeList, TemplateType type)
        {
            // We have an artificial limitation in the number of figures we combine.
            if (shapeList.Count > 3) throw new ArgumentException("Cannot synthesize a figure with more than 3 Figures.");

            if (type.CompareTo(TemplateType.DEMARCATION) < 0 && shapeList.Count != 2)
            {
                throw new ArgumentException("Expected two figures with a synthesis dictacted by template: " + type);
            }

            if (type.CompareTo(TemplateType.DEMARCATION) > 0 && shapeList.Count < 3)
            {
                throw new ArgumentException("Expected three figures with a synthesis dictacted by template: " + type);
            }

            return true;
        }
Esempio n. 2
0
        //
        // Ensure that the input set of shapes meets the desired application and template parameters.
        //
        public static bool VerifyInputParameters(List <ShapeType> shapeList, TemplateType type)
        {
            // We have an artificial limitation in the number of figures we combine.
            if (shapeList.Count > 3)
            {
                throw new ArgumentException("Cannot synthesize a figure with more than 3 Figures.");
            }

            if (type.CompareTo(TemplateType.DEMARCATION) < 0 && shapeList.Count != 2)
            {
                throw new ArgumentException("Expected two figures with a synthesis dictacted by template: " + type);
            }

            if (type.CompareTo(TemplateType.DEMARCATION) > 0 && shapeList.Count < 3)
            {
                throw new ArgumentException("Expected three figures with a synthesis dictacted by template: " + type);
            }

            return(true);
        }