public TcCutJobResultListItem(IControlObject listViewItem) { mRoot = listViewItem.FindGeneric(Search.ByControlName("TemplateRoot"), depth: 2); }
/// <summary> /// Initializes a new instance of the <see cref="TcCheckBox"/> class. /// </summary> /// <param name="controlObject">The control object.</param> public TcCheckBox(IControlObject controlObject) : base(controlObject) { }
/// <summary> /// Returns the states from a result list item that has one row of state stacks. /// </summary> /// <param name="obj">Object from which to get the states (root).</param> /// <returns>a dictionary of states</returns> public static IReadOnlyDictionary <string, string> GetSingleStackStates(IControlObject obj) { return(obj.Node.GetDataContextProperty <IObject>("DisplayStates.Items").AsEnumerable <IObject>() .ToDictionary(x => x.GetProperty <string>("Component"), x => x.GetProperty <string>("State"))); }
public TcControl(IControlObject controlObject) { ControlObject = controlObject; }
void Update() { if (MainCameraTransform == null) { return; } bool[] isDetected = new bool[2]; foreach (HandVRSphereHand sphereHand in sphereHands_) { if (!sphereHand.IsTrackingHand) { continue; } if (isDetected[(int)sphereHand.ThisEitherHand]) { continue; } isDetected[(int)sphereHand.ThisEitherHand] = true; int layerMask = LayerMask.GetMask("ControlObject"); RaycastHit hit; IControlObject newObject = null; bool rayIsHit = Physics.Raycast(sphereHand.GetFinger(8).position - (sphereHand.GetFinger(8).position - MainCameraTransform.position).normalized * 2f, (sphereHand.GetFinger(8).position - MainCameraTransform.position).normalized, out hit, Mathf.Infinity, layerMask, QueryTriggerInteraction.Collide); if (rayIsHit) { newObject = hit.transform.GetComponent <IControlObject>(); } int handId = (int)sphereHand.ThisEitherHand; if (focusedObjects_[handId] != newObject && focusedObjects_[handId] != null && !isGrab_[handId]) { focusedObjects_[handId].EndFocus(sphereHand.ThisEitherHand); focusedObjects_[handId] = null; } if (focusedObjects_[handId] == null && newObject != null) { newObject.StartFocus(sphereHand.ThisEitherHand); focusedObjects_[handId] = newObject; } if (focusedObjects_[handId] != null) { Collider col = null; if (rayIsHit && hit.distance < 2f + TouchSize) { col = hit.collider; } if (!isTouch_[handId]) { if (col != null && col.GetComponent <IControlObject>() == focusedObjects_[handId]) { focusedObjects_[handId].StartTouch(sphereHand.ThisEitherHand, sphereHand.transform.TransformPoint(sphereHand.GetFinger(8).position)); isTouch_[handId] = true; } } else { isTouch_[handId] = false; if (col != null && col.GetComponent <IControlObject>() == focusedObjects_[handId]) { focusedObjects_[handId].StayTouch(sphereHand.ThisEitherHand, sphereHand.transform.TransformPoint(sphereHand.GetFinger(8).position)); isTouch_[handId] = true; } if (!isTouch_[handId]) { focusedObjects_[handId].EndTouch(sphereHand.ThisEitherHand); } } bool grabCountrol = true; for (int loop = 0; loop < 2; loop++) { if (handId != loop && focusedObjects_[handId] == focusedObjects_[loop] && isGrab_[loop]) { grabCountrol = false; } } if (grabCountrol) { bool grabed = true; bool opened = true; #if false for (int loop = 1; loop < 5; loop++) { if (sphereHand.GetFingerOpened(loop)) { grabed = false; } else { opened = false; } } if (Vector3.Distance(sphereHand.GetFinger(4).position, sphereHand.GetFinger(8).position) < PickSize) { grabed = true; opened = false; } #endif grabed = sphereHand.IsGrab; opened = !grabed; if (!isGrab_[handId] && grabed) { startGrabCoroutineRunning_[handId] = StartCoroutine(startGrabCoroutine(sphereHand.ThisEitherHand, sphereHand.transform.TransformPoint(sphereHand.GetFinger(8).position))); isGrab_[handId] = true; } else if (isGrab_[handId] && grabed) { if (startGrabCoroutineRunning_[handId] == null) { focusedObjects_[handId].StayGrab(sphereHand.ThisEitherHand, sphereHand.transform.TransformPoint(sphereHand.GetFinger(8).position)); } if (endGrabCoroutineRunning_[handId] != null) { StopCoroutine(endGrabCoroutineRunning_[handId]); endGrabCoroutineRunning_[handId] = null; } } else if (isGrab_[handId] && opened) { if (startGrabCoroutineRunning_[handId] != null) { StopCoroutine(startGrabCoroutineRunning_[handId]); startGrabCoroutineRunning_[handId] = null; } else if (endGrabCoroutineRunning_[handId] == null) { endGrabCoroutineRunning_[handId] = StartCoroutine(endGrabCoroutine(sphereHand.ThisEitherHand)); } } } } } for (int loop = 0; loop < 2; loop++) { if (!isDetected[loop] && focusedObjects_[loop] != null && !isGrab_[loop]) { focusedObjects_[loop].EndFocus((HandVRSphereHand.EitherHand)loop); focusedObjects_[loop] = null; } } }
/// <summary> /// Initializes a new instance of the <see cref="TcTextEdit"/> class. /// </summary> /// <param name="controlObject">The control object.</param> public TcTextEdit(IControlObject controlObject) : base(controlObject) { }
public TcResultColumn(IControlObject resultColumn, Func <IControlObject, T> itemFactory) : base(resultColumn) { mItemFactory = itemFactory; }
internal TcRawSheet(IControlObject root) { mRoot = root; }
public TcUnmappedControl(IControlObject controlObject) : base(controlObject) { }
public TcComboBox(IControlObject controlObject) : base(controlObject) { }
public TcRawSheetList(IControlObject controlObject) { mControlObject = controlObject; }
public TcRegularTableView(IControlObject gridTableView, Func <TcTableRow, TRow> rowWrapper) : base(gridTableView, rowWrapper) { }
void Update() { bool[] isDetected = new bool[2]; foreach (HandVRSphereHand sphereHand in sphereHands_) { if (!sphereHand.IsTrackingHand) { continue; } if (isDetected[(int)sphereHand.ThisEitherHand]) { continue; } isDetected[(int)sphereHand.ThisEitherHand] = true; int layerMask = LayerMask.GetMask("ControlObject"); RaycastHit hit; IControlObject newObject = null; if (Physics.Raycast(sphereHand.HandCenterPosition, (sphereHand.HandCenterPosition - Camera.main.transform.position).normalized, out hit, Mathf.Infinity, layerMask, QueryTriggerInteraction.Collide)) { newObject = hit.transform.GetComponent <IControlObject>(); } int handId = (int)sphereHand.ThisEitherHand; if (focusedObjects_[handId] != newObject && focusedObjects_[handId] != null && !isGrab_[handId]) { focusedObjects_[handId].EndFocus(sphereHand.ThisEitherHand); focusedObjects_[handId] = null; } if (focusedObjects_[handId] == null && newObject != null) { newObject.StartFocus(sphereHand.ThisEitherHand); focusedObjects_[handId] = newObject; } if (focusedObjects_[handId] != null) { bool grabCountrol = true; for (int loop = 0; loop < 2; loop++) { if (handId != loop && focusedObjects_[handId] == focusedObjects_[loop] && isGrab_[loop]) { grabCountrol = false; } } if (grabCountrol) { bool grabed = true; bool opened = true; for (int loop = 1; loop < 5; loop++) { if (sphereHand.GetFingerOpened(loop)) { grabed = false; } else { opened = false; } } if (!isGrab_[handId] && grabed) { startGrabCoroutineRunning_[handId] = StartCoroutine(startGrabCoroutine(sphereHand.ThisEitherHand, sphereHand.transform.TransformPoint(sphereHand.HandCenterPosition))); isGrab_[handId] = true; } else if (isGrab_[handId] && grabed) { if (startGrabCoroutineRunning_[handId] == null) { focusedObjects_[handId].StayGrab(sphereHand.ThisEitherHand, sphereHand.transform.TransformPoint(sphereHand.HandCenterPosition)); } if (endGrabCoroutineRunning_[handId] != null) { StopCoroutine(endGrabCoroutineRunning_[handId]); endGrabCoroutineRunning_[handId] = null; } } else if (isGrab_[handId] && opened) { if (startGrabCoroutineRunning_[handId] != null) { StopCoroutine(startGrabCoroutineRunning_[handId]); startGrabCoroutineRunning_[handId] = null; } else if (endGrabCoroutineRunning_[handId] == null) { endGrabCoroutineRunning_[handId] = StartCoroutine(endGrabCoroutine(sphereHand.ThisEitherHand)); } } } } } for (int loop = 0; loop < 2; loop++) { if (!isDetected[loop] && focusedObjects_[loop] != null && !isGrab_[loop]) { focusedObjects_[loop].EndFocus((HandVRSphereHand.EitherHand)loop); focusedObjects_[loop] = null; } } }
public TcResultColumn(IControlObject resultColumn) { mResultColumn = resultColumn; }
/// <summary> /// Initializes a new instance of the <see cref="TcSpinEdit"/> class. /// </summary> /// <param name="controlObject">The control object.</param> public TcSpinEdit(IControlObject controlObject) : base(controlObject) { }