public static PanelSectionViewModel CreateCenterPanelSection(Point3D center, double xSectionSize, double ySectionSize, int i, int j) { PanelSectionViewModel section = null; var idx = new SectionIndex(); idx.SetIndex(i, j); if (_sectionsDictionary.TryGetValue(idx, out PanelSectionViewModel vm)) { vm.SizeX = xSectionSize; vm.SizeY = ySectionSize; vm.SizeZ = SizeZ; vm.Center = center; vm.Reset(); section = vm; } else { section = new PanelSectionViewModel() { XSectionIndex = i, YSectionIndex = j, Position = PanelSectionPosition.Center, NumCells = NumCells, SizeX = xSectionSize, SizeY = ySectionSize, SizeZ = SizeZ, Center = center, Visible = true }; section.Initialize(); _sectionsDictionary.Add(idx, section); } return(section); }
private PanelSectionViewModel CreatePanelSection(Point3D center, double xSectionSize, double ySectionSize, int i, int j) { var positon = GetSctionPosition(i, j); PanelSectionViewModel panelSection = null; PanelSectionViewModelFactory.NumCells = _numCells; PanelSectionViewModelFactory.SizeZ = SizeZ; switch (positon) { case PanelSectionPosition.Center: //panelSection = CreateCenterPanelSection(center, xSectionSize, ySectionSize, i, j); panelSection = PanelSectionViewModelFactory.CreateCenterPanelSection(center, xSectionSize, ySectionSize, i, j); break; case PanelSectionPosition.SideBottom: case PanelSectionPosition.SideTop: case PanelSectionPosition.SideRight: case PanelSectionPosition.SideLeft: //panelSection = CreateSidePanelSection(center, xSectionSize, ySectionSize, i, j, positon); panelSection = PanelSectionViewModelFactory.CreateSidePanelSection(center, xSectionSize, ySectionSize, i, j, positon); break; case PanelSectionPosition.CornerBottomLeft: case PanelSectionPosition.CornerBottomRight: case PanelSectionPosition.CornerTopLeft: case PanelSectionPosition.CornerTopRight: //panelSection = CreateCornerPanelSection(center, xSectionSize, ySectionSize, i, j, positon); panelSection = PanelSectionViewModelFactory.CreateCornerPanelSection(center, xSectionSize, ySectionSize, i, j, positon); break; default: break; } return(panelSection); }