TransformEditorViewModel

new IonSdkMeasurements.TransformEditorViewModel(options)

Creates an interactive transform editor
Name Type Description
options Object An object with the following properties
Name Type Default Description
scene Scene The scene
transform Matrix4 The transform of the primitive that needs positioning
boundingSphere BoundingSphere The bounding sphere of the primitive that needs positioning
originOffset Cartesian3 optional A offset vector (in local coordinates) from the origin as defined by the transform translation.
pixelSize Number 100 optional The desired size of the transformation widget in pixels. Set this to zero to disable screen space scaling.
maximumSizeInMeters Number Infinity optional The maximum size of the transformation widget in meters. Set this to Infinity for no limit.

Members

static IonSdkMeasurements.TransformEditorViewModel.originOffset : Cartesian3

Gets and sets the offset of the transform editor UI components from the origin as defined by the transform

readonly active : Boolean

Gets whether the widget is active. Use the activate and deactivate functions to set this value.

editorMode : EditorMode

Gets and sets the selected interactive mode.

enableNonUniformScaling : Boolean

Gets and sets whether non-uniform scaling is enabled

headingPitchRoll : HeadingPitchRoll

Gets and sets the heading pitch roll

readonly left : String

Gets the x screen coordinate of the widget menu
Gets and sets whether the menu is expanded

position : Cartesian3

Gets and sets the position

scale : Cartesian3

Gets and sets the scale

readonly top : String

Gets the y screen coordinate of the widget menu

Methods

activate()

Activates the widget by showing the primitives and enabling mouse handlers

deactivate()

Deactivates the widget by disabling mouse handlers and hiding the primitives

destroy()

Destroys the view model.

expandMenu()

Expands the widget menu

isDestroyed()Boolean

Returns:
true if the object has been destroyed, false otherwise.

setModeRotation()

Activates the rotation interactive mode

setModeScale()

Activates the scale interactive mode

setModeTranslation()

Activates the translation interactive mode

setOriginPosition(position)

Sets the originOffset based on the Cartesian3 position in world coordinates
Name Type Description
position Cartesian3

toggleNonUniformScaling()

Toggles whether non-uniform scaling is enabled
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.