com.metaio.sdk.jni
Class IGeometry

java.lang.Object
  extended by com.metaio.sdk.jni.IGeometry

public class IGeometry
extends Object

General interface for a geometry that can be loaded within the system.


Field Summary
static int ANCHOR_BC
           
static int ANCHOR_BL
           
static int ANCHOR_BOTTOM
           
static int ANCHOR_BR
           
static int ANCHOR_CC
           
static int ANCHOR_CENTER_H
           
static int ANCHOR_CENTER_V
           
static int ANCHOR_CL
           
static int ANCHOR_CR
           
static int ANCHOR_LEFT
           
static int ANCHOR_NONE
           
static int ANCHOR_RIGHT
           
static int ANCHOR_TC
           
static int ANCHOR_TL
           
static int ANCHOR_TOP
           
static int ANCHOR_TR
           
static int FLAG_AUTOSCALE
           
static int FLAG_IGNORE_ANIMATIONS
           
static int FLAG_IGNORE_ROTATION
           
static int FLAG_MATCH_DISPLAY
           
static int FLAG_NONE
           
 
Constructor Summary
IGeometry(long cPtr, boolean cMemoryOwn)
           
 
Method Summary
 void delete()
           
 boolean equals(Object obj)
           
 StringVector getAnimationNames()
          all animation names.
 BoundingBox getBoundingBox()
           
 BoundingBox getBoundingBox(boolean inObjectCoordinates)
           
 int getCoordinateSystemID()
          The (one based) index of the coordinate system.
static long getCPtr(IGeometry obj)
           
 boolean getIsRendered()
          It only works when target is being tracked.True if the geometry is being rendered, false otherwise.
 String getName()
          Name of the geometry See: setName
 boolean getRadarVisibility()
          true, if it should be displayed on the radar, false otherwise See: setRadarVisibility to set the visiblity on radar
 int getRelativeToScreen()
          One or combination of screen anchors.
 int getRenderOrder()
          the level See: setRenderOrder
 Rotation getRotation()
          The current rotation as Rotation object.
 Vector3d getScale()
          The scaling vector (x,y,z).
 Vector3d getTranslation()
          A 3D vector containing the translation in millimeters.
 LLACoordinate getTranslationLLA()
          The LLA (latitude, longitude, altitude) coordinate of the geometry.
 Vector3d getTranslationLLACartesian()
          It returns absolute translation of the geometry relative to current LLA coordinates provided by the sensors' component.A 3D vector containing the translation in millimeters See: setTranslation and getTranslation setTranslationLLA and getTranslationLLA
 float getTransparency()
          transparency The transparency value, where 0 corresponds to a non- transparent model, 1 to a fully transparent model.
 EGEOMETRY_TYPE getType()
          EGEOMETRY_TYPE value See: EGEOMETRY_TYPE
 int hashCode()
           
 boolean isOccluded()
          boolean If true geometry is occluded, otherwise false See: isVisible
 boolean isPickingEnabled()
          true, if enabled, false otherwise See: setPickingEnabled
 boolean isVisible()
          True if the geometry is set visible, false otherwise.
 void pauseAnimation()
           
 void pauseMovieTexture()
          Call startMovieTexture to resume again.
 void removeMovieTexture()
          See: setMovieTexture
 void setAnimationSpeed(float fps)
           
 void setCoordinateSystemID(int coordinateSystemID)
           
 void setLLALimitsEnabled(boolean enabled)
          If disabled, the geometry will ignore the near and far LLA limit and always render the object the the real location.
 void setMovieTexture(String filename)
          If the movie texture is transparent, the left side should have colored part, and right side should have alpha transparency (red channel).
 void setMovieTexture(String filename, boolean transparent)
          If the movie texture is transparent, the left side should have colored part, and right side should have alpha transparency (red channel).
 void setName(String name)
           
 void setOcclusionMode(boolean occlude)
           
 void setPickingEnabled(boolean enabled)
           
 void setRadarVisibility(boolean visible)
           
 void setRelativeToScreen(int anchor)
           
 void setRelativeToScreen(int anchor, int flags)
           
 void setRenderAsXray(boolean xray)
          This method shall be used if a model should be drawn on top of all others and therefore ignore the z-buffer.
 void setRenderOrder(int level)
          This method should be used for compositing, e.g. if a geometry should be drawn before or after other geometries.
 void setRenderOrder(int level, boolean disableDepth)
          This method should be used for compositing, e.g. if a geometry should be drawn before or after other geometries.
 void setRenderOrder(int level, boolean disableDepth, boolean clearDepth)
          This method should be used for compositing, e.g. if a geometry should be drawn before or after other geometries.
 void setRotation(Rotation rotation)
           
 void setRotation(Rotation rotation, boolean concat)
           
 void setScale(float scale)
           
 void setScale(float scale, boolean concat)
           
 void setScale(Vector3d scale)
           
 void setScale(Vector3d scale, boolean concat)
           
 boolean setTexture(String texturePath)
          Supported formats are PNG and JPG.
 boolean setTexture(String textureName, ImageStruct image)
           
 boolean setTexture(String textureName, ImageStruct image, boolean updateable)
           
 void setTranslation(Vector3d translation)
           
 void setTranslation(Vector3d translation, boolean concat)
           
 void setTranslationLLA(LLACoordinate llaCoorindate)
          The system will then adjust its Cartesian offset in the renderer accordingly.
 void setTransparency(float transparency)
           
 void setVisible(boolean visible)
           
 void startAnimation()
           
 void startAnimation(String animationName)
           
 void startAnimation(String animationName, boolean loop)
           
 void startMovieTexture()
          If the movie texture was stopped, it will start from begining.
 void startMovieTexture(boolean loop)
          If the movie texture was stopped, it will start from begining.
 void stopAnimation()
          See: startAnimation
 void stopMovieTexture()
          See: startMovieTexture pauseMovieTexture
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ANCHOR_NONE

public static final int ANCHOR_NONE

ANCHOR_LEFT

public static final int ANCHOR_LEFT

ANCHOR_RIGHT

public static final int ANCHOR_RIGHT

ANCHOR_BOTTOM

public static final int ANCHOR_BOTTOM

ANCHOR_TOP

public static final int ANCHOR_TOP

ANCHOR_CENTER_H

public static final int ANCHOR_CENTER_H

ANCHOR_CENTER_V

public static final int ANCHOR_CENTER_V

ANCHOR_TL

public static final int ANCHOR_TL

ANCHOR_TC

public static final int ANCHOR_TC

ANCHOR_TR

public static final int ANCHOR_TR

ANCHOR_CL

public static final int ANCHOR_CL

ANCHOR_CC

public static final int ANCHOR_CC

ANCHOR_CR

public static final int ANCHOR_CR

ANCHOR_BL

public static final int ANCHOR_BL

ANCHOR_BC

public static final int ANCHOR_BC

ANCHOR_BR

public static final int ANCHOR_BR

FLAG_NONE

public static final int FLAG_NONE

FLAG_IGNORE_ROTATION

public static final int FLAG_IGNORE_ROTATION

FLAG_IGNORE_ANIMATIONS

public static final int FLAG_IGNORE_ANIMATIONS

FLAG_MATCH_DISPLAY

public static final int FLAG_MATCH_DISPLAY

FLAG_AUTOSCALE

public static final int FLAG_AUTOSCALE
Constructor Detail

IGeometry

public IGeometry(long cPtr,
                 boolean cMemoryOwn)
Method Detail

getCPtr

public static long getCPtr(IGeometry obj)

delete

public void delete()

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

setRelativeToScreen

public void setRelativeToScreen(int anchor,
                                int flags)
Parameters:
anchor - one or combination of screen anchors (use ANCHOR_NONE to stop rendering geometry as relative to screen)
flags - additional flags to ignore some geometric transforms. Can be combination of FLAG_IGNORE_ROTATION, FLAG_IGNORE_ANIMATIONS, FLAG_MATCH_DISPLAY or FLAG_AUTOSCALE. Default is FLAG_NONE. See: ANCHOR_NONE ANCHOR_LEFT, ANCHOR_RIGHT, ANCHOR_BOTTOM, ANCHOR_TOP, ANCHOR_CENTER_H, ANCHOR_CENTER_V ANCHOR_TL, ANCHOR_TC, ANCHOR_TR, ANCHOR_CL, ANCHOR_CC, ANCHOR_CR, ANCHOR_BL, ANCHOR_BC, ANCHOR_BR FLAG_NONE FLAG_IGNORE_ROTATION, FLAG_IGNORE_ANIMATIONS FLAG_MATCH_DISPLAY, FLAG_AUTOSCALE getRelativeToScreen

setRelativeToScreen

public void setRelativeToScreen(int anchor)
Parameters:
anchor - one or combination of screen anchors (use ANCHOR_NONE to stop rendering geometry as relative to screen)
flags - additional flags to ignore some geometric transforms. Can be combination of FLAG_IGNORE_ROTATION, FLAG_IGNORE_ANIMATIONS, FLAG_MATCH_DISPLAY or FLAG_AUTOSCALE. Default is FLAG_NONE. See: ANCHOR_NONE ANCHOR_LEFT, ANCHOR_RIGHT, ANCHOR_BOTTOM, ANCHOR_TOP, ANCHOR_CENTER_H, ANCHOR_CENTER_V ANCHOR_TL, ANCHOR_TC, ANCHOR_TR, ANCHOR_CL, ANCHOR_CC, ANCHOR_CR, ANCHOR_BL, ANCHOR_BC, ANCHOR_BR FLAG_NONE FLAG_IGNORE_ROTATION, FLAG_IGNORE_ANIMATIONS FLAG_MATCH_DISPLAY, FLAG_AUTOSCALE getRelativeToScreen

getRelativeToScreen

public int getRelativeToScreen()
One or combination of screen anchors. See: setRelativeToScreen


setTranslation

public void setTranslation(Vector3d translation,
                           boolean concat)
Parameters:
translation - The 3D translation vector in millimeters.
concat - If true, the new translation is added to the existing one, otherwise it is overwritten. See: getTranslation

setTranslation

public void setTranslation(Vector3d translation)
Parameters:
translation - The 3D translation vector in millimeters.
concat - If true, the new translation is added to the existing one, otherwise it is overwritten. See: getTranslation

getTranslation

public Vector3d getTranslation()
A 3D vector containing the translation in millimeters. See: setTranslation


setTranslationLLA

public void setTranslationLLA(LLACoordinate llaCoorindate)
The system will then adjust its Cartesian offset in the renderer accordingly. Note: The altitude is ignored, if you want adjust the height use setTranslation

Parameters:
llaCoorindate - The LLA (latitude, longitude, altitude) to set as translation. See: setTranslation and getTranslation getTranslationLLA getTranslationLLACartesian

getTranslationLLA

public LLACoordinate getTranslationLLA()
The LLA (latitude, longitude, altitude) coordinate of the geometry. See: setTranslation and getTranslation setTranslationLLA getTranslationLLACartesian


getTranslationLLACartesian

public Vector3d getTranslationLLACartesian()
It returns absolute translation of the geometry relative to current LLA coordinates provided by the sensors' component.A 3D vector containing the translation in millimeters See: setTranslation and getTranslation setTranslationLLA and getTranslationLLA


setScale

public void setScale(Vector3d scale,
                     boolean concat)
Parameters:
scale - Scaling vector (x,y,z).
concat - If true, the new scale is multiplied with existing scale. See: getScale

setScale

public void setScale(Vector3d scale)
Parameters:
scale - Scaling vector (x,y,z).
concat - If true, the new scale is multiplied with existing scale. See: getScale

setScale

public void setScale(float scale,
                     boolean concat)
Parameters:
scale - scale factor for all dimensions
concat - If true, the new scale is multiplied with existing scale. See: getScale

setScale

public void setScale(float scale)
Parameters:
scale - scale factor for all dimensions
concat - If true, the new scale is multiplied with existing scale. See: getScale

getScale

public Vector3d getScale()
The scaling vector (x,y,z). See: setScale


setRotation

public void setRotation(Rotation rotation,
                        boolean concat)
Parameters:
rotation - The rotation object specifying the rotation.
concat - If true, the new rotation is concatenated with an existing rotation. See: getRotation

setRotation

public void setRotation(Rotation rotation)
Parameters:
rotation - The rotation object specifying the rotation.
concat - If true, the new rotation is concatenated with an existing rotation. See: getRotation

getRotation

public Rotation getRotation()
The current rotation as Rotation object. See: setRotation


getIsRendered

public boolean getIsRendered()
It only works when target is being tracked.True if the geometry is being rendered, false otherwise.


isVisible

public boolean isVisible()
True if the geometry is set visible, false otherwise. See: setVisible


setVisible

public void setVisible(boolean visible)
Parameters:
visible - True if the geometry should be visible, false if it should be hidden. See: isVisible setOcclusionMode setTransparency setRenderAsXray setPickingEnabled

setRenderAsXray

public void setRenderAsXray(boolean xray)
This method shall be used if a model should be drawn on top of all others and therefore ignore the z-buffer. It is only available with OpenGL ES 2.0 rendering.

Parameters:
xray - If true, the geometry will be rendered with the x-ray effect, otherwise it will be displayed normally. See: setVisible and isVisible setOcclusionMode setTransparency setPickingEnabled

setRenderOrder

public void setRenderOrder(int level,
                           boolean disableDepth,
                           boolean clearDepth)
This method should be used for compositing, e.g. if a geometry should be drawn before or after other geometries. The ordering depends on the value of the level that is passed, the lower levels are drawn before higher levels, which means that a geometry with higher level will be on top of a geometry with lower level.The z-buffer (depth) check can be optionaly disabled so that geomrteis are rendered independant of their real distance from the camera. This is usefull when more than one geometries are positioned at same depth (z), or a geometry with greater depth needs to be rendered in front of a geometry with less depth. Note that it works only for simple geometries, e.g a plane or sphere.For complex geometries, clear depth (z-buffer) can be enabled instead of disabling z-buffer check. This would ensure that geometries are rendered in correct order, however, it is an expensive operation and can significantly reduce rendering performance.Note that geometry picking is always based on real distance from the camera. It means that even though a geometry is forced to rendered on top of another geometry (i.e. by disabling z-buffer check and/or enabling clear depth), the background geometry may be picked because it is closer to the camera in reality.

Parameters:
level - render order, the higher value means front, default is 0
disableDepth - true to disable depth test, false to enable (default)
clearDepth - true to clear depth before rendering, false to disable this (default) See: getRenderOrder

setRenderOrder

public void setRenderOrder(int level,
                           boolean disableDepth)
This method should be used for compositing, e.g. if a geometry should be drawn before or after other geometries. The ordering depends on the value of the level that is passed, the lower levels are drawn before higher levels, which means that a geometry with higher level will be on top of a geometry with lower level.The z-buffer (depth) check can be optionaly disabled so that geomrteis are rendered independant of their real distance from the camera. This is usefull when more than one geometries are positioned at same depth (z), or a geometry with greater depth needs to be rendered in front of a geometry with less depth. Note that it works only for simple geometries, e.g a plane or sphere.For complex geometries, clear depth (z-buffer) can be enabled instead of disabling z-buffer check. This would ensure that geometries are rendered in correct order, however, it is an expensive operation and can significantly reduce rendering performance.Note that geometry picking is always based on real distance from the camera. It means that even though a geometry is forced to rendered on top of another geometry (i.e. by disabling z-buffer check and/or enabling clear depth), the background geometry may be picked because it is closer to the camera in reality.

Parameters:
level - render order, the higher value means front, default is 0
disableDepth - true to disable depth test, false to enable (default)
clearDepth - true to clear depth before rendering, false to disable this (default) See: getRenderOrder

setRenderOrder

public void setRenderOrder(int level)
This method should be used for compositing, e.g. if a geometry should be drawn before or after other geometries. The ordering depends on the value of the level that is passed, the lower levels are drawn before higher levels, which means that a geometry with higher level will be on top of a geometry with lower level.The z-buffer (depth) check can be optionaly disabled so that geomrteis are rendered independant of their real distance from the camera. This is usefull when more than one geometries are positioned at same depth (z), or a geometry with greater depth needs to be rendered in front of a geometry with less depth. Note that it works only for simple geometries, e.g a plane or sphere.For complex geometries, clear depth (z-buffer) can be enabled instead of disabling z-buffer check. This would ensure that geometries are rendered in correct order, however, it is an expensive operation and can significantly reduce rendering performance.Note that geometry picking is always based on real distance from the camera. It means that even though a geometry is forced to rendered on top of another geometry (i.e. by disabling z-buffer check and/or enabling clear depth), the background geometry may be picked because it is closer to the camera in reality.

Parameters:
level - render order, the higher value means front, default is 0
disableDepth - true to disable depth test, false to enable (default)
clearDepth - true to clear depth before rendering, false to disable this (default) See: getRenderOrder

getRenderOrder

public int getRenderOrder()
the level See: setRenderOrder


setOcclusionMode

public void setOcclusionMode(boolean occlude)
Parameters:
occlude - If true, the geometry is not displayed but only used to occlude other geometrys, otherwise it will be displayed normally. See: setVisible and isVisible setTransparency setRenderAsXray setPickingEnabled

isOccluded

public boolean isOccluded()
boolean If true geometry is occluded, otherwise false See: isVisible


setTransparency

public void setTransparency(float transparency)
Parameters:
transparency - The transparency value, where 0 corresponds to a non-transparent model, 1 to a fully transparent model. See: getTransparency setVisible and isVisible setOcclusionMode setRenderAsXray setPickingEnabled

getTransparency

public float getTransparency()
transparency The transparency value, where 0 corresponds to a non- transparent model, 1 to a fully transparent model. See: setTransparency


startAnimation

public void startAnimation(String animationName,
                           boolean loop)
Parameters:
animationName - Identifier of the animation.
loop - If true, the animation is looped, otherwise it is only played once. See: setAnimationSpeed

startAnimation

public void startAnimation(String animationName)
Parameters:
animationName - Identifier of the animation.
loop - If true, the animation is looped, otherwise it is only played once. See: setAnimationSpeed

startAnimation

public void startAnimation()
Parameters:
animationName - Identifier of the animation.
loop - If true, the animation is looped, otherwise it is only played once. See: setAnimationSpeed

stopAnimation

public void stopAnimation()
See: startAnimation


setAnimationSpeed

public void setAnimationSpeed(float fps)
Parameters:
fps - Desired animation speed in frames per second.

pauseAnimation

public void pauseAnimation()

getAnimationNames

public StringVector getAnimationNames()
all animation names. See: startAnimation


getBoundingBox

public BoundingBox getBoundingBox(boolean inObjectCoordinates)
Parameters:
inObjectCoordinates - If true (default behaviour) the bounding box will be returned in the coordinate system of the object, if false it will be returned in the camera coordinate system The bounding box of the geometry.

getBoundingBox

public BoundingBox getBoundingBox()
Parameters:
inObjectCoordinates - If true (default behaviour) the bounding box will be returned in the coordinate system of the object, if false it will be returned in the camera coordinate system The bounding box of the geometry.

setCoordinateSystemID

public void setCoordinateSystemID(int coordinateSystemID)
Parameters:
coordinateSystemID - The (one based) index of the coordinate system. See: getCoordinateSystemID

getCoordinateSystemID

public int getCoordinateSystemID()
The (one based) index of the coordinate system. See: setCoordinateSystemID


setName

public void setName(String name)
Parameters:
name - Name of the geometry See: getName

getName

public String getName()
Name of the geometry See: setName


getType

public EGEOMETRY_TYPE getType()
EGEOMETRY_TYPE value See: EGEOMETRY_TYPE


setLLALimitsEnabled

public void setLLALimitsEnabled(boolean enabled)
If disabled, the geometry will ignore the near and far LLA limit and always render the object the the real location. The default is always enabled.

Parameters:
enabled - True to enable, false to disable. See: IMetaioSDK::setLLAObjectRenderingLimits

setPickingEnabled

public void setPickingEnabled(boolean enabled)
Parameters:
enabled - True to enable picking of this geometry, false to disable it. See: isPickingEnabled setVisible and isVisible setOcclusionMode setTransparency setPickingEnabled setRenderAsXray

isPickingEnabled

public boolean isPickingEnabled()
true, if enabled, false otherwise See: setPickingEnabled


setTexture

public boolean setTexture(String texturePath)
Supported formats are PNG and JPG.

Parameters:
texturePath - Path to the texture image file. true on success

setTexture

public boolean setTexture(String textureName,
                          ImageStruct image,
                          boolean updateable)
Parameters:
textureName - A name that should be assigned to the texture (for reuse).
image - The actual image.
updateable - Flag to signal, that this image will be frequently updated. true on success

setTexture

public boolean setTexture(String textureName,
                          ImageStruct image)
Parameters:
textureName - A name that should be assigned to the texture (for reuse).
image - The actual image.
updateable - Flag to signal, that this image will be frequently updated. true on success

setMovieTexture

public void setMovieTexture(String filename,
                            boolean transparent)
If the movie texture is transparent, the left side should have colored part, and right side should have alpha transparency (red channel).

Parameters:
filename - Filename of the movie.
transparent - If true, the movie file will be rendererd as transparent texture. See: removeMovieTexture

setMovieTexture

public void setMovieTexture(String filename)
If the movie texture is transparent, the left side should have colored part, and right side should have alpha transparency (red channel).

Parameters:
filename - Filename of the movie.
transparent - If true, the movie file will be rendererd as transparent texture. See: removeMovieTexture

removeMovieTexture

public void removeMovieTexture()
See: setMovieTexture


stopMovieTexture

public void stopMovieTexture()
See: startMovieTexture pauseMovieTexture


startMovieTexture

public void startMovieTexture(boolean loop)
If the movie texture was stopped, it will start from begining. If it was paused, it will resume playback from same frame.

Parameters:
loop - If true, the movie will play in a loop, otherwise it is played only once. See: pauseMovieTexture stopMovieTexture

startMovieTexture

public void startMovieTexture()
If the movie texture was stopped, it will start from begining. If it was paused, it will resume playback from same frame.

Parameters:
loop - If true, the movie will play in a loop, otherwise it is played only once. See: pauseMovieTexture stopMovieTexture

pauseMovieTexture

public void pauseMovieTexture()
Call startMovieTexture to resume again. See: startMovieTexture stopMovieTexture


getRadarVisibility

public boolean getRadarVisibility()
true, if it should be displayed on the radar, false otherwise See: setRadarVisibility to set the visiblity on radar


setRadarVisibility

public void setRadarVisibility(boolean visible)
Parameters:
visible - if false, the geometry is never displayed on the radar, else it may be displayed depending on its visibility.