Fork me
BeyondAR
Augmented Reality Framework for Android
 All Classes Functions Variables
com.beyondar.android.fragment.BeyondarFragmentSupport Class Reference

Support fragment class that displays and control the CameraView and the BeyondarGLSurfaceView More...

Inheritance diagram for com.beyondar.android.fragment.BeyondarFragmentSupport:
Collaboration diagram for com.beyondar.android.fragment.BeyondarFragmentSupport:

Public Member Functions

void onCreate (Bundle savedInstanceState)
 
void onAttach (Activity activity)
 
CameraView getCameraView ()
 Returns the CameraView for this class instance. More...
 
BeyondarGLSurfaceView getGLSurfaceView ()
 Returns the SurfaceView for this class instance. More...
 
View onCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
 
void onResume ()
 
void onPause ()
 
void setOnTouchBeyondarViewListener (OnTouchBeyondarViewListener listener)
 Set the listener to get notified when the user touch the AR view. More...
 
void setOnClickBeyondarObjectListener (OnClickBeyondarObjectListener listener)
 Set the OnClickBeyondarObjectListener to get notified when the user click on a BeyondarObject. More...
 
boolean onTouch (View v, final MotionEvent event)
 
void onClick (View v)
 
World getWorld ()
 Get the World in use by the fragment. More...
 
void setWorld (World world)
 Set the World that contains all the BeyondarObject that will be displayed. More...
 
void setSensorDelay (int delay)
 Specify the delay to apply to the accelerometer and the magnetic field sensor. More...
 
int getSensorDelay ()
 Get the current sensor delay. More...
 
void setFpsUpdatable (FpsUpdatable fpsUpdatable)
 Use this method to check the frames per second. More...
 
void stopRenderingAR ()
 Disable the GLSurface to stop rendering the AR world.
 
void startRenderingAR ()
 Enable the GLSurface to start rendering the AR world.
 
List< BeyondarObjectgetBeyondarObjectsOnScreenCoordinates (float x, float y)
 Get the GeoObject that intersect with the coordinates x, y on the screen. More...
 
void getBeyondarObjectsOnScreenCoordinates (float x, float y, ArrayList< BeyondarObject > beyondarObjects)
 Get the GeoObject that intersect with the coordinates x, y on the screen. More...
 
void getBeyondarObjectsOnScreenCoordinates (float x, float y, ArrayList< BeyondarObject > beyondarObjects, Ray ray)
 Get the GeoObject that intersect with the coordinates x, y on the screen. More...
 
void setPullCloserDistance (float maxDistanceSize)
 When a GeoObject is rendered according to its position it could look very small if it is far away. More...
 
float getPullCloserDistance ()
 Get the distance which all the GeoObject will be rendered if the are farther that the returned distance. More...
 
void setPushAwayDistance (float minDistanceSize)
 When a GeoObject is rendered according to its position it could look very big if it is too close. More...
 
float getPushAwayDistance ()
 Get the closest distance which all the GeoObject can be displayed. More...
 
void setMaxDistanceToRender (float meters)
 Set the distance (in meters) which the objects will be considered to render. More...
 
float getMaxDistanceToRender ()
 Get the distance (in meters) which the objects are being considered when rendering. More...
 
void setDistanceFactor (float meters)
 Set the distance factor for rendering all the objects. More...
 
float getDistanceFactor ()
 Get the distance factor. More...
 
void takeScreenshot (OnScreenshotListener listener, BitmapFactory.Options options)
 Take a screenshot of the beyondar fragment. More...
 
void takeScreenshot (OnScreenshotListener listener)
 Take a screenshot of the beyondar fragment. More...
 
void showFPS (boolean show)
 Show the number of frames per second in the left upper corner. More...
 
void onFpsUpdate (final float fps)
 
void setBeyondarViewAdapter (BeyondarViewAdapter adapter)
 Set the adapter to draw the views on top of the AR View. More...
 
void forceFillBeyondarObjectPositionsOnRendering (boolean fill)
 Use this method to fill all the screen positions of the BeyondarObject when a object is rendered. More...
 
void fillBeyondarObjectPositions (BeyondarObject beyondarObject)
 Use this method to fill all the screen positions of the BeyondarObject. More...
 
void setMaxFarDistance (float maxDistanceSize)
 Use setPullCloserDistance instead.
 
float getMaxDistanceSize ()
 Use getPushFrontDistance instead.
 
void setMinFarDistanceSize (float minDistanceSize)
 Use setPushAwayDistance instead.
 
float getMinDistanceSize ()
 Use getPushAwayDistance instead.
 
void onFpsUpdate (float fps)
 This method will get the frames per second rendered by the ARRenderer. More...
 

Protected Member Functions

BeyondarGLSurfaceView createBeyondarGLSurfaceView ()
 Override this method to personalize the BeyondarGLSurfaceView that will be instantiated. More...
 
CameraView createCameraView ()
 Override this method to personalize the CameraView that will be instantiated. More...
 

Detailed Description

Support fragment class that displays and control the CameraView and the BeyondarGLSurfaceView

It also provide a set of utilities to control the usage of the augmented reality world.

Member Function Documentation

BeyondarGLSurfaceView com.beyondar.android.fragment.BeyondarFragmentSupport.createBeyondarGLSurfaceView ( )
protected

Override this method to personalize the BeyondarGLSurfaceView that will be instantiated.

Returns
CameraView com.beyondar.android.fragment.BeyondarFragmentSupport.createCameraView ( )
protected

Override this method to personalize the CameraView that will be instantiated.

Returns
void com.beyondar.android.fragment.BeyondarFragmentSupport.fillBeyondarObjectPositions ( BeyondarObject  beyondarObject)

Use this method to fill all the screen positions of the BeyondarObject.

After this method is called you can use the following:
BeyondarObject.getScreenPositionBottomLeft()
BeyondarObject.getScreenPositionBottomRight()
BeyondarObject.getScreenPositionTopLeft()
BeyondarObject.getScreenPositionTopRight()

Parameters
beyondarObjectThe BeyondarObject to compute
void com.beyondar.android.fragment.BeyondarFragmentSupport.forceFillBeyondarObjectPositionsOnRendering ( boolean  fill)

Use this method to fill all the screen positions of the BeyondarObject when a object is rendered.

Remember that the information is filled when the object is rendered, so it is asynchronous.

After this method is called you can use the following:
BeyondarObject.getScreenPositionBottomLeft()
BeyondarObject.getScreenPositionBottomRight()
BeyondarObject.getScreenPositionTopLeft()
BeyondarObject.getScreenPositionTopRight()

Important Enabling this feature will reduce the FPS, use only when is needed.

Parameters
fillEnable or disable this feature.
List<BeyondarObject> com.beyondar.android.fragment.BeyondarFragmentSupport.getBeyondarObjectsOnScreenCoordinates ( float  x,
float  y 
)

Get the GeoObject that intersect with the coordinates x, y on the screen.


Important When this method is called a new List is created.

Parameters
xX screen position.
yY screen position.
Returns
A new list with the BeyondarObject that collide with the screen cord
void com.beyondar.android.fragment.BeyondarFragmentSupport.getBeyondarObjectsOnScreenCoordinates ( float  x,
float  y,
ArrayList< BeyondarObject beyondarObjects 
)

Get the GeoObject that intersect with the coordinates x, y on the screen.

Parameters
xX screen position.
yY screen position.
beyondarObjectsThe output list where all the BeyondarObject that collide with the screen cord will be stored.
void com.beyondar.android.fragment.BeyondarFragmentSupport.getBeyondarObjectsOnScreenCoordinates ( float  x,
float  y,
ArrayList< BeyondarObject beyondarObjects,
Ray  ray 
)

Get the GeoObject that intersect with the coordinates x, y on the screen.

Parameters
xscreen position.
yscreen position.
beyondarObjectsThe output list where all the BeyondarObject that collide with the screen cord will be stored.
rayThe ray that will hold the direction of the screen coordinate.
CameraView com.beyondar.android.fragment.BeyondarFragmentSupport.getCameraView ( )

Returns the CameraView for this class instance.

Returns

Here is the caller graph for this function:

float com.beyondar.android.fragment.BeyondarFragmentSupport.getDistanceFactor ( )

Get the distance factor.

Returns
Distance factor
BeyondarGLSurfaceView com.beyondar.android.fragment.BeyondarFragmentSupport.getGLSurfaceView ( )

Returns the SurfaceView for this class instance.

Returns

Here is the caller graph for this function:

float com.beyondar.android.fragment.BeyondarFragmentSupport.getMaxDistanceToRender ( )

Get the distance (in meters) which the objects are being considered when rendering.

Returns
meters
float com.beyondar.android.fragment.BeyondarFragmentSupport.getPullCloserDistance ( )

Get the distance which all the GeoObject will be rendered if the are farther that the returned distance.

Returns
The current max distance. 0 is the default behavior.

Here is the caller graph for this function:

float com.beyondar.android.fragment.BeyondarFragmentSupport.getPushAwayDistance ( )

Get the closest distance which all the GeoObject can be displayed.

Returns
The current minimum distance. 0 is the default behavior.

Here is the caller graph for this function:

int com.beyondar.android.fragment.BeyondarFragmentSupport.getSensorDelay ( )

Get the current sensor delay.

See Also
SensorManager
Returns
Current sensor delay.
World com.beyondar.android.fragment.BeyondarFragmentSupport.getWorld ( )

Get the World in use by the fragment.

Returns
void com.beyondar.android.opengl.renderer.ARRenderer.FpsUpdatable.onFpsUpdate ( float  fps)
inherited

This method will get the frames per second rendered by the ARRenderer.

Parameters
fpsThe Frames per second rendered
void com.beyondar.android.fragment.BeyondarFragmentSupport.setBeyondarViewAdapter ( BeyondarViewAdapter  adapter)

Set the adapter to draw the views on top of the AR View.

Parameters
adapter
void com.beyondar.android.fragment.BeyondarFragmentSupport.setDistanceFactor ( float  meters)

Set the distance factor for rendering all the objects.

As bigger the factor the closer the objects.

Parameters
factornumber bigger than 0.
void com.beyondar.android.fragment.BeyondarFragmentSupport.setFpsUpdatable ( FpsUpdatable  fpsUpdatable)

Use this method to check the frames per second.

Parameters
fpsUpdatableListener that will be notified with current fps.
See Also
FpsUpdatable

Here is the caller graph for this function:

void com.beyondar.android.fragment.BeyondarFragmentSupport.setMaxDistanceToRender ( float  meters)

Set the distance (in meters) which the objects will be considered to render.

Parameters
metersto be rendered from the user.
void com.beyondar.android.fragment.BeyondarFragmentSupport.setOnClickBeyondarObjectListener ( OnClickBeyondarObjectListener  listener)

Set the OnClickBeyondarObjectListener to get notified when the user click on a BeyondarObject.

Parameters
listener
void com.beyondar.android.fragment.BeyondarFragmentSupport.setOnTouchBeyondarViewListener ( OnTouchBeyondarViewListener  listener)

Set the listener to get notified when the user touch the AR view.

Parameters
listener
void com.beyondar.android.fragment.BeyondarFragmentSupport.setPullCloserDistance ( float  maxDistanceSize)

When a GeoObject is rendered according to its position it could look very small if it is far away.

Use this method to render far objects as if there were closer.
For instance if there are objects farther than 50 meters and we want them to be displayed as they where at 50 meters, we could use this method for that purpose.
To set it to the default behavior just set it to 0

Parameters
maxDistanceSizeThe top far distance (in meters) which we want to draw a GeoObject , 0 to set again the default behavior

Here is the caller graph for this function:

void com.beyondar.android.fragment.BeyondarFragmentSupport.setPushAwayDistance ( float  minDistanceSize)

When a GeoObject is rendered according to its position it could look very big if it is too close.

Use this method to render near objects as if there were farther.
For instance if there is an object at 1 meters and we want to have everything at to look like if they where at least at 10 meters, we could use this method for that purpose.
To set it to the default behavior just set it to 0.

Parameters
minDistanceSizeThe top near distance (in meters) which we want to draw a GeoObject , 0 to set again the default behavior.

Here is the caller graph for this function:

void com.beyondar.android.fragment.BeyondarFragmentSupport.setSensorDelay ( int  delay)

Specify the delay to apply to the accelerometer and the magnetic field sensor.

If you don't know what is the best value, don't touch it. The following values are applicable:

SensorManager.SENSOR_DELAY_UI
SensorManager.SENSOR_DELAY_NORMAL
SensorManager.SENSOR_DELAY_GAME
SensorManager.SENSOR_DELAY_GAME
SensorManager.SENSOR_DELAY_FASTEST

See Also
SensorManager
Parameters
delaySensor delay.
void com.beyondar.android.fragment.BeyondarFragmentSupport.setWorld ( World  world)

Set the World that contains all the BeyondarObject that will be displayed.

Parameters
worldThe World that holds the information of all the elements.
Exceptions
IllegalStateExceptionIf the device do not have the required sensors available.
void com.beyondar.android.fragment.BeyondarFragmentSupport.showFPS ( boolean  show)

Show the number of frames per second in the left upper corner.

False by default.

Parameters
showTrue to show the FPS, false otherwise.

Here is the call graph for this function:

void com.beyondar.android.fragment.BeyondarFragmentSupport.takeScreenshot ( OnScreenshotListener  listener,
BitmapFactory.Options  options 
)

Take a screenshot of the beyondar fragment.

The screenshot will contain the camera and the AR world overlapped.

Parameters
listenerOnScreenshotListener That will be notified when the screenshot is ready.
optionsBitmap options.

Here is the call graph for this function:

Here is the caller graph for this function:

void com.beyondar.android.fragment.BeyondarFragmentSupport.takeScreenshot ( OnScreenshotListener  listener)

Take a screenshot of the beyondar fragment.

The screenshot will contain the camera and the AR world overlapped.

Parameters
listenerOnScreenshotListener That will be notified when the screenshot is ready.

Here is the call graph for this function:


The documentation for this class was generated from the following file: