Пример #1
0
        Vector3 AlignTextPosition(AlignedItemLabels labels, PieObject obj, out CanvasLines.LineSegement line, float modifiedRaidus)
        {
            line = null;
            float   angle    = obj.StartAngle + obj.AngleSpan * 0.5f;
            Vector3 position = new Vector3(labels.Seperation, labels.Location.Breadth, labels.Location.Depth);

            position = Quaternion.AngleAxis(angle, Vector3.forward) * position;
            float   alignRadius = (modifiedRaidus + TorusRadius) * 0.5f;
            Vector3 atAngle     = (Vector3)ChartCommon.FromPolar(angle, 1f);

            if (labels.Alignment == ChartLabelAlignment.Top)
            {
                alignRadius = Mathf.Max(modifiedRaidus, TorusRadius);
                Vector3 basePosition = atAngle * alignRadius;
                Vector3 end          = basePosition + position;
                end -= (position.normalized * LineSpacingLink);
                Vector4[] arr = new Vector4[] { basePosition, end };
                arr[0].w = -1f;
                arr[1].w = -1f;
                line     = new CanvasLines.LineSegement(arr);
            }

            position += atAngle * alignRadius;
            return(position);
        }
        Vector3 AlignTextPosition(AlignedItemLabels labels, PyramidObject obj, IPyramidGenerator generator, float height)
        {
            Vector3 position = new Vector3(labels.Location.Breadth, labels.Seperation, labels.Location.Depth);

            position.y += height;
            position    = generator.GetTextPosition(justification, labels.Alignment == ChartLabelAlignment.Base);
            return(position);
        }
Пример #3
0
        /// <summary>
        /// alignes a label to the bar chart
        /// </summary>
        /// <param name="labels"></param>
        /// <param name="innerPosition"></param>
        /// <param name="size"></param>
        /// <returns></returns>
        private Vector3 AlignLabel(AlignedItemLabels labels, Vector3 innerPosition, float size)
        {
            float alignPos = 0f;

            if (labels.Alignment == ChartLabelAlignment.Top)
            {
                alignPos += size;
            }
            return(new Vector3(
                       labels.Location.Breadth,
                       alignPos + labels.Seperation,
                       labels.Location.Depth));
        }