예제 #1
0
        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);
                    }
                }
            }
        }
예제 #2
0
        static public Folder GetWtmlFile(string url, Action complete)
        {
            Folder temp = new Folder();

            temp.LoadFromUrl(url, delegate { LoadImagesets(temp); complete(); });
            return(temp);
        }
예제 #3
0
        public void Refresh()
        {
            if (proxyFolder == null)
            {
                proxyFolder         = new Folder();
                proxyFolder.IsProxy = true;
                proxyFolder.Parent  = Parent;
            }

            proxyFolder.LoadFromUrl(urlField, childReadyCallback);
            childReadyCallback = null;
        }
예제 #4
0
 public void LoadImageCollection(string url)
 {
     imageUrl    = url;
     imageFolder = new Folder();
     imageFolder.LoadFromUrl(url, delegate { Wtml.LoadImagesets(imageFolder); FireCollectionLoaded(url); });
 }
예제 #5
0
        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(); });
            }
        }
예제 #6
0
        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();
        }
예제 #7
0
 public static void GetWtmlFile(string url, Action complete)
 {
     Folder temp = new Folder();
     temp.LoadFromUrl(url, delegate { LoadImagesets(temp); complete(); });
 }
예제 #8
0
        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);
                    }

                }
            }
        }