private SegmentDrawing CalculateUnidirectedLineSegments(ClassVisual sourceVisual, ClassVisual targetVisual)
        {
            float yLocation  = sourceVisual.Location.Y + sourceVisual.Size.Height / 2f;
            var   startPoint = new Point(sourceVisual.Location.X + sourceVisual.Size.Width, yLocation);
            var   endPoint   = new Point(targetVisual.Location.X, yLocation);

            return(new SegmentDrawing(startPoint, endPoint));
        }
        private void CalculateCompositionPoints(ClassVisual sourceVisual, ClassVisual targetVisual)
        {
            CalculateDirectedLineSegments(sourceVisual, targetVisual, 20f);

            var startPoint = new Point(sourceVisual.Location.X + sourceVisual.Size.Width, sourceVisual.Location.Y + sourceVisual.Size.Height / 2f);

            var aggrUp    = startPoint.Subtract(new Point(-10f, 10f));
            var aggrDown  = startPoint.Add(new Point(10f, +10f));
            var aggrRight = startPoint.Add(new Point(20f, 0f));

            _drawings.Add(new PolygonDrawing(startPoint, aggrUp, aggrRight, aggrDown));
        }
        private void RotateLineSegments(ClassVisual sourceVisual, ClassVisual targetVisual)
        {
            var startPoint   = new Point(sourceVisual.Location.X + sourceVisual.Size.Width, sourceVisual.Location.Y + sourceVisual.Size.Height / 2f);
            var trueEndPoint = new Point(targetVisual.Location.X, targetVisual.Location.Y + targetVisual.Size.Height / 2f);

            var rotationCenter = startPoint;
            var angle          = startPoint.CalculateAngle(trueEndPoint);

            foreach (Drawing d in _drawings)
            {
                d.RotateAround(rotationCenter, angle);
            }
        }
        private void CalculateDirectedLineSegments(ClassVisual sourceVisual, ClassVisual targetVisual, float xOffset = 0f)
        {
            float commonY         = sourceVisual.Location.Y + sourceVisual.Size.Height / 2f;
            var   startPoint      = new Point(sourceVisual.Location.X + sourceVisual.Size.Width + xOffset, commonY);
            var   commonYEndPoint = new Point(targetVisual.Location.X, commonY);

            var arrowPointUpper = new Point(commonYEndPoint.X - 10f, commonYEndPoint.Y - 10f);
            var arrowPointLower = new Point(commonYEndPoint.X - 10f, commonYEndPoint.Y + 10f);

            _drawings.Add(new SegmentDrawing(startPoint, commonYEndPoint));
            _drawings.Add(new SegmentDrawing(arrowPointLower, commonYEndPoint));
            _drawings.Add(new SegmentDrawing(arrowPointUpper, commonYEndPoint));
        }
        private void Initialize()
        {
            foreach (var @class in _mCd.Classes)
            {
                var cv = new ClassVisual(@class);
                _classVisuals[@class] = cv;
                AddChild(cv);
            }

            foreach (var assoc in _mCd.Associations)
            {
                var assocVisual = new AssociationVisual(assoc, this);
                _associationVisuals[assoc] = assocVisual;
                AddChild(assocVisual);
            }
        }