com.supermap.realspace
Class Feature3D
- java.lang.Object
-
- com.supermap.realspace.Feature3D
-
public class Feature3D extends java.lang.Object
The Feature3D class.
-
-
Constructor Summary
Constructors Constructor and Description Feature3D()
Creates a new Feature3D object.Feature3D(Feature3D feature3D)
Initializes a new instance of the Feature3D class which is a copy of the specified Feature3D object.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method and Description void
dispose()
Releases the resources occupied by the object.boolean
fromKML(java.lang.String kml)
Imports the Feature3D object from an KML string.boolean
fromKMLFile(java.lang.String kmlFile)
Imports the Feature3D object through importing the KML file.Camera
getCamera()
Gets the camera object.java.lang.String
getDescription()
Returns the description of the feature3D object.java.lang.Object
getFieldValue(int index)
Returns field value corresponding to the field index specified by the Feature3D object.java.lang.Object
getFieldValue(java.lang.String name)
Returns field value corresponding to the field name specified by the Feature3D object.Geometry3D
getGeometry()
Returns the 3D geometry that corresponds to the 3D feature.int
getID()
Returns the ID of the Feature3D object.java.lang.String
getName()
Gets the name of the feature3D object.Feature3Ds
getParent()
Returns the Feature3Ds object which the Feature3D object belongs to.double
getVisibleDistance()
Deprecated.This method is obsolete. Related functions have been replaced by the get / setMaxObjectVisibleDistance () method in the Layer3D class. The visible distance of feature 3Dboolean
isVisible()
Returns whether the Feature3D object is visible or not.void
setCamera(Camera camera)
Sets the camera object.void
setDescription(java.lang.String value)
Sets the description of the feature3D object.void
setGeometry(Geometry3D geometry3D)
Sets the 3D geometry that corresponds to the 3D feature.void
setName(java.lang.String value)
Sets the name of the feature3D object.void
setVisible(boolean value)
Sets whether the Feature3D object is visible or not.void
setVisibleDistance(double value)
Deprecated.This method is obsolete. Related functions have been replaced by the get / setMaxObjectVisibleDistance () method in the Layer3D class. Sets the visible distance of the feature3D object.java.lang.String
toKML()
Returns an KML string indicating the description of the Feature3D object.void
toKMLFile(java.lang.String kmlFile)
Exports the Feature3D object to a specified KML file.void
updateData()
Updates the data to be rendered.
-
-
-
Constructor Detail
-
Feature3D
public Feature3D()
Creates a new Feature3D object.
-
Feature3D
public Feature3D(Feature3D feature3D)
Initializes a new instance of the Feature3D class which is a copy of the specified Feature3D object.- Parameters:
feature3D
- The Specified Feature3D object.
-
-
Method Detail
-
getID
public int getID()
Returns the ID of the Feature3D object.- Returns:
- The ID of the feature3D object.
- Default:
- The default value is ID.
-
getName
public java.lang.String getName()
Gets the name of the feature3D object.- Returns:
- The name of the feature3D object.
- Default:
- The default value is UntitledFeature3D.
-
setName
public void setName(java.lang.String value)
Sets the name of the feature3D object.- Parameters:
value
- The name of the feature3D object.
-
getDescription
public java.lang.String getDescription()
Returns the description of the feature3D object.- Returns:
- The description of the feature3D object.
- Default:
- The default is a null string.
-
setDescription
public void setDescription(java.lang.String value)
Sets the description of the feature3D object.- Parameters:
value
- The description of the feature3D object.
-
getGeometry
public Geometry3D getGeometry()
Returns the 3D geometry that corresponds to the 3D feature.- Returns:
- The 3D geometry object corresponding to 3D feature object.
- Default:
- The default value is null.
-
setGeometry
public void setGeometry(Geometry3D geometry3D)
Sets the 3D geometry that corresponds to the 3D feature.Note: If the type of the geometry object to be set is different from the type the original geometry object, the original geometry object will be disposed.
- Parameters:
geometry3D
- The 3D geometry object corresponding to 3D feature object.
-
getParent
public Feature3Ds getParent()
Returns the Feature3Ds object which the Feature3D object belongs to.- Returns:
- The parent of the feature3D object.
- Default:
- The default value is null.
-
isVisible
public boolean isVisible()
Returns whether the Feature3D object is visible or not.- Returns:
- If the feature3D object is visible return true; otherwise return false.
- Default:
- The default value is true.
-
setVisible
public void setVisible(boolean value)
Sets whether the Feature3D object is visible or not.- Parameters:
value
- A bool specifies the visibility of the feature3D object.
-
getVisibleDistance
public double getVisibleDistance()
Deprecated. This method is obsolete. Related functions have been replaced by the get / setMaxObjectVisibleDistance () method in the Layer3D class. The visible distance of feature 3D- Returns:
- The visible distance of feature 3D.
- Default:
- The default value is -9999.
-
setVisibleDistance
public void setVisibleDistance(double value)
Deprecated. This method is obsolete. Related functions have been replaced by the get / setMaxObjectVisibleDistance () method in the Layer3D class. Sets the visible distance of the feature3D object.- Parameters:
value
- The visible distance of feature 3D.
-
getCamera
public Camera getCamera()
Gets the camera object.- Returns:
- the camera object.
- Default:
- The default value is .{Altitude=-1.79769313486232E+308,Heading=-1.79769313486232E+308,Latitude=-1.79769313486232E+308,Longitude=-1.79769313486232E+308,Tilt=-1.79769313486232E+308,AltitudeMode=ClampToGround}
-
setCamera
public void setCamera(Camera camera)
Sets the camera object.- Parameters:
camera
- The camera object.
-
toKML
public java.lang.String toKML()
Returns an KML string indicating the description of the Feature3D object.- Returns:
- KML string.
- Example:
- The following exmaple show how to export the feature3D class as a kml string and import the feature3D object from kml string.
public void FromToKML() { Feature3D feature3D = new Feature3D(); feature3D.fromKMLFile("D:\\SampleData\\kml.kml"); String kml=feature3D.toKML(); feature3D.fromKML(kml); }
-
fromKML
public boolean fromKML(java.lang.String kml)
Imports the Feature3D object from an KML string.- Parameters:
kml
- The specified KML string.- Returns:
- Returns true if successful; otherwise false.
-
toKMLFile
public void toKMLFile(java.lang.String kmlFile)
Exports the Feature3D object to a specified KML file.- Parameters:
kmlFile
- The relative path of the specified KML file.
-
fromKMLFile
public boolean fromKMLFile(java.lang.String kmlFile)
Imports the Feature3D object through importing the KML file.- Parameters:
kmlFile
- The relative path of the specified KML file.- Returns:
- If import successful return true; Otherwise return false.
-
updateData
public void updateData()
Updates the data to be rendered.The data can be updated correctly when modifying the Feature3D.getGeometry() method and invoking the Style3D.setAltitudeMode().
-
dispose
public void dispose()
Releases the resources occupied by the object. After calling this method, this object will not be usable.
-
getFieldValue
public java.lang.Object getFieldValue(int index)
Returns field value corresponding to the field index specified by the Feature3D object.- Parameters:
index
- The specified field index.- Returns:
- Field value.
-
getFieldValue
public java.lang.Object getFieldValue(java.lang.String name)
Returns field value corresponding to the field name specified by the Feature3D object.- Parameters:
name
- The specified name of the field.- Returns:
- Field value.
-
-