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

Inherits GLSurfaceView, Renderer, OnTouchListener, OnKeyListener, and Callback.

Public Member Functions

native void drawFrame (long pAppCPtr)
 
native void setSurfaceSize (long pAppCPtr, int pWidth, int pHeight)
 
native void dispatchTouchDown (long pAppCPtr, int pX, int pY, int pTouchCount)
 
native void dispatchTouchUp (long pAppCPtr, int pX, int pY, int pTouchCount)
 
native void dispatchTouchMove (long pAppCPtr, int pX, int pY, int pTouchCount)
 
native void dispatchDoubleTouchMove (long pAppCPtr, int pX, int pY, int pX2, int pY2, int pTouchCount)
 
Future< Bitmap > captureToBitmap ()
 
 VgSurfaceView (Context pContext, AttributeSet pAttributeSet, boolean pNeedsTransparency)
 
 VgSurfaceView (Context pContext, AttributeSet pAttributeSet)
 
 VgSurfaceView (Context pContext)
 
 VgSurfaceView (Context pContext, boolean pNeedsTransparency)
 
void pauseRendering ()
 
void resumeRendering ()
 
boolean isRendering ()
 
void requestRedraw ()
 
void postLoadDataset ()
 
VgIApplication getApplication ()
 
void addOnCreateRunnable (Runnable pRunnable)
 
synchronized void onDrawFrame (GL10 gl)
 
void onSurfaceCreated (GL10 gl, EGLConfig config)
 
void onSurfaceChanged (GL10 gl, int width, int height)
 
void surfaceDestroyed (SurfaceHolder pHolder)
 
boolean onKey (View pView, int pInt, KeyEvent pEvent)
 
boolean onTouch (View pView, MotionEvent pEvent)
 
void setRenderOnDemand (boolean pIsEnabled)
 
boolean getRenderOnDemand ()
 

Detailed Description

The VisioMove surface view class that extends the GLSurfaceView.

Constructor & Destructor Documentation

VgSurfaceView.VgSurfaceView ( Context  pContext,
AttributeSet  pAttributeSet,
boolean  pNeedsTransparency 
)

Class constructor. Creates a new VgSurfaceView.

Parameters
pContextThe application context (passed through to Android's GLSurfaceView).
pAttributeSetThe attributes (passed through to Android's GLSurfaceView).
pNeedsTransparencyIndicates whether transparency (i.e. alpha channel) is needed for this view.
VgSurfaceView.VgSurfaceView ( Context  pContext,
AttributeSet  pAttributeSet 
)
VgSurfaceView.VgSurfaceView ( Context  pContext)
VgSurfaceView.VgSurfaceView ( Context  pContext,
boolean  pNeedsTransparency 
)

Class constructor. Creates a new VgSurfaceView.

Parameters
pContextThe application context (passed through to Android's GLSurfaceView).
pNeedsTransparencyIndicates whether transparency (i.e. alpha channel) is needed for this view.

Member Function Documentation

void VgSurfaceView.addOnCreateRunnable ( Runnable  pRunnable)

Add a runnable task to the VisioMove. Will be executed within the onSurfaceCreated() method.

This is a good method to add listeners (touch/key) to the VgSurfaceView.

Parameters
pRunnable- Runnable to be executed
Future<Bitmap> VgSurfaceView.captureToBitmap ( )

Captures the current GL Buffer and creates a Bitmap.

Must be called after setRenderer and while the surface is displayed and visible.

Note: this actually generates a new frame and captures it. It does not capture the surface content at the exact time of the call. Expect timing differences depending on the time necessary to render a frame.

Returns
Surface content. Returns null if the view is not visible, paused or destroyed.
Note
The Future can be cancelled if the view is paused before the capture is made.
If multiple captureToBitmap are called before the first one succeeded, all future will be cancelled except the last one.
// This code snippet shows how to use captureToBitmap to store a capture in a png file.
final Future<Bitmap> bitmapFuture = mSurfaceView.captureToBitmap();
try {
final Bitmap lCapturedBitmap = bitmapFuture.get();
if (lCapturedBitmap != null) {
lCapturedBitmap.compress(Bitmap.CompressFormat.PNG, 100, new FileOutputStream("Path/To/Your/Capture.png"));
}
} catch (Exception e) {
e.printStackTrace();
}
Version
2.1.3
native void VgSurfaceView.dispatchDoubleTouchMove ( long  pAppCPtr,
int  pX,
int  pY,
int  pX2,
int  pY2,
int  pTouchCount 
)
native void VgSurfaceView.dispatchTouchDown ( long  pAppCPtr,
int  pX,
int  pY,
int  pTouchCount 
)
native void VgSurfaceView.dispatchTouchMove ( long  pAppCPtr,
int  pX,
int  pY,
int  pTouchCount 
)
native void VgSurfaceView.dispatchTouchUp ( long  pAppCPtr,
int  pX,
int  pY,
int  pTouchCount 
)
native void VgSurfaceView.drawFrame ( long  pAppCPtr)
VgIApplication VgSurfaceView.getApplication ( )
Returns
The VgIApplication object which provides access to VisioMove API.
boolean VgSurfaceView.getRenderOnDemand ( )
Returns
True if render on demand (when dirty) is on. Default is on.
Version
2.0.9263.9284
boolean VgSurfaceView.isRendering ( )
Returns
True if the surface rendering is active. The Rendering is normally active between OnResume and OnPause, unless pauseRendering or resumeRendering have been called.
Version
2.1.3
synchronized void VgSurfaceView.onDrawFrame ( GL10  gl)

Called to draw the current frame

boolean VgSurfaceView.onKey ( View  pView,
int  pInt,
KeyEvent  pEvent 
)

Called when a hardware key is dispatched to a view

void VgSurfaceView.onSurfaceChanged ( GL10  gl,
int  width,
int  height 
)

Called when the surface changed size.

It's a good place to set up your camera here, if it's a fixed camera that doesn't move around the scene.

void VgSurfaceView.onSurfaceCreated ( GL10  gl,
EGLConfig  config 
)

Called when the surface is created or recreated.

The drawing context is typically lost and recreated when the activity is paused and resumed. This is a good place to create long-lived OpenGL resources like textures.

References VgIEngine.reloadShaders(), and VgIEngine.resetGraphicResources().

boolean VgSurfaceView.onTouch ( View  pView,
MotionEvent  pEvent 
)

Called when a touch event is dispatched to a view.

void VgSurfaceView.pauseRendering ( )

Pauses the rendering of the VgSurfaceView. You can enclose regions that manipulate many map elements with pause/resumeRendering for better performance.

mSurfaceView.pauseRendering() ...manipulate map elements like VgPoints, setPlaceName(), etc mSurfaceView.resumeRendering()

void VgSurfaceView.postLoadDataset ( )

Called after the dataset has been loaded.

void VgSurfaceView.requestRedraw ( )

Requests a single redraw of the VgSurfaceView.

void VgSurfaceView.resumeRendering ( )

Resumes the rendering of the VgSurfaceView. After calling this method, the manipulator will be reset.

void VgSurfaceView.setRenderOnDemand ( boolean  pIsEnabled)

Controls the rendering strategy. Default is on (when dirty/changed). It basically calls setRenderMode.

Version
2.0.9263.9284
2.1.0 turned on by default.
native void VgSurfaceView.setSurfaceSize ( long  pAppCPtr,
int  pWidth,
int  pHeight 
)
void VgSurfaceView.surfaceDestroyed ( SurfaceHolder  pHolder)

This method is called immediately before a surface is being destroyed.

You should override this method to release/unregister all VisioMove objects, and null out as many references on other objects as possible.


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