Exemplo n.º 1
0
        /* Reflect all the figures and groups in the scene.*/
        public void ReflectScene(ReflectOrientation reflectOrientation)
        {
            SceneRectangle sceneRectangle   = CalculateSceneCircumscribingRectangle();
            var            pointSceneCenter = new ScenePoint
            {
                X = (sceneRectangle.Vertex1.X + sceneRectangle.Vertex2.X) / 2.0,
                Y = (sceneRectangle.Vertex1.Y + sceneRectangle.Vertex2.Y) / 2.0
            };

            foreach (var figure in _figures)
            {
                var points = figure.Value.Points;
                GeneralMethodsFigure.ReflectFigure(reflectOrientation, pointSceneCenter, ref points);
                figure.Value.Points = points;
            }


            foreach (var composite in _compositeFigures)
            {
                foreach (var compositeFigures in composite.Value.ChildFigures)
                {
                    var points = compositeFigures.Points;
                    GeneralMethodsFigure.ReflectFigure(reflectOrientation, pointSceneCenter, ref points);
                    compositeFigures.Points = points;
                }
            }
        }
Exemplo n.º 2
0
        /* Move all the figures and groups in the scene by 'vector'.*/
        public void MoveScene(ScenePoint vector)
        {
            foreach (var figure in _figures)
            {
                var points = figure.Value.Points;
                GeneralMethodsFigure.Move(vector, ref points);
                figure.Value.Points = points;
            }

            foreach (var composite in _compositeFigures)
            {
                foreach (var compositeFigures in composite.Value.ChildFigures)
                {
                    var points = compositeFigures.Points;
                    GeneralMethodsFigure.Move(vector, ref points);
                    compositeFigures.Points = points;
                }
            }
        }