Beispiel #1
0
 public void CollectLocalGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups)
 {
     ColorGroupStyle.AddLocalGroupStyle(externalGroups, localGroups);
     SymbolSizeGroupStyle.AddLocalGroupStyle(externalGroups, localGroups);
     SymbolShapeStyleGroupStyle.AddLocalGroupStyle(externalGroups, localGroups);
     SkipFrequencyGroupStyle.AddLocalGroupStyle(externalGroups, localGroups); // (local group style only)
 }
Beispiel #2
0
        public void CollectExternalGroupStyles(PlotGroupStyleCollection externalGroups)
        {
            if (this.IsColorProvider)
            {
                ColorGroupStyle.AddExternalGroupStyle(externalGroups);
            }
            if (this.IsSymbolSizeProvider)
            {
                SymbolSizeGroupStyle.AddExternalGroupStyle(externalGroups);
            }

            SymbolShapeStyleGroupStyle.AddExternalGroupStyle(externalGroups);
        }
Beispiel #3
0
        public void PrepareGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups, IPlotArea layer, Processed2DPlotData pdata)
        {
            if (this.IsColorProvider)
            {
                ColorGroupStyle.PrepareStyle(externalGroups, localGroups, delegate() { return(PlotColors.Colors.GetPlotColor(this.Color)); });
            }

            SymbolShapeStyleGroupStyle.PrepareStyle(externalGroups, localGroups, delegate { return(this.ShapeAndStyle); });

            if (this.IsSymbolSizeProvider)
            {
                SymbolSizeGroupStyle.PrepareStyle(externalGroups, localGroups, delegate() { return(SymbolSize); });
            }

            // SkipFrequency should be the same for all sub plot styles, so there is no "private" property
            SkipFrequencyGroupStyle.PrepareStyle(externalGroups, localGroups, delegate() { return(SkipFrequency); });
        }
Beispiel #4
0
        public void ApplyGroupStyles(PlotGroupStyleCollection externalGroups, PlotGroupStyleCollection localGroups)
        {
            if (this.IsColorReceiver)
            {
                ColorGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(PlotColor c) { this.Color = c; });
            }

            SymbolShapeStyleGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(ShapeAndStyle c) { this.ShapeAndStyle = c; });


            if (!_independentSymbolSize)
            {
                SymbolSizeGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(float size) { this.SymbolSize = size; });
            }

            // SkipFrequency should be the same for all sub plot styles, so there is no "private" property
            SkipFrequencyGroupStyle.ApplyStyle(externalGroups, localGroups, delegate(int c) { this.SkipFrequency = c; });
        }
            public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                PlotItemCollection s = null != o ? (PlotItemCollection)o : new PlotItemCollection();

                int count = info.OpenArray();

                IGPlotItem[] plotItems = new IGPlotItem[count];
                for (int i = 0; i < count; i++)
                {
                    plotItems[i] = (IGPlotItem)info.GetValue("PlotItem", s);
                }
                info.CloseArray(count);


                count = info.OpenArray(); // PlotGroups
                PGTrans[] plotGroups = new PGTrans[count];
                for (int i = 0; i < count; i++)
                {
                    plotGroups[i].PlotGroup = (PlotGroupMemento)info.GetValue(s);
                }
                info.CloseArray(count);

                // now assemble the new tree based collection based on the both fields

                for (int pix = 0; pix < plotItems.Length; pix++)
                {
                    // look if this plotItem is member of some group
                    int foundidx = -1;
                    for (int grx = 0; grx < plotGroups.Length; grx++)
                    {
                        if (Array.IndexOf <int>(plotGroups[grx].PlotGroup._plotItemIndices, pix) >= 0)
                        {
                            foundidx = grx;
                            break;
                        }
                    }
                    if (foundidx < 0) // if not found in some group, add the item directly
                    {
                        s.Add(plotItems[pix]);
                    }
                    else
                    {
                        if (plotGroups[foundidx].PlotItemCollection == null)
                        {
                            PlotItemCollection newColl = new PlotItemCollection();
                            plotGroups[foundidx].PlotItemCollection = newColl;
                            s.Add(plotGroups[foundidx].PlotItemCollection);
                            // now set the properties of this new collection
                            bool            serial = !plotGroups[foundidx].PlotGroup._concurrently;
                            IPlotGroupStyle curr   = null;
                            IPlotGroupStyle prev   = null;
                            if (0 != (plotGroups[foundidx].PlotGroup._plotGroupStyle & Version0PlotGroupStyle.Color))
                            {
                                curr = new ColorGroupStyle();
                                newColl.GroupStyles.Add(curr);
                            }
                            if (0 != (plotGroups[foundidx].PlotGroup._plotGroupStyle & Version0PlotGroupStyle.Line))
                            {
                                prev = curr;
                                curr = new LineStyleGroupStyle();
                                newColl.GroupStyles.Add(curr, serial ? (prev == null?null:prev.GetType()) : null);
                            }
                            if (0 != (plotGroups[foundidx].PlotGroup._plotGroupStyle & Version0PlotGroupStyle.Symbol))
                            {
                                prev = curr;
                                curr = new SymbolShapeStyleGroupStyle();
                                newColl.GroupStyles.Add(curr, serial ? (prev == null ? null : prev.GetType()) : null);
                            }
                        }
                        // now add the item to this collection
                        plotGroups[foundidx].PlotItemCollection.Add(plotItems[pix]);
                    }
                }

                return(s);
            }