VisioMove SDK (Android)  2.1.22
 All Classes Functions Variables Pages
VgIEngine Class Reference

Public Member Functions

void addPostDrawCallback (VgIEnginePostDrawCallbackRefPtr pCallback)
 
void removePostDrawCallback (VgIEnginePostDrawCallbackRefPtr pCallback)
 
VgPostDrawCallbacks getPostDrawCallbacks ()
 
VgIDatabase editDatabase ()
 
VgICamera editCamera ()
 
VgILicenseManager editLicenseManager ()
 
VgITextureManager editTextureManager ()
 
VgIAnimationManager editAnimationManager ()
 
VgIResourceManager editResourceManager ()
 
VgLayerManager editLayerManager ()
 
VgInstanceFactory editInstanceFactory ()
 
VgFontManager editFontManager ()
 
VgPositionToolbox getPositionToolbox ()
 
VgErrorCode getLastError ()
 
String getErrorString (VgErrorCode pErrorCode)
 
VgSpatialList execute (VgQuery pQuery)
 
void resetGraphicResources (boolean pIsContextLost)
 
void reloadShaders ()
 
VgLightConstRefPtr getLight (long pLightNum)
 
VgLightRefPtr editLight (long pLightNum)
 
long getNumLights ()
 
void replaceNamedTexture (String pResourceName, VgITextureRefPtr pTexture)
 
void setClearColor (VgColor pClearColor)
 
boolean isLoaded (int[] pGraphicsQueue, int[] pLoadQueueSize, int[] pLoadedQueueSize, int[] pActiveThreads)
 

Detailed Description

This interface provides an entry-point to retrieve objects from the Visioglobe engine.

Member Function Documentation

void VgIEngine.addPostDrawCallback ( VgIEnginePostDrawCallbackRefPtr  pCallback)

This method is used to add a VgIEnginePostDrawCallback to the engine.

Note
Note that adding too many post draw callbacks (or having a post draw callback that takes time to execute) can lead to bad performance.
Parameters
pCallbackthe post draw callback.
VgIAnimationManager VgIEngine.editAnimationManager ( )
Returns
The animation manager.
VgICamera VgIEngine.editCamera ( )
Returns
The camera.
VgIDatabase VgIEngine.editDatabase ( )
Returns
The database.
VgFontManager VgIEngine.editFontManager ( )
Version
2.0.8387
Returns
The font manager.
VgInstanceFactory VgIEngine.editInstanceFactory ( )
Returns
The instance factory.
VgLayerManager VgIEngine.editLayerManager ( )
Returns
The layer manager.
VgILicenseManager VgIEngine.editLicenseManager ( )
Returns
The license manager.
VgLightRefPtr VgIEngine.editLight ( long  pLightNum)

This method gives read-write access to one of the engine lights.

Parameters
pLightNumThe index of the queried light.
Version
2.0.8744
Returns
A VgRefPtr containing the pointer to the light, or NULL if there is no light with this index.
VgIResourceManager VgIEngine.editResourceManager ( )
Returns
The resource manager.
VgITextureManager VgIEngine.editTextureManager ( )
Returns
The texture manager.
VgSpatialList VgIEngine.execute ( VgQuery  pQuery)

Executes a query to retrieve VgEngine::VgSpatial according to a VgEngine::VgQuery (e.g. all VgSpatials of the map, or having a specific ID) This call will not return results before selecting the Dataset, i.e. before VgEngine::VgIDatabase::selectDataset()

Example:

...
VgEngine::VgQuery lQuery;
typedef std::list< VgEngine::VgRefPtr< VgEngine::VgSpatial > > SpatialList;
SpatialList lSpatials;
// use VgQuery to retrieve one specific ID
// You could also retrieve all and use ->getID()
lSpatials = lEngine->execute(lQuery.where("ID",VgEngine::VgQuery::eEquals,"L-250"));
// Note you can get many lSpatials, including the labels at different LODs.
for (SpatialList::const_iterator lIter = lSpatials.begin() ; lIter != lSpatials.end(); ++lIter)
{
VgEngine:Vg3DModule::VgPoint* lPoint = lIter->get()->asPoint();
if (lPoint)
{
// modify your point here.
lPoint->setScale(...)
lPoint->setGeometryConstantSizeDistance(50);
...
}
}
Remarks
the VgSpatial must have already been created, for labels by having done a setPlaceName/setPlaceIcon on the ID.
Make sure you do a .clear() on the VgSpatial 's list before the the destruction of the VgIApplication keeping references to VgSpatial after the destruction of the VgIApplication can lead to crashes when these VgSpatials are destroyed.
Parameters
pQueryQuery to execute.
Version
2.0.9334
2.1.0 Updated documentation about having a reference when the VgIApplication is destroyed.
See also
VgEngine::VgQuery
VgEngine::VgSpatial
Vg3DModule::VgPoint
VgMapModule::VgIMapModule::setPlaceName
VgMapModule::VgIMapModule::setPlaceIcon
Returns
Selected spatials if any.
String VgIEngine.getErrorString ( VgErrorCode  pErrorCode)
Parameters
pErrorCode
Returns
The error string corresponding to an error code.
VgErrorCode VgIEngine.getLastError ( )
Returns
The last error (an empty string is returned if no error occured).

References VgErrorCode.swigToEnum().

VgLightConstRefPtr VgIEngine.getLight ( long  pLightNum)

This method gives read-only access to one of the engine lights.

Parameters
pLightNumThe index of the queried light.
Version
2.0.8744
Returns
A VgConstRefPtr containing the pointer to the light, or NULL if there is no light with this index.
long VgIEngine.getNumLights ( )

This method returns the number of lights in the scene.

Version
2.0.8744
Returns
The number of lights in the scene.
VgPositionToolbox VgIEngine.getPositionToolbox ( )
Returns
The toolbox for positions.
VgPostDrawCallbacks VgIEngine.getPostDrawCallbacks ( )
Returns
Registred post draw callbacks.
boolean VgIEngine.isLoaded ( int[]  pGraphicsQueue,
int[]  pLoadQueueSize,
int[]  pLoadedQueueSize,
int[]  pActiveThreads 
)

This method is used to check if everything is loaded at a given time Useful for screencaptures, progress bars, and resource scheduling. It is best to run it on a VgEngine::VgIEnginePostDrawCallback

Parameters
pGraphicsQueuenumber of pending graphics operation (related to graphics context)
pLoadQueueSizenumber of pending operations.
pLoadedQueueSizeanother queue waiting to be processed
pActiveThreadscurrent number of threads that are processing requests
Version
2.1.0
2.1.5 improved accuracy
See also
VgIEngine::addPostDrawCallback
Returns
true if everything is loaded at the moment of the call. This result takes into account a larger criteria than just the counters above.
void VgIEngine.reloadShaders ( )

This method causes the engine to reinstantiate the shaders from source files.

Version
2.0.8744

Referenced by VgSurfaceView.onSurfaceCreated().

void VgIEngine.removePostDrawCallback ( VgIEnginePostDrawCallbackRefPtr  pCallback)

This method is used to remove a VgIEnginePostDrawCallback to the engine.

Parameters
pCallbackthe post draw callback.
void VgIEngine.replaceNamedTexture ( String  pResourceName,
VgITextureRefPtr  pTexture 
)

This method is used to override a given texture resource (defined in the configuration file). If a resource exists by that name, it is replaced by the provided texture instance and all items in the scene referencing it are updated. If there is no matching texture nothing happens.

Parameters
pResourceNamethe name of the texture resource to override.
pTextureThe texture to override with.
Version
2.0.8744
void VgIEngine.resetGraphicResources ( boolean  pIsContextLost)

Resets all the GPU graphic resources.

Remarks
if the context was not lost and you specify true, it will produce memory leaks in the GPU.
this is only supported on Android.
Parameters
pIsContextLostUse true to specify that the context has been lost, false otherwise.
Version
2.0.7885.7885
2.1.2 added note on android only support.

Referenced by VgSurfaceView.onSurfaceCreated().

void VgIEngine.setClearColor ( VgColor  pClearColor)

This method is used to change the clear color of the VgEAGLView. If the view has an opaque background, this clear color will be hidden, except for the first few frames while the background is loading. Thus you could set the clear color of the VgEAGLView to closely match the background (of the dataset).

Remarks
this method should be called after VgIDatabase::selectDataset
Parameters
pClearColorThe new color to use for screen clearing.
Version
2.0.8955
2.1.5 updated documentation
See also
VgIDatabase::selectDataset

The documentation for this class was generated from the following file:
VisioMove 2.1.22, Visioglobe® 2016