public override void Activate(VrSession session) { var stn = Station.ActiveStation; if (stn == null) { return; } var tasks = stn.Irc5Controllers.SelectMany(t => t.Tasks).ToList(); tasks.Add(stn.DefaultTask); foreach (var task in tasks) { foreach (RsPathProcedure p in task.PathProcedures) { if (!p.ShowSpeeds) { p.ShowSpeeds = true; _restoreShowSpeeds.Add(p); } } } }
public override void Activate(VrSession session) { var stn = Station.ActiveStation; if (stn == null) { return; } _detector = new PathObjectDetector(stn); var tasks = stn.Irc5Controllers.SelectMany(t => t.Tasks).ToList(); tasks.Add(stn.DefaultTask); foreach (var task in tasks) { foreach (RsPathProcedure p in task.PathProcedures) { if (p.ZoneVisualization != ZoneVisualization.Programmed) { p.ZoneVisualization = ZoneVisualization.Programmed; // actual? _restoreShowZones.Add(p); } } } }
RsMoveInstruction GetPickedMoveInstruction(VrSession session) { var pd = _picker.PickNearest(session); _pickPreview.Update(session, pd); return(pd.selectedObject as RsMoveInstruction); }
public override void Activate(VrSession session) { PathEditingHelper.EnsurePath(); //:TODO: Update if active tool changes CreateToolGraphics(); }
public override void Deactivate(VrSession session) { foreach (var p in _restoreShowZones) { p.ZoneVisualization = ZoneVisualization.None; } _restoreShowZones.Clear(); }
public override void Deactivate(VrSession session) { _pickPreview.Clear(); foreach (var p in _restoreShowSpeeds) { p.ShowSpeeds = false; } _restoreShowSpeeds.Clear(); }
public override void Deactivate(VrSession session) { if (_brushSelector != null) { _brushSelector.Dispose(); _brushSelector = null; } DeleteBrushTempGfx(); }
private void UpdatePreview(VrSession session) { if (_paintCone != null) { _paintCone.Delete(); } var mesh = _painter.CreatePreviewGraphics(); var pm = session.RightController.PointerOffsetTransform; _paintCone = session.RightController.TemporaryGraphics.DrawMesh(pm, mesh); }
public override void Deactivate(VrSession session) { foreach (var g in _toolGfx) { g.Delete(); } if (_previewTrace != null) { _previewTrace.Delete(); } _toolGfx.Clear(); }
public override void Deactivate(VrSession session) { Station station = Project.ActiveProject as Station; if (RecData.JointValuesList.Count > 0) { RecData.ResetPos(); } RecData.resetList(); DeleteGfx(); station.ActiveTask.ActivePathProcedure.Visible = true; Graph.DeleteChart(); }
public override void Activate(VrSession session) { base.Activate(session); PathEditingHelper.EnsurePath(); _controller = session.RightController; AddGfx(); //Click += HandleClick; AlternateClick += HandleAlternateClick; DeltaDrag += HandleDeltaDrag; BeginDrag += HandleBeginDrag; EndDrag += HandleDeltaDrag; HoverObject += HandleHover; }
public override void Deactivate(VrSession session) { if (_painter != null) { _painter.Dispose(); _painter = null; } if (_paintCone != null) { _paintCone.Delete(); _paintCone = null; } _part = null; }
public override void Activate(VrSession session) { Station station = Project.ActiveProject as Station; Light light = station.Lights[0]; light.CastShadows = false; Light light2 = station.Lights[1]; light2.CastShadows = false; _rcontroller = session.RightController; _lcontroller = session.LeftController; SetCurrentSignal(0); new RecData().RunPos(); atTrack = true; press = false; _recSig = true; currentSignal = 0; }
public override void Activate(VrSession session) { //:TODO: How to determine which part to paint? var part = Station.ActiveStation.FindGraphicComponentsByType(typeof(Part)).OfType <Part>().FirstOrDefault(p => p.Name == "PaintPart"); if (part != null) { _painter = new GfxTexturePainter(part); _painter.Range = 0.500; _painter.SizeX = 0.150; _painter.SizeY = 0.400; _painter.Strength = 0.1; _painter.ShowPaint(true); _part = part; UpdatePreview(session); } }
public override void Update(VrSession session) { var ctrl = session.RightController; if (_dragMoveInstr != null) { if (ctrl.InputState.TriggerPressed) { //double newZoneVal = } else { _dragMoveInstr = null; } } var ctrlPos = ctrl.PointerTransform.Translation; var hitResult = _detector.DetectMoveInstruction(ctrlPos) as HitResult <RsMoveInstruction>; if (hitResult != null) { //:TODO: Update some preview if (ctrl.InputState.TriggerPressed && !ctrl.PreviousInputState.TriggerPressed) { // Improve? _zoneArg = hitResult.HitObject.InstructionArguments["Z"]; if (_zoneArg == null) { return; } int zoneVal = 0; if (_zoneArg.Name.StartsWith("z") && _zoneArg.Enabled) { int.TryParse(_zoneArg.Value, out zoneVal); } _distOffset = ctrlPos.Distance(hitResult.HitPoint) - zoneVal; _dragMoveInstr = hitResult.HitObject; } } }
public override void Deactivate(VrSession session) { base.Deactivate(session); DeleteGfx(); _controller = null; //Click -= HandleClick; AlternateClick -= HandleAlternateClick; DeltaDrag -= HandleDeltaDrag; BeginDrag -= HandleBeginDrag; EndDrag -= HandleEndDrag; //:TODO: //view.OpenVRRemoveAttachedLine(_pointerToSelGfx); ClearHover(); if (_pointerToSelGfx != IntPtr.Zero) { var view = (GraphicView)GraphicControl.ActiveGraphicControl.GetView(); view.OpenVRRemoveAttachedLine(_pointerToSelGfx); _pointerToSelGfx = IntPtr.Zero; } }
// 1. Attatch random object to right controller: public void Attatch() { VrSession session = VrEnvironment.Session; _controller = session.RightController; }
public override void Deactivate(VrSession session) { _objectDetector = null; }
public override void Activate(VrSession session) { _controller = session.RightController; AddGfx(); }
public override void Deactivate(VrSession session) { DeleteGfx(); }
public override void Activate(VrSession session) { _detector = new PathObjectDetector(Station.ActiveStation); }