com.dopanic.panicarkit.lib
Class PARPoi

java.lang.Object
  extended by com.dopanic.panicarkit.lib.PARPoi
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
PARPoiLabel

public class PARPoi
extends java.lang.Object
implements java.io.Serializable

Represents a point of interest

See Also:
Serialized Form

Field Summary
protected  int _backgroundImageResource
           
protected  RelativeLayout _labelView
           
protected  boolean addedToRadar
           
protected  boolean addedToView
           
protected  Context ctx
           
protected  double distanceToUser
          Distance of poi to user
protected  PointF halfSizeOfView
           
protected  boolean isClippedByDistance
           
protected  boolean isClippedByViewport
           
protected  boolean isDebug
           
protected  boolean isHidden
           
protected  Location location
           
protected  boolean observed
           
protected  Point offset
           
protected  PARRadarView radarParentView
           
protected  int radarResourceId
          Resource id for POI's radar representation
protected  View radarView
           
 
Constructor Summary
PARPoi(Location atLocation)
          Constructor
 
Method Summary
 void createView()
           
 int getBackgroundImageResource()
           
 Location getLocation()
           
protected  Point getOffset()
          Gives offset (default 0,0)
 View getRadarView()
           
 PointF getRelativeScreenPosition()
          Get relative screen position of poi (absolute x,y coordinates)
 View getView()
           
 boolean isAddedToRadar()
          Indicates if poi is added to the radar
 boolean isClippedByDistance()
           
 boolean isClippedByViewport()
           
 boolean isHadLocationUpdate()
           
 boolean isHidden()
           
 boolean isInView(float[] perspectiveMatrix)
          Check if point is visible in view
 boolean isObserved()
           
 void onAddedToARController()
          added poi to PARController
 void onRemovedFromARController()
          removed poi from PARController
 void renderInRadar(PARRadarView radar)
          Render poi in radar
 void renderInView(PARFragment parent)
          Draw poi in view
 void setBackgroundImageResource(int backgroundImageResource)
           
static void setDeviceGravity(float[] gravity)
          Setter for device gravity
 void setLocation(Location location)
           
 void setObserved(boolean observed)
           
 void setViewRotation(float angle)
          Set view angle
 void updateContent()
           
 void updateLocation()
          Update poi location
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_backgroundImageResource

protected int _backgroundImageResource

ctx

protected Context ctx

observed

protected boolean observed

radarResourceId

protected int radarResourceId
Resource id for POI's radar representation


location

protected Location location

offset

protected Point offset

distanceToUser

protected double distanceToUser
Distance of poi to user


_labelView

protected RelativeLayout _labelView

isHidden

protected boolean isHidden

isClippedByDistance

protected boolean isClippedByDistance

isClippedByViewport

protected boolean isClippedByViewport

radarView

protected View radarView

isDebug

protected boolean isDebug

halfSizeOfView

protected PointF halfSizeOfView

radarParentView

protected PARRadarView radarParentView

addedToView

protected boolean addedToView

addedToRadar

protected boolean addedToRadar
Constructor Detail

PARPoi

public PARPoi(Location atLocation)
Constructor

Parameters:
atLocation - Poi location
Method Detail

setDeviceGravity

public static void setDeviceGravity(float[] gravity)
Setter for device gravity

Parameters:
gravity - Device gravity matrix

getRadarView

public View getRadarView()

isHidden

public boolean isHidden()

isClippedByDistance

public boolean isClippedByDistance()

getView

public View getView()

renderInRadar

public void renderInRadar(PARRadarView radar)
Render poi in radar

Parameters:
radar - the PARRadarView

getRelativeScreenPosition

public PointF getRelativeScreenPosition()
Get relative screen position of poi (absolute x,y coordinates)

Returns:
Screen coordinates

setViewRotation

public void setViewRotation(float angle)
Set view angle

Parameters:
angle - The angle towards the poi

updateLocation

public void updateLocation()
Update poi location


updateContent

public void updateContent()

isInView

public boolean isInView(float[] perspectiveMatrix)
Check if point is visible in view

Parameters:
perspectiveMatrix - Perspective matrix
Returns:
true if point is within view

getOffset

protected Point getOffset()
Gives offset (default 0,0)

Returns:

renderInView

public void renderInView(PARFragment parent)
Draw poi in view

Parameters:
parent - Reference to activity

createView

public void createView()

onAddedToARController

public void onAddedToARController()
added poi to PARController


onRemovedFromARController

public void onRemovedFromARController()
removed poi from PARController


isAddedToRadar

public boolean isAddedToRadar()
Indicates if poi is added to the radar

Returns:
true if poi is added to radar

getBackgroundImageResource

public int getBackgroundImageResource()

setBackgroundImageResource

public void setBackgroundImageResource(int backgroundImageResource)

getLocation

public Location getLocation()

setLocation

public void setLocation(Location location)

isClippedByViewport

public boolean isClippedByViewport()

isObserved

public boolean isObserved()

setObserved

public void setObserved(boolean observed)

isHadLocationUpdate

public boolean isHadLocationUpdate()



Copyright © 2014 doPanic GmbH. All rights reserved.