com.supermap.ar.areffect
Class ARMapElement
- java.lang.Object
-
- com.supermap.ar.areffect.AREffectElement
-
- com.supermap.ar.areffect.ARMapElement
-
public class ARMapElement extends AREffectElement
AR map elements
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static class
ARMapElement.ActionType
static interface
ARMapElement.MapRefreshListener
static interface
ARMapElement.OnMapClickListener
Map click listener, used to monitor the starting and ending points in path analysisstatic interface
ARMapElement.OnMapUpdateListener
Map update monitor-
Nested classes/interfaces inherited from class com.supermap.ar.areffect.AREffectElement
AREffectElement.onRenderableLoadCompleteListener, AREffectElement.OnTapListener, AREffectElement.OnTouchListener, AREffectElement.PositionType
-
-
Constructor Summary
Constructors Constructor and Description ARMapElement(android.content.Context context)
The constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description boolean
checkPoint(Point point, boolean change)
Determine whether the point is out of rangePoint3D
convertToArPoint(Point point)
Convert the MapView coordinates to the relative coordinates of the parent node in ARPoint
convertToMapPoint(Point3D point)
Convert AR coordinates to pixel coordinates in MapView, the return value can be nullARMapElement.ActionType
getActionType()
Gets the gesture action typeAREffectElement
getArMapParent()
Gets the parent element of the AR mapfloat
getArMapScale()
Get the scale of the AR map to the real sceneARViewElement
getArMapSelf()
Get ARViewAREffectElement
getArObjParent()
Gets the parent element of the corresponding AR object on the AR map to be bound Child objects on the AR map need to be bound to the parent elementjava.util.List<Point3D>
getArViewVertice()
Gets the vertex set of ARView Note: five points end to endfloat[]
getRealScaleFactor()
Gets the true scale of the AR scenefloat[]
getScaleFactor()
Gets the ratio of object in ar worldboolean
isLoaded()
Whether the map has been loadedboolean
isRealMode()
Determine if it is true mode (1:1 map)void
loadModel(MapView source)
Resource to loadvoid
setActionType(ARMapElement.ActionType type)
Sets the gesture action typevoid
setMapRefreshListener(ARMapElement.MapRefreshListener listener)
Set the map refresh listenervoid
setOnMapClickListener(ARMapElement.OnMapClickListener listener)
Set the map click to listenvoid
setOnUpdateListener(ARMapElement.OnMapUpdateListener listener)
Set AR map update listenervoid
setRealMode(boolean realMode)
Set true mode (with 1:1 map enabled or not)void
setScaleFactor(float[] scales)
Sets the ratio of object in ar worldvoid
updateArMap()
update ArMap-
Methods inherited from class com.supermap.ar.areffect.AREffectElement
addChild, addChilds, addOnTapListener, addOnTouchListener, clearAllChilds, destroy, getAllChilds, getChild, getChild, getChild, getChildCount, getElementType, getId, getLocalScaleFactor, getOnRenderableLoadCompleteListener, getPosition, getPositionType, getRelativePosition, getRotationAngle, getRotationAxis, getWGSCoordinates, isShadowCaster, isShadowReceiver, isTransformable, isVisible, removeChild, removeChild, removeChild, removeChild, removeOnTapListener, removeOnTouchListener, setElementName, setLocalScaleFactor, setOnRenderableLoadCompleteListener, setParentNode, setParentNode, setParentNode, setPosition, setRelativePosition, setRelativePosition, setRotateAlwaysToCamera, setRotateToCameraType, setRotationAngle, setShadowCaster, setShadowReceiver, setTransformable, setVisiblity, setWGSCoordinates
-
-
-
-
Constructor Detail
-
ARMapElement
public ARMapElement(android.content.Context context)
The constructor- Parameters:
context
-
-
-
Method Detail
-
setOnUpdateListener
public void setOnUpdateListener(ARMapElement.OnMapUpdateListener listener)
Set AR map update listener- Parameters:
listener
-
-
setMapRefreshListener
public void setMapRefreshListener(ARMapElement.MapRefreshListener listener)
Set the map refresh listener- Parameters:
listener
-
-
getArMapScale
public float getArMapScale()
Get the scale of the AR map to the real scene- Returns:
-
isRealMode
public boolean isRealMode()
Determine if it is true mode (1:1 map)- Returns:
-
setRealMode
public void setRealMode(boolean realMode)
Set true mode (with 1:1 map enabled or not)- Parameters:
realMode
-
-
getScaleFactor
public float[] getScaleFactor()
Description copied from class:AREffectElement
Gets the ratio of object in ar world- Overrides:
getScaleFactor
in classAREffectElement
- Returns:
-
setScaleFactor
public void setScaleFactor(float[] scales)
Description copied from class:AREffectElement
Sets the ratio of object in ar world- Overrides:
setScaleFactor
in classAREffectElement
- Parameters:
scales
- including 3 values that are coefficients of x, y, and z
-
getRealScaleFactor
public float[] getRealScaleFactor()
Gets the true scale of the AR scene- Returns:
-
checkPoint
public boolean checkPoint(Point point, boolean change)
Determine whether the point is out of range- Parameters:
point
-change
- Out of range, whether to update point coordinates- Returns:
- Is the point within the boundary of the map container
-
convertToArPoint
public Point3D convertToArPoint(Point point)
Convert the MapView coordinates to the relative coordinates of the parent node in AR- Parameters:
point
-- Returns:
-
convertToMapPoint
public Point convertToMapPoint(Point3D point)
Convert AR coordinates to pixel coordinates in MapView, the return value can be null- Parameters:
point
-- Returns:
-
loadModel
public void loadModel(MapView source)
Resource to load- Parameters:
source
-
-
updateArMap
public void updateArMap()
update ArMap
-
getArObjParent
public AREffectElement getArObjParent()
Gets the parent element of the corresponding AR object on the AR map to be bound Child objects on the AR map need to be bound to the parent element- Returns:
-
getArMapParent
public AREffectElement getArMapParent()
Gets the parent element of the AR map- Returns:
-
getArMapSelf
public ARViewElement getArMapSelf()
Get ARView- Returns:
-
getArViewVertice
public java.util.List<Point3D> getArViewVertice()
Gets the vertex set of ARView Note: five points end to end- Returns:
-
setActionType
public void setActionType(ARMapElement.ActionType type)
Sets the gesture action type- Parameters:
type
-
-
getActionType
public ARMapElement.ActionType getActionType()
Gets the gesture action type- Returns:
-
isLoaded
public boolean isLoaded()
Whether the map has been loaded- Returns:
-
setOnMapClickListener
public void setOnMapClickListener(ARMapElement.OnMapClickListener listener)
Set the map click to listen- Parameters:
listener
-
-
-