Exemple #1
0
        /// <summary>
        ///
        /// </summary>
        public override void Insert()
        {
            component.Number = -100000;
            component.Name   = this.name;
            component.LoadAttributesFromFile(this.attributeFile);

            ComponentInput I = new ComponentInput();

            I.AddInputObject(firstMember);
            I.AddInputObject(secondMember);

            component.SetComponentInput(I);

            component.Insert();
            this.ID = component.Identifier.ID;
        }
Exemple #2
0
        /// <summary>
        /// Modifies the input.
        /// </summary>
        /// <param name="points">The points.</param>
        private void ModifyInput(List <Point> points)
        {
            this.Graphics.Clear();
            var originalInput = this.Component.GetComponentInput();

            if (originalInput == null)
            {
                return;
            }

            var input = new ComponentInput();
            var index = 0;

            foreach (var inputItem in originalInput)
            {
                if (!(inputItem is InputItem item))
                {
                    continue;
                }

                switch (item.GetInputType())
                {
                case InputItem.InputTypeEnum.INPUT_1_OBJECT:
                    input.AddInputObject(item.GetData() as ModelObject);
                    break;

                case InputItem.InputTypeEnum.INPUT_N_OBJECTS:
                    input.AddInputObjects(item.GetData() as ArrayList);
                    break;

                case InputItem.InputTypeEnum.INPUT_1_POINT:
                    input.AddOneInputPosition(points[index]);
                    index++;
                    break;

                case InputItem.InputTypeEnum.INPUT_2_POINTS:
                    input.AddTwoInputPositions(points[index], points[index + 1]);
                    index += 2;
                    break;

                case InputItem.InputTypeEnum.INPUT_POLYGON:
                    var polygon = new Polygon();
                    foreach (var point in points)
                    {
                        polygon.Points.Add(new Point(point));
                    }

                    input.AddInputPolygon(polygon);
                    break;

                default:
                    break;
                }
            }

            this.ModifyComponentInput(input);
        }