Copyright © 2021 by K4.org
  (v.0.48.124)

This mixin supports interactive graphical dragging behavior.

Grid Handling

A 'grid' is a spatial subdivision that restricts dragging to certain discrete spacings. This is distinct from snapping to Connectors. Note that the grid is not displayed by using this mixin.

The parameters gridX, gridY, and gridZ accept a 'grid specification' object, which is an object containing one or more of the following properties:

size: The distance between grid points in the given direction. Zero indicates no grid snapping.

min: The lower limit of dragging in the given direction. If not present, there is no limit.

max: The upper limit of dragging in the given direction. If not present, there is no limit.

If the grid specification is null, no dragging is permitted in the given direction.

All grid spacing start at the origin of the grid frame, which is obtained by evaluating gridFrameName in the parent. If the grid origin (and/or orientation) needs to be customized, a new frame should be defined, and gridFrameName be set to it. All X, Y, or Z values are based on the grid frame.

Index

Rules

__pos3

__pos3: String

Internal Use Only.

Flags : Cached (Note this is uncached)

Expression : this.parent.__pos3; return R.THREE.setPosition(this.renderName, this.dragData, null, ...this.localTransform.m43());

dragBoundary

dragBoundary: Array

An array of co-planar Points that defines polygonal boundary for dragging in the XY-plane. Works only if gridEnable is true. It recommended that the points be connected in a counter-clockwise (about the +Z axis) direction. Setting this overrides any restrictions in the gridX or gridY specifications.

Flags : Cached, Parameter (Note this is uncached)

Expression : []

dragData

dragData: Any

Internal Use Only.

Flags : Cached (Note this is uncached)

Expression : { dragEnable: this.dragEnable, rotateEnable: this.rotateEnable, snapEnable: this.snapEnable, connData: this.connectors, freeDrag: this.freeDrag, rotateData: this.rotateData, offsetDragEnable: this.offsetDragEnable }

dragEnable

dragEnable: Boolean

Allows this model to be dragged.

Flags : Cached, Parameter (Note this is uncached)

Expression : true

freeDrag

freeDrag: Any

Internal Use Only.

Flags : Cached (Note this is uncached)

Expression : if (this.gridEnable) return { snapGrid: { gridFrameName: this.gridFrameName, gridFrame: this.nha[this.gridFrameName].get3(), dragBoundary: this.dragBoundary, xStep: this.gridX, yStep: this.gridY, zStep: this.gridZ }};

gridEnable

gridEnable: Boolean

If true, the snap-grid is used during free dragging.

Flags : Cached, Parameter (Note this is uncached)

Expression : false

gridFrameName

gridFrameName: String

The name of the rule in the parent of the dragged item which holds the coordinate system which defines the snap grid. This defaults to the parent coordinate system, which is usually what is desired.

Flags : Cached, Parameter (Note this is uncached)

Expression : "transform"

gridX

gridX: Any

The x-direction grid specification object. Ignored if dragBoundary is non-empty. The default allows continuous (no grid) dragging. Set to null to restrict dragging entirely in this direction.

Flags : Cached, Parameter (Note this is uncached)

Expression : {size: 0}

example

{size: 1, min: 0, max: 10}

gridY

gridY: Any

The y-direction grid specification object. Ignored if dragBoundary is non-empty. The default allows continuous (no grid) dragging. Set to null to restrict dragging entirely in this direction.

Flags : Cached, Parameter (Note this is uncached)

Expression : {size: 0}

example

{size: 1, min: 0, max: 10}

gridZ

gridZ: Any

The z-direction grid specification object. The default allows continuous (no grid) dragging. Set to null to restrict dragging entirely in this direction.

Flags : Cached, Parameter (Note this is uncached)

Expression : {size: 0}

example

{size: 1, min: 0, max: 10}.

offsetDragEnable

offsetDragEnable: Boolean

Enables offset dragging.

Flags : Cached, Parameter (Note this is uncached)

Expression : false

rotateData

rotateData: Any

Internal Use Only.

Flags : Cached (Note this is uncached)

Expression : if (this.rotateEnable) return { rotateX: this.rotateX, rotateY: this.rotateY, rotateZ: this.rotateZ };

rotateEnable

rotateEnable: Boolean

Allows this model to be rotated.

Flags : Cached, Parameter (Note this is uncached)

Expression : false

rotateX

rotateX: Any

The X-axis rotation specification. Use null to disable rotation. snap: 0 disables snapping, otherwise the value is an angle in degrees. Angles are measured relative to the inital orientation.

Flags : Cached, Parameter (Note this is uncached)

Expression : {snap: 0}

rotateY

rotateY: Any

The Y-axis rotation specification. Use null to disable. snap: 0 disables snapping, otherwise the value is an angle in degrees.

Flags : Cached, Parameter (Note this is uncached)

Expression : {snap: 0}

rotateZ

rotateZ: Any

The Z-axis rotation specification. Use null to disable. snap: 0 disables snapping, otherwise the value is an angle in degrees.

Flags : Cached, Parameter (Note this is uncached)

Expression : {snap: 0}