12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772 |
- using OpenCvSharp;
- using PaintDotNet.Annotation;
- using PaintDotNet.Base;
- using PaintDotNet.Base.CommTool;
- using PaintDotNet.Base.Functionodel;
- using PaintDotNet.Base.SettingModel;
- using PaintDotNet.Data.Param;
- using System;
- using System.Collections.Generic;
- using System.Drawing;
- using System.IO;
- using System.Windows.Forms;
- namespace PaintDotNet
- {
- class BinaryClass
- {
- private int menuId;
- protected static string ParamKey_binaryStyle = "binaryStyle";//二值样式
- //protected static string ParamKey_displaygrid = "displaygrid";//显示网格
- //protected static string ParamKey_displaysections = "displaysections";//显示截点
- /// <summary>
- /// 是否针对全图进行二值化操作
- /// </summary>
- public bool processWholeMat = false;
- /// <summary>
- /// 是否显示视场
- /// </summary>
- public Boolean ShowDrawClassView = true;
- /// <summary>
- /// 调色板
- /// </summary>
- PaintDotNet.ColorsForm colorsForm1;
- /// <summary>
- /// 构造工作结构
- /// </summary>
- private Dictionary<int, DocumentItem> documentItems;
- /// <summary>
- /// 需要的数据在这里引用
- /// </summary>
- CustomControl.BinaryControlSmaller bmc;
- /// <summary>
- /// 需要的数据在这里引用
- /// </summary>
- CustomControl.BinaryControl bc;
- AppWorkspace appWorkspace;
- DocumentWorkspaceWindow documentWorkspace;
- ListView listView1;
- /// <summary>
- /// 是否要调用二值化的算法
- /// </summary>
- private bool toApplyBinary = true;
- /// <summary>
- /// 处理程序
- /// </summary>
- private ParamObject action = new Data.Action.Action901();
- /// <summary>
- /// 处理程序
- /// </summary>
- private ParamObject analysisAction = new Data.Action.ActionAnalysis();
- /// <summary>
- /// 二值参数配置值(当前图片)
- /// </summary>
- private BinaryExtractionModel binaryExtractionModel;
- /// <summary>
- /// 二值参数是否进行全部应用,用于更新图片二值化效果,默认为false
- /// </summary>
- private Dictionary<string, bool> binaryModelFlag = new Dictionary<string, bool>();
- /// <summary>
- /// 二值参数配置值(全部图片的)
- /// </summary>
- private Dictionary<string, BinaryExtractionModel> binaryModelDict = new Dictionary<string, BinaryExtractionModel>();
- /// <summary>
- /// 二值(备份全部图片)
- /// </summary>
- private Dictionary<string, Mat> binaryData1Dict = new Dictionary<string, Mat>();
- /// <summary>
- /// 相0的图片,处理多视场使用
- /// </summary>
- public Mat PhaseModels0Mat;
- /// <summary>
- /// 辅助线集成
- /// </summary>
- public PaintDotNet.DedicatedAnalysis.GrainSizeStandard.IntegrationClass.GrainSizeGuideClass guideClass;
- public ComboBox comboBox1;
- //public object SelectedItem;
- //public GrainSizeGuideClass GuideClass
- //{
- // set
- // {
- // this.guideClass = value;
- // }
- //}
- public static Mat dstBinary;
- /// <summary>
- /// 对二值图像的透明通道提取出单通道图像
- /// </summary>
- /// <param name="source"></param>
- /// <returns></returns>
- public unsafe static Mat BGRA2GRAY(Mat source/*, out Mat dst*/)
- {
- if (source.Channels() != 4)
- {
- //Mat dst = source;
- return source.CvtColor(ColorConversionCodes.BGR2GRAY);// dst;// false;、、should never go here !
- }
- //二值提取
- if (dstBinary != null)
- {
- dstBinary.Dispose();
- dstBinary = null;
- }
- dstBinary = new Mat(source.Rows, source.Cols, MatType.CV_8UC1, new Scalar(0));
- //如果是rgba
- source.ForEachAsVec4b(ForeachFunctionByteForWhole4B);
- Mat dst = dstBinary.Clone();
- dstBinary.Dispose();
- dstBinary = null;
- return dst;// true;
- }
- /// <summary>
- /// 提取二值化的透明通道并赋值
- /// </summary>
- /// <param name="t"></param>
- /// <param name="position"></param>
- public unsafe static void ForeachFunctionByteForWhole4B(Vec4b* t, int* position)
- {
- dstBinary.Set(position[0], position[1], t->Item3);
- }
- /// <summary>
- /// 公开的事件,每次二值化之后需要的计算事件写在这里
- /// </summary>
- public event EventHandler BinaryImplFinishAction;
- private void OnBinaryImplFinishAction()
- {
- if (BinaryImplFinishAction != null)
- {
- BinaryImplFinishAction(this, new EventArgs());
- }
- }
- public BinaryClass(int menuId)
- {
- this.menuId = menuId;
- }
- /// <summary>
- /// 判断是否进行二值,以及返回二值图片
- /// </summary>
- /// <param name="imagesKey"></param>
- /// <returns></returns>
- public Mat getModelMat(string imagesKey)
- {
- if (binaryData1Dict.ContainsKey(imagesKey) && (!binaryModelDict.ContainsKey(imagesKey) && binaryExtractionModel.BinaryCheckFlag > 1
- || binaryModelDict.ContainsKey(imagesKey) && binaryModelDict[imagesKey].BinaryCheckFlag > 1))
- return binaryData1Dict[imagesKey];
- return null;
- }
- /// <summary>
- /// 判断是否进行二值
- /// </summary>
- /// <param name="imagesKey"></param>
- /// <returns></returns>
- public bool getModelBinaryCheckFlag(string imagesKey)
- {
- if ((!binaryModelDict.ContainsKey(imagesKey) && binaryExtractionModel.BinaryCheckFlag > 1
- || binaryModelDict.ContainsKey(imagesKey) && binaryModelDict[imagesKey].BinaryCheckFlag > 1))
- return true;
- return false;
- }
- /// <summary>
- /// 判断是否需要计算,并根据判断结果进行相关处理
- /// </summary>
- /// <param name="imagesKey"></param>
- /// <param name="analysisPicture"></param>
- public void updateAnalysisData(string imagesKey, int analysisPicture)
- {
- if (!binaryModelDict.ContainsKey(imagesKey) && binaryExtractionModel.BinaryCheckFlag > 1
- || binaryModelDict.ContainsKey(imagesKey) && binaryModelDict[imagesKey].BinaryCheckFlag > 1)
- ////|| binaryModelFlag.ContainsKey(imagesKey) && binaryModelFlag[imagesKey]/* //################ && binaryModelFlag[imagesKey] = false;*/)
- {
- this.applyButtonImpl(imagesKey, analysisPicture, /*bitmap = */this.appWorkspace.DocumentWorkspaces[analysisPicture].CompositionSurface.CreatedAliasedMat());
- //if (binaryModelFlag.ContainsKey(imagesKey) && binaryModelFlag[imagesKey])
- // binaryModelFlag[imagesKey] = false;
- }
- else if (binaryData1Dict.ContainsKey(imagesKey))
- {
- if (binaryData1Dict[imagesKey] != null)
- binaryData1Dict[imagesKey] = null;
- }
- }
- public void InitBinaryControlEvent()
- {
- if (bmc != null)
- {
- bmc.InitBinaryControlEvent();
- bmc.BinaryGetParamAction += new EventHandler(this.bcBinaryGetParamAction);
- bmc.AutoThresClickAction += new EventHandler(this.bcAutoThresClickAction);
- bmc.InverseClickAction += new EventHandler(this.bcBinaryGetParamAction);
- bmc.InverseClickAction += new EventHandler(this.bcApplyButtonImplAction);
- bmc.RadioButton1ChangedAction += new EventHandler(this.bcBinaryGetParamAction);
- bmc.RadioButton2ChangedAction += new EventHandler(this.bcBinaryGetParamAction);
- bmc.ApplyButtonImplAction += new EventHandler(this.bcApplyButtonImplAction);
- bmc.BinaryCheckedChangedAction += new EventHandler(this.bcBinaryCheckedChanged);
- bmc.OriginCheckedChangedAction += new EventHandler(this.bcOriginCheckedChanged);
- bmc.BinaryEditClickAction += new EventHandler(this.bcBinaryEditClickAction);
- bmc.PanelColorClickAction += new EventHandler(this.bcPanelColorClickAction);//初始化颜色点击事件
- return;
- }
- if (bc == null)
- return;
- bc.InitBinaryControlEvent();
- bc.BinaryGetParamAction += new EventHandler(this.bcBinaryGetParamAction);
- bc.AutoThresClickAction += new EventHandler(this.bcAutoThresClickAction);
- bc.InverseClickAction += new EventHandler(this.bcBinaryGetParamAction);
- bc.InverseClickAction += new EventHandler(this.bcApplyButtonImplAction);
- bc.RadioButton1ChangedAction += new EventHandler(this.bcBinaryGetParamAction);
- bc.RadioButton2ChangedAction += new EventHandler(this.bcBinaryGetParamAction);
- bc.ApplyButtonImplAction += new EventHandler(this.bcApplyButtonImplAction);
- bc.BinaryCheckedChangedAction += new EventHandler(this.bcBinaryCheckedChanged);
- bc.OriginCheckedChangedAction += new EventHandler(this.bcOriginCheckedChanged);
- bc.BinaryEditClickAction += new EventHandler(this.bcBinaryEditClickAction);
- bc.PanelColorClickAction += new EventHandler(this.bcPanelColorClickAction);//初始化颜色点击事件
- }
- /// <summary>
- /// 外部需要改变二值化勾选状态时调用该方法
- /// </summary>
- /// <param name="toCheck"></param>
- public void performClickBinaryCheck(bool toCheck)
- {
- if (bmc != null)
- bmc.BinaryChecked = toCheck;
- else
- bc.BinaryChecked = toCheck;
- }
- /// <summary>
- /// 相颜色点击事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void bcPanelColorClickAction(object sender, EventArgs e)
- {
- this.colorsForm1.UserPrimaryColor = ColorBgra.FromColor(bmc != null ? bmc.BinaryBackColor : bc.BinaryBackColor);
- this.colorsForm1.ShowDialog();
- this.applyButtonImpl(/*bitmap*/);
- }
- /// <summary>
- /// 二值筛选
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void bcBinaryEditClickAction(object sender, EventArgs e)
- {
- if (this.documentWorkspace.PhaseModels[0].mat == null)
- {
- MessageBox.Show(PdnResources.GetString("Menu.Pleaseperonfirst.text"));
- return;
- }
- PaintDotNet.DedicatedAnalysis.GrainSizeStandard.IntegrationClass.GrainBinaryBoundaryEditingDialog boundaryEditingDialog = new PaintDotNet.DedicatedAnalysis.GrainSizeStandard.IntegrationClass.GrainBinaryBoundaryEditingDialog(this.appWorkspace, this.listView1.FocusedItem != null ? this.listView1.FocusedItem.Index : this.listView1.SelectedItems[0].Index, bmc != null ? bmc.BinaryBackColor : bc.BinaryBackColor
- , this.documentWorkspace.PhaseModels[0].mat.Clone(), ShowDrawClassView, this.appWorkspace.DocumentWorkspaces[this.listView1.FocusedItem != null ? this.listView1.FocusedItem.Index : this.listView1.SelectedItems[0].Index].GetRuler(MeasurementUnit.Micron));
- ////1013###19326 晶粒度的晶界编辑页面,需要把辅助线带过去(客户编辑只处理辅助线位置的晶界)
- if (this.guideClass != null && this.comboBox1 != null && this.comboBox1.SelectedItem != null)
- {
- boundaryEditingDialog.GuideClass = this.guideClass;
- boundaryEditingDialog.SelectedItem = this.comboBox1.SelectedItem;
- }
- if (boundaryEditingDialog.ShowDialog() == DialogResult.OK)
- {
- this.documentWorkspace.PhaseModels[0].mat = boundaryEditingDialog.PhaseMat.Clone();
- OnBinaryImplFinishAction();
- }
- }
- /// <summary>
- /// 显示原图勾选改变事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void bcOriginCheckedChanged(object sender, EventArgs e)
- {
- if (bc == null && bmc == null)
- return;
- int BinaryCheckFlag = 0;
- if (bmc != null ? bmc.OriginChecked : bc.OriginChecked)
- BinaryCheckFlag += 1;
- if (bmc != null ? bmc.BinaryChecked : bc.BinaryChecked)
- BinaryCheckFlag += 2;
- this.binaryExtractionModel.BinaryCheckFlag = BinaryCheckFlag;
- }
- /// <summary>
- /// 二值化勾选改变事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void bcBinaryCheckedChanged(object sender, EventArgs e)
- {
- if (bc == null && bmc == null)
- return;
- int BinaryCheckFlag = 0;
- if (bmc != null ? bmc.OriginChecked : bc.OriginChecked)
- BinaryCheckFlag += 1;
- if (bmc != null ? bmc.BinaryChecked : bc.BinaryChecked)
- BinaryCheckFlag += 2;
- this.binaryExtractionModel.BinaryCheckFlag = BinaryCheckFlag;
- if ((bmc != null ? bmc.BinaryChecked : bc.BinaryChecked) && !(bmc != null ? bmc.OriginChecked : bc.OriginChecked))
- {
- this.documentWorkspace.PhaseModels[0].choise = true;
- }
- else
- {
- this.documentWorkspace.PhaseModels[0].choise = false;
- }
- if (toApplyBinary)
- this.applyButtonImpl();
- else
- OnBinaryImplFinishAction();
- toApplyBinary = true;
- if (this.listView1.FocusedItem == null || !(bmc != null ? bmc.BinaryChecked : bc.BinaryChecked))
- this.documentWorkspace.Refresh();
- }
- /// <summary>
- /// 自动阈值
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void bcAutoThresClickAction(object sender, EventArgs e)
- {
- if (bc == null && bmc == null)
- return;
- Mat imageMat = null;
- if (listView1.FocusedItem != null || this.listView1.SelectedItems != null && this.listView1.SelectedItems.Count > 0)
- imageMat = this.appWorkspace.DocumentWorkspaces[this.listView1.FocusedItem != null ? this.listView1.FocusedItem.Index : this.listView1.SelectedItems[0].Index].CompositionSurface.CreatedAliasedMat();
- if (imageMat != null)
- {
- //先计算阈值
- Mat gray = imageMat.CvtColor(ColorConversionCodes.BGR2GRAY);
- double otsu = Cv2.Threshold(gray, gray, 0, 255, ThresholdTypes.Triangle/*.Otsu*/);
- if (otsu <= 10 || otsu >= 245)
- {
- otsu = Cv2.Threshold(imageMat.CvtColor(ColorConversionCodes.BGR2GRAY), gray, 0, 255, ThresholdTypes.Otsu);//.Triangle
- }
- //如果当前是两个区间,则需要重新计算一次
- if (this.ColorInterval == 2)
- {
- if (bmc != null)
- bmc.OnInverseClickAction();
- else
- bc.OnInverseClickAction();
- this.ColorInterval = (bmc != null ? bmc.getInverseStyle() : bc.getInverseStyle());
- }
- else
- {
- if (bmc != null)
- bmc.setInverseStyle(1);
- else
- bc.setInverseStyle(1);
- }
- //给控件赋值
- if (bmc != null)
- bmc.scope1Start = 0;
- else
- bc.scope1Start = 0;
- if (bmc != null)
- bmc.scope1End = otsu;
- else
- bc.scope1End = otsu;
- //处理直方图
- if (bmc != null)
- bmc.UpdateVerticalBarWithOneScope(0, Convert.ToInt32(bmc.scope1End));
- else
- bc.UpdateVerticalBarWithOneScope(0, Convert.ToInt32(bc.scope1End));
- GC.Collect();
- this.bcApplyButtonImplAction(sender, e);
- }
- else
- {
- MessageBox.Show(PdnResources.GetString("Menu.Pleaseselectapicturefirst.text"));
- }
- }
- /// <summary>
- /// 执行读取参数的事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void bcBinaryGetParamAction(object sender, EventArgs e)
- {
- if (bc == null && bmc == null)
- return;
- this.binaryExtractionModel.ColorInterval = (bmc != null ? bmc.getInverseStyle() : bc.getInverseStyle());//###
- this.binaryExtractionModel.BinaryStyle = (bmc != null ? bmc.BinaryStyle : bc.BinaryStyle);
- this.binaryExtractionModel.ColorOneStart = (int)(bmc != null ? bmc.scope1Start : bc.scope1Start);
- this.binaryExtractionModel.ColorOneEnd = (int)(bmc != null ? bmc.scope1End : bc.scope1End);
- this.binaryExtractionModel.ColorTwoStart = (int)(bmc != null ? bmc.scope2Start : bc.scope2Start);
- this.binaryExtractionModel.ColorTwoEnd = (int)(bmc != null ? bmc.scope2End : bc.scope2End);
- this.binaryExtractionModel.ColorThreeStart = (int)(bmc != null ? bmc.scope3Start : bc.scope3Start);
- this.binaryExtractionModel.ColorThreeEnd = (int)(bmc != null ? bmc.scope3End : bc.scope3End);
- this.initParamsToAction();
- }
- /// <summary>
- /// 获取相的工作结构
- /// </summary>
- /// <param name="index">指明获取第几个相的工作结构</param>
- /// <returns></returns>
- public List<PhaseModel> getPhaseModels(int index)
- {
- return this.documentItems[index].phaseModels;
- }
- /// <summary>
- /// 应用到全部
- /// </summary>
- /// <param name="imagesKeys">所有要改变参数的图片tag</param>
- /// <param name="currentImagesKey">当前操作的图片tag</param>
- public void applyToAll(System.Collections.Specialized.StringCollection imagesKeys, string currentImagesKey)
- {
- foreach (var imagesKey in imagesKeys)
- {
- if (imagesKey.Equals(currentImagesKey))
- continue;//#
- if (!binaryModelDict.ContainsKey(imagesKey))
- {
- binaryModelFlag.Add(imagesKey, true);
- binaryModelDict.Add(imagesKey, this.binaryExtractionModel.cloneModel());
- if (!binaryData1Dict.ContainsKey(imagesKey))
- {
- binaryData1Dict.Add(imagesKey, null);
- }
- else
- binaryData1Dict[imagesKey] = null;//###
- }
- else
- {
- binaryModelFlag[imagesKey] = true;
- binaryModelDict[imagesKey] = this.binaryExtractionModel.cloneModel();
- binaryData1Dict[imagesKey] = null;
- }
- }
- }
- /// <summary>
- /// 保存二值化图片
- /// </summary>
- /// <param name="imagesKey"></param>
- public void saveMat(string imagesKey)
- {
- if (binaryData1Dict.ContainsKey(imagesKey))
- {
- if (binaryData1Dict[imagesKey] != null)
- binaryData1Dict[imagesKey] = null;
- binaryData1Dict[imagesKey] = this.documentWorkspace.phaseModels[0].mat;
- }
- else
- {
- try
- {
- binaryData1Dict.Add(imagesKey, this.documentWorkspace.phaseModels[0].mat);
- }
- catch (Exception)
- {
- binaryData1Dict.Add(imagesKey, null);
- }
- }
- }
- /// <summary>
- /// ListView图片选择改变事件,不显示视场
- /// </summary>
- /// <param name="imagesKey">选择改变后的图片tag</param>
- /// <param name="imageMat">选择改变后的图片</param>
- public void listView1_SelectedIndexChangedHideDrawClassView(Mat imageMat, string imagesKey = null)
- {
- if (imagesKey != null)
- {
- if (!binaryModelDict.ContainsKey(imagesKey))
- {
- binaryModelFlag.Add(imagesKey, false);
- this.binaryExtractionModel = this.binaryExtractionModel.cloneModel();
- binaryModelDict.Add(imagesKey, this.binaryExtractionModel);
- }
- //else
- {
- this.binaryExtractionModel = binaryModelDict[imagesKey];
- this.initParamsToAction();
- this.InitParameterToControl();
- }
- }
- Document document = Document.FromImageMat(imageMat/* //待测试.Clone()*/);
- this.documentWorkspace.Document = document;
- this.documentWorkspace.Visible = true;
- GraphicsList itemGraphicsList = this.appWorkspace.DocumentWorkspaces[this.listView1.FocusedItem != null ? this.listView1.FocusedItem.Index : this.listView1.SelectedItems[0].Index].GraphicsList;
- GraphicsList graphicsList = new GraphicsList();
- for (int j = 0; j < itemGraphicsList.Count; j++)
- {
- if (itemGraphicsList[j].objectType != Annotation.Enum.DrawClass.View)
- graphicsList.Add(itemGraphicsList[j]);
- }
- this.documentWorkspace.GraphicsList = graphicsList;
- this.documentWorkspace.PhaseModels = new List<PhaseModel>();
- this.documentWorkspace.PhaseModels.AddRange(this.getPhaseModels(this.listView1.FocusedItem != null ? this.listView1.FocusedItem.Index : this.listView1.SelectedItems[0].Index));
- if ((imagesKey == null || !binaryModelFlag.ContainsKey(imagesKey) || !binaryModelFlag[imagesKey]/*用于更新图片二值化效果*/) && (bc != null || bmc != null) && this.documentWorkspace.PhaseModels[0].mat != null)
- {
- if (!(bmc != null ? bmc.BinaryChecked : bc.BinaryChecked) && this.documentWorkspace.PhaseModels[0].choise
- /*&& (this.binaryExtractionModel.BinaryCheckFlag > 1)*/)
- {
- this.toApplyBinary = false;
- if (bmc != null)
- bmc.BinaryChecked = true;
- else
- bc.BinaryChecked = true;
- }
- }
- else
- {
- if (binaryData1Dict.ContainsKey(imagesKey) && binaryData1Dict[imagesKey] != null)
- {
- documentWorkspace.PhaseModels[0].mat = binaryData1Dict[imagesKey];// this.PerformProcess(
- //PaintDotNet.Camera.Tools.ToMat(documentWorkspace.GetFullSizeWithRegion()),
- //PaintDotNet.Camera.Tools.ToMat(bitmap));
- //documentWorkspace.PhaseModels[0].color = (bmc != null ? bmc.BinaryBackColor.ToArgb() : bc.BinaryBackColor.ToArgb());
- documentWorkspace.Refresh();
- }
- else
- this.applyButtonImpl();
- }
- if (imagesKey != null && binaryModelFlag.ContainsKey(imagesKey)/*用于更新图片二值化效果*/)
- {
- this.documentWorkspace.PhaseModels[0].choise = (this.binaryExtractionModel.BinaryCheckFlag == 2)/*(bmc != null ? bmc.BinaryChecked : bc.BinaryChecked)*/;
- binaryModelFlag[imagesKey] = false;
- if (bmc != null)
- bmc.BinaryChecked = this.documentWorkspace.PhaseModels[0].choise || (this.binaryExtractionModel.BinaryCheckFlag > 1);
- else
- bc.BinaryChecked = this.documentWorkspace.PhaseModels[0].choise || (this.binaryExtractionModel.BinaryCheckFlag > 1);
- }
- else if ((bc != null || bmc != null) && !this.documentWorkspace.PhaseModels[0].choise
- && (this.binaryExtractionModel.BinaryCheckFlag <= 1))
- if (bmc != null)
- bmc.BinaryChecked = false;
- else
- bc.BinaryChecked = false;
- if (imagesKey != null)
- {
- if (this.binaryExtractionModel.BinaryCheckFlag % 2 == 1)
- {
- if (bmc != null)
- bmc.OriginChecked = true;
- else
- bc.OriginChecked = true;
- }
- else
- {
- if (bmc != null)
- bmc.OriginChecked = false;
- else
- bc.OriginChecked = false;
- }
- }
- //显示直方图
- if (bc != null || bmc != null)
- if (bmc != null)
- bmc.CreateHistogram(imageMat, true, 339, 130, 0);
- else
- bc.CreateHistogram(imageMat, true, 339, 130, 0);
- this.RefreshHistogramControl1Values();//##
- }
- /// <summary>
- /// ListView图片选择改变事件
- /// </summary>
- /// <param name="imageMat">选择改变后的图片</param>
- public void listView1_SelectedIndexChanged(Mat imageMat, string imagesKey = null)
- {
- if (imagesKey != null)
- {
- if (!binaryModelDict.ContainsKey(imagesKey))
- {
- binaryModelFlag.Add(imagesKey, false);
- this.binaryExtractionModel = this.binaryExtractionModel.cloneModel();
- binaryModelDict.Add(imagesKey, this.binaryExtractionModel);
- }
- //else
- {
- this.binaryExtractionModel = binaryModelDict[imagesKey];
- this.initParamsToAction();
- this.InitParameterToControl();
- }
- }
- Document document = Document.FromImageMat(imageMat/* //待测试.Clone()*/);
- this.documentWorkspace.Document = document;
- this.documentWorkspace.Visible = true;
- this.documentWorkspace.GraphicsList = this.appWorkspace.DocumentWorkspaces[this.listView1.FocusedItem != null ? this.listView1.FocusedItem.Index : this.listView1.SelectedItems[0].Index].GraphicsList;
- this.documentWorkspace.PhaseModels = new List<PhaseModel>();
- this.documentWorkspace.PhaseModels.AddRange(this.getPhaseModels(this.listView1.FocusedItem != null ? this.listView1.FocusedItem.Index : this.listView1.SelectedItems[0].Index));
- if (((imagesKey == null || !binaryModelFlag.ContainsKey(imagesKey) || !binaryModelFlag[imagesKey]/*用于更新图片二值化效果*/) && (bc != null || bmc != null)) && this.documentWorkspace.PhaseModels[0].mat != null)
- {
- if (!(bmc != null ? bmc.BinaryChecked : bc.BinaryChecked) && this.documentWorkspace.PhaseModels[0].choise)
- {
- this.toApplyBinary = false;
- if (bmc != null)
- bmc.BinaryChecked = true;
- else
- bc.BinaryChecked = true;
- }
- }
- else
- {
- this.applyButtonImpl();
- }
- if (imagesKey != null && binaryModelFlag.ContainsKey(imagesKey)/*用于更新图片二值化效果*/)
- {
- this.documentWorkspace.PhaseModels[0].choise = (this.binaryExtractionModel.BinaryCheckFlag == 2);// (bmc != null ? bmc.BinaryChecked : bc.BinaryChecked);
- binaryModelFlag[imagesKey] = false;
- if (bmc != null)
- bmc.BinaryChecked = this.documentWorkspace.PhaseModels[0].choise || (this.binaryExtractionModel.BinaryCheckFlag > 1);
- else
- bc.BinaryChecked = this.documentWorkspace.PhaseModels[0].choise || (this.binaryExtractionModel.BinaryCheckFlag > 1);
- }
- else if ((bc != null || bmc != null) && !this.documentWorkspace.PhaseModels[0].choise
- && (this.binaryExtractionModel.BinaryCheckFlag <= 1))
- if (bmc != null)
- bmc.BinaryChecked = false;
- else
- bc.BinaryChecked = false;
- if (imagesKey != null)
- {
- if (this.binaryExtractionModel.BinaryCheckFlag % 2 == 1)
- {
- if (bmc != null)
- bmc.OriginChecked = true;
- else
- bc.OriginChecked = true;
- }
- else
- {
- if (bmc != null)
- bmc.OriginChecked = false;
- else
- bc.OriginChecked = false;
- }
- }
- //显示直方图
- if (bc != null || bmc != null)
- if (bmc != null)
- bmc.CreateHistogram(imageMat, true, 339, 130, 0);
- else
- bc.CreateHistogram(imageMat, true, 339, 130, 0);
- this.RefreshHistogramControl1Values();
- }
- /// <summary>
- /// ListView图片选择改变事件
- /// </summary>
- /// <param name="imageMat">选择改变后的图片</param>
- public void listView1_SelectedIndexChangedNoCheckedChanged(Mat imageMat, string imagesKey = null)
- {
- if (imagesKey != null)
- {
- if (!binaryModelDict.ContainsKey(imagesKey))
- {
- binaryModelFlag.Add(imagesKey, false);
- this.binaryExtractionModel = this.binaryExtractionModel.cloneModel();
- binaryModelDict.Add(imagesKey, this.binaryExtractionModel);
- }
- //else
- {
- this.binaryExtractionModel = binaryModelDict[imagesKey];
- this.initParamsToAction();
- this.InitParameterToControl();
- }
- }
- Document document = Document.FromImageMat(imageMat/* //待测试.Clone()*/);
- this.documentWorkspace.Document = document;
- this.documentWorkspace.Visible = true;
- this.documentWorkspace.GraphicsList = this.appWorkspace.DocumentWorkspaces[this.listView1.FocusedItem != null ? this.listView1.FocusedItem.Index : this.listView1.SelectedItems[0].Index].GraphicsList;
- this.documentWorkspace.PhaseModels = new List<PhaseModel>();
- this.documentWorkspace.PhaseModels.AddRange(this.getPhaseModels(this.listView1.FocusedItem != null ? this.listView1.FocusedItem.Index : this.listView1.SelectedItems[0].Index));
- if ((imagesKey == null || !binaryModelFlag.ContainsKey(imagesKey) || !binaryModelFlag[imagesKey]/*用于更新图片二值化效果*/) && (bc != null || bmc != null) && this.documentWorkspace.PhaseModels[0].mat != null)
- {
- if (!(bmc != null ? bmc.BinaryChecked : bc.BinaryChecked) && this.documentWorkspace.PhaseModels[0].choise)//to sure and test
- {
- this.toApplyBinary = false;
- if (bmc != null)
- bmc.BinaryChecked = true;
- else
- bc.BinaryChecked = true;
- }
- }
- else
- {
- this.applyButtonImpl();
- }
- if (imagesKey != null && binaryModelFlag.ContainsKey(imagesKey)/*用于更新图片二值化效果*/)
- {
- this.documentWorkspace.PhaseModels[0].choise = (this.binaryExtractionModel.BinaryCheckFlag == 2);// (bmc != null ? bmc.BinaryChecked : bc.BinaryChecked);
- binaryModelFlag[imagesKey] = false;
- if (bmc != null)
- bmc.BinaryChecked = this.documentWorkspace.PhaseModels[0].choise || (this.binaryExtractionModel.BinaryCheckFlag > 1);
- else
- bc.BinaryChecked = this.documentWorkspace.PhaseModels[0].choise || (this.binaryExtractionModel.BinaryCheckFlag > 1);
- }
- //else
- ////to sure and test
- //if (bc != null && !this.documentWorkspace.PhaseModels[0].choise)
- // bc.BinaryChecked = false;
- //显示直方图
- if (bc != null || bmc != null)
- if (bmc != null)
- bmc.CreateHistogram(imageMat, true, 339, 130, 0);
- else
- bc.CreateHistogram(imageMat, true, 339, 130, 0);
- this.RefreshHistogramControl1Values();
- }
- /// <summary>
- /// 构造相的工作结构
- /// </summary>
- /// <param name="phaseNames">相的命名,如果只有二值则只传PdnResources.GetString("Menu.BinaryAction.BinaryExtraction.Text")即可,没有特殊情况命名第一个相为PdnResources.GetString("Menu.BinaryAction.BinaryExtraction.Text")</param>
- /// <param name="bmc"></param>
- /// <param name="appWorkspace"></param>
- /// <param name="documentWorkspace"></param>
- public void createDocumentItemsSmaller(string[] phaseNames, CustomControl.BinaryControlSmaller bmc, AppWorkspace appWorkspace
- , DocumentWorkspaceWindow documentWorkspace, ListView listView1)
- {
- this.bmc = bmc;
- this.appWorkspace = appWorkspace;
- this.documentWorkspace = documentWorkspace;
- this.listView1 = listView1;
- //如果是脚本执行,将参数带入(AppWorkspace.ScriptRunning && AppWorkspace.ScriptCurrentParam != null && AppWorkspace.ScriptCurrentParam.MenuId == action.MenuId);
- if (this.appWorkspace.ScriptRunning && this.appWorkspace.ScriptCurrentParam != null)
- {
- binaryExtractionModel = new BinaryExtractionModel();
- foreach (Args args in analysisAction.Lists)
- {
- Args param1 = this.appWorkspace.ScriptCurrentParam.Lists.Find(m => m.Key.Equals(args.Key));
- if (param1 != null && param1.value != null)
- args.Value = param1.value;
- if (args.Key == "colorInterval")
- {
- this.binaryExtractionModel.ColorInterval = (Boolean)args.Value ? 2 : 1;
- }
- else if (args.Key == "scope1")
- {
- List<double> twoL = (List<double>)args.Value;
- this.binaryExtractionModel.ColorOneStart = (int)twoL[0];
- this.binaryExtractionModel.ColorOneEnd = (int)twoL[1];
- }
- else if (args.Key == "scope2")
- {
- List<double> twoL = (List<double>)args.Value;
- this.binaryExtractionModel.ColorTwoStart = (int)twoL[0];
- this.binaryExtractionModel.ColorTwoEnd = (int)twoL[1];
- }
- else if (args.Key == "scope3")
- {
- List<double> twoL = (List<double>)args.Value;
- this.binaryExtractionModel.ColorThreeStart = (int)twoL[0];
- this.binaryExtractionModel.ColorThreeEnd = (int)twoL[1];
- }
- else if (args.Key == "scope4")
- {
- this.binaryExtractionModel.DebrisAreaStart = (int)((List<double>)args.Value)[0];
- this.binaryExtractionModel.DebrisAreaEnd = (int)((List<double>)args.Value)[1];
- }
- else if (args.Key == "binaryStyle")
- {
- this.binaryExtractionModel.BinaryStyle = (int)args.Value;
- }
- else if (args.Key == "phaseColor")
- {
- this.binaryExtractionModel.PhaseColor = (int)args.Value;
- }
- else if (args.Key == "binarization")
- {
- this.binaryExtractionModel.BinaryCheckFlag = Convert.ToBoolean(args.Value) == true ? 2 : 0;
- }
- else if (args.Key == "theoriginalcolor")
- {
- bool thisValue = Convert.ToBoolean(args.Value);
- if (thisValue)
- {
- this.binaryExtractionModel.BinaryCheckFlag = this.binaryExtractionModel.BinaryCheckFlag == 2 ? 3 : 1;
- }
- }
- }
- //string xmlFilePath = Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\BinaryConfig\\Default_" + this.menuId + ".xml";
- //bool createNewFile = !System.IO.File.Exists(xmlFilePath);
- //if (createNewFile)
- // xmlFilePath = Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\BinaryExtraction\\Default.xml";
- //this.binaryExtractionModel = XmlSerializeHelper.DESerializer<BinaryExtractionModel>(FileOperationHelper.ReadStringFromFile(xmlFilePath, FileMode.Open));
- //if (createNewFile)
- // this.binaryExtractionModel.BinaryCheckFlag = 0;
- this.initParamsToAction();
- }
- else
- this.initParams();
- for (int i = 0; i < phaseNames.Length; i++)
- {
- PhaseModel model = new PhaseModel();
- model.choise = true;
- model.mat = null;
- model.color = (i == 0 && bmc != null) ? bmc.BinaryBackColor.ToArgb() : Color.Green.ToArgb();//###
- model.position = documentWorkspace.PhaseModels.Count + 1;
- model.name = phaseNames[i];
- documentWorkspace.PhaseModels.Add(model);
- }
- this.documentItems = new Dictionary<int, DocumentItem>();
- // 构造工作结构
- for (int i = 0; i < appWorkspace.DocumentWorkspaces.Length; i++)
- {
- GraphicsList graphicsList = new GraphicsList();
- for (int j = 0; j < appWorkspace.DocumentWorkspaces[i].GraphicsList.Count; j++)
- {
- graphicsList.Add(appWorkspace.DocumentWorkspaces[i].GraphicsList[j]);
- }
- List<PhaseModel> phaseModels = new List<PhaseModel>();
- for (int j = 0; j < phaseNames.Length; j++)
- {
- //二值化相关
- if (j == 0)
- {
- PhaseModel analysisModel = appWorkspace.DocumentWorkspaces[i].AnalysisPhaseModel;
- if (analysisModel == null)
- {
- PhaseModel model = new PhaseModel();
- model.choise = true;
- model.mat = null;
- model.color = bmc != null ? bmc.BinaryBackColor.ToArgb() : Color.Green.ToArgb();
- model.position = phaseModels.Count + 1;
- model.name = phaseNames[j];
- phaseModels.Add(model);
- }
- else
- phaseModels.Add(analysisModel);
- }
- else
- {
- PhaseModel model = new PhaseModel();
- model.choise = true;
- model.mat = null;
- model.color = Color.Green/*panel2.BackColor*/.ToArgb();//###
- model.position = phaseModels.Count + 1;
- model.name = phaseNames[j];
- phaseModels.Add(model);
- }
- }
- this.documentItems.Add(i, new DocumentItem(graphicsList, phaseModels));
- }
- //
- //调色板
- //
- this.colorsForm1 = new ColorsForm();
- this.colorsForm1.StartPosition = FormStartPosition.CenterScreen;
- this.colorsForm1.setSaveBtn_Click(new System.EventHandler(this.colorsForm1Changed));
- this.InitParameterToControl();//###
- if (this.binaryExtractionModel != null)
- this.applyButtonImpl();
- this.InitBinaryControlEvent();
- }
- /// <summary>
- /// 构造相的工作结构
- /// </summary>
- /// <param name="phaseNames">相的命名,如果只有二值则只传(二值提取)即可,没有特殊情况命名第一个相为(二值提取)</param>
- /// <param name="bc"></param>
- /// <param name="appWorkspace"></param>
- /// <param name="documentWorkspace"></param>
- public void createDocumentItems(string[] phaseNames, CustomControl.BinaryControl bc, AppWorkspace appWorkspace
- , DocumentWorkspaceWindow documentWorkspace, ListView listView1)
- {
- this.bc = bc;
- this.appWorkspace = appWorkspace;
- this.documentWorkspace = documentWorkspace;
- this.listView1 = listView1;
- //如果是脚本执行,将参数带入(AppWorkspace.ScriptRunning && AppWorkspace.ScriptCurrentParam != null && AppWorkspace.ScriptCurrentParam.MenuId == action.MenuId);
- if (this.appWorkspace.ScriptRunning && this.appWorkspace.ScriptCurrentParam != null)
- {
- binaryExtractionModel = new BinaryExtractionModel();
- foreach (Args args in analysisAction.Lists)
- {
- Args param1 = this.appWorkspace.ScriptCurrentParam.Lists.Find(m => m.Key.Equals(args.Key));
- if (param1 != null && param1.value != null)
- args.Value = param1.value;
- if (args.Key == "colorInterval")
- {
- this.binaryExtractionModel.ColorInterval = (Boolean)args.Value ? 2 : 1;
- }
- else if (args.Key == "scope1")
- {
- List<double> twoL = (List<double>)args.Value;
- this.binaryExtractionModel.ColorOneStart = (int)twoL[0];
- this.binaryExtractionModel.ColorOneEnd = (int)twoL[1];
- }
- else if (args.Key == "scope2")
- {
- List<double> twoL = (List<double>)args.Value;
- this.binaryExtractionModel.ColorTwoStart = (int)twoL[0];
- this.binaryExtractionModel.ColorTwoEnd = (int)twoL[1];
- }
- else if (args.Key == "scope3")
- {
- List<double> twoL = (List<double>)args.Value;
- this.binaryExtractionModel.ColorThreeStart = (int)twoL[0];
- this.binaryExtractionModel.ColorThreeEnd = (int)twoL[1];
- }
- else if (args.Key == "scope4")
- {
- this.binaryExtractionModel.DebrisAreaStart = (int)((List<double>)args.Value)[0];
- this.binaryExtractionModel.DebrisAreaEnd = (int)((List<double>)args.Value)[1];
- }
- else if (args.Key == "binaryStyle")
- {
- this.binaryExtractionModel.BinaryStyle = (int)args.Value;
- }
- else if (args.Key == "phaseColor")
- {
- this.binaryExtractionModel.PhaseColor = (int)args.Value;
- }
- else if (args.Key == "binarization")
- {
- this.binaryExtractionModel.BinaryCheckFlag = Convert.ToBoolean(args.Value) == true ? 2 : 0;
- }
- else if (args.Key == "theoriginalcolor")
- {
- bool thisValue = Convert.ToBoolean(args.Value);
- if (thisValue)
- {
- this.binaryExtractionModel.BinaryCheckFlag = this.binaryExtractionModel.BinaryCheckFlag == 2 ? 3 : 1;
- }
- }
- }
- //string xmlFilePath = Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\BinaryConfig\\Default_" + this.menuId + ".xml";
- //bool createNewFile = !System.IO.File.Exists(xmlFilePath);
- //if (createNewFile)
- // xmlFilePath = Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\BinaryExtraction\\Default.xml";
- //this.binaryExtractionModel = XmlSerializeHelper.DESerializer<BinaryExtractionModel>(FileOperationHelper.ReadStringFromFile(xmlFilePath, FileMode.Open));
- //if (createNewFile)
- // this.binaryExtractionModel.BinaryCheckFlag = 0;
- this.initParamsToAction();
- }
- else
- this.initParams();
- for (int i = 0; i < phaseNames.Length; i++)
- {
- PhaseModel model = new PhaseModel();
- model.choise = true;
- model.mat = null;
- model.color = (i == 0 && bc != null) ? bc.BinaryBackColor.ToArgb() : Color.Green.ToArgb();//###
- model.position = documentWorkspace.PhaseModels.Count + 1;
- model.name = phaseNames[i];
- documentWorkspace.PhaseModels.Add(model);
- }
- this.documentItems = new Dictionary<int, DocumentItem>();
- // 构造工作结构
- for (int i = 0; i < appWorkspace.DocumentWorkspaces.Length; i++)
- {
- GraphicsList graphicsList = new GraphicsList();
- for (int j = 0; j < appWorkspace.DocumentWorkspaces[i].GraphicsList.Count; j++)
- {
- graphicsList.Add(appWorkspace.DocumentWorkspaces[i].GraphicsList[j]);
- }
- List<PhaseModel> phaseModels = new List<PhaseModel>();
- for (int j = 0; j < phaseNames.Length; j++)
- {
- //二值化相关
- if (j == 0)
- {
- PhaseModel analysisModel = appWorkspace.DocumentWorkspaces[i].AnalysisPhaseModel;
- if (analysisModel == null)
- {
- PhaseModel model = new PhaseModel();
- model.choise = true;
- model.mat = null;
- model.color = bc != null ? bc.BinaryBackColor.ToArgb() : Color.Green.ToArgb();
- model.position = phaseModels.Count + 1;
- model.name = phaseNames[j];
- phaseModels.Add(model);
- }
- else
- phaseModels.Add(analysisModel);
- }
- else
- {
- PhaseModel model = new PhaseModel();
- model.choise = true;
- model.mat = null;
- model.color = Color.Green/*panel2.BackColor*/.ToArgb();//###
- model.position = phaseModels.Count + 1;
- model.name = phaseNames[j];
- phaseModels.Add(model);
- }
- }
- this.documentItems.Add(i, new DocumentItem(graphicsList, phaseModels));
- }
- //
- //调色板
- //
- this.colorsForm1 = new ColorsForm();
- this.colorsForm1.StartPosition = FormStartPosition.CenterScreen;
- this.colorsForm1.setSaveBtn_Click(new System.EventHandler(this.colorsForm1Changed));
- this.InitParameterToControl();//###
- if (this.binaryExtractionModel != null)
- this.applyButtonImpl();
- this.InitBinaryControlEvent();
- }
- /// <summary>
- /// 无视场执行运算
- /// </summary>
- public OpenCvSharp.Mat PerformProcess(OpenCvSharp.Mat src) { return action.PerformProcess(src); }
- /// <summary>
- /// 多视场执行运算
- /// </summary>
- /// <param name="src">视场mat</param>
- /// <param name="mat">原图mat</param>
- /// <returns></returns>
- public OpenCvSharp.Mat PerformProcess(OpenCvSharp.Mat src, OpenCvSharp.Mat mat) { return action.PerformProcess(src, mat); }
- public int ColorInterval
- {
- get
- {
- return this.binaryExtractionModel.ColorInterval;
- }
- set
- {
- this.binaryExtractionModel.ColorInterval = value;
- }
- }
- private void colorsForm1Changed(object sender, EventArgs e)
- {
- Color color = this.colorsForm1.UserPrimaryColor.ToColor();
- this.SetBinaryBackColor(color);//改变参数配置的相颜色
- this.colorsForm1.Close();
- }
- /// <summary>
- /// 把参数的值设置到控件上
- /// </summary>
- public void InitParameterToControl()
- {
- if (this.binaryExtractionModel != null)
- {
- if (bc != null || bmc != null)
- {
- if (this.binaryExtractionModel.BinaryCheckFlag > 1)
- {
- if (bmc != null)
- bmc.BinaryChecked = true;
- else
- bc.BinaryChecked = true;
- }
- if (this.binaryExtractionModel.BinaryCheckFlag % 2 == 1)
- {
- if (bmc != null)
- bmc.OriginChecked = true;
- else
- bc.OriginChecked = true;
- }
- //阈值相关
- //1个颜色区间还是2个
- if (bmc != null)
- bmc.setInverseStyle((this.binaryExtractionModel.ColorInterval == 1) ? 1 : 2);
- else
- bc.setInverseStyle((this.binaryExtractionModel.ColorInterval == 1) ? 1 : 2);
- //删除事件
- if (bmc != null)
- bmc.DeleteEventHandler();
- else
- bc.DeleteEventHandler();
- if (bmc != null)
- bmc.scope1End = this.binaryExtractionModel.ColorOneEnd;
- else
- bc.scope1End = this.binaryExtractionModel.ColorOneEnd;
- if (bmc != null)
- bmc.scope1Start = this.binaryExtractionModel.ColorOneStart;
- else
- bc.scope1Start = this.binaryExtractionModel.ColorOneStart;
- if (bmc != null)
- bmc.scope2End = this.binaryExtractionModel.ColorTwoEnd;
- else
- bc.scope2End = this.binaryExtractionModel.ColorTwoEnd;
- if (bmc != null)
- bmc.scope2Start = this.binaryExtractionModel.ColorTwoStart;
- else
- bc.scope2Start = this.binaryExtractionModel.ColorTwoStart;
- if (bmc != null)
- bmc.scope3End = this.binaryExtractionModel.ColorThreeEnd;
- else
- bc.scope3End = this.binaryExtractionModel.ColorThreeEnd;
- if (bmc != null)
- bmc.scope3Start = this.binaryExtractionModel.ColorThreeStart;
- else
- bc.scope3Start = this.binaryExtractionModel.ColorThreeStart;
- if (bmc != null)
- bmc.BinaryStyle = this.binaryExtractionModel.BinaryStyle;
- else
- bc.BinaryStyle = this.binaryExtractionModel.BinaryStyle;
- if (bmc != null)
- bmc.BinaryBackColor = Color.FromArgb(this.binaryExtractionModel.PhaseColor);
- else
- bc.BinaryBackColor = Color.FromArgb(this.binaryExtractionModel.PhaseColor);
- //添加事件
- if (bmc != null)
- bmc.AddEventHandler();
- else
- bc.AddEventHandler();
- if (bmc != null)
- bmc.InitParameterToControl();
- else
- bc.InitParameterToControl();
- }
- }
- }
- /// <summary>
- /// 更新显示直方图的数据
- /// </summary>
- public void RefreshHistogramControl1Values()
- {
- ////显示直方图
- //if (bc != null || bmc != null)
- // if (bmc != null)
- // bmc.CreateHistogram(bitmap, true, 339, 130, 0);
- // else
- // bc.CreateHistogram(bitmap, true, 339, 130, 0);
- if (bmc != null)
- bmc.InitParameterToControl(this.binaryExtractionModel.ColorInterval);
- else
- bc.InitParameterToControl(this.binaryExtractionModel.ColorInterval);
- }
- Vec4b vecForPhaseColor4B;
- public unsafe void SetBinaryBackColor(Color color)
- {
- if (bmc != null)
- bmc.BinaryBackColor = color;//设置panel背景
- else
- bc.BinaryBackColor = color;//设置panel背景
- this.binaryExtractionModel.PhaseColor = color.ToArgb();
- //###
- foreach (Args args in action.Lists)
- {
- if (args.Key == "phaseColor")
- {
- args.Value = color.ToArgb();//this.binaryExtractionModel.PhaseColor
- break;
- }
- }
- if (this.documentWorkspace.PhaseModels[0].mat == null || this.documentWorkspace.PhaseModels[0].mat.IsDisposed)
- {
- this.applyButtonImpl();
- }
- else
- {
- Mat source = this.documentWorkspace.PhaseModels[0].mat;
- //##20143
- if (source.Channels() != 4)
- {
- this.applyButtonImpl();// false;、、should never go here !
- return;
- }
- //二值提取
- if (dstBinary != null)
- {
- dstBinary.Dispose();
- dstBinary = null;
- }
- dstBinary = new Mat(source.Rows, source.Cols, MatType.CV_8UC4, new Scalar(0, 0, 0, 0));
- //赋值二值相的颜色
- vecForPhaseColor4B = new Vec4b(color.B, color.G, color.R, color.A);
- source.ForEachAsVec4b(ForeachFunctionByteForPhaseColor4B);
- this.documentWorkspace.PhaseModels[0].mat/*Mat dst*/ = dstBinary.Clone();
- this.documentWorkspace.Refresh();
- dstBinary.Dispose();
- dstBinary = null;
- }
- //return dst;// true;
- }
- /// <summary>
- /// 提取二值化的透明通道并赋值
- /// </summary>
- /// <param name="t"></param>
- /// <param name="position"></param>
- public unsafe void ForeachFunctionByteForPhaseColor4B(Vec4b* t, int* position)
- {
- if (t->Item3 > 0)
- dstBinary.Set(position[0], position[1], vecForPhaseColor4B);
- }
- /// <summary>
- /// 保证二值化颜色赋值到action
- /// </summary>
- public void loadParams()
- {
- if (bc == null && bmc == null)
- return;
- foreach (Args args in action.Lists)
- {
- switch (args.Key)
- {
- case "scope1"://不反选时候的范围
- if (bmc != null)
- bmc.ScopeValue1ChangedAction += new EventHandler(((DecimalScope)args).numberScope_ValueChanged);
- else
- bc.ScopeValue1ChangedAction += new EventHandler(((DecimalScope)args).numberScope_ValueChanged);
- break;
- case "scope2"://反选时候的范围1
- if (bmc != null)
- bmc.ScopeValue2ChangedAction += new EventHandler(((DecimalScope)args).numberScope_ValueChanged);
- else
- bc.ScopeValue2ChangedAction += new EventHandler(((DecimalScope)args).numberScope_ValueChanged);
- break;
- case "scope3"://反选时候的范围2
- if (bmc != null)
- bmc.ScopeValue3ChangedAction += new EventHandler(((DecimalScope)args).numberScope_ValueChanged);
- else
- bc.ScopeValue3ChangedAction += new EventHandler(((DecimalScope)args).numberScope_ValueChanged);
- break;
- case "phaseColor":
- args.Value = this.binaryExtractionModel.PhaseColor;
- break;
- default:
- break;
- }
- }
- }
- /// <summary>
- /// 执行二值方法的事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void bcApplyButtonImplAction(object sender, EventArgs e)
- {
- this.applyButtonImpl(/*bitmap*/);
- }
- ///// <summary>
- ///// 参数改变时,重新处理图像
- ///// </summary>
- /// <param name="imagesKey">不是当前显示图片的需要传值</param>
- /// <param name="analysisPicture">不是当前显示图片的需要传值</param>
- /// <param name="imageMat">不带视场处理的需要传值</param>
- public void applyButtonImpl(string imagesKey = null, int analysisPicture = -1, Mat imageMat = null)
- {
- if (bc == null && bmc == null)
- return;
- //long start = Cv2.GetTickCount();
- if (imageMat != null ||
- (listView1.FocusedItem != null || this.listView1.SelectedItems != null && this.listView1.SelectedItems.Count > 0) && (bmc != null ? bmc.BinaryChecked : bc.BinaryChecked))
- {
- bool processWholeMat11 = (imageMat != null);
- if (imageMat == null)
- imageMat = this.appWorkspace.DocumentWorkspaces[this.listView1.FocusedItem != null ? this.listView1.FocusedItem.Index : this.listView1.SelectedItems[0].Index].CompositionSurface.CreatedAliasedMat();
- //判断是否存在视场,如果存在视场,则把视场提取出来,进行处理//可能会带视场//########################
- DocumentView documentWorkspace = this.documentWorkspace;
- if (analysisPicture >= 0)
- documentWorkspace = this.appWorkspace.DocumentWorkspaces[analysisPicture];
- if (!processWholeMat11
- && !processWholeMat && documentWorkspace.GraphicsList.IsExsitView())
- {
- if (analysisPicture == -1)
- {
- documentWorkspace.PhaseModels[0].mat = this.PerformProcess(
- PaintDotNet.Camera.Tools.ToMat(documentWorkspace.GetFullSizeWithRegion()),
- imageMat.Clone());
- documentWorkspace.PhaseModels[0].color = (bmc != null ? bmc.BinaryBackColor.ToArgb() : bc.BinaryBackColor.ToArgb());
- documentWorkspace.Refresh();
- }
- else
- {
- if (binaryData1Dict.ContainsKey(imagesKey))
- {
- if (binaryData1Dict[imagesKey] != null)
- binaryData1Dict[imagesKey] = null;
- binaryData1Dict[imagesKey] = this.PerformProcess(
- PaintDotNet.Camera.Tools.ToMat(documentWorkspace.GetFullSizeWithRegion()),
- imageMat.Clone());// this.documentWorkspace.phaseModels[0].mat;
- }
- else
- {
- try
- {
- binaryData1Dict.Add(imagesKey, this.PerformProcess(
- PaintDotNet.Camera.Tools.ToMat(documentWorkspace.GetFullSizeWithRegion()),
- imageMat.Clone())/*this.documentWorkspace.phaseModels[0].mat*/);
- }
- catch (Exception)
- {
- binaryData1Dict.Add(imagesKey, null);
- }
- }
- }
- }
- else if (!processWholeMat11
- && processWholeMat && documentWorkspace.GraphicsList.IsExsitView())
- {
- if (PhaseModels0Mat != null)
- {
- PhaseModels0Mat.Dispose();
- PhaseModels0Mat = null;
- }
- Mat OrgImg0 = this.PerformProcess(imageMat.Clone());
- PhaseModels0Mat = OrgImg0.Clone();
- Vec4b vec4 = new Vec4b(0, 0, 0, 0);
- //视场图像
- Mat exsitViewMatOrg = PaintDotNet.Camera.Tools.ToMat(documentWorkspace.GetFullSizeWithRegion());
- for (int y = 0; y < exsitViewMatOrg/*temp*/.Rows; y++)
- {
- for (int x = 0; x < exsitViewMatOrg/*temp*/.Cols; x++)
- {
- if (exsitViewMatOrg.At<Vec4b>(y, x).Item3 == 0)
- OrgImg0.Set(y, x, vec4);//不在视场图像范围内
- }
- }
- if (analysisPicture == -1)
- {
- documentWorkspace.PhaseModels[0].mat = OrgImg0;
- documentWorkspace.PhaseModels[0].color = (bmc != null ? bmc.BinaryBackColor.ToArgb() : bc.BinaryBackColor.ToArgb());
- documentWorkspace.Refresh();
- }
- else
- {
- if (binaryData1Dict.ContainsKey(imagesKey))
- {
- if (binaryData1Dict[imagesKey] != null)
- binaryData1Dict[imagesKey] = null;
- binaryData1Dict[imagesKey] = OrgImg0;// this.documentWorkspace.phaseModels[0].mat;
- }
- else
- {
- try
- {
- binaryData1Dict.Add(imagesKey, OrgImg0/*this.documentWorkspace.phaseModels[0].mat*/);
- }
- catch (Exception)
- {
- binaryData1Dict.Add(imagesKey, null);
- }
- }
- }
- }
- else
- {
- if (analysisPicture == -1)
- {
- documentWorkspace.PhaseModels[0].mat = this.PerformProcess(imageMat.Clone());
- documentWorkspace.PhaseModels[0].color = (bmc != null ? bmc.BinaryBackColor.ToArgb() : bc.BinaryBackColor.ToArgb());
- documentWorkspace.Refresh();
- }
- else
- {
- if (binaryData1Dict.ContainsKey(imagesKey))
- {
- if (binaryData1Dict[imagesKey] != null)
- binaryData1Dict[imagesKey] = null;
- binaryData1Dict[imagesKey] = this.PerformProcess(imageMat.Clone());// this.documentWorkspace.phaseModels[0].mat;
- }
- else
- {
- try
- {
- binaryData1Dict.Add(imagesKey, this.PerformProcess(imageMat.Clone())/*this.documentWorkspace.phaseModels[0].mat*/);
- }
- catch (Exception)
- {
- binaryData1Dict.Add(imagesKey, null);
- }
- }
- }
- }
- }
- ////double time = (Cv2.GetTickCount() - start) / Cv2.GetTickFrequency();
- ////System.Console.WriteLine("执行时间:" + time);
- ////AddRectangleToRectangleFCaps();//0916###18745
- //if (analysisPicture != -1)
- OnBinaryImplFinishAction();
- }
- ///// <summary>
- ///// (夹杂物专用)参数改变时,重新处理图像
- ///// </summary>
- /// <param name="imagesKey">不是当前显示图片的需要传值</param>
- /// <param name="analysisPicture">不是当前显示图片的需要传值</param>
- /// <param name="bitmap">不带视场处理的需要传值</param>
- public void applyButtonImplMethodInclusion(string imagesKey = null, int analysisPicture = -1, Mat imageMat = null, int index = 0, int color = 0, List<double> valueList = null)
- {
- if (bc == null && bmc == null)
- return;
- if (imageMat != null ||
- (listView1.FocusedItem != null || this.listView1.SelectedItems != null && this.listView1.SelectedItems.Count > 0))
- {
- bool processWholeMat11 = (imageMat != null);
- if (imageMat == null)
- imageMat = this.appWorkspace.DocumentWorkspaces[this.listView1.FocusedItem != null ? this.listView1.FocusedItem.Index : this.listView1.SelectedItems[0].Index].CompositionSurface.CreatedAliasedMat();
- //判断是否存在视场,如果存在视场,则把视场提取出来,进行处理//可能会带视场//########################
- DocumentView documentWorkspace = this.documentWorkspace;
- if (analysisPicture >= 0)
- documentWorkspace = this.appWorkspace.DocumentWorkspaces[analysisPicture];
- if (!processWholeMat11
- && !processWholeMat && documentWorkspace.GraphicsList.IsExsitView())
- {
- //if (analysisPicture == -1)
- //{
- //}
- //else
- //{
- // if (binaryData1Dict.ContainsKey(imagesKey))
- // {
- // if (binaryData1Dict[imagesKey] != null)
- // binaryData1Dict[imagesKey] = null;
- // binaryData1Dict[imagesKey] = this.PerformProcess(
- // PaintDotNet.Camera.Tools.ToMat(documentWorkspace.GetFullSizeWithRegion()),
- // PaintDotNet.Camera.Tools.ToMat(bitmap));// this.documentWorkspace.phaseModels[0].mat;
- // }
- // else
- // {
- // try
- // {
- // binaryData1Dict.Add(imagesKey, this.PerformProcess(
- // PaintDotNet.Camera.Tools.ToMat(documentWorkspace.GetFullSizeWithRegion()),
- // PaintDotNet.Camera.Tools.ToMat(bitmap))/*this.documentWorkspace.phaseModels[0].mat*/);
- // }
- // catch (Exception)
- // {
- // binaryData1Dict.Add(imagesKey, null);
- // }
- // }
- //}
- this.binaryExtractionModel.PhaseColor = color;
- //###
- foreach (Args args in action.Lists)
- {
- if (args.Key == "phaseColor")
- {
- args.Value = color;//this.binaryExtractionModel.PhaseColor
- }
- if (args.Key == "colorInterval")
- {
- args.Value = 1;
- }
- else if (args.Key == "scope1")
- {
- ((List<double>)args.Value)[0] = valueList[0];
- ((List<double>)args.Value)[1] = valueList[1];
- }
- //else if (args.Key == "scope2")
- //{
- // ((List<double>)args.Value)[0] = 0;
- // ((List<double>)args.Value)[1] = 139;
- //}
- //else if (args.Key == "scope3")
- //{
- // ((List<double>)args.Value)[0] = 140;
- // ((List<double>)args.Value)[1] = 255;
- //}
- }
- documentWorkspace.PhaseModels[index].mat = this.PerformProcess(
- PaintDotNet.Camera.Tools.ToMat(documentWorkspace.GetFullSizeWithRegion()),
- imageMat.Clone());
- documentWorkspace.PhaseModels[index].color = color;
- documentWorkspace.Refresh();
- }
- else if (!processWholeMat11
- && processWholeMat && documentWorkspace.GraphicsList.IsExsitView())
- {
- if (PhaseModels0Mat != null)
- {
- PhaseModels0Mat.Dispose();
- PhaseModels0Mat = null;
- }
- Mat OrgImg0 = this.PerformProcess(imageMat.Clone());
- PhaseModels0Mat = OrgImg0.Clone();
- Vec4b vec4 = new Vec4b(0, 0, 0, 0);
- //视场图像
- Mat exsitViewMatOrg = PaintDotNet.Camera.Tools.ToMat(documentWorkspace.GetFullSizeWithRegion());
- for (int y = 0; y < exsitViewMatOrg/*temp*/.Rows; y++)
- {
- for (int x = 0; x < exsitViewMatOrg/*temp*/.Cols; x++)
- {
- if (exsitViewMatOrg.At<Vec4b>(y, x).Item3 == 0)
- OrgImg0.Set(y, x, vec4);//不在视场图像范围内
- }
- }
- documentWorkspace.PhaseModels[index].mat = OrgImg0;
- documentWorkspace.PhaseModels[index].color = color;
- documentWorkspace.Refresh();
- //if (analysisPicture == -1)
- //{
- //}
- //else
- //{
- // if (binaryData1Dict.ContainsKey(imagesKey))
- // {
- // if (binaryData1Dict[imagesKey] != null)
- // binaryData1Dict[imagesKey] = null;
- // binaryData1Dict[imagesKey] = OrgImg0;// this.documentWorkspace.phaseModels[0].mat;
- // }
- // else
- // {
- // try
- // {
- // binaryData1Dict.Add(imagesKey, OrgImg0/*this.documentWorkspace.phaseModels[0].mat*/);
- // }
- // catch (Exception)
- // {
- // binaryData1Dict.Add(imagesKey, null);
- // }
- // }
- //}
- }
- else
- {
- documentWorkspace.PhaseModels[0].mat = this.PerformProcess(imageMat.Clone());
- documentWorkspace.PhaseModels[0].color = color;
- documentWorkspace.Refresh();
- //if (analysisPicture == -1)
- //{
-
- //}
- //else
- //{
- // if (binaryData1Dict.ContainsKey(imagesKey))
- // {
- // if (binaryData1Dict[imagesKey] != null)
- // binaryData1Dict[imagesKey] = null;
- // binaryData1Dict[imagesKey] = this.PerformProcess(PaintDotNet.Camera.Tools.ToMat(bitmap));// this.documentWorkspace.phaseModels[0].mat;
- // }
- // else
- // {
- // try
- // {
- // binaryData1Dict.Add(imagesKey, this.PerformProcess(PaintDotNet.Camera.Tools.ToMat(bitmap))/*this.documentWorkspace.phaseModels[0].mat*/);
- // }
- // catch (Exception)
- // {
- // binaryData1Dict.Add(imagesKey, null);
- // }
- // }
- //}
- }
- }
- ////double time = (Cv2.GetTickCount() - start) / Cv2.GetTickFrequency();
- ////System.Console.WriteLine("执行时间:" + time);
- ////AddRectangleToRectangleFCaps();//0916###18745
- //if (analysisPicture != -1)
- OnBinaryImplFinishAction();
- }
- /// <summary>
- /// 初始化二值化相关的变量
- /// </summary>
- public void initParams()
- {
- string xmlFilePath = Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\BinaryConfig\\Default_" + this.menuId + ".xml";
- bool createNewFile = !System.IO.File.Exists(xmlFilePath);
- if (createNewFile)
- xmlFilePath = Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\BinaryExtraction\\Default.xml";
- this.binaryExtractionModel = XmlSerializeHelper.DESerializer<BinaryExtractionModel>(FileOperationHelper.ReadStringFromFile(xmlFilePath, FileMode.Open));
- if (createNewFile)
- this.binaryExtractionModel.BinaryCheckFlag = 0;
- this.initParamsToAction();
- }
- /// <summary>
- /// 把参数的值设置到action
- /// </summary>
- public void initParamsToAction()
- {
- foreach (Args args in action.Lists)
- {
- if (args.Key == "colorInterval")
- args.Value = this.binaryExtractionModel.ColorInterval;
- else if (args.Key == "binaryStyle")
- args.Value = this.binaryExtractionModel.BinaryStyle;
- else if (args.Key == "scope1")
- {
- ((List<double>)args.Value)[0] = (int)(this.binaryExtractionModel.ColorOneStart);
- ((List<double>)args.Value)[1] = (int)(this.binaryExtractionModel.ColorOneEnd);
- }
- else if (args.Key == "scope2")
- {
- ((List<double>)args.Value)[0] = (int)(this.binaryExtractionModel.ColorTwoStart);
- ((List<double>)args.Value)[1] = (int)(this.binaryExtractionModel.ColorTwoEnd);
- }
- else if (args.Key == "scope3")
- {
- ((List<double>)args.Value)[0] = (int)(this.binaryExtractionModel.ColorThreeStart);
- ((List<double>)args.Value)[1] = (int)(this.binaryExtractionModel.ColorThreeEnd);
- }
- else if (args.Key == "phaseColor")//#22092
- {
- args.Value = this.binaryExtractionModel.PhaseColor;
- }
- }
- }
- /// <summary>
- /// 保存二值化相关的变量
- /// </summary>
- public void saveParams()
- {
- string xmlFilePath = Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\BinaryConfig\\Default_" + this.menuId + ".xml";
- string userInfoXml = XmlSerializeHelper.XmlSerialize<BinaryExtractionModel>(this.binaryExtractionModel);
- FileOperationHelper.WriteStringToFile(userInfoXml, xmlFilePath, System.IO.FileMode.Create);
- }
- #region [脚本录制参数]
- public object setScriptRecording(string key) {
- object value = null;
- if (key == "colorInterval")
- {
- value = this.binaryExtractionModel.ColorInterval == 2 ? true : false;
- }
- else if (key == "scope1")
- {
- value = new List<double>() { this.binaryExtractionModel.ColorOneStart, this.binaryExtractionModel.ColorOneEnd };
- }
- else if (key == "scope2")
- {
- value = new List<double>() { this.binaryExtractionModel.ColorTwoStart, this.binaryExtractionModel.ColorTwoEnd };
- }
- else if (key == "scope3")
- {
- value = new List<double>() { this.binaryExtractionModel.ColorThreeStart, this.binaryExtractionModel.ColorThreeEnd };
- }
- else if (key == "scope4")
- {
- value = new List<double>() { this.binaryExtractionModel.DebrisAreaStart, this.binaryExtractionModel.DebrisAreaEnd };
- }
- else if (key == "binaryStyle")
- {
- value = this.binaryExtractionModel.BinaryStyle;
- }
- else if (key == "phaseColor")
- {
- value = this.binaryExtractionModel.PhaseColor;
- }
- else if (key == "binarization")
- {
- value = this.binaryExtractionModel.BinaryCheckFlag == 2 || this.binaryExtractionModel.BinaryCheckFlag == 3 ? true : false;
- }
- else if (key == "theoriginalcolor")
- {
- value = this.binaryExtractionModel.BinaryCheckFlag == 1 || this.binaryExtractionModel.BinaryCheckFlag == 3 ? true : false;
- }
- return value;
- }
- #endregion
- #region 内部类
- internal class LocalListViewItem
- {
- public DocumentWorkspace Value { get; }
- public string Display { get; }
- public LocalListViewItem(DocumentWorkspace Value, string Display)
- {
- this.Value = Value;
- this.Display = Display;
- }
- }
- internal class DocumentItem
- {
- public GraphicsList graphicsList;
- public List<PhaseModel> phaseModels;
- public DocumentItem(GraphicsList graphicsList, List<PhaseModel> phaseModels)
- {
- this.graphicsList = graphicsList;
- this.phaseModels = phaseModels;
- }
- }
- #endregion
- }
- }
|