Пример #1
0
        /// <summary>
        /// Plugin entry point - All plugins must implement this function
        /// </summary>
        public override void Load()
        {
            layer = new GlobeIconLayer(LayerName, PluginDirectory, ParentApplication.WorldWindow);

            // Add layer visibility controller (and save it to make sure you can kill it later!)
            control.Visible         = true;
            evhand                  = new EventHandler(control_VisibleChanged);
            control.VisibleChanged += evhand;

            string imgPath = Path.Combine(PluginDirectory, "GlobeIcon.png");

            if (File.Exists(imgPath) == false)
            {
                Utility.Log.Write(new Exception("imgPath not found " + imgPath));
            }
            m_ToolbarItem = new WorldWind.WindowsControlMenuButton(
                "Globe Overview",
                imgPath,
                control);

            ParentApplication.WorldWindow.MenuBar.AddToolsMenuButton(m_ToolbarItem);


            //ParentApplication.WorldWindow.CurrentWorld.RenderableObjects.ChildObjects.Insert(0,layer);
            ParentApplication.WorldWindow.CurrentWorld.RenderableObjects.Add(layer);
            m_ToolbarItem.SetPushed(layer.IsOn);
        }
Пример #2
0
        /// <summary>
        /// Plugin entry point - All plugins must implement this function
        /// </summary>
        public override void Load()
        {
            layer = new GlobeIconLayer(LayerName, PluginDirectory, ParentApplication.WorldWindow);

            // Add layer visibility controller (and save it to make sure you can kill it later!)
            control.Visible = true;
            evhand = new EventHandler(control_VisibleChanged);
            control.VisibleChanged += evhand;

            string imgPath = Path.Combine(PluginDirectory, "GlobeIcon.png");

            if (File.Exists(imgPath) == false)
            {
                Utility.Log.Write(new Exception("imgPath not found " + imgPath));
            }
            m_ToolbarItem = new WorldWind.WindowsControlMenuButton(
                "Globe Overview",
                imgPath,
                control);

            ParentApplication.WorldWindow.MenuBar.AddToolsMenuButton(m_ToolbarItem);


            //ParentApplication.WorldWindow.CurrentWorld.RenderableObjects.ChildObjects.Insert(0,layer);
            ParentApplication.WorldWindow.CurrentWorld.RenderableObjects.Add(layer);
            m_ToolbarItem.SetPushed(layer.IsOn);
        }
Пример #3
0
            public propertiesDialog(GlobeIconLayer layer)
            {
                InitializeComponent();
                this.layer = layer;
                //this.Icon = WorldWind.PluginEngine.Plugin.Icon;
                this.Text = layer.pluginName + " " + layer.version + " properties";
                // Init texture list with *.png
                DirectoryInfo di = new DirectoryInfo(layer.texturePath);

                //DirectoryInfo di = new DirectoryInfo(Path.Combine(WorldWindSettings.WorldWindDirectory, "Data/Earth/BmngBathy"));
                FileInfo[] imgFiles = di.GetFiles("*.jpg");
                cboTexture.Items.AddRange(imgFiles);
                imgFiles = di.GetFiles("*.png");
                cboTexture.Items.AddRange(imgFiles);
                // select current bitmap
                int i = cboTexture.FindString(layer.textureFileName);

                if (i != -1)
                {
                    cboTexture.SelectedIndex = i;
                }
                // Show globe
                chkGlobe.Checked = layer.showGlobe;
                // Positions globe
                cboPosition.Items.Add("Top-Left");
                cboPosition.Items.Add("Top-Center");
                cboPosition.Items.Add("Top-Right");
                cboPosition.Items.Add("Bottom-Left");
                cboPosition.Items.Add("Bottom-Center");
                cboPosition.Items.Add("Bottom-Right");
                cboPosition.Items.Add("Screen-Center");
                i = cboPosition.FindString(layer.spritePos);
                if (i != -1)
                {
                    cboPosition.SelectedIndex = i;
                }
                // Size globe
                cboSize.Items.Add("64x64");
                cboSize.Items.Add("80x80");
                cboSize.Items.Add("100x100");
                cboSize.Items.Add("128x128");
                i = cboSize.FindString((layer.globeRadius * 2).ToString() + "x" + (layer.globeRadius * 2).ToString());
                if (i != -1)
                {
                    cboSize.SelectedIndex = i;
                }
                // Show inset
                chkInset.Checked = layer.showInset;
                // Positions inset
                cboPosition2.Items.Add("Top-Left");
                cboPosition2.Items.Add("Top-Center");
                cboPosition2.Items.Add("Top-Right");
                cboPosition2.Items.Add("Bottom-Left");
                cboPosition2.Items.Add("Bottom-Center");
                cboPosition2.Items.Add("Bottom-Right");
                cboPosition2.Items.Add("Screen-Center");
                i = cboPosition2.FindString(layer.insetPos);
                if (i != -1)
                {
                    cboPosition2.SelectedIndex = i;
                }
                // Size inset
                cboSize2.Items.Add("64x64");
                cboSize2.Items.Add("100x64");
                cboSize2.Items.Add("64x100");
                cboSize2.Items.Add("80x80");
                cboSize2.Items.Add("110x80");
                cboSize2.Items.Add("80x110");
                cboSize2.Items.Add("100x100");
                cboSize2.Items.Add("133x100");
                cboSize2.Items.Add("100x133");
                cboSize2.Items.Add("128x128");
                cboSize2.Items.Add("160x128");
                cboSize2.Items.Add("128x160");
                i = cboSize2.FindString(layer.insetWidth.ToString() + "x" + layer.insetHeight.ToString());
                if (i != -1)
                {
                    cboSize2.SelectedIndex = i;
                }
            }
Пример #4
0
 public propertiesDialog(GlobeIconLayer layer)
 {
     InitializeComponent();
     this.layer = layer;
     //this.Icon = WorldWind.PluginEngine.Plugin.Icon;
     this.Text = layer.pluginName + " " + layer.version + " properties";
     // Init texture list with *.png
     DirectoryInfo di = new DirectoryInfo(layer.texturePath);
     //DirectoryInfo di = new DirectoryInfo(Path.Combine(WorldWindSettings.WorldWindDirectory, "Data/Earth/BmngBathy"));
     FileInfo[] imgFiles = di.GetFiles("*.jpg");
     cboTexture.Items.AddRange(imgFiles);
     imgFiles = di.GetFiles("*.png");
     cboTexture.Items.AddRange(imgFiles);
     // select current bitmap
     int i = cboTexture.FindString(layer.textureFileName);
     if (i != -1) cboTexture.SelectedIndex = i;
     // Show globe
     chkGlobe.Checked = layer.showGlobe;
     // Positions globe
     cboPosition.Items.Add("Top-Left");
     cboPosition.Items.Add("Top-Center");
     cboPosition.Items.Add("Top-Right");
     cboPosition.Items.Add("Bottom-Left");
     cboPosition.Items.Add("Bottom-Center");
     cboPosition.Items.Add("Bottom-Right");
     cboPosition.Items.Add("Screen-Center");
     i = cboPosition.FindString(layer.spritePos);
     if (i != -1) cboPosition.SelectedIndex = i;
     // Size globe
     cboSize.Items.Add("64x64");
     cboSize.Items.Add("80x80");
     cboSize.Items.Add("100x100");
     cboSize.Items.Add("128x128");
     i = cboSize.FindString((layer.globeRadius * 2).ToString() + "x" + (layer.globeRadius * 2).ToString());
     if (i != -1) cboSize.SelectedIndex = i;
     // Show inset
     chkInset.Checked = layer.showInset;
     // Positions inset
     cboPosition2.Items.Add("Top-Left");
     cboPosition2.Items.Add("Top-Center");
     cboPosition2.Items.Add("Top-Right");
     cboPosition2.Items.Add("Bottom-Left");
     cboPosition2.Items.Add("Bottom-Center");
     cboPosition2.Items.Add("Bottom-Right");
     cboPosition2.Items.Add("Screen-Center");
     i = cboPosition2.FindString(layer.insetPos);
     if (i != -1) cboPosition2.SelectedIndex = i;
     // Size inset
     cboSize2.Items.Add("64x64");
     cboSize2.Items.Add("100x64");
     cboSize2.Items.Add("64x100");
     cboSize2.Items.Add("80x80");
     cboSize2.Items.Add("110x80");
     cboSize2.Items.Add("80x110");
     cboSize2.Items.Add("100x100");
     cboSize2.Items.Add("133x100");
     cboSize2.Items.Add("100x133");
     cboSize2.Items.Add("128x128");
     cboSize2.Items.Add("160x128");
     cboSize2.Items.Add("128x160");
     i = cboSize2.FindString(layer.insetWidth.ToString() + "x" + layer.insetHeight.ToString());
     if (i != -1) cboSize2.SelectedIndex = i;
 }