/// <summary>
        /// Event handler for the <see cref="PickingTool.PickSessionEnded"/> event.
        /// </summary>
        /// <param name="sender">The sender object.</param>
        /// <param name="eventArgs">The event argument for the handler.</param>
        private void OnPickEnded(object sender, EventArgs eventArgs)
        {
            var input = new ComponentInput();

            input.AddInputPolygon(new Polygon {
                Points = new ArrayList(this.pickedPoints)
            });
            this.CommitComponentInput(input);
        }
示例#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);
        }
        /// <summary>
        /// Event handler for the <see cref="PickingTool.PickSessionEnded"/> event.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="eventArgs">The event argument for the handler.</param>
        private void OnPickSessionEnded(object sender, EventArgs eventArgs)
        {
            var input = new ComponentInput();

            input.AddInputPolygon(new Polygon {
                Points = new ArrayList(this.pickedPoints)
            });

            this.Component.SetAttribute(TransitionSectionPluginPropertyNames.RectangleWidth, this.widthValueBox.Value);
            this.Component.SetAttribute(TransitionSectionPluginPropertyNames.RectangleHeight, this.heightValueBox.Value);
            this.Component.SetAttribute(TransitionSectionPluginPropertyNames.CircleRadius, this.radiusValueBox.Value);

            this.CommitComponentInput(input);
        }