public virtual void Draw(IGraphicsContext3D g, IMaterial brush, PointD3D point)
            {
                g.DrawString(_firstpart, _font1, brush, point);

                point = point.WithXPlus(_size1.X);

                g.DrawString(_exponent, _font2, brush, point.WithYPlus(_size1.Y - _size2.Y));

                point = point.WithXPlus(_size2.X);

                g.DrawString(_lastpart, _font1, brush, point);
            }
Esempio n. 2
0
 public override void Draw(IGraphicsContext3D g, DrawContext dc, double xbase, double ybase, double zbase)
 {
     if (_child != null)
     {
         _child.Draw(g, dc, xbase, ybase, zbase);
         FontInfo fontInfo = dc.FontCache.GetFontInfo(Style.FontId);
         g.DrawString("_", Style.FontId, Style.brush, new PointD3D((xbase), (ybase - _child.ExtendAboveBaseline - fontInfo.cyAscent), zbase));
     }
 }
Esempio n. 3
0
 public override void Draw(IGraphicsContext3D g, DrawContext dc, double xbase, double ybase, double zbase)
 {
     if (_child != null)
     {
         _child.Draw(g, dc, xbase, ybase, zbase);
         FontInfo fontInfo = dc.FontCache.GetFontInfo(Style.FontId);
         double   psize    = FontManager3D.Instance.MeasureString(".", Style.FontId).X;
         g.DrawString(".", Style.FontId, Style.brush, new PointD3D((xbase + _child.SizeX / 2 - psize / 2), (ybase - _child.ExtendAboveBaseline - fontInfo.cyAscent), zbase));
     }
 }
        public override void DrawItem(IGraphicsContext3D g, IMaterial brush, FontX3D font, Altaxo.Data.AltaxoVariant item, PointD3D morg)
        {
            SplitInFirstPartAndExponent(item, out var firstpart, out var mant, out var middelpart, out var exponent);

            var size1 = g.MeasureString(_prefix + firstpart + middelpart, font, morg);

            g.DrawString(_prefix + firstpart + middelpart, font, brush, morg);
            var orginalY = morg.Y;

            morg = morg + new VectorD3D(size1.X, size1.Y, 0);
            var font2 = font.WithSize(font.Size * 2 / 3.0);

            g.DrawString(exponent, font2, brush, morg);
            if (!string.IsNullOrEmpty(_suffix))
            {
                var shiftX = g.MeasureString(exponent, font2, morg).X;
                morg = new PointD3D(morg.X + shiftX, orginalY, morg.Z);
            }

            if (!string.IsNullOrEmpty(_suffix))
            {
                g.DrawString(_suffix, font, brush, morg);
            }
        }
Esempio n. 5
0
            public virtual void Draw(IGraphicsContext3D g, IMaterial brush, PointD3D point)
            {
                var positionX = point.X + GetHorizontalOffset();
                var positionY = point.Y + GetVerticalOffset();

                for (int i = 0; i < _text.Length; ++i)
                {
                    var posX = positionX;
                    switch (_textBlockAligment)
                    {
                    case Alignment.Center:
                        posX += (_size.X - _stringSize[i].X) * 0.5;
                        break;

                    case Alignment.Far:
                        posX += (_size.X - _stringSize[i].X);
                        break;
                    }

                    g.DrawString(_text[i], _font, brush, new PointD3D(posX, positionY, 0));
                    positionY -= _stringSize[i].Y * _lineSpacing;
                }
            }
			public virtual void Draw(IGraphicsContext3D g, IMaterial brush, PointD3D point)
			{
				var positionX = point.X + GetHorizontalOffset();
				var positionY = point.Y + GetVerticalOffset();

				for (int i = 0; i < _text.Length; ++i)
				{
					var posX = positionX;
					switch (_textBlockAligment)
					{
						case Alignment.Center:
							posX += (_size.X - _stringSize[i].X) * 0.5;
							break;

						case Alignment.Far:
							posX += (_size.X - _stringSize[i].X);
							break;
					}

					g.DrawString(_text[i], _font, brush, new PointD3D(posX, positionY, 0));
					positionY -= _stringSize[i].Y * _lineSpacing;
				}
			}
Esempio n. 7
0
            public override void Draw(IGraphicsContext3D g, DrawContext dc, double xbase, double ybase, double zbase)
            {
                var fontInfo = dc.FontCache.GetFontInfo(Style.FontId);

                g.DrawString(_text, Style.FontId, Style.brush, new PointD3D(xbase, (ybase - fontInfo.cyDescent), zbase));
            }
Esempio n. 8
0
			public override void Draw(IGraphicsContext3D g, DrawContext dc, double xbase, double ybase, double zbase)
			{
				var fontInfo = dc.FontCache.GetFontInfo(Style.FontId);
				g.DrawString(_text, Style.FontId, Style.brush, new PointD3D(xbase, (ybase - fontInfo.cyDescent), zbase));
			}
Esempio n. 9
0
			public override void Draw(IGraphicsContext3D g, DrawContext dc, double xbase, double ybase, double zbase)
			{
				if (_child != null)
				{
					_child.Draw(g, dc, xbase, ybase, zbase);
					FontInfo fontInfo = dc.FontCache.GetFontInfo(Style.FontId);
					g.DrawString("_", Style.FontId, Style.brush, new PointD3D((xbase), (ybase - _child.ExtendAboveBaseline - fontInfo.cyAscent), zbase));
				}
			}
			public virtual void Draw(IGraphicsContext3D g, IMaterial brush, PointD3D point)
			{
				g.DrawString(_firstpart, _font1, brush, point);

				point = point.WithXPlus(_size1.X);

				g.DrawString(_exponent, _font2, brush, point.WithYPlus(_size1.Y - _size2.Y));

				point = point.WithXPlus(_size2.X);

				g.DrawString(_lastpart, _font1, brush, point);
			}
Esempio n. 11
0
			public virtual void Draw(IGraphicsContext3D g, IMaterial brush, PointD3D point)
			{
				g.DrawString(_text, _font, brush, point);
			}
Esempio n. 12
0
		/// <summary>
		/// Draws the item to a specified location.
		/// </summary>
		/// <param name="g">Graphics context.</param>
		/// <param name="brush">Brush used to draw the item.</param>
		/// <param name="font">Font used to draw the item.</param>
		/// <param name="item">The item to draw.</param>
		/// <param name="morg">The location where the item is drawn to.</param>
		public virtual void DrawItem(IGraphicsContext3D g, IMaterial brush, FontX3D font, AltaxoVariant item, PointD3D morg)
		{
			string text = _prefix + FormatItem(item) + _suffix;
			g.DrawString(text, font, brush, morg);
		}
Esempio n. 13
0
		/// <summary>
		/// Paints one label.
		/// </summary>
		/// <param name="g"></param>
		/// <param name="label"></param>
		/// <param name="variableTextBrush">If not null, this argument provides the text brush that should be used now. If null, then the <see cref="_material"/> is used instead.</param>
		/// <param name="variableBackBrush"></param>
		public void Paint(IGraphicsContext3D g, string label, double symbolSize, IMaterial variableTextBrush, IMaterial variableBackBrush)
		{
			var fontSize = _font.Size;

			var xpos = _offsetX_Points + (_offsetX_EmUnits * fontSize) + (_offsetX_SymbolSizeUnits * symbolSize / 2);
			var ypos = _offsetY_Points + (_offsetY_EmUnits * fontSize) + (_offsetY_SymbolSizeUnits * symbolSize / 2);
			var zpos = _offsetZ_Points + (_offsetZ_EmUnits * fontSize) + (_offsetZ_SymbolSizeUnits * symbolSize / 2);
			var stringsize = g.MeasureString(label, _font, new PointD3D(xpos, ypos, zpos));

			if (this._backgroundStyle != null)
			{
				var x = xpos;
				var y = ypos;
				var z = zpos;

				switch (_alignmentX)
				{
					case Alignment.Center:
						x -= stringsize.X / 2;
						break;

					case Alignment.Far:
						x -= stringsize.X;
						break;
				}

				switch (_alignmentY)
				{
					case Alignment.Center:
						y -= stringsize.Y / 2;
						break;

					case Alignment.Far:
						y -= stringsize.Y;
						break;
				}
				if (null == variableBackBrush)
				{
					this._backgroundStyle.Draw(g, new RectangleD3D(x, y, z, stringsize.X, stringsize.Y, stringsize.Z));
				}
				else
				{
					this._backgroundStyle.Draw(g, new RectangleD3D(x, y, z, stringsize.X, stringsize.Y, stringsize.Z), variableBackBrush);
				}
			}

			var brush = null != variableTextBrush ? variableTextBrush : _material;
			g.DrawString(label, _font, brush, new PointD3D(xpos, ypos, zpos), _alignmentX, _alignmentY, _alignmentZ);
		}
Esempio n. 14
0
 public virtual void Draw(IGraphicsContext3D g, IMaterial brush, PointD3D point)
 {
     g.DrawString(_text, _font, brush, point);
 }
Esempio n. 15
0
        /// <summary>
        /// Draws the item to a specified location.
        /// </summary>
        /// <param name="g">Graphics context.</param>
        /// <param name="brush">Brush used to draw the item.</param>
        /// <param name="font">Font used to draw the item.</param>
        /// <param name="item">The item to draw.</param>
        /// <param name="morg">The location where the item is drawn to.</param>
        public virtual void DrawItem(IGraphicsContext3D g, IMaterial brush, FontX3D font, AltaxoVariant item, PointD3D morg)
        {
            string text = _prefix + FormatItem(item) + _suffix;

            g.DrawString(text, font, brush, morg);
        }
Esempio n. 16
0
			public override void Draw(IGraphicsContext3D g, DrawContext dc, double xbase, double ybase, double zbase)
			{
				if (_child != null)
				{
					_child.Draw(g, dc, xbase, ybase, zbase);
					FontInfo fontInfo = dc.FontCache.GetFontInfo(Style.FontId);
					double psize = FontManager3D.Instance.MeasureString(".", Style.FontId).X;
					g.DrawString(".", Style.FontId, Style.brush, new PointD3D((xbase + _child.SizeX / 2 - psize / 2), (ybase - _child.ExtendAboveBaseline - fontInfo.cyAscent), zbase));
				}
			}
		public override void DrawItem(IGraphicsContext3D g, IMaterial brush, FontX3D font, Altaxo.Data.AltaxoVariant item, PointD3D morg)
		{
			string firstpart, middelpart, exponent;
			double mant;
			SplitInFirstPartAndExponent((double)item, out firstpart, out mant, out middelpart, out exponent);

			var size1 = g.MeasureString(_prefix + firstpart + middelpart, font, morg);
			g.DrawString(_prefix + firstpart + middelpart, font, brush, morg);
			var orginalY = morg.Y;
			morg = morg + new VectorD3D(size1.X, size1.Y, 0);
			var font2 = font.WithSize(font.Size * 2 / 3.0);
			g.DrawString(exponent, font2, brush, morg);
			if (!string.IsNullOrEmpty(_suffix))
			{
				var shiftX = g.MeasureString(exponent, font2, morg).X;
				morg = new PointD3D(morg.X + shiftX, orginalY, morg.Z);
			}

			if (!string.IsNullOrEmpty(_suffix))
			{
				g.DrawString(_suffix, font, brush, morg);
			}
		}