Viewer - Interaction
    Preparing search index...

    Class InteractionData

    InteractionData is used to make a TreeNode interactable.

    Via the interactionTypes the type of interaction that is possible can be specified for the node. Example: Only if the property drag in the interactionTypes is set to true it will be possible to drag the node.

    If the node is interacted with, the interactionStates are set to the corresponding types. Example: If the node is dragged, the drag property in the interactionStates is set to true.

    The dragOrigin and dragAnchors are only used when the object is being dragged. The logic for dragging is as follow:

    • If neither dragOrigin or dragAnchors are defined, the intersection point of the ray with the node is used as the origin for dragging.
    • If a dragOrigin is defined, but no dragAnchors, the dragOrigin is used as the origin for dragging.
    • If at least one anchor is defined in dragAnchors, the dragAnchors are used for dragging. In that case, the anchors are positioned accoriding to the drag transformation and then transformed with the rotation that has been provided. The transformed result is used to measure the distance to the ray, and the closest distanced anchor of the dragAnchors is chosen to compute the tranformation matrix that is applied to the node.

    The calculations that are mentioned above happen in close proximity with the IDragConstraints. As this is not the easiest of topics, please visit our help desk section on interactions. There we explain the process to set this up with many examples.

    Hierarchy

    • AbstractTreeNodeData
      • InteractionData

    Implements

    Index

    Constructors

    • Creates an interaction data item.

      Parameters

      • interactionTypes: IInteractionTypes

        the data as key-value pairs

      • OptionalgroupId: string

        the group id to be able to interact with multiple nodes at once

      • OptionalrestrictedManagers: string[]
      • Optionalid: string

        the id that is used internally (leave empty if in doubt)

      • Optionalversion: string

        the version that is used internally (leave empty if in doubt)

      Returns InteractionData

    Accessors

    • get convertedObject(): { [key: string]: unknown }

      The converted object of the tree node.

      Returns { [key: string]: unknown }

    • set convertedObject(value: { [key: string]: unknown }): void

      The converted object of the tree node.

      Parameters

      • value: { [key: string]: unknown }

      Returns void

    • get dragAnchors(): IDragAnchor[]

      The drag anchors can be defined as various points in space that will be transformed according to the node matrix that this data item belongs to. These anchors are used when an object is being dragged instead of the dragOrigin or the default, the intersection with the node.

      The optional rotation in axis-angle representation is being applied to the node if the specified drag anchor has been used.

      Returns IDragAnchor[]

    • set dragAnchors(value: IDragAnchor[]): void

      The drag anchors can be defined as various points in space that will be transformed according to the node matrix that this data item belongs to. These anchors are used when an object is being dragged instead of the dragOrigin or the default, the intersection with the node.

      The optional rotation in axis-angle representation is being applied to the node if the specified drag anchor has been used.

      Parameters

      • value: IDragAnchor[]

      Returns void

    • get dragOrigin(): vec3 | undefined

      The drag origin can be defined instead of usind the default, the intersection with the node, as a dragging origin. If at least one dragAnchors is used, this property will be ignored.

      Returns vec3 | undefined

    • set dragOrigin(value: vec3 | undefined): void

      The drag origin can be defined instead of usind the default, the intersection with the node, as a dragging origin. If at least one dragAnchors is used, this property will be ignored.

      Parameters

      • value: vec3 | undefined

      Returns void

    • get groupId(): string | undefined

      The group id to be able to interact with multiple nodes at once. If the same group id is specified at the InteractionData of another node, these nodes are treated as being one.

      Returns string | undefined

    • set groupId(value: string | undefined): void

      The group id to be able to interact with multiple nodes at once. If the same group id is specified at the InteractionData of another node, these nodes are treated as being one.

      Parameters

      • value: string | undefined

      Returns void

    • get id(): string

      The ID of the tree node data.

      Returns string

    • get parentsUpdateVersions(): { [key: string]: () => void }

      The updateVersion functions of all parents of the tree node data.

      Returns { [key: string]: () => void }

    • get restrictedManagers(): string[]

      The restricted managers are the managers that are allowed to interact with this node. If the array is empty, all managers are allowed to interact with this node.

      Returns string[]

    • set restrictedManagers(value: string[]): void

      The restricted managers are the managers that are allowed to interact with this node. If the array is empty, all managers are allowed to interact with this node.

      Parameters

      • value: string[]

      Returns void

    • get updateCallback(): ((newVersion: string, oldVersion: string) => void) | null

      The update callback for the tree node data. This callback is called when the node is updated, e.g. when the version changes.

      Returns ((newVersion: string, oldVersion: string) => void) | null

    • set updateCallback(
          value: ((newVersion: string, oldVersion: string) => void) | null,
      ): void

      The update callback for the tree node data. This callback is called when the node is updated, e.g. when the version changes.

      Parameters

      • value: ((newVersion: string, oldVersion: string) => void) | null

      Returns void

    • get updateCallbackConvertedObject(): | (
          (newObj: unknown, oldObj: unknown, viewport: string) => void
      )
      | null

      The update callback for the converted object of the tree node.

      Returns ((newObj: unknown, oldObj: unknown, viewport: string) => void) | null

    • set updateCallbackConvertedObject(
          value:
              | ((newObj: unknown, oldObj: unknown, viewport: string) => void)
              | null,
      ): void

      The update callback for the converted object of the tree node.

      Parameters

      • value: ((newObj: unknown, oldObj: unknown, viewport: string) => void) | null

      Returns void

    • get version(): string

      The version of the tree node data. If the version changes, the node data will be marked for an update. A version change can be triggered via updateVersion.

      Returns string

    Methods

    • Update the version

      Returns void