public HotRegion[] CheckHotRegions(int x, int y, Type[] objectTypes) { ArrayList arrayList = new ArrayList(); for (int num = this.list.Count - 1; num >= 0; num--) { HotRegion hotRegion = (HotRegion)this.list[num]; if (this.IsOfType(objectTypes, hotRegion.SelectedObject)) { GraphicsPath[] paths = ((HotRegion)this.list[num]).Paths; foreach (GraphicsPath graphicsPath in paths) { if (graphicsPath != null && graphicsPath.IsVisible((float)x, (float)y)) { arrayList.Add(this.list[num]); } } } } if (arrayList.Count > 0) { return((HotRegion[])arrayList.ToArray(typeof(HotRegion))); } return(null); }
public HitTestResult(HotRegion region, PointF hitTestPoint) { this.region = region; if (region != null) { this.obj = region.SelectedObject; } this.htPoint = hitTestPoint; }
public override double GetValue(PointF c, PointF p) { if (this.Common != null) { HotRegionList hotRegionList = this.Common.GaugeCore.HotRegionList; int num = hotRegionList.LocateObject(this.GetGauge()); if (num != -1) { HotRegion hotRegion = (HotRegion)hotRegionList.List[num]; RectangleF boundingRectangle = hotRegion.BoundingRectangle; float num2 = (float)((this.ParentGauge.GetOrientation() != 0) ? ((p.Y - boundingRectangle.Y) / boundingRectangle.Height * 100.0) : ((p.X - boundingRectangle.X) / boundingRectangle.Width * 100.0)); return(this.GetValueFromPosition(num2)); } } return(double.NaN); }
public void SetHotRegion(object selectedObject, PointF pinPoint, params GraphicsPath[] paths) { int num = this.LocateObject(selectedObject); HotRegion hotRegion; if (num == -1) { hotRegion = new HotRegion(); num = this.list.Add(hotRegion); } else { hotRegion = (HotRegion)this.list[num]; } hotRegion.SelectedObject = selectedObject; Matrix transform = this.Common.Graph.Transform; if (transform != null) { for (int i = 0; i < paths.Length; i++) { if (paths[i] != null) { try { paths[i].Transform(transform); } catch { return; } } } } else { this.Common.Graph.Transform = new Matrix(); } hotRegion.Paths = paths; if (!pinPoint.IsEmpty) { pinPoint.X += transform.OffsetX; pinPoint.Y += transform.OffsetY; } hotRegion.PinPoint = pinPoint; hotRegion.BuildMatrices(this.Common.Graph); }