Plugin FAQ

From World Wind Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 14:05, 17 August 2005 (edit)
83.65.246.216 (Talk)
(How do I remote control World Wind)
← Previous diff
Revision as of 01:24, 25 August 2005 (edit) (undo)
200.148.117.213 (Talk)
(How do I subscribe to the event that fires when vertical exaggeration changes)
Next diff →
Line 23: Line 23:
===How do I subscribe to the event that fires when vertical exaggeration changes=== ===How do I subscribe to the event that fires when vertical exaggeration changes===
-Currently events aren't used in World Wind. If you are writing a layer you can instead in the Update method store the current vertical exaggeration value. Next time your update method is called (by the background worker thread) you check if it has changed. +Currently events aren't used in World Wind. If you are writing a layer you can instead in the Update method store the current vertical exaggeration value. Next time your update method is called (by the background worker thread) you check if it has changed.
===How do I access the layer list (renderable objects)=== ===How do I access the layer list (renderable objects)===

Revision as of 01:24, 25 August 2005

Contents

General

Is it possible to run binary plugins

In addition to loading source code plugins World Wind also probes for .dll files inside the Plugins directory that implement the plugin interface. If found they will be displayed in the Plugin Dialog.

Which programming languages are supported

Currently, VB.net, C# and JScript.net in addition to pre-compiled binary plugins.

Troubleshooting

Why doesn't World Wind unload my plugin cleanly

It is the responsibilty of the plugin to restore World Wind to the original state when the plugin is unloaded. For example if the plugin adds menu items, the plugin must remove those menu items when unloading.

How-to

How do I print debug data on screen?

Check WorldWindow.RenderPositionInfo for ideas on how to draw text on screen.

How do I subscribe to the event that fires when vertical exaggeration changes

Currently events aren't used in World Wind. If you are writing a layer you can instead in the Update method store the current vertical exaggeration value. Next time your update method is called (by the background worker thread) you check if it has changed.

How do I access the layer list (renderable objects)

ParentApplication.WorldWindow.CurrentWorld.ChildObjects

This RenderableObjectList contains a collection of RenderableObjects and RenderableObjectLists making it a tree.

How do I get the location of WW's main directory

MainApplication.DirectoryPath

How do I reference additional assemblies from my plugin

Use the REFERENCES keyword in the Plugin Header.

How do I add my own property dialog for a layer

Override OnPropertiesClick for example like this:

/// <summary>
/// Layer properties context menu item
/// </summary>
protected virtual void OnPropertiesClick(object sender, System.EventArgs e)
{
  if(m_propertyBrowser!=null)
    m_propertyBrowser.Dispose();
  m_propertyBrowser = new MyFancyPropertyDialog(this);
  m_propertyBrowser.Show();
}

How do I remote control World Wind

ParentApplication.WorldWindow.GotoLatLonAltitude(50.94299, 6.96291, 10000) for Latitude, Longitude,  Altitude input
ParentApplication.WorldWindow.GotoLatLon(double latitude, double longitude) for Latitude, Longitude  input
ParentApplication.WorldWindow.GotoLatLonHeadingAltitude(double latitude, double longitude, double
heading, double altitude) for Latitude, Longitude, Heanding, Altitude input
ParentApplication.WorldWindow.GotoLatLon(double latitude, double longitude, double heading, double
altitude, double perpendicularViewRange, double tilt) for Latitude, Longitude, Heanding, Altitude,   FOV, Tilt input
For URI Input first add in the class:
public static WorldWindUri worldWindUri; 
ParentApplication.WorldWindow.ParentApplication.WorldWindow.Goto(WorldWindUri.Parse("worldwind://
goto/world=Earth&lat="+Latitude + "&lon=" + Longitude + "&alt=" + Altitude+ "&dir=" + Heading + 
"&tilt=" + Tilt));

How do I retrieve the current position

ParentApplication.WorldWindow.DrawArgs.WorldCamera.Latitude
ParentApplication.WorldWindow.DrawArgs.WorldCamera.Longitude

How do I detect what directory my plugin was loaded from

The Plugin base class has a property PluginDirectory that contains the path from which the plugin was loaded. This path may be used to find any additional files you may want to load.

this.PluginDirectory
Personal tools