JSFigure
API for creating and modifying 3D Figure objects.
Create a API with Module.createFigure.
let figure = Module.createFigure("ID");Function
getAngle() → number
Returns the rotation angle around the y-axis of the object.
- Return - Valid angle (number): Successful return of the rotation angle. 
- -999.0 (number): If the object is null. 
 
var dAngle = figure.getAngle();getBoundary() → JSAABBox3D
Returns the object's boundary.
- Return - JSAABBox3D: The function successfully returns the object's bounds. 
- null: Object bounds return failed. 
 
var boundary = figure.getBoundary();
var boundary_min = boundary.min;
var boundary_max = boundary.max;getCenter() → JSVector3D
Returns the center point of the object.
- Return - JSVector3D: Returns the centroid coordinates (longitude, latitude, altitude) of the object successfully. 
- null: Coordinate return failed. 
 
var vCenter = figure.getCenter();
var dCenterLon = vCenter.Longitude;
var dCenterLat = vCenter.Latitude;
var dCenterAlt = vCenter.Altitude;getExtent() → number
Returns the distance between Min-Max of the object boundary Box.
- Return - number: Distance between Min-Max of the object boundary Box. 
 
var bExtends = figure.getExtent();getFigureType() → number
Returns the Figure type of the object.
- Return - Valid constant (number): Successful return of the Figure type. 
- -1 (number): If the object is null. 
 
var figureType = figure.getFigureType();getId() → string
Returns the ID of the object.
- Return - string: Successful return of the object's Key string. 
- null: If the object is null. 
 
lat strKey = figure.getId();getPosition() → JSVector3D
Returns the bottom center position of the object.
- Return - JSVector3D: Returns the bottom center coordinates (longitude, latitude, altitude) of the object successfully. 
- null: Coordinate return failed. 
 
let position = figure.getPosition();
let longitude = position.x;
let latitude = position.y;
let altitude = position.z;getSize() → JSVector3D
Returns the size values of the object.
- Return - JSVector3D: Successfully returns the scale of the object corresponding to the x, y, z axes. 
- null: size return failed. 
 
let size = figure.getSize();
let width = size.x;
let height = size.y;
let depth = size.z;setAngle(angle) → boolean
Sets the rotation angle around the y-axis of the object.
angle
number
Rotation angle around the y-axis (in degrees).
- Return - true: Rotation angle setting successful. 
- false: If the object is null or the input angle is outside the range of 0º to 360º. 
 
figure.setAngle(50.0);setDepth(depth) → boolean
Sets the depth (Z-axis direction size) of the object.
depth
number
Object depth.
- Return - true: Object depth setting successful. 
- false: If the object is null. 
 
figure.setDepth(200.0);setHeight(height) → boolean
Sets the height (Y-axis direction size) of the object.
height
number
Object height.
- Return - true: Object height setting successful. 
- false: If the object is null. 
 
figure.setHeight(100.0);setWidth(width) → boolean
Sets the width (X-axis direction size) of the object.
width
number
Object width.
- Return - true: Object width setting successful. 
- false: If the object is null. 
 
figure.setWidth(130.0);setPosition(position) → boolean
Sets the bottom center position of the object.
position
Figure location (based on the bottom center point) coordinates (longitude, latitude, altitude).
- Return - true: Setting successful. 
- false: Setting failed. 
 
var vPos = new Module.JSVector3D("127.0273188", "37.4977981", "30.0");
figure.setPosition(vPos);setSize(width, height, depth) → boolean
Sets the size of the object.
width
number
Object width (size in the x-axis direction).
height
number
Object height (size in the y-axis direction).
depth
number
Object depth (size in the z-axis direction).
- Return - true: Object size setting successful. 
- false: If the object is null. 
 
figure.setSize(50.0, 100.0, 150.0);Getter / Setter
getDescription(), setDescription(desc) → string
Set a description for the object.
desc
string
Object description string.
- Return - string: Successful return of the object's description string. 
- null: If the object is null. 
 
var strDesc = object.getDescription();
// ... or ...
object.setDescription("First Object.");getName(), setName(name) → string
Sets the name of the object.
name
string
The name to set for the object.
- Return - string: Successful return of the object's name. 
- null: If the object is null. 
 
var objName = object.getName();
// ... or ...
object.setName("MyObject");getStyle(), setStyle(style) → JSPolygonStyle
Changes the object style with options applied in JSPolygonStyle.
Currently settable styles (subject to updates - refer to JSPolygonStyle)
- Return - Valid object style (JSPolygonStyle): Successful return of the object style. 
- Simple initialized state of object style (JSPolygonStyle): If the object is null. 
 
var figure = new Module.JSFigure();
var figureStyle = figure.getStyle();
// ... or ...
var figure = new Module.JSFigure();
var figureStyle = new Module.JSFigureStyle();
//...
figure.setStyle(figureStyle);getVisible(), setVisible(visible) → boolean
Sets the visibility state of an object.
visible
boolean
true: Make the object visible. false: Hide the object.
- Return - true: Object visible state. 
- false: Object hidden state. 
 
var objName = object.getName();
// ... or ...
object.setVisible(true);Last updated
