コード例 #1
0
        /* ---------------------------------------- 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);
        }
コード例 #2
0
 private void AddItemToModel(GridItem3D item)
 {
     item.UpdateModelProperties(xOffset, yOffset);
     item.isSet = true;
     Model.Children.Add(item.model);
 }
コード例 #3
0
 public void SelectItem(GridItem3D item)
 {
     if (!item.isSelected)
     {
         item.isSelected = true;
         selectedItems.Add(item);
         if (selectedItems.Count == 1)
         {
             SetGhost();
         }
         else
         {
             UnsetGhost();
         }
     }
     else
     {
         ClearAndDeselectAllItems();
     }
 }
コード例 #4
0
 /* ------------------------------------------ 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();
     }
 }
コード例 #5
0
        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);
            }
        }
コード例 #6
0
 /* --------------------- GUI-Methoden ---------------------------*/
 public void PlaceItem(GridItem3D item)
 {
     modelList.Add(item);
     UpdateModel();
 }
コード例 #7
0
 private void ShowScriptingButton(GridItem3D item)
 {
     if (grid.selectedItems.Count == 1 & item.isSelected & scriptableItems.Contains(item.classId))
     {
         ScriptingButton.Visibility = Visibility.Visible;
     }
 }
コード例 #8
0
 private void ShowConsumerEmptyButton(GridItem3D item)
 {
     if (grid.selectedItems.Count == 1 & item.isSelected)
     {
         if (grid.selectedItems[0].classId == 2)
         {
             ConsumerCanvas.Visibility = Visibility.Visible;
         }
     }
 }
コード例 #9
0
 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);
     }
 }
コード例 #10
0
 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);
 }
コード例 #11
0
        /* ---------------------------------------- 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;
        }