/// <summary> /// Maps the provided visible bounds in volume space back to section space with the provided transform. /// </summary> /// <param name="transform"></param> /// <param name="VisibleBounds"></param> /// <returns></returns> protected List<MappingGridVector2> VisibleBoundsCorners(Geometry.Transforms.TransformBase transform, GridRectangle VisibleBounds) { List<MappingGridVector2> listBoundCorners = new List<MappingGridVector2>(4); //Add any corners of the VisibleBounds that we can transform to the list of points bool transformSuccess = false; GridVector2 TLowerLeft; GridVector2 TLowerRight; GridVector2 TUpperLeft; GridVector2 TUpperRight; transformSuccess = transform.TryInverseTransform(VisibleBounds.LowerLeft, out TLowerLeft); if(transformSuccess) listBoundCorners.Add(new MappingGridVector2(VisibleBounds.LowerLeft, TLowerLeft)); //Add any corners of the VisibleBounds that we can transform to the list of points transformSuccess = transform.TryInverseTransform(VisibleBounds.LowerRight, out TLowerRight); if(transformSuccess) listBoundCorners.Add(new MappingGridVector2(VisibleBounds.LowerRight, TLowerRight)); transformSuccess = transform.TryInverseTransform(VisibleBounds.UpperLeft, out TUpperLeft); if(transformSuccess) listBoundCorners.Add(new MappingGridVector2(VisibleBounds.UpperLeft, TUpperLeft)); transformSuccess = transform.TryInverseTransform(VisibleBounds.UpperRight, out TUpperRight); if(transformSuccess) listBoundCorners.Add(new MappingGridVector2(VisibleBounds.UpperRight, TUpperRight)); return listBoundCorners; }
Viking.Common.IUIObjectBasic Viking.Common.ISectionOverlayExtension.NearestObject(Geometry.GridVector2 WorldPosition, out double distance) { distance = double.MaxValue; return RecursiveFindBookmarks(Global.FolderUIObjRoot, WorldPosition, ref distance); }