Plugins

Plugins
are a method of adding additional functionality to Punt. Listed below is
information about Plugins that will work with Punt.

Authors
of Plugins written for World Wind need to modify their plugins to work
with Punt, however, the modifications are relatively minor. Examples of
changes required to convert Plugins to work with Punt are provided in
the Plugin Coversion section.

Plugins
Conversion

Plugins
are a method of adding additional functionality to Punt. Plugins are
C#, VB.net, or JScript.net source code, or binary .Net assemblies,
that are loaded and run within Punt. The Plugin Engine used in Punt
(and in World Wind) was written by Bjørn Reppen, one of the
originators of the Punt project. His website has over 20 Sample
Plugins that "have been written to demonstrate some of the
capabilities and hopefully inspire others into developing more useful
plug-ins".

Authors
of Plugins written for World Wind will need to modify their plugins to
work with Punt. In most cases, the modifications are relatively minor.
The information below should help plugin authors convert their
"World Wind format" plugins for use with Punt.

Converting
the Sky and Fog plugin to work in Punt

Patrick
Murris wrote a "Sky and Fog" plugin for World Wind.
Outlined below are the steps that were required to convert his Sky and
Fog plugin to work with Punt. The converted Sky and Fog plugin is
available for download from the Punt Sourceforge page.

The
first errors

The
World
Wind-format Sky and Fog plugin ZIP file was downloaded, and then
unzipped into the Punt Plugins directory. In Punt, the Plugin Load/Unload
dialog lists both Fog and Sky as available plugins. Selecting the Sky
plugin, and using the Load button gives the following error messages:

These
are caused because there is no "WorldWind" namespace in Punt,
so any lines in Sky.cs that reference the WorldWind namespace need to
be changed. Change these lines:

using WorldWind.Renderable;
using WorldWind.Camera;
using WorldWind;
public class Sky : WorldWind.PluginEngine.Plugin

to
this:

using Punt.Renderable;
using Punt.Camera;
using Punt;
public class Sky : Punt.PluginEngine.Plugin

An
error and a warning

Having
made those changes, again selecting the Sky plugin, and using the Load
button gives more messages:

The
error is caused because Skylayer is a RenderableObject,
and RenderableObject no longer has an abstract method Initialize()
to be overridden. Change these lines in Sky.cs:

The
two warnings can be ignored, or the two uses of (Exception
caught) can be removed. The two errors referring to Punt.Distance
are because in the Camera class the Altitude
property is now of type Distance (a new class in Punt)
rather than double. One way to fix these two errors is to
change these two lines:

Sky
now works in Punt, almost

Having
made those changes, again selecting the Sky plugin, and using the Load
button, the Sky plugin now loads in Punt. However, even if you zoom
in, and tilt the view to show the sky, there is no apparent effect
from the Sky plugin, even though it shows as enabled in the Layer
Manager. If you disable, then enable, the Sky layer in Layer Manager,
then it works.

This
is caused because in Punt only layers that are "on" are
rendered, and because the Sky layer isn't "on", it's Render()
method isn't being called. To fix this, set the layer to be
"on" in the plugin's Load() method: