Ejemplo n.º 1
0
        /// <summary>
        /// Элементы визуализации здания
        /// </summary>
        public List <Entity> CreateVisual()
        {
            var visuals = new List <Entity>();

            var color  = Color.FromColor(System.Drawing.Color.Violet);
            var transp = new Transparency(100);
            // Контур здания
            Polyline plContour;

            if (Contour == null || Contour.IsDisposed)
            {
                plContour = Building.GetContourInModel();
            }
            else
            {
                plContour = (Polyline)Contour.Clone();
            }
            plContour.ConstantWidth = 0.2;
            plContour.Color         = color;
            //plContour.Transparency = transp;
            visuals.Add(plContour);

            // точка вставки текста
            //var ptText = plContour.Centroid();
            var ptText = GetCenter(plContour);

            // Текст описания здания
            var vopt     = new VisualOption(System.Drawing.Color.White, ptText);
            var textInfo = VisualHelper.CreateMText(GetInfo(), vopt, 2, AttachmentPoint.MiddleCenter);

            visuals.Add(textInfo);

            //var textInfo = new MText();
            //textInfo.Location = ptText;
            //textInfo.Attachment = AttachmentPoint.MiddleCenter;
            //textInfo.Height = 2;
            //textInfo.Contents = this.GetInfo();
            //textInfo.Color = color;
            //textInfo.Transparency = transp;
            //visuals.Add(textInfo);

            return(visuals);
        }