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
-
Add a geo-referenced map on a container (using GeoImage/Globe geometry).
-
Add a child container to the newly created container with a geometry and the VWPosition plug-in.
-
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
-
Add a geo-referenced map on a container (using GeoImage/Globe geometry).
-
Add a child container to the newly created container with a geometry and VWMousePosition plug-in.
-
Click the E button (events button next to the Scene Editor).
-
Click on the map and see that the new container moves to the coordinate.
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
);
}