protected override void OnClickMove(ScreenPoint cursorPos, Line cursorRay) { if (getPointUnderCursor(cursorRay, out pCur, out basZ)) { if (tState == 0) { // nothing is defined. Mouse is moved to set origin. } else if (tState == 1) { // pOrig is defined. Mouse is moved to find position of basX basX = pCur - pOrig; basY = Vector.Cross(basZ, basX); basY *= (basX.Magnitude / basY.Magnitude); ext = basX.Magnitude; // _report(PlotCommands[1]); } else if (tState == 2) { // pOrig and bas are defined. Mouse is moved to set extension. ext = (pCur - pOrig).Magnitude; // _report(PlotCommands[2]); } UpdateRendering(); // _compare_camera_and_cursor(cursorPos, cursorRay); } }
private bool getPointUnderCursor(Line cursorRay, out Point p, out Vector v) { Plane sP = Window.ActiveContext.SectionPlane; if (sP != null) { sP.TryIntersectLine(cursorRay, out p); v = sP.Frame.DirZ.UnitVector; return(true); } return(false); }