public static void DrawArtwork(RenderContext renderContext) { if (Artwork == null) { if (artFile == null) { artFile = new Folder(); artFile.LoadFromUrl("http://www.worldwidetelescope.org/wwtweb/catalog.aspx?W=hevelius", OnArtReady); //artFile.LoadFromUrl("http://www.worldwidetelescope.org/wwtweb/catalog.aspx?W=and", OnArtReady); } return; } maxSeperation = Math.Max(.50, Math.Cos((renderContext.FovAngle * 2) / 180.0 * Math.PI)); foreach (Place place in Artwork) { //BlendState bs = PictureBlendStates[imageset.Name]; //bs.TargetState = Settings.Active.ConstellationArtFilter.IsSet(imageset.Name); //if (bs.State) bool reverse = false; Place centroid = ConstellationCentroids[place.Constellation]; if (centroid != null) { Vector3d pos = Coordinates.RADecTo3d(reverse ? -centroid.RA - 6 : centroid.RA, reverse ? centroid.Dec : centroid.Dec); if (Vector3d.Dot(renderContext.ViewPoint, pos) > maxSeperation) { renderContext.DrawImageSet(place.StudyImageset, 100); } } } }
static public Folder GetWtmlFile(string url, Action complete) { Folder temp = new Folder(); temp.LoadFromUrl(url, delegate { LoadImagesets(temp); complete(); }); return(temp); }
public void Refresh() { if (proxyFolder == null) { proxyFolder = new Folder(); proxyFolder.IsProxy = true; proxyFolder.Parent = Parent; } proxyFolder.LoadFromUrl(urlField, childReadyCallback); childReadyCallback = null; }
public void LoadImageCollection(string url) { imageUrl = url; imageFolder = new Folder(); imageFolder.LoadFromUrl(url, delegate { Wtml.LoadImagesets(imageFolder); FireCollectionLoaded(url); }); }
public void CreateExplorerUI() { if (Explorer == null) { Explorer = FolderBrowser.Create(); DivElement div = (DivElement)Document.GetElementById("UI"); div.InsertBefore(Explorer.Canvas); ExploreRoot = new Folder(); ExploreRoot.LoadFromUrl("http://www.worldwidetelescope.org/wwtweb/catalog.aspx?W=NewExploreRoot", delegate { Explorer.AddItems(WWTControl.ExploreRoot.Children); Explorer.Refresh(); }); } }
public void Setup(CanvasElement canvas) { canvas.AddEventListener("dblclick", OnDoubleClick, false); //canvas.AddEventListener("mousemove", OnMouseMove, false); //canvas.AddEventListener("mouseup", OnMouseUp, false); //canvas.AddEventListener("pointerdown", OnPointerDown, false); canvas.AddEventListener("mousedown", OnMouseDown, false); canvas.AddEventListener("mousewheel", OnMouseWheel, false); canvas.AddEventListener("DOMMouseScroll", OnMouseWheel, false); // this is for firefox as it does not support mousewheel canvas.AddEventListener("touchstart", OnTouchStart, false); canvas.AddEventListener("touchmove", OnTouchMove, false); canvas.AddEventListener("touchend", OnTouchEnd, false); canvas.AddEventListener("gesturechange", OnGestureChange, false); canvas.AddEventListener("gesturestart", OnGestureStart, false); canvas.AddEventListener("gestureend", OnGestureEnd, false); Document.Body.AddEventListener("keydown", OnKeyDown, false); //canvas.AddEventListener("MSGestureChange", OnGestureChange, false); //canvas.AddEventListener("mouseout", OnMouseUp, false); // MS Touch code canvas.AddEventListener("pointerdown", OnPointerDown, false); canvas.AddEventListener("pointermove", OnPointerMove, false); canvas.AddEventListener("pointerup", OnPointerUp, false); // End MS touch code RenderContext.ViewCamera.Lat = StartLat; RenderContext.ViewCamera.Lng = StartLng; RenderContext.ViewCamera.Zoom = StartZoom; RenderContext.TargetCamera = RenderContext.ViewCamera.Copy(); if (RenderContext.gl == null) { foregroundCanvas = (CanvasElement)Document.CreateElement("canvas"); foregroundCanvas.Width = canvas.Width; foregroundCanvas.Height = canvas.Height; fgDevice = (CanvasContext2D)foregroundCanvas.GetContext(Rendering.Render2D); } webFolder = new Folder(); webFolder.LoadFromUrl("http://www.worldwidetelescope.org/wwtweb/catalog.aspx?X=ImageSets5", SetupComplete); WebFile webFile = new WebFile("http://www.worldwidetelescope.org/wwtweb/weblogin.aspx?user=12345678-03D2-4935-8D0F-DCE54C9113E5&Version=HTML5&webkey=AX2011Gqqu&platform=web"); webFile.Send(); }
public static void GetWtmlFile(string url, Action complete) { Folder temp = new Folder(); temp.LoadFromUrl(url, delegate { LoadImagesets(temp); complete(); }); }