private void EventHandlerCore_ObjectSelected(object sender, BimPlusEventArgs e)
        {
            Debug.WriteLine(string.Format("Id:{0} Selected:{1} Multiselect:{2}", e.Id, e.Selected, e.Multiselect));

            if (e.Id != Guid.Empty || e.Selected != true)
            {
                DtObject dtObject = _integrationBase.ApiCore.DtObjects.GetObject(e.Id, ObjectRequestProperties.AttributDefinition | ObjectRequestProperties.Pset);

                if (dtObject != null)
                {
                    if (e.Multiselect == true)
                    {
                        if (SelectedObjects.FirstOrDefault(o => o.Id == e.Id) == null)
                        {
                            SelectedObjects.Add(dtObject);
                        }
                    }
                    else
                    {
                        SelectedObjects.Clear();
                        if (e.Selected == true)
                        {
                            SelectedObjects.Add(dtObject);
                        }
                    }
                }

                if (e.Selected == false)
                {
                    DtObject exist = SelectedObjects.FirstOrDefault(o => o.Id == e.Id);
                    if (exist != null)
                    {
                        SelectedObjects.Remove(exist);
                    }
                    else
                    {
                        SelectedObjects.Clear();
                    }
                }
                else if (e.Selected == null && e.Id != Guid.Empty)
                {
                    if (dtObject != null)
                    {
                        if (SelectedObjects.FirstOrDefault(o => o.Id == e.Id) == null)
                        {
                            SelectedObjects.Add(dtObject);
                        }
                    }
                    else
                    {
                        SelectedObjects.Clear();
                    }
                }

                List <DtObject> newList = new List <DtObject>();
                newList.AddRange(SelectedObjects);
                SelectedObjects = newList;
                Trace.WriteLine(string.Format("_selectedObjects.Count:{0}", SelectedObjects.Count()));
            }
        }
 /// <summary>
 /// Removes selection icon from tile and requeues it in object pool
 /// </summary>
 /// <param name="selection"></param>
 void RemoveSelection(Transform selection)
 {
     //Queue up removed selection to inactive pool
     InactiveSelectionObjects.Enqueue(SelectedObjects[selection]);
     //Set gameobject to inactive
     SelectedObjects[selection].SetActive(false);
     //Remove selection gameobject from active objects
     ActiveSelectionIconObjects.Remove(SelectedObjects[selection]);
     //Remove from select dictionary
     SelectedObjects.Remove(selection);
 }
        public void OnDeSelectedObjects(List <UnityEngine.Object> selectedObjects)
        {
            USUndoManager.PropertyChange(this, "DeSelect");
            foreach (var selectedObject in selectedObjects)
            {
                SelectedObjects.Remove(selectedObject);
                var selection = Selection.objects != null?Selection.objects.ToList() : new List <UnityEngine.Object>();

                selection.Remove(selectedObject);
                Selection.objects = selection.ToArray();
            }
        }
Exemplo n.º 4
0
 public void ObjectDeselected(ISelectableObject deselectedObject)
 {
     SelectedObjects.Remove(deselectedObject);
 }
Exemplo n.º 5
0
 public void DeselectObject(IObject3D obj)
 {
     SelectedObjects.Remove(obj);
 }
Exemplo n.º 6
0
 public static void RemoveSelection(CollisionObject collisionObject)
 {
     (collisionObject.UserObject as ISelectable).Model.RenderFlags &= ~RenderFlags.Selected;
     SelectedObjects.Remove(collisionObject);
 }