예제 #1
0
 public static void Paint(IGraphicsContext3D g, Altaxo.Graph.IPaintContext paintContext, IPlotArea layer, PlotItemCollection coll)
 {
     for (int i = coll.Count - 1; i >= 0; --i)
     {
         coll[i].Paint(g, paintContext, layer, i == coll.Count - 1 ? null : coll[i + 1], i == 0 ? null : coll[i - 1]);
     }
 }
예제 #2
0
 public override void Paint(IGraphicsContext3D g, Altaxo.Graph.IPaintContext context, IPlotArea layer, IGPlotItem previousPlotItem, IGPlotItem nextPlotItem)
 {
     if (null != _plotStyle)
     {
         _plotStyle.Paint(g, layer, _plotData);
     }
 }
예제 #3
0
        public void Paint(IGraphicsContext3D g, Altaxo.Graph.IPaintContext paintContext, bool bForPreview)
        {
            //_isStructureInSync = false;
            _isMeasureInSync = false; // Change: interpret text every time in order to update plot items and \ID

            if (!_isStructureInSync)
            {
                // this.Interpret(g);
                InterpretText();

                _isStructureInSync = true;
                _isMeasureInSync   = false;
            }

            using (var fontCache = new FontCache())
            {
                if (!_isMeasureInSync)
                {
                    // this.MeasureStructure(g, obj);
                    MeasureGlyphs(g, fontCache, paintContext);

                    MeasureBackground(g, _rootNode.SizeX, _rootNode.SizeY, _rootNode.SizeZ);

                    _isMeasureInSync = true;
                }

                _cachedSymbolPositions.Clear();

                var gs = g.SaveGraphicsState();

                var bounds = Bounds;

                var transformmatrix = Matrix4x3.NewScalingShearingRotationDegreesTranslation(
                    ScaleX, ScaleY, ScaleZ,
                    ShearX, ShearY, ShearZ,
                    RotationX, RotationY, RotationZ,
                    _location.AbsolutePivotPositionX, _location.AbsolutePivotPositionY, _location.AbsolutePivotPositionZ);
                transformmatrix.TranslatePrepend(bounds.X, bounds.Y, bounds.Z);

                if (!bForPreview)
                {
                    TransformGraphics(g);
                    g.TranslateTransform(bounds.X, bounds.Y, bounds.Z);
                }

                // first of all paint the background
                PaintBackground(g);

                var dc = new DrawContext
                {
                    FontCache              = fontCache,
                    bForPreview            = bForPreview,
                    LinkedObject           = Altaxo.Main.AbsoluteDocumentPath.GetRootNodeImplementing <HostLayer>(this),
                    transformMatrix        = transformmatrix,
                    _cachedSymbolPositions = _cachedSymbolPositions
                };
                DrawGlyphs(g, dc, _cachedTextOffset.X, _cachedTextOffset.Y, _cachedTextOffset.Z);
                g.RestoreGraphicsState(gs);
            }
        }
예제 #4
0
 public void Paint(IGraphicsContext3D g, Altaxo.Graph.IPaintContext paintContext, IPlotArea layer)
 {
     for (int i = 0; i < _axisStyles.Count; ++i)
     {
         _axisStyles[i].Paint(g, paintContext, layer);
     }
 }
예제 #5
0
파일: AxisStyle.cs 프로젝트: olesar/Altaxo
 public void PaintTitle(IGraphicsContext3D g, Altaxo.Graph.IPaintContext paintContext, IPlotArea layer)
 {
     if (IsTitleEnabled)
     {
         _axisTitle.Paint(g, paintContext);
     }
 }
예제 #6
0
파일: AxisStyle.cs 프로젝트: olesar/Altaxo
 public void Paint(IGraphicsContext3D g, Altaxo.Graph.IPaintContext paintContext, IPlotArea layer, Func <CSLineID, CSAxisInformation> GetAxisStyleInformation)
 {
     PaintLine(g, layer);
     PaintMajorLabels(g, layer);
     PaintMinorLabels(g, layer);
     PaintTitle(g, paintContext, layer);
 }
예제 #7
0
        private void MeasureGlyphs(IGraphicsContext3D g, FontCache cache, Altaxo.Graph.IPaintContext paintContext)
        {
            var mc = new MeasureContext
            {
                FontCache    = cache,
                LinkedObject = Altaxo.Main.AbsoluteDocumentPath.GetRootNodeImplementing <HostLayer>(this),
                TabStop      = Glyph.MeasureString("MMMM", _font).X
            };

            if (null != _rootNode)
            {
                _rootNode.Measure(mc, 0);
            }
        }
예제 #8
0
파일: PlotItem.cs 프로젝트: olesar/Altaxo
 /// <summary>
 /// This paints the plot to the layer.
 /// </summary>
 /// <param name="g">The graphics context.</param>
 /// <param name="context">The painting context.</param>
 /// <param name="layer">The plot layer.</param>
 /// <param name="previousPlotItem">Previous plot item.</param>
 /// <param name="nextPlotItem">Next plot item.</param>
 /// <returns>A data object, which can be used by the next plot item for some styles (like fill style).</returns>
 public abstract void Paint(IGraphicsContext3D g, Altaxo.Graph.IPaintContext context, IPlotArea layer, IGPlotItem previousPlotItem, IGPlotItem nextPlotItem);
예제 #9
0
파일: PlotItem.cs 프로젝트: olesar/Altaxo
 /// <summary>
 /// Called before painting takes place.
 /// </summary>
 /// <param name="context">The painting context.</param>
 public virtual void PaintPreprocessing(Altaxo.Graph.IPaintContext context)
 {
 }
예제 #10
0
 public override void Paint(IGraphicsContext3D g, Altaxo.Graph.IPaintContext paintContext)
 {
     Paint(g, paintContext, false);
 }
예제 #11
0
파일: AxisStyle.cs 프로젝트: olesar/Altaxo
 public void Paint(IGraphicsContext3D g, Altaxo.Graph.IPaintContext paintContext, IPlotArea layer)
 {
     Paint(g, paintContext, layer, layer.CoordinateSystem.GetAxisStyleInformation);
 }
예제 #12
0
 /// <summary>
 /// Paint the object in the graphics context.
 /// </summary>
 /// <param name="g">Graphics context.</param>
 /// <param name="context">Additional information used to draw the object.</param>
 public abstract void Paint(IGraphicsContext3D g, Altaxo.Graph.IPaintContext context);