public bool InitializeDocument(params object[] args)
 {
     if (args.Length == 0 || !(args[0] is DensityImagePlotStyle))
     {
         return(false);
     }
     m_PlotStyle = (DensityImagePlotStyle)args[0];
     //_doc = _originalDoc; // _useDocumentCopy == UseDocument.Directly ? _originalDoc : (DensityImagePlotStyle)_originalDoc.Clone();
     SetElements(true); // initialize always because we have to update the temporary variables
     return(true);
 }
Example #2
0
 protected override System.Collections.Generic.IEnumerable <Main.DocumentNodeAndName> GetDocumentNodeChildrenWithName()
 {
     if (null != _plotData)
     {
         yield return(new Main.DocumentNodeAndName(_plotData, () => _plotData = null, "Data"));
     }
     if (null != _plotStyle)
     {
         yield return(new Main.DocumentNodeAndName(_plotStyle, () => _plotStyle = null, "Style"));
     }
 }
            public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                XYZMeshedColumnPlotData pa = (XYZMeshedColumnPlotData)info.GetValue("Data", o);
                DensityImagePlotStyle   ps = (DensityImagePlotStyle)info.GetValue("Style", o);

                if (o == null)
                {
                    return(new DensityImagePlotItem(pa, ps));
                }
                else
                {
                    DensityImagePlotItem s = (DensityImagePlotItem)o;
                    s.Data  = pa;
                    s.Style = ps;
                    return(s);
                }
            }
Example #4
0
        /// <summary>
        /// Plots a density image of the selected columns.
        /// </summary>
        /// <param name="dg"></param>
        /// <param name="bLine"></param>
        /// <param name="bScatter"></param>
        public static void PlotDensityImage(GUI.WorksheetController dg, bool bLine, bool bScatter)
        {
            DensityImagePlotStyle plotStyle = new DensityImagePlotStyle();

            // if nothing is selected, assume that the whole table should be plotted
            int len = dg.SelectedDataColumns.Count;

            XYZMeshedColumnPlotData assoc = new XYZMeshedColumnPlotData(dg.Doc.DataColumns, len == 0 ? null : dg.SelectedDataColumns);


            // now create a new Graph with this plot associations

            Altaxo.Graph.GUI.IGraphController gc = Current.ProjectService.CreateNewGraph();

            IGPlotItem pi = new DensityImagePlotItem(assoc, plotStyle);

            gc.Doc.Layers[0].PlotItems.Add(pi);
        }
Example #5
0
        /// <summary>
        /// Plots a density image of the selected columns.
        /// </summary>
        /// <param name="dg"></param>
        /// <param name="bLine"></param>
        /// <param name="bScatter"></param>
        public static void PlotDensityImage(IWorksheetController dg, bool bLine, bool bScatter)
        {
            var graph   = Altaxo.Graph.Gdi.GraphTemplates.TemplateWithXYPlotLayerWithG2DCartesicCoordinateSystem.CreateGraph(dg.DataTable.GetPropertyContext(), null, dg.DataTable.Name, true);
            var xylayer = graph.RootLayer.Layers.OfType <XYPlotLayer>().First();
            var context = graph.GetPropertyContext();

            var plotStyle = new DensityImagePlotStyle();

            var assoc = new XYZMeshedColumnPlotData(dg.DataTable, dg.SelectedDataRows, dg.SelectedDataColumns, dg.SelectedPropertyColumns);

            if (assoc.DataTableMatrix.RowHeaderColumn == null)
            {
                assoc.DataTableMatrix.RowHeaderColumn = new IndexerColumn();
            }
            if (assoc.DataTableMatrix.ColumnHeaderColumn == null)
            {
                assoc.DataTableMatrix.ColumnHeaderColumn = new IndexerColumn();
            }

            IGPlotItem pi = new DensityImagePlotItem(assoc, plotStyle);

            xylayer.PlotItems.Add(pi);
            Current.ProjectService.CreateNewGraph(graph);
        }
Example #6
0
		public DensityImagePlotItem(XYZMeshedColumnPlotData pa, DensityImagePlotStyle ps)
		{
			this.Data = pa;
			this.Style = ps;
		}
Example #7
0
		protected override System.Collections.Generic.IEnumerable<Main.DocumentNodeAndName> GetDocumentNodeChildrenWithName()
		{
			if (null != _plotData)
				yield return new Main.DocumentNodeAndName(_plotData, () => _plotData = null, "Data");
			if (null != _plotStyle)
				yield return new Main.DocumentNodeAndName(_plotStyle, () => _plotStyle = null, "Style");
		}
 public DensityImagePlotItem(XYZMeshedColumnPlotData pa, DensityImagePlotStyle ps)
 {
     this.Data  = pa;
     this.Style = ps;
 }
 public DensityImagePlotStyleController(DensityImagePlotStyle plotStyle)
 {
     m_PlotStyle = plotStyle;
     SetElements(true);
 }