Ejemplo n.º 1
0
        // 设置坐标
        private void GenerateData(float scale)
        {
            PointF[] pfs = _frameArray;

            if (_objects.IsEmpty)
            {
                for (int i = 0; i < pfs.Length; i++)
                {
                    pfs[i] = PointF.Empty;
                }
            }
            else
            {
                float      size = FrameSize / scale;
                RectangleF rf   = _objects.Rect;

                for (int i = 0; i < pfs.Length; i++)
                {
                    int j   = (i < 4) ? i : i + 1;
                    int row = j / 3;
                    int col = j % 3;

                    pfs[i].X = rf.X + rf.Width / 2 * col + size * (col - 1);
                    pfs[i].Y = rf.Y + rf.Height / 2 * row + size * (row - 1);

                    pfs[i] = ControlPointContainer.TransFormData(_objects.Matrix, scale, pfs[i]);
                }
            }
            //rotate center
            _rotatePointPos    = _objects.RotatePointPos;
            _rotatePointPos.X *= scale;
            _rotatePointPos.Y *= scale;
        }
Ejemplo n.º 2
0
        public Studio(HMIForm control) : base(control)
        {
            _create       = new CreateDrawObject(this);
            _controlPoint = new ControlPointContainer(Container);

            InitScrollControl();
        }
Ejemplo n.º 3
0
        public void InvalidateControlPoint(ControlPointContainer control)
        {
            Rectangle rect = Rectangle.Round(control.InvalidateRect);

            rect.Offset(Container.AutoScrollPosition);
            Container.Invalidate(rect);
            rect = Rectangle.Round(control.RotateCenterRect);
            rect.Offset(Container.AutoScrollPosition);
            Container.Invalidate(rect);
        }
Ejemplo n.º 4
0
        // 设置数据
        private void GenerateData(float scale)
        {
            _datas = new List <PointF>(_objects.Node.NodeDatas);

            int len = _datas.Count;

            for (int i = 0; i < len; i++)
            {
                _datas[i] = ControlPointContainer.TransFormData(_objects.Matrix, scale, _datas[i]);
            }
        }
Ejemplo n.º 5
0
        private void GenerateData(float scale)
        {
            _datas = (PointF[])_objects.Custom.CustomDatas.Clone();
            for (int i = 0; i < _datas.Length; i++)
            {
                _datas[i] = ControlPointContainer.TransFormData(_objects.Matrix, scale, _datas[i]);
            }

            _center = _objects.Custom.CustomCenter;
            _center = ControlPointContainer.TransFormData(_objects.Matrix, scale, _center);
        }
Ejemplo n.º 6
0
        private void GenerateData(float scale)
        {
            if (_objects.Segment.Intersections == null)
            {
                _intersections = null;
                return;
            }

            _intersections = (PointF[])_objects.Segment.Intersections.Clone();
            for (int i = 0; i < _intersections.Length; i++)
            {
                _intersections[i] = ControlPointContainer.TransFormData(_objects.Matrix, scale, _intersections[i]);
            }
        }
Ejemplo n.º 7
0
 public SelectObjectManager(ControlPointContainer controlPoint)
 {
     Debug.Assert(controlPoint != null);
     _controlPoint = controlPoint;
 }