com.metaio.sdk.jni
Class GestureHandler

java.lang.Object
  extended by com.metaio.sdk.jni.GestureHandler
Direct Known Subclasses:
GestureHandlerAndroid

public class GestureHandler
extends Object

GestureHandler base class, the applications should use platform specific implementations, i.e. GestureHandlerAndroid or GestureHandlerIOS


Field Summary
static int GESTURE_ALL
           
static int GESTURE_DRAG
           
static int GESTURE_NONE
           
static int GESTURE_PINCH
           
static int GESTURE_ROTATE
           
 
Constructor Summary
GestureHandler(IMetaioSDK metaioSDK)
           
GestureHandler(IMetaioSDK metaioSDK, int gestureMask)
           
GestureHandler(long cPtr, boolean cMemoryOwn)
           
 
Method Summary
 void addObject(IGeometry geometry, int group, boolean pickable)
           
 void delete()
           
 void enableGestures(int gestureMask)
           
 void enablePickability(boolean pickable)
           
 IGeometryVector getAllObjects()
          A vector of geometries See: addObject
static long getCPtr(GestureHandler obj)
           
 int getGestures()
          Gesture mask See: enableGestures GESTURE_NONE GESTURE_DRAG GESTURE_ROTATE GESTURE_PINCH GESTURE_ALL
 boolean getPickable()
          True if geometries are pickable one by one, false otherwise.
 char getRotationAxis()
          The rotation axis that is enabled, i.e.
 void handlePinchGesture(float scale)
           
 void handleRotateGesture(float rotation)
           
 void registerCallback(IGestureHandlerCallback callback)
           
 void removeObject(IGeometry geometry)
           
 void removeObjects()
           
 void resetSelected()
           
 void selectAllObjects(int x, int y)
           
 void selectAllObjectsInGroup(int group, int x, int y)
           
 void setRotationAxis(char axis)
           
 void setSDK(IMetaioSDK metaioSDK)
           
 void touchesBegan(int x, int y)
           
 void touchesEnded(int x, int y)
           
 void touchesMoved(int x, int y)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GESTURE_NONE

public static final int GESTURE_NONE

GESTURE_DRAG

public static final int GESTURE_DRAG

GESTURE_ROTATE

public static final int GESTURE_ROTATE

GESTURE_PINCH

public static final int GESTURE_PINCH

GESTURE_ALL

public static final int GESTURE_ALL
Constructor Detail

GestureHandler

public GestureHandler(long cPtr,
                      boolean cMemoryOwn)

GestureHandler

public GestureHandler(IMetaioSDK metaioSDK,
                      int gestureMask)
Parameters:
metaioSDK - metaio SDK instance
gestureMask - Gesture mask to enable gestures See: GESTURE_DRAG GESTURE_ROTATE GESTURE_PINCH GESTURE_ALL

GestureHandler

public GestureHandler(IMetaioSDK metaioSDK)
Parameters:
metaioSDK - metaio SDK instance
gestureMask - Gesture mask to enable gestures See: GESTURE_DRAG GESTURE_ROTATE GESTURE_PINCH GESTURE_ALL
Method Detail

getCPtr

public static long getCPtr(GestureHandler obj)

delete

public void delete()

registerCallback

public void registerCallback(IGestureHandlerCallback callback)
Parameters:
callback - An implementation of metaio::IGestureHandlerCallback See: metaio::IGestureHandlerCallback

enableGestures

public void enableGestures(int gestureMask)
Parameters:
gestureMask - Gestures that should be enabled. See: getGestures GESTURE_NONE GESTURE_DRAG GESTURE_ROTATE GESTURE_PINCH GESTURE_ALL

getGestures

public int getGestures()
Gesture mask See: enableGestures GESTURE_NONE GESTURE_DRAG GESTURE_ROTATE GESTURE_PINCH GESTURE_ALL


enablePickability

public void enablePickability(boolean pickable)
Parameters:
pickable - True if pickable, false otherwise. See: getPickable

getPickable

public boolean getPickable()
True if geometries are pickable one by one, false otherwise. See: enablePickability


setRotationAxis

public void setRotationAxis(char axis)
Parameters:
axis - axis that should be enabled, i.e. 'x', 'y' or 'z' (default). See: getRotationAxis

getRotationAxis

public char getRotationAxis()
The rotation axis that is enabled, i.e. 'x', 'y' or 'z' See: setRotationAxis


addObject

public void addObject(IGeometry geometry,
                      int group,
                      boolean pickable)
Parameters:
geometry - A pointer to the geometry to be added.
group - The group which geometry should belong to.
pickable - Specify if the geometry is pickable one by one. See: removeObject, removeObjects getAllObjects

removeObject

public void removeObject(IGeometry geometry)
Parameters:
geometry - The geometry to be removed. See: addObject getAllObjects

removeObjects

public void removeObjects()

resetSelected

public void resetSelected()

getAllObjects

public IGeometryVector getAllObjects()
A vector of geometries See: addObject


selectAllObjectsInGroup

public void selectAllObjectsInGroup(int group,
                                    int x,
                                    int y)
Parameters:
group - The group number of the selected object.
x - The x coordinate of the touch point.
y - The y coordinate of the touch point.

selectAllObjects

public void selectAllObjects(int x,
                             int y)
Parameters:
x - The x coordinate of the touch point.
y - The y coordinate of the touch point.

touchesBegan

public void touchesBegan(int x,
                         int y)
Parameters:
x - The x coordinate of the touch point.
y - The y coordinate of the touch point.

touchesMoved

public void touchesMoved(int x,
                         int y)
Parameters:
x - The x coordinate of the touch point.
y - The y coordinate of the touch point.

touchesEnded

public void touchesEnded(int x,
                         int y)
Parameters:
x - The x coordinate of the touch point.
y - The y coordinate of the touch point.

handlePinchGesture

public void handlePinchGesture(float scale)
Parameters:
scale - The new scale of the geometry.

handleRotateGesture

public void handleRotateGesture(float rotation)
Parameters:
rotation - The new rotation that should be applied to the axis.

setSDK

public void setSDK(IMetaioSDK metaioSDK)
Parameters:
metaioSDK - Pointer to the metaio SDK instance.