示例#1
0
        /// <summary>
        /// updates the text lables of the chart
        /// </summary>
        private void UpdateTextLables()
        {
            List <BillboardText> items = TextController.Text;

            if (items == null)
            {
                return;
            }
            for (int i = 0; i < items.Count; ++i)
            {
                BillboardText     text = items[i];
                LabelPositionInfo inf  = text.UserData as LabelPositionInfo;
                if (inf != null)
                {
                    if (inf.Group != null)
                    {
                        if (mGroupLabels != null)
                        {
                            Vector3 position = AlignGroupLabel(inf.Group);
                            text.transform.localPosition = position;
                            ChartCommon.FixBillboardText(mGroupLabels, text);
                        }
                    }
                    else if (inf.Bar != null && inf.Options is ItemLabels)
                    {
                        Vector3 position = AlignLabel((ItemLabels)inf.Options, inf.Bar.InnerPosition, inf.Bar.Size);
                        text.transform.localPosition = position;
                        ChartCommon.FixBillboardText(inf.Options, text);
                    }
                }
            }
        }
示例#2
0
        // This triangulates the sector geometry
        internal void Triangulate()
        {
            if (updateneeded)
            {
                // Triangulate again?
                if (triangulationneeded || (triangles == null))
                {
                    // Triangulate sector
                    triangles           = Triangulation.Create(this);
                    triangulationneeded = false;
                    updateneeded        = true;

                    //mxd. Update label position
                    label = FindLabelPosition(this);

                    // Number of vertices changed?
                    if (triangles.Vertices.Count != surfaceentries.TotalVertices)
                    {
                        General.Map.CRenderer2D.Surfaces.FreeSurfaces(surfaceentries);
                    }
                }
            }
        }