コード例 #1
0
ファイル: ScatterPlotStyle.cs プロジェクト: olesar/Altaxo
        public void ApplyGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups)
        {
            // IgnoreMissingDataPoints is the same for all sub plot styles
            IgnoreMissingDataPointsGroupStyle.ApplyStyle(externalGroups, localGroups, (ignoreMissingDataPoints) => _ignoreMissingDataPoints = ignoreMissingDataPoints);

            if (IsColorReceiver)
            {
                // try to get a constant color ...
                ColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(NamedColor c)
                                           { Color = c; });
                // but if there is a color evaluation function, then use that function with higher priority
                if (!VariableColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(Func <int, Color> evalFunc)
                                                        { _cachedColorForIndexFunction = evalFunc; }))
                {
                    _cachedColorForIndexFunction = null;
                }
            }

            if (!_independentScatterSymbol)
            {
                ScatterSymbolGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(IScatterSymbol c)
                                                   { ScatterSymbol = c; });
            }

            // per Default, set the symbol size evaluation function to null
            _cachedSymbolSizeForIndexFunction = null;
            if (!_independentSymbolSize)
            {
                // try to get a constant symbol size ...
                SymbolSizeGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(double size)
                                                { SymbolSize = size; });
                // but if there is an symbol size evaluation function, then use this with higher priority.
                if (!VariableSymbolSizeGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(Func <int, double> evalFunc)
                                                             { _cachedSymbolSizeForIndexFunction = evalFunc; }))
                {
                    _cachedSymbolSizeForIndexFunction = null;
                }
            }

            // SkipFrequency should be the same for all sub plot styles, so there is no "private" property
            if (!_independentSkipFreq)
            {
                SkipFrequencyGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(int c)
                                                   { SkipFrequency = c; });
            }

            // Shift the items ?
            _cachedLogicalShiftX = 0;
            _cachedLogicalShiftY = 0;
            if (!_independentOnShiftingGroupStyles)
            {
                var shiftStyle = PlotGroupStyle.GetFirstStyleToApplyImplementingInterface <IShiftLogicalXYGroupStyle>(externalGroups, localGroups);
                if (null != shiftStyle)
                {
                    shiftStyle.Apply(out _cachedLogicalShiftX, out _cachedLogicalShiftY);
                }
            }
        }
コード例 #2
0
        public void ApplyGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups)
        {
            // IgnoreMissingDataPoints is the same for all sub plot styles
            IgnoreMissingDataPointsGroupStyle.ApplyStyle(externalGroups, localGroups, (ignoreMissingDataPoints) => _ignoreMissingDataPoints = ignoreMissingDataPoints);

            _cachedColorForIndexFunction      = null;
            _cachedSymbolSizeForIndexFunction = null;
            // color
            if (!_independentColor)
            {
                ColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(NamedColor c)
                                           { _strokePen.Color = c; });

                // but if there is a color evaluation function, then use that function with higher priority
                VariableColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(Func <int, System.Drawing.Color> evalFunc)
                                                   { _cachedColorForIndexFunction = evalFunc; });
            }

            if (!_independentSkipFrequency)
            {
                SkipFrequencyGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(int c)
                                                   { SkipFrequency = c; });
            }

            // symbol size
            if (!_independentSymbolSize)
            {
                _symbolSize = 0;
                SymbolSizeGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(double size)
                                                { _symbolSize = size; });

                // but if there is an symbol size evaluation function, then use this with higher priority.
                _cachedSymbolSizeForIndexFunction = null;
                VariableSymbolSizeGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(Func <int, double> evalFunc)
                                                        { _cachedSymbolSizeForIndexFunction = evalFunc; });
            }
            else
            {
                _cachedSymbolSizeForIndexFunction = null;
            }

            // Shift the items ?
            _cachedLogicalShiftX = 0;
            _cachedLogicalShiftY = 0;
            if (!_independentOnShiftingGroupStyles)
            {
                var shiftStyle = PlotGroupStyle.GetFirstStyleToApplyImplementingInterface <IShiftLogicalXYGroupStyle>(externalGroups, localGroups);
                if (null != shiftStyle)
                {
                    shiftStyle.Apply(out _cachedLogicalShiftX, out _cachedLogicalShiftY);
                }
            }
        }
コード例 #3
0
        public void ApplyGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups)
        {
            if (IsColorReceiver)
            {
                // try to get a constant color ...
                ColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(NamedColor c)
                                           { Color = c; });
                // but if there is a color evaluation function, then use that function with higher priority
                if (!VariableColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(Func <int, Color> evalFunc)
                                                        { _cachedColorForIndexFunction = evalFunc; }))
                {
                    _cachedColorForIndexFunction = null;
                }
            }

            // try to get the symbol size ...
            if (!_independentSymbolSize)
            {
                _cachedSymbolSize = 0;
                SymbolSizeGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(double size)
                                                { _cachedSymbolSize = size; });
                // but if there is an symbol size evaluation function, then use this with higher priority.
                if (!VariableSymbolSizeGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(Func <int, double> evalFunc)
                                                             { _cachedSymbolSizeForIndexFunction = evalFunc; }))
                {
                    _cachedSymbolSizeForIndexFunction = null;
                }
            }
            else
            {
                _cachedSymbolSize = _symbolSize;
            }

            // SkipFrequency should be the same for all sub plot styles, so there is no "private" property
            if (!_independentSkipFreq)
            {
                _skipFreq = 1;
                SkipFrequencyGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(int c)
                                                   { _skipFreq = c; });
            }
        }
コード例 #4
0
        public void ApplyGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups)
        {
            _cachedColorForIndexFunction = null;

            BarSizePosition2DGroupStyle bwp = PlotGroupStyle.GetStyleToApply <BarSizePosition2DGroupStyle>(externalGroups, localGroups);

            if (null != bwp)
            {
                bwp.Apply(out _relInnerGapX, out _relOuterGapX, out _xSizeLogical, out _xOffsetLogical);
            }

            if (!_independentFillColor)
            {
                if (null == _fillBrush)
                {
                    _fillBrush = new BrushX(Drawing.ColorManagement.ColorSetManager.Instance.BuiltinDarkPlotColors[0]);
                }
                ColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(NamedColor c)
                                           { _fillBrush.Color = c; });

                // but if there is a color evaluation function, then use that function with higher priority
                VariableColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(Func <int, Color> evalFunc)
                                                   { _cachedColorForIndexFunction = evalFunc; });
            }

            if (!_independentFrameColor)
            {
                if (null == _framePen)
                {
                    _framePen = new PenX(Drawing.ColorManagement.ColorSetManager.Instance.BuiltinDarkPlotColors[0]);
                }
                ColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(NamedColor c)
                                           { _framePen.Color = c; });

                // but if there is a color evaluation function, then use that function with higher priority
                VariableColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(Func <int, Color> evalFunc)
                                                   { _cachedColorForIndexFunction = evalFunc; });
            }
        }
コード例 #5
0
ファイル: BarGraphPlotStyle.cs プロジェクト: olesar/Altaxo
        public void ApplyGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups)
        {
            _cachedColorForIndexFunction = null;

            BarSizePosition3DGroupStyle bwp = PlotGroupStyle.GetStyleToApply <BarSizePosition3DGroupStyle>(externalGroups, localGroups);

            if (null != bwp)
            {
                bwp.Apply(
                    out _barShiftStrategy, out _barShiftMaxNumberOfItemsInOneDirection,
                    out _relInnerGapX, out _relOuterGapX, out _xSizeLogical, out _xOffsetLogical,
                    out _relInnerGapY, out _relOuterGapY, out _ySizeLogical, out _yOffsetLogical);
            }

            if (!_independentColor)
            {
                ColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(NamedColor c)
                                           { _pen = _pen.WithColor(c); });

                // but if there is a color evaluation function, then use that function with higher priority
                VariableColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(Func <int, System.Drawing.Color> evalFunc)
                                                   { _cachedColorForIndexFunction = evalFunc; });
            }
        }
コード例 #6
0
 public void PrepareGroupStyles(Graph3D.Plot.Groups.PlotGroupStyleCollection externalGroups, Graph3D.Plot.Groups.PlotGroupStyleCollection localGroups, Graph3D.IPlotArea layer, Graph3D.Plot.Data.Processed3DPlotData pdata)
 {
     VariableColorGroupStyle.PrepareStyle(externalGroups, localGroups, GetColor);
 }
コード例 #7
0
 public void PrepareGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups, IPlotArea layer, Processed2DPlotData pdata)
 {
     VariableColorGroupStyle.PrepareStyle(externalGroups, localGroups, GetColor);
 }
コード例 #8
0
 public void CollectLocalGroupStyles(Graph3D.Plot.Groups.PlotGroupStyleCollection externalGroups, Graph3D.Plot.Groups.PlotGroupStyleCollection localGroups)
 {
     VariableColorGroupStyle.AddLocalGroupStyle(externalGroups, localGroups);
 }
コード例 #9
0
 public void CollectLocalGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups)
 {
     VariableColorGroupStyle.AddLocalGroupStyle(externalGroups, localGroups);
 }