예제 #1
0
파일: MainWindow.cs 프로젝트: Netkidxp/TPLC
        private void OnLoadDataFinished(object sender, EventArgs e)
        {
            if (currentDesc.PatchProperty.Count > 0)
            {
                foreach (DatasetUnitProperty unitProperty in currentDesc.PatchProperty)
                {
                    unitProperty.Unit = fdvMain.UnitManager.FindUnitWithName(unitProperty.Name);
                    unitProperty.OnPropertyChanged -= OnUnitPropertyChanged;
                    unitProperty.OnPropertyChanged += OnUnitPropertyChanged;
                    unitProperty.FieldName          = CurrentFieldName;
                }
            }
            else
            {
                foreach (PatchUnit patchUnit in fdvMain.UnitManager.GetAllPatchUnits())
                {
                    DatasetUnitProperty unitProperty = new DatasetUnitProperty(patchUnit);
                    unitProperty.OnPropertyChanged += OnUnitPropertyChanged;
                    unitProperty.FieldName          = CurrentFieldName;
                    currentDesc.PatchProperty.Add(unitProperty);
                }
            }
            if (currentDesc.CutUnitProperty.Count > 0)
            {
                foreach (CutterUnitProprety cutterUnitProperty in currentDesc.CutUnitProperty)
                {
                    CutUnit cu = new CutUnit(cutterUnitProperty.Name, fdvMain.UnitManager.GetInternalMeshUnit(), fdvMain.UnitManager.RenderWindow.GetInteractor());

                    /*
                     * cu.FieldName = cutterUnitProperty.FieldName;
                     * cu.ScalarRange = new double[2] { cutterUnitProperty.Min, cutterUnitProperty.Max };
                     * cu.Origin = cutterUnitProperty.Origin.ToBlock();
                     * cu.Normal = cutterUnitProperty.Normal.ToBlock();
                     */

                    cutterUnitProperty.Unit = cu;
                    cutterUnitProperty.OnPropertyChanged             -= OnUnitPropertyChanged;
                    cutterUnitProperty.OnPropertyChanged             += OnUnitPropertyChanged;
                    cutterUnitProperty.FieldName                      = CurrentFieldName;
                    cutterUnitProperty.OnPlaneWidgetParameterChanged += OnCutUnitPlaneWidgetParametersChanged;
                    cu.UpdateCut();
                    fdvMain.UnitManager.AddCutUnit(cu);
                    fdvMain.Render();
                }
            }
            ptvMain.PostDesc = currentDesc;
            if (currentDesc.PatchProperty.Count > 0)
            {
                fdvMain.UnitManager.ActiveUnitName = currentDesc.PatchProperty[0].Name;
                fdvMain.UnitManager.ScalarBarOn    = true;
            }
            else
            {
                fdvMain.UnitManager.ActiveUnitName = "";
                fdvMain.UnitManager.ScalarBarOn    = false;
            }
            ResetRange();
            UnBusy(new Control[] { pgMain, ptvMain }, new string[] { "case_open", "state_open", "state_saveas", "export", "field", "range" });
        }
예제 #2
0
 public CutterUnitProprety(CutUnit unit) : base(unit)
 {
     this.origin = new Vector(unit.Origin);
     this.normal = new Vector(unit.Normal);
     this.origin.OnPropertyChanged             += OnChildPropertyChanged;
     this.normal.OnPropertyChanged             += OnChildPropertyChanged;
     (unit as CutUnit).OnPlaneParameterChanged += OnUnitWidgetPlaneParametersChanged;
 }