com.supermap.realspace

Class Camera

  • java.lang.Object
    • com.supermap.realspace.Camera


  • public class Camera
    extends java.lang.Object

    The SuperMap 3D geographic information system controls objects displayed in the scene by theCamera object. The Camera object is actually a virtual lens in the 3D scene, and specifies the view with the lens position and orientation.

    By default, the camera's position is at the location where the longitude and latitude are both 0, that is the intersection of the equator and the prime meridian, while the getHeading() value of the camera is 0, getTilt() is 0, if you want to change the position and direction of the camera in order to get different views, you just need to change the cameras attribute settings, for example, changing the setHeading() value indicates that rotating the camera around the Z axis for a certain angle; changing the setTilt() value indicates that rotating the camera around the X axis for a certain angle.

    • Constructor Summary

      Constructors 
      Constructor and Description
      Camera()
      Constructs a new Camera object.
      Camera(Camera camera)
      Constructs a new object that is the same with the specified Camera object.
      Camera(double longitude, double latitude, double altitude)
      Creates a new Camera object according to given parameters.
      Camera(double longitude, double latitude, double altitude, double heading, double tilt)
      Creates a new Camera object according to given parameters.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      double getAltitude()
      Returns the altitude.
      AltitudeMode getAltitudeMode()
      Returns the altitude mode.
      double getHeading()
      Returns the camera azimuth.
      double getLatitude()
      Returns the camera latitude.The unit is degree.
      double getLongitude()
      Returns the camera longitude.The unit is degree.
      double getTilt()
      Returns the camera's tilt (the angle around the X axis).
      void setAltitude(double value)
      Sets the camera altitude.
      void setAltitudeMode(AltitudeMode altitudeMode)
      Sets the height mode.
      void setHeading(double value)
      Sets the camera azimuth.
      void setLatitude(double value)
      Sets the camera latitude.The unit is degree.
      void setLongitude(double value)
      Sets the camera longitude.The unit is degree.
      void setTilt(double value)
      Sets the camera's tilt (the angle around the X axis).
      java.lang.String toString()
      Returns a character string to describe the Camera object, The format is {Altitude=,Heading=,Latitude=,Longitude=,Roll=,Tilt=,AltitudeMode=}.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Camera

        public Camera()
        Constructs a new Camera object.
      • Camera

        public Camera(Camera camera)
        Constructs a new object that is the same with the specified Camera object.
        Parameters:
        camera - The given Camera object. It will throw an exception when the Camera parameter is null or released.
      • Camera

        public Camera(double longitude,
                      double latitude,
                      double altitude)
        Creates a new Camera object according to given parameters.
        Parameters:
        longitude - Designated longitude.
        latitude - Designated latitude.
        altitude - The specified altitude.
      • Camera

        public Camera(double longitude,
                      double latitude,
                      double altitude,
                      double heading,
                      double tilt)
        Creates a new Camera object according to given parameters.
        Parameters:
        longitude - Designated longitude.
        latitude - Designated latitude.
        altitude - The specified altitude.
        heading - The specified direction angle.
        tilt - The specified tilt angle.
    • Method Detail

      • getAltitude

        public double getAltitude()
        Returns the altitude. The unit is in meters.
        Returns:
        The camera altitude. The unit is in meters.
      • setAltitude

        public void setAltitude(double value)
        Sets the camera altitude. The unit is in meters.
        Parameters:
        value - Altitude. The unit is in meters.
      • getHeading

        public double getHeading()
        Returns the camera azimuth. The range of azimuth is 0-360 degrees.

        The azimuth: the direction of the compass. In the 3D analysis and the spatial analysis, the direction of the light source illuminating a surface is called the azimuth.

        Returns:
        The camera azimuth, in degrees.
        Default:
        The default is 0, in degrees.
      • setHeading

        public void setHeading(double value)
        Sets the camera azimuth. The range of azimuth is 0-360 degrees.

        The azimuth: the direction of the compass. In the 3D analysis and the spatial analysis, the direction of the light source illuminating a surface is called the azimuth.

        Parameters:
        value - The camera azimuth, in degrees.
      • getLatitude

        public double getLatitude()
        Returns the camera latitude.The unit is degree.
        Returns:
        The latitude of the camera, in degrees.
        Default:
        The default is 0, in degrees.
      • setLatitude

        public void setLatitude(double value)
        Sets the camera latitude.The unit is degree.
        Parameters:
        value - The latitude of the camera, in degrees.
      • getLongitude

        public double getLongitude()
        Returns the camera longitude.The unit is degree.
        Returns:
        The longitude of the camera, in degrees.
        Default:
        The default is 0, in degrees.
      • setLongitude

        public void setLongitude(double value)
        Sets the camera longitude.The unit is degree.
        Parameters:
        value - The longitude of the camera, in degrees.
      • getTilt

        public double getTilt()
        Returns the camera's tilt (the angle around the X axis). The tilt ranges from 0 and 90 degrees.
        Returns:
        The camera pitch angle, in degrees.
        Default:
        The default is 0, in degrees.
      • setTilt

        public void setTilt(double value)
        Sets the camera's tilt (the angle around the X axis). The tilt ranges from 0 and 90 degrees.
        Parameters:
        value - The camera pitch angle, in degrees.
      • toString

        public java.lang.String toString()
        Returns a character string to describe the Camera object, The format is {Altitude=,Heading=,Latitude=,Longitude=,Roll=,Tilt=,AltitudeMode=}.
        Overrides:
        toString in class java.lang.Object
        Returns:
        Describes the character string of camera.
      • getAltitudeMode

        public AltitudeMode getAltitudeMode()
        Returns the altitude mode.

        The altitude mode has the following types: the clamp-to-ground altitude mode (CLAMP_TO_GROUND), the relative-to-ground altitude mode (RELATIVE_TO_GROUND), and the absolute altitude mode (ABSOLUTE). For related details, please see the enumeration type enumerate in AltitudeMode.

        Returns:
        The altitude mode.
        Default:
        Default value is CLAMP_TO_GROUND.
      • setAltitudeMode

        public void setAltitudeMode(AltitudeMode altitudeMode)
        Sets the height mode.

        The altitude mode has the following types: the clamp-to-ground altitude mode (CLAMP_TO_GROUND), the relative-to-ground altitude mode (RELATIVE_TO_GROUND), and the absolute altitude mode (ABSOLUTE). For related details, please see the enumeration type enumerate in AltitudeMode.

        Parameters:
        altitudeMode - Altitude Mode.