public override void MouseClick(ObjectClickEventArgs e) { if (m_State == FittingsState.Configuring) { m_OSDExcluderTool.MouseClick(e); } if (m_State == FittingsState.Solved) { IStarMap starMap = AstrometryContext.Current.StarMap; if (starMap != null) { int x, y; StarMapFeature feature = starMap.GetFeatureInRadius(e.Pixel.X, e.Pixel.Y, 5); if (feature != null) { x = feature.GetCenter().X; y = feature.GetCenter().Y; } else { x = e.Pixel.X; y = e.Pixel.Y; } int searchArea = Control.ModifierKeys == Keys.Shift ? 5 : 10; PSFFit psfFit; ImagePixel pixelCent = starMap.GetPSFFit(x, y, searchArea, out psfFit); if (pixelCent != null && pixelCent != ImagePixel.Unspecified) { PlateConstStarPair selectedPair = null; LeastSquareFittedAstrometry astrometry = FittedAstrometryFromUserSelectedFitGrade(); if (astrometry != null) { foreach (PlateConstStarPair pair in astrometry.FitInfo.AllStarPairs) { if (Math.Abs(pair.x - pixelCent.X) < 2 && Math.Abs(pair.y - pixelCent.Y) < 2) { selectedPair = pair; break; } } } DrawHighResFeature(pixelCent, selectedPair, astrometry); } else { ClearZoomImage(); } } } }
public override void MouseClick(ObjectClickEventArgs e) { if (m_OperationState == SpectroscopyState.ChoosingStar && e.Gausian != null && e.Gausian.IsSolved && e.Gausian.Certainty > 0.2) { float bestAngle = m_SpectroscopyController.LocateSpectraAngle(e.Gausian); if (float.IsNaN(bestAngle)) { SelectedStar = new ImagePixel(e.Gausian.XCenter, e.Gausian.YCenter); SelectedStarFWHM = e.Gausian.FWHM; m_SelectedStarGaussian = e.Gausian; MeasurementAreaWing = (int)(2 * Math.Ceiling(SelectedStarFWHM)); BackgroundAreaWing = MeasurementAreaWing; BackgroundAreaGap = 5; SelectedAnglePoint = Point.Empty; m_ControlPanel.ClearSpectra(); m_OperationState = SpectroscopyState.ChoosingAngleManually; } else { SelectedStar = new ImagePixel(e.Gausian.XCenter, e.Gausian.YCenter); SelectedStarFWHM = e.Gausian.FWHM; m_SelectedStarGaussian = e.Gausian; MeasurementAreaWing = (int)(2 * Math.Ceiling(SelectedStarFWHM)); BackgroundAreaWing = MeasurementAreaWing; BackgroundAreaGap = 5; SetBestAngle(bestAngle); } m_VideoController.RedrawCurrentFrame(false, true); } else if (m_OperationState == SpectroscopyState.ChoosingAngleManually && SelectedStar != null) { double atanAgnle = 180 * Math.Atan((SelectedStar.YDouble - e.Pixel.YDouble) / (e.Pixel.XDouble - SelectedStar.XDouble)) / Math.PI; if (atanAgnle < 0) { atanAgnle = 360 + atanAgnle; } int roughAngle = (int)atanAgnle; float bestAngle = m_SpectroscopyController.LocateSpectraAngle(e.Gausian, roughAngle); if (!float.IsNaN(bestAngle)) { SetBestAngle(bestAngle); m_VideoController.RedrawCurrentFrame(false, true); } } }
public override void MouseClick(ObjectClickEventArgs e) { }
public override void MouseClick(ObjectClickEventArgs e) { if (e.MouseEventArgs.Button == MouseButtons.Right && m_AstrometricState.ManualStarIdentificationMode) { m_AstrometryController.SetManuallyIdentifyStarState(false); } if (e.Pixel != null) { if ((m_AstrometricState.MeasuringState == AstrometryInFramesState.Ready || m_AstrometricState.MatchResult != PerformMatchResult.FitSucceessfull) && m_AstrometricState.ManualStarIdentificationMode && AstrometryContext.Current.FieldSolveContext.CatalogueStars != null && AstrometryContext.Current.FieldSolveContext.CatalogueStars.Count > 3) { var frmIdentifyCalibrationStar = new frmIdentifyCalibrationStar(AstrometryContext.Current.FieldSolveContext.CatalogueStars, m_AstrometricState.ManuallyIdentifiedStars, false); DialogResult res = m_VideoController.ShowDialog(frmIdentifyCalibrationStar); if (res == DialogResult.Abort) { m_AstrometricState.ManuallyIdentifiedStars.Clear(); m_AstrometryController.SetManuallyIdentifyStarState(false); } else if (res == DialogResult.OK && frmIdentifyCalibrationStar.SelectedStar != null) { var frmQuestion = new frmIdentifiedStarAction(m_AstrometricState); if (m_VideoController.ShowDialog(frmQuestion) == DialogResult.OK) { m_AstrometricState.ManuallyIdentifiedStars.Add(e.Gausian, frmIdentifyCalibrationStar.SelectedStar); m_AstrometryController.TriggerPlateReSolve(); m_AstrometryController.SetManuallyIdentifyStarState(false); } else { m_AstrometricState.ManuallyIdentifiedStars.Add(e.Gausian, frmIdentifyCalibrationStar.SelectedStar); m_VideoController.RedrawCurrentFrame(false, true, false); } } } else if (m_AstrometricState.MeasuringState != AstrometryInFramesState.RunningMeasurements) { AstrometricState astrometryTracker = AstrometryContext.Current.AstrometricState; if (astrometryTracker != null && astrometryTracker.AstrometricFit != null) { var objInfo = new SelectedObject() { X0 = e.Pixel.XDouble, Y0 = e.Pixel.YDouble }; astrometryTracker.AstrometricFit.GetRADEFromImageCoords(e.Pixel.XDouble, e.Pixel.YDouble, out objInfo.RADeg, out objInfo.DEDeg); objInfo.FittedStar = astrometryTracker.AstrometricFit.FitInfo.GetFittedStar(e.Pixel); objInfo.Solution = astrometryTracker.AstrometricFit; objInfo.Pixel = e.Pixel; objInfo.Gaussian = e.Gausian; if (m_AstrometricState.IdentifiedObjects != null) { objInfo.IdentifiedObject = m_AstrometricState.GetIdentifiedObjectAt(objInfo.RADeg, objInfo.DEDeg); } else { objInfo.IdentifiedObject = null; } // We don't want to reload the current frame as this will result in trying another Astrometric Fit // So we send a message to the Astrometry component about the newly selected object m_AstrometryController.NewObjectSelected(objInfo); m_SelectedObject = objInfo; m_VideoController.RedrawCurrentFrame(false, true, false); } } } }
public virtual void MouseClick(ObjectClickEventArgs e) { }