Default Process

The default process allows a user to receive a common callback from a scene.

Class of process (TypeScript):

export type DefaultProcess = {
    name: "Default"
    options: {
        [key: string]: unknown
    },
    events:{
        onContextMenu?:(xClient:number, yClient:number, uuid?:string)=>void
        onEdit?:(xClient:number, yClient:number, uuid?:string)=>void,
        onEditText?:(uuid:string,index?:number)=>void
        onHint?:(xClient:number, yClient:number, uuid?:string)=>void,
        onSelect?:(uuid?: string)=>void|true
    }
}

To run the process, you should call the command RunProcessCommand with the Default name of a process.

Example (TypeScript):

view.runCommand({
    name: "RunProcessCommand", // name of command
    // next arguments
    process:{
        name:"Default", // process name
        options:{}, // process options
        events:{} // process events
    }
})

Events

Available events:

  • onContextMenu(x, y, uuid): emitted with a left click on a model, receives x, y (viewport coordinates of the event) and a uuid linked to a geometry object.

  • onEdit(x, y, uuid): emitted with a double click on a model, receives x, y (viewport coordinates of the event) and a uuid linked to a geometry object.

  • onEditText(uuid, index): emitted with a single click on a text geometry object, receives a uuid of objects and an index (not active at the moment).

  • onHint(x, y, uuid): emitted when the mouse hovers over a geometry object, receives x, y (viewport coordinates of the event) and a uuid linked to a geometry object (uuid can be empty in cases of hints).

  • onSelect(uuid): emitted with a single click on geometry, receives a uuid of this geometry which can be empty when non-geometry clicking. If it returns true, the geometry is highlighted. If a uuid is empty and it returns true, highlighting clears up.

Important

Updating process is not provided!