Viz World User Guide

Version 22.0 | Published December 15, 2022 ©

Viz World Plug-in API

The Viz World Plug-in API offers an easy to use geo-reference capability when building your own Viz Artist plug-ins. The API allows you to communicate and manipulate Viz World scenes and get Navigator Plug-in information.

Working with the API

This section contains short descriptions on how to use the API and what it does.

VWPosition

Can be used to position a container based on a longitude/latitude coordinate on a geo-referenced map.

To Use VWPosition

  1. Add a geo-referenced map on a container (using GeoImage/Globe geometry).

  2. Add a child container to the newly created container with a geometry and the VWPosition plug-in.

  3. Changing the longitude/latitude updates the position of the new container.

VWMousePosition

Can be used to translate a Mouse position into a longitude/latitude coordinate.

To Use VWMousePosition

  1. Add a geo-referenced map on a container (using GeoImage/Globe geometry).

  2. Add a child container to the newly created container with a geometry and VWMousePosition plug-in.

  3. Click the E button (events button next to the Scene Editor).

  4. Click on the map and see that the new container moves to the coordinate.

VWNavigatorControl

Can be used to get or set Navigator values.

To Use VWNavigatorControl

  1. Create a Navigator scene.

  2. Under the scene’s GeoReferenceMap container, add a new container with a VWNavigatorControl.

  3. Clicking the Update Geo Ref Data button reads navigator current values.

  4. Changing one of the fields sets Navigator values.

Best Practices

When using a geo-reference (VWGeoref) object it is best to use a class member that is initialized in the constructor or only when you would like to explicitly do a refresh, doing so on the ExePerField impacts performance.

The scene object (VWScene) has to be initialized in the constructor and has to be freed on the destructor, avoiding to do so results in a performance impact as Viz World’s memory consumption is not freed.

Example

class MyPlugin
{
....
private:
VWScene * m_pVWScene;
}
MyPlugin::MyPlugin()
{
m_pVWScene = VWScene::AddVWSceneInstance(this);
}
MyPlugin::~MyPlugin()
{
VWScene::RemoveVWSceneInstance(m_pVWScene, this);
}