Ejemplo n.º 1
0
        /// <summary>
        /// Ask for space to PreviusLabel B if it can leave the space inorder to overcome the overlap.
        /// PreviusLabel B asks for space to the previous label C.. and so on
        /// </summary>
        /// <param name="labelA">CircularLabel looking for space to overcome the overlap</param>
        private static Boolean AskSpaceToPreviusLabel(CircularLabel labelA, Double requiredVerticalOffset, Int32 noOfIteration)
        {
            Boolean retValue = true;
            Double  gap      = 0;

            if (labelA.IsFirst)
            {
                if (labelA.Position.Y > requiredVerticalOffset)
                {
                    retValue = labelA.RotateByVerticalOffset(requiredVerticalOffset, SweepDirection.Counterclockwise);
                    return(retValue);
                }
                else
                {
                    return(false);
                }
            }

            gap = VerticalSpcaeBetweenLabels(labelA, labelA.PreviusLabel);

            if (gap > requiredVerticalOffset)
            {
                retValue = labelA.RotateByVerticalOffset(requiredVerticalOffset, SweepDirection.Counterclockwise);
                return(retValue);
            }
            else
            {
                retValue = AskSpaceToPreviusLabel(labelA.PreviusLabel, requiredVerticalOffset, noOfIteration);
                if (retValue)
                {
                    retValue = labelA.RotateByVerticalOffset(requiredVerticalOffset, SweepDirection.Counterclockwise);
                    return(retValue);
                }
                else
                {
                    retValue = false;
                }
            }

            return(retValue);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Ask for space to NextLabel if NextLabel can leave the space.
        /// NextLabel B asks for space to the next label C.. and so on
        /// </summary>
        /// <param name="labelA">CircularLabel looking for space to overcome the overlap</param>
        private static Boolean AskSpaceToNextLabel(CircularLabel label, Double requiredVerticalOffset, Int32 noOfIteration)
        {
            Boolean retValue = true;
            Double  gap      = 0;

            if (label.IsLast)
            {
                if (label.Position.Y + label.Height < label.Boundary.Height &&
                    label.Boundary.Height - (label.Position.Y + label.Height) > requiredVerticalOffset)
                {
                    retValue = label.RotateByVerticalOffset(requiredVerticalOffset, SweepDirection.Clockwise);
                    return(retValue);
                }
                else
                {
                    return(false);
                }
            }

            gap = VerticalSpcaeBetweenLabels(label, label.NextLabel);
            if (gap > requiredVerticalOffset)
            {
                retValue = label.RotateByVerticalOffset(requiredVerticalOffset, SweepDirection.Clockwise);
                return(retValue);
            }
            else
            {
                retValue = AskSpaceToNextLabel(label.NextLabel, requiredVerticalOffset, noOfIteration);
                if (retValue)
                {
                    retValue = label.RotateByVerticalOffset(requiredVerticalOffset, SweepDirection.Clockwise);
                    return(retValue);
                }
                else
                {
                    retValue = false;
                }
            }

            return(retValue);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Ask for space to PreviusLabel B if it can leave the space inorder to overcome the overlap.
        /// PreviusLabel B asks for space to the previous label C.. and so on
        /// </summary>
        /// <param name="labelA">CircularLabel looking for space to overcome the overlap</param>
        private static Boolean AskSpaceToPreviusLabel(CircularLabel labelA, Double requiredVerticalOffset, Int32 noOfIteration)
        {
            Boolean retValue = true;
            Double gap = 0;
            if (labelA.IsFirst)
            {
                if (labelA.Position.Y > requiredVerticalOffset)
                {
                    retValue = labelA.RotateByVerticalOffset(requiredVerticalOffset, SweepDirection.Counterclockwise);
                    return retValue;
                }
                else
                    return false;
            }

            gap = VerticalSpcaeBetweenLabels(labelA, labelA.PreviusLabel);

            if (gap > requiredVerticalOffset)
            {   
                retValue =labelA.RotateByVerticalOffset(requiredVerticalOffset, SweepDirection.Counterclockwise);
                return retValue;
            }
            else
            {
                retValue = AskSpaceToPreviusLabel(labelA.PreviusLabel, requiredVerticalOffset, noOfIteration);
                if (retValue)
                {
                    retValue = labelA.RotateByVerticalOffset(requiredVerticalOffset, SweepDirection.Counterclockwise);
                    return retValue;
                }
                else
                    retValue = false;
            }

            return retValue;
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Ask for space to NextLabel if NextLabel can leave the space.
        /// NextLabel B asks for space to the next label C.. and so on
        /// </summary>
        /// <param name="labelA">CircularLabel looking for space to overcome the overlap</param>
        private static Boolean AskSpaceToNextLabel(CircularLabel label, Double requiredVerticalOffset, Int32 noOfIteration)
        {   
            Boolean retValue = true;
            Double gap = 0;
            if (label.IsLast)
            {   
                if (label.Position.Y + label.Height < label.Boundary.Height &&
                    label.Boundary.Height - (label.Position.Y + label.Height) > requiredVerticalOffset)
                {   
                    retValue = label.RotateByVerticalOffset(requiredVerticalOffset, SweepDirection.Clockwise);
                    return retValue;
                }
                else
                    return false;
            }

            gap = VerticalSpcaeBetweenLabels(label, label.NextLabel);
            if (gap > requiredVerticalOffset)
            {
                retValue = label.RotateByVerticalOffset(requiredVerticalOffset, SweepDirection.Clockwise);
                return retValue;
            }
            else
            {
                retValue = AskSpaceToNextLabel(label.NextLabel, requiredVerticalOffset, noOfIteration);
                if (retValue)
                {
                    retValue = label.RotateByVerticalOffset(requiredVerticalOffset, SweepDirection.Clockwise);
                    return retValue;
                }
                else
                    retValue = false;
            }

            return retValue;
        }