public cFeedBackMessage Run() { if (base.Start() == false) { base.FeedBackMessage.IsSucceed = false; return base.FeedBackMessage; } if ((this.Input == null)||(this.Input.Count==0)) { FeedBackMessage.IsSucceed = false; FeedBackMessage.Message = "No input data defined."; return FeedBackMessage; } FeedBackMessage.IsSucceed = true; #region Properties Management object _firstValue = base.ListProperties.FindByName("Normalized ?"); bool IsNormalized = false; if (_firstValue == null) { base.GenerateError("-Normalized ?- not found !"); return base.FeedBackMessage; } try { cProperty TmpProp = (cProperty)_firstValue; IsNormalized = (bool)TmpProp.GetValue(); } catch (Exception) { base.GenerateError("-Normalized ?- cast didn't work"); return base.FeedBackMessage; } _firstValue = base.ListProperties.FindByName("Draw Axis ?"); bool IsdrawAxis = true; if (_firstValue == null) { base.GenerateError("-Draw Axis ?- not found !"); return base.FeedBackMessage; } try { cProperty TmpProp = (cProperty)_firstValue; IsdrawAxis = (bool)TmpProp.GetValue(); } catch (Exception) { base.GenerateError("-Draw Axis ?- cast didn't work"); return base.FeedBackMessage; } _firstValue = base.ListProperties.FindByName("Link Points ?"); bool IsLinked = false; if (_firstValue == null) { base.GenerateError("-Link Points ?- not found !"); return base.FeedBackMessage; } try { cProperty TmpProp = (cProperty)_firstValue; IsLinked = (bool)TmpProp.GetValue(); } catch (Exception) { base.GenerateError("-Link Points ?- cast didn't work"); return base.FeedBackMessage; } _firstValue = base.ListProperties.FindByName("Desc. 1"); string Desc1; if (_firstValue == null) { base.GenerateError("-Desc. 1- not found !"); return base.FeedBackMessage; } try { cProperty TmpProp = (cProperty)_firstValue; Desc1 = (string)TmpProp.GetValue(); } catch (Exception) { base.GenerateError("-Desc. 1- cast didn't work"); return base.FeedBackMessage; } cDescriptorType DescX = cGlobalInfo.CurrentScreening.ListDescriptors.GetDescriptorByName(Desc1); if (DescX == null) { base.GenerateError(Desc1 + " is not a descriptor !"); return base.FeedBackMessage; } _firstValue = base.ListProperties.FindByName("Desc. 2"); if (_firstValue == null) { base.GenerateError("-Desc. 2- not found !"); return base.FeedBackMessage; } try { cProperty TmpProp = (cProperty)_firstValue; Desc1 = (string)TmpProp.GetValue(); } catch (Exception) { base.GenerateError("-Desc. 2- cast didn't work"); return base.FeedBackMessage; } cDescriptorType DescY = cGlobalInfo.CurrentScreening.ListDescriptors.GetDescriptorByName(Desc1); if (DescY == null) { base.GenerateError(Desc1 + " is not a descriptor !"); return base.FeedBackMessage; } _firstValue = base.ListProperties.FindByName("Desc. 3"); if (_firstValue == null) { base.GenerateError("-Desc. 3- not found !"); return base.FeedBackMessage; } try { cProperty TmpProp = (cProperty)_firstValue; Desc1 = (string)TmpProp.GetValue(); } catch (Exception) { base.GenerateError("-Desc. 2- cast didn't work"); return base.FeedBackMessage; } cDescriptorType DescZ = cGlobalInfo.CurrentScreening.ListDescriptors.GetDescriptorByName(Desc1); if (DescZ == null) { base.GenerateError(Desc1 + " is not a descriptor !"); return base.FeedBackMessage; } #endregion List<cDescriptorType> ListDesc = new List<cDescriptorType>(); ListDesc.Add(DescX); ListDesc.Add(DescY); ListDesc.Add(DescZ); cListExtendedTable LET = new cListExtendedTable(); foreach (var item in cGlobalInfo.ListWellClasses) { List<cWellClassType> TypeForFilter = new List<cWellClassType>(); TypeForFilter.Add(item); cExtendedTable TmpTable = ((cListWells)this.Input.Filter(TypeForFilter)).GetAverageDescriptorValues(ListDesc,false, false); if (TmpTable != null) LET.Add(TmpTable); } cViewer3D V3D = new cViewer3D(); c3DNewWorld MyWorld = new c3DNewWorld(new cPoint3D(1, 1, 1), new cPoint3D(1, 1, 1)); c3DObjectScatterPoints _3DScatterPt = new c3DObjectScatterPoints(); _3DScatterPt.ListProperties.FindByName("Draw Axis ?").SetNewValue(IsdrawAxis); _3DScatterPt.ListProperties.FindByName("Normalized ?").SetNewValue(IsNormalized); _3DScatterPt.ListProperties.FindByName("Link Points ?").SetNewValue(IsLinked); _3DScatterPt.SetInputData(LET); if (_3DScatterPt.Run(MyWorld).IsSucceed == false) return base.FeedBackMessage; cListGeometric3DObject GlobalList = _3DScatterPt.GetOutPut(); foreach (var item in GlobalList) { MyWorld.AddGeometric3DObject(item); } MyWorld.BackGroundColor = cGlobalInfo.OptionsWindow.FFAllOptions.panelFor3DBackColor.BackColor; V3D.SetInputData(MyWorld); V3D.Run(); cDisplayToWindow DTW = new cDisplayToWindow(); DTW.SetInputData(V3D.GetOutPut()); DTW.Title = "3D Scatter Plot(List "+this.Input.Count +" Wells)"; DTW.Run(); DTW.Display(); return base.FeedBackMessage; }
private void dRC3DToolStripMenuItem_Click(object sender, EventArgs e) { if (cGlobalInfo.CurrentScreening.ListDescriptors.GetActiveDescriptors().Count < 3) { MessageBox.Show("At least 3 descriptors are required for this operation !", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } cListExtendedTable LET = new cListExtendedTable(); //List<cListWells> ListWells = new List<cListWells>(); //ListWells.Add(cGlobalInfo.CurrentScreening.GetCurrentDisplayPlate().ListActiveWells); // firstly, wells are grouped by class //foreach (var item in cGlobalInfo.ListWellClasses) //{ // List<cWellClassType> TypeForFilter = new List<cWellClassType>(); // TypeForFilter.Add(item); // cListWells TmpListWells = cGlobalInfo.CurrentScreening.GetCurrentDisplayPlate().ListActiveWells.Filter(TypeForFilter); // cGeneralDRC gDRC = new cGeneralDRC(TmpListWells); // LET.Add(gDRC.ListAverageValues); //} for (int i = 0; i < 3; i++) { List<int> GroupForFilter = new List<int>(); GroupForFilter.Add(i); cListWells TmpListWells = cGlobalInfo.CurrentScreening.GetCurrentDisplayPlate().ListActiveWells.FilterByGroup(GroupForFilter); cGeneralDRC gDRC = new cGeneralDRC(TmpListWells); LET.Add(gDRC.ListAverageValues); } cViewer3D V3D = new cViewer3D(); c3DNewWorld MyWorld = new c3DNewWorld(new cPoint3D(1, 1, 1), new cPoint3D(1, 1, 1)); c3DObjectScatterPoints _3DScatterPt = new c3DObjectScatterPoints(); //_3DScatterPt.SetInputData(cGlobalInfo.CurrentScreening.GetCurrentDisplayPlate().ListActiveWells.GetDescriptorValues(cGlobalInfo.CurrentScreening.ListDescriptors.GetActiveDescriptors(), false)); // _3DScatterPt.GlobalInfo = this.GlobalInfo; _3DScatterPt.SetInputData(LET); // _3DScatterPt.IsLinked = true; _3DScatterPt.Run(MyWorld); cListGeometric3DObject GlobalList = _3DScatterPt.GetOutPut(); foreach (var item in GlobalList) { MyWorld.AddGeometric3DObject(item); } MyWorld.BackGroundColor = cGlobalInfo.OptionsWindow.FFAllOptions.panelFor3DBackColor.BackColor; V3D.SetInputData(MyWorld); V3D.Run(); cDisplayToWindow DTW = new cDisplayToWindow(); DTW.SetInputData(V3D.GetOutPut()); DTW.Title = "3D Dose Response Visualization"; DTW.Run(); DTW.Display(); }
private void ToolStripMenuItem_Display3DScatterGraph(object sender, EventArgs e) { cExtendedTable CET = new cExtendedTable(); foreach (DataGridViewColumn item in GridView.SelectedColumns) { CET.Add(Input[item.Index]); } if (this.Input.ListTags != null) { CET.ListTags = new List<object>(); foreach (var item in this.Input.ListTags) { CET.ListTags.Add(item); } } cListExtendedTable LET = new cListExtendedTable(); LET.Add(CET); //List<cListWells> ListWells = new List<cListWells>(); //ListWells.Add(cGlobalInfo.CurrentScreening.GetCurrentDisplayPlate().ListActiveWells); cViewer3D V3D = new cViewer3D(); c3DNewWorld MyWorld = new c3DNewWorld(new cPoint3D(1, 1, 1), new cPoint3D(1, 1, 1)); c3DObjectScatterPoints _3DScatterPt = new c3DObjectScatterPoints(); _3DScatterPt.ListProperties.FindByName("Draw Axis ?").SetNewValue((bool)true); _3DScatterPt.ListProperties.FindByName("Draw Axis ?").IsGUIforValue = true; _3DScatterPt.ListProperties.FindByName("Normalized ?").SetNewValue((bool)true); _3DScatterPt.ListProperties.FindByName("Normalized ?").IsGUIforValue = true; _3DScatterPt.ListProperties.FindByName("Link Points ?").SetNewValue((bool)false); _3DScatterPt.ListProperties.FindByName("Link Points ?").IsGUIforValue = true; //_3DScatterPt.GlobalInfo = cGlobalInfo; _3DScatterPt.SetInputData(LET); if (_3DScatterPt.Run(MyWorld).IsSucceed == false) return; cListGeometric3DObject GlobalList = _3DScatterPt.GetOutPut(); foreach (var item in GlobalList) { MyWorld.AddGeometric3DObject(item); } V3D.SetInputData(MyWorld); V3D.Run(); cDisplayToWindow DTW = new cDisplayToWindow(); DTW.SetInputData(V3D.GetOutPut()); DTW.Title = "3D Scatter Graph ("+ this.Input.Name +")"; DTW.Run(); DTW.Display(); }