/* ---------------------------------------- GHOST-METHODS -------------------------------------- */ public GridItem3D Clone() { GridItem3D item = new GridItem3D(); item.classId = this.classId; item.instanceId = "ghost"; item.model = this.model.Clone(); item.isSet = true; item.width = this.width; item.length = this.length; item.direction = this.direction; item.position = new Point3D(this.position.X, this.position.Y, this.position.Z); item.SetColor(glasMaterial); return(item); }
private void AddItemToModel(GridItem3D item) { item.UpdateModelProperties(xOffset, yOffset); item.isSet = true; Model.Children.Add(item.model); }
public void SelectItem(GridItem3D item) { if (!item.isSelected) { item.isSelected = true; selectedItems.Add(item); if (selectedItems.Count == 1) { SetGhost(); } else { UnsetGhost(); } } else { ClearAndDeselectAllItems(); } }
/* ------------------------------------------ Hilfs-Methoden - Item Selektieren ----------------------------------------------*/ internal void DeselectItem(GridItem3D item) { if (selectedItems.Count() == 1) { if (selectedItems[0] != item) { ClearAndDeselectAllItems(); } UnsetGhost(); } else if (selectedItems.Count() > 1) { ClearAndDeselectAllItems(); } }
private void ShowScriptingWindow(GridItem3D item) { string script = item.GetScriptFromServer(); ScriptingWindow scriptingWindow = new ScriptingWindow(script); DialogResult result = scriptingWindow.ShowDialog(); if (result == System.Windows.Forms.DialogResult.OK) { item.ScriptObjectOnServer(scriptingWindow.script); } }
/* --------------------- GUI-Methoden ---------------------------*/ public void PlaceItem(GridItem3D item) { modelList.Add(item); UpdateModel(); }
private void ShowScriptingButton(GridItem3D item) { if (grid.selectedItems.Count == 1 & item.isSelected & scriptableItems.Contains(item.classId)) { ScriptingButton.Visibility = Visibility.Visible; } }
private void ShowConsumerEmptyButton(GridItem3D item) { if (grid.selectedItems.Count == 1 & item.isSelected) { if (grid.selectedItems[0].classId == 2) { ConsumerCanvas.Visibility = Visibility.Visible; } } }
private void SetItemInformations(GridItem3D item) { ShowScriptingButton(item); ShowConsumerEmptyButton(item); Point3D point = grid.TransformClientToServerCoords(item.position); SetMaschinePositionBoxValue(point); if (grid.selectedItems.Count > 0) { SetMachineCapacityTextbox(grid.selectedItems[0].instanceId); } }
private void SelectItem(GridItem3D item) { if (!CtrlPressed()) // Wenn STRG nicht gedrückt und mehrere markiert sind { grid.DeselectItem(item); MachinePositionXBox.Text = ""; MachinePositionYBox.Text = ""; } grid.SelectItem(item); }
/* ---------------------------------------- GHOST-METHODS -------------------------------------- */ public GridItem3D Clone() { GridItem3D item = new GridItem3D(); item.classId = this.classId; item.instanceId = "ghost"; item.model = this.model.Clone(); item.isSet = true; item.width = this.width; item.length = this.length; item.direction = this.direction; item.position = new Point3D(this.position.X, this.position.Y, this.position.Z); item.SetColor(glasMaterial); return item; }