public class VgMyStackedLayerAndCameraHandler extends java.lang.Object implements VgMyLayerAndCameraHandler
Modifier and Type | Class and Description |
---|---|
static class |
VgMyStackedLayerAndCameraHandler.VgMyConfigurableParam
The below enum represents parameters that can be configured to
change the behaviour of the VgMyStackedLayerAndCameraHandler object.
|
Modifier and Type | Field and Description |
---|---|
long |
mCurrentLayerIndex |
protected boolean |
mSetFovOnce
Setup the elements which are associated with the view's width and height
|
Constructor and Description |
---|
VgMyStackedLayerAndCameraHandler(VgMySurfaceView pSurfaceView,
VgMyLayerAndCameraListener pLayerUpdateListener,
long pViewWidthInPixels,
long pViewHeightInPixels) |
Modifier and Type | Method and Description |
---|---|
void |
animateCameraToViewPoint(VgIViewPoint pViewPoint,
float pDuration,
boolean pIsAnimated)
Animates the camera from its current view point to the given view point
|
void |
animateLayersFromCloseToStackView(com.visioglobe.VisioSample.Blocks.VgMyStackedLayerAndCameraHandler.eFromToViewEnum pDirection,
float pDuration,
boolean pIsAnimated) |
void |
animateLayerToPositionAndRotation(VgLayerRefPtr pLayer,
VgPosition pStartPos,
VgPosition pEndPos,
VgIAnimationCallbackRefPtr pCallback,
float pDuration,
float pStartAngle,
float pEndAngle)
Gets the position for a layer when in detailed view.
|
protected void |
calculateDynamicStackParams() |
static double |
computeAngularDistance(double pA,
double pB) |
VgPosition |
getCameraPosition() |
java.lang.String |
getFocusedLayerName()
Note: mCurrentLayerIndex is only valid when mIsLayerInitialized is true
|
boolean |
getLayerName(long pLayerIndex,
java.lang.String pLayerNameOut) |
long |
getNumberOfLayers() |
double |
getParam(VgMyStackedLayerAndCameraHandler.VgMyConfigurableParam pParam) |
VgPosition |
getPositionForLayerInDetailedView(long pLayerIndex,
long pFocusedLayer) |
VgPosition |
getPositionForLayerInGlobalView(long pLayerIndex,
long pFocusedLayer) |
VgPosition |
getStackCenter() |
VgIViewPoint |
getStackViewPoint() |
void |
gotoLayer(long pLayerIndex,
boolean pIsAnimated)
Focus a specific layer
|
void |
gotoLayer(java.lang.String pLayerName,
boolean pIsAnimated)
Focus a specific layer
|
void |
gotoLayerInDetailedView(long pLayerIndex,
boolean pIsAnimated) |
void |
gotoLayerInGlobalView(long pLayerIndex,
boolean pIsAnimated) |
void |
gotoLookAtPosition(VgPosition pPosition,
java.lang.String pLayerName,
boolean pIsAnimated)
Moves the camera so that it is focused on a given position.
|
void |
gotoViewpoint(VgIViewPoint pViewPoint,
java.lang.String pLayerName,
boolean pIsAnimated)
Moves the camera to a specific view point.
|
boolean |
isGlobalView() |
void |
onLayerSelected() |
void |
onSelectorReady() |
void |
refreshParameters(long pWidth,
long pHeight)
Refreshes the inner parameters.
|
void |
refreshStackView() |
void |
release()
This method should be called when the activity dies to notify that we
should release/unregister all VisioDevKit objects, and null out as much
references on other objects as possible.
|
protected void |
setDefaultStackParams() |
void |
setParam(VgMyStackedLayerAndCameraHandler.VgMyConfigurableParam pParam,
double pDouble) |
void |
setStackCenterPosition(VgPosition pCenterPos) |
void |
switchToDetailedView(boolean pIsAnimated)
Switches from the global to the detailed view.
|
void |
switchToGlobalView(boolean pIsAnimated)
Switches from the detailledView to the global view.
|
void |
updateManipulatorForGlobalView(boolean pIsGlobalView) |
public long mCurrentLayerIndex
protected boolean mSetFovOnce
public VgMyStackedLayerAndCameraHandler(VgMySurfaceView pSurfaceView, VgMyLayerAndCameraListener pLayerUpdateListener, long pViewWidthInPixels, long pViewHeightInPixels)
protected void setDefaultStackParams()
public void updateManipulatorForGlobalView(boolean pIsGlobalView)
public boolean isGlobalView()
isGlobalView
in interface VgMyLayerAndCameraHandler
public void switchToGlobalView(boolean pIsAnimated)
VgMyLayerAndCameraHandler
switchToGlobalView
in interface VgMyLayerAndCameraHandler
pIsAnimated
- If true then animates the transition, otherwise does not.public void switchToDetailedView(boolean pIsAnimated)
VgMyLayerAndCameraHandler
switchToDetailedView
in interface VgMyLayerAndCameraHandler
pIsAnimated
- If true then animates the transition, otherwise does not.public java.lang.String getFocusedLayerName()
getFocusedLayerName
in interface VgMyLayerAndCameraHandler
public long getNumberOfLayers()
public boolean getLayerName(long pLayerIndex, java.lang.String pLayerNameOut)
public void gotoLayer(java.lang.String pLayerName, boolean pIsAnimated)
VgMyLayerAndCameraHandler
gotoLayer
in interface VgMyLayerAndCameraHandler
pLayerName
- Layer that will be focused.
keeps current mode.pIsAnimated
- If true then animates the transition, otherwise does not.public void gotoLayer(long pLayerIndex, boolean pIsAnimated)
VgMyLayerAndCameraHandler
gotoLayer
in interface VgMyLayerAndCameraHandler
pLayerIndex
- Layer index which is associated with the returned list given by VgLayerManager::getLayers().
keeps current mode.pIsAnimated
- If true then animates the transition, otherwise does not.public void gotoLayerInGlobalView(long pLayerIndex, boolean pIsAnimated)
public void gotoLayerInDetailedView(long pLayerIndex, boolean pIsAnimated)
public VgPosition getPositionForLayerInGlobalView(long pLayerIndex, long pFocusedLayer)
public VgPosition getPositionForLayerInDetailedView(long pLayerIndex, long pFocusedLayer)
public void gotoViewpoint(VgIViewPoint pViewPoint, java.lang.String pLayerName, boolean pIsAnimated)
VgMyLayerAndCameraHandler
gotoViewpoint
in interface VgMyLayerAndCameraHandler
pViewPoint
- The view point to associate with the camerapLayerName
- The layer which should be given the focus.pIsAnimated
- If true then animates the transition, otherwise does not.public void gotoLookAtPosition(VgPosition pPosition, java.lang.String pLayerName, boolean pIsAnimated)
VgMyLayerAndCameraHandler
gotoLookAtPosition
in interface VgMyLayerAndCameraHandler
pPosition
- The position to focus on.pLayerName
- The name of the layer associated with the position.pIsAnimated
- If true then animates the transition, otherwise does not.public void animateLayersFromCloseToStackView(com.visioglobe.VisioSample.Blocks.VgMyStackedLayerAndCameraHandler.eFromToViewEnum pDirection, float pDuration, boolean pIsAnimated)
public void animateLayerToPositionAndRotation(VgLayerRefPtr pLayer, VgPosition pStartPos, VgPosition pEndPos, VgIAnimationCallbackRefPtr pCallback, float pDuration, float pStartAngle, float pEndAngle)
pLayer
- pointer to layer to manipulatepStartPos
- starting position of layer. If not the same as its current position
it will jump.pEndPos
- ending position of layer.pCallback
- callback at end of animation.pDuration
- duration of animation in seconds.pStartAngle
- start angle of layer, used for carrousel mode, otherwise use 0.0fpEndAngle
- start angle of layer, used for carrousel mode, otherwise use 0.0fpublic VgIViewPoint getStackViewPoint()
public void animateCameraToViewPoint(VgIViewPoint pViewPoint, float pDuration, boolean pIsAnimated)
pViewPoint
- The view point to move the camera to.pDuration
- Animation duration in seconds.public VgPosition getCameraPosition()
public void onLayerSelected()
public void onSelectorReady()
public void refreshParameters(long pWidth, long pHeight)
VgMyLayerAndCameraHandler
refreshParameters
in interface VgMyLayerAndCameraHandler
public void refreshStackView()
protected void calculateDynamicStackParams()
public void setStackCenterPosition(VgPosition pCenterPos)
public VgPosition getStackCenter()
public void setParam(VgMyStackedLayerAndCameraHandler.VgMyConfigurableParam pParam, double pDouble)
public double getParam(VgMyStackedLayerAndCameraHandler.VgMyConfigurableParam pParam)
public void release()
release
in interface VgMyLayerAndCameraHandler
public static double computeAngularDistance(double pA, double pB)