Home Reference Source
public class | source

DataPathSetOp

Extends:

scripts/path-controller/util/events.js~events.EventHandlerToolOp → DataPathSetOp

Static Method Summary

Static Public Methods
public static

create(ctx: *, datapath: *, value: *, id: *, massSetPath: *): *

public static

tooldef(): {"uiname": string, "toolpath": string, "icon": *, "flag": *, "is_modal": boolean, "inputs": *}

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public
public
Private Members
private

__ctx: *

private

_undo: *

Method Summary

Public Methods
public

exec(ctx: *)

public

hash(massSetPath: *, dataPath: *, prop: *, id: *): *

public

hashThis(): *

public

modalStart(ctx: *)

public

setValue(ctx: *, val: *, object: *)

public

undo(ctx: *): *

public

undoPre(ctx: *): *

Inherited Summary

From class ToolOp
public static

Equals(a: *, b: *): *

public static

canRun(ctx: *, toolop: *): boolean

public static

inherit(slots: {}): *

public static

invoke(ctx: *, args: *): *

Creates a new instance of this toolop from args and a context.

public static

isRegistered(cls: *): *

public static

onTick()

public static

register(cls: *)

public static

searchBoxOk(ctx: *): *

public static

tooldef(): {}

ToolOp definition.

public static

unregister(cls: *)

private static
private static

_regWithNstructjs(cls: *, structName: *)

public

[k]: *

public

drawlines: *[]

public

flag: *

public

inputs: {}

public
public
public
public

outputs: {}

public
private
private

_accept: *

private
private
private

_reject: *

private
public

calcMemSize(ctx: *): *

Used by undo system to limit memory

public

calcUndoMem(ctx: *): number

public

error(msg: *)

public

exec(ctx: *)

public

execPost(ctx: *)

public

execPre(ctx: *)

public

exec_pre(ctx: *)

public
public

getDefault(toolprop: *, key: *): *

public
public

hasDefault(toolprop: *, key: *): *

public

loadDefaults(force: boolean): *

public

loadSTRUCT(reader: *)

public

makeTempLine(v1: *, v2: *, style: *): *

for use in modal mode only

public

modalEnd(was_cancelled: *)

public

modalStart(ctx: *): *

returns promise to be executed on modalEnd

public

Called when the undo system needs to destroy this toolop to save memory

public

on_keydown(e: *)

default on_keydown implementation for modal tools, no need to call super() to execute this if you don't want to

public
public
public

pushModal(node: *)

public

redo(ctx: *)

public

for use in modal mode only

public
public
public

undo(ctx: *)

public

undoPre(ctx: *)

private
private

Static Public Methods

public static create(ctx: *, datapath: *, value: *, id: *, massSetPath: *): * source

Params:

NameTypeAttributeDescription
ctx *
datapath *
value *
id *
massSetPath *

Return:

*

public static tooldef(): {"uiname": string, "toolpath": string, "icon": *, "flag": *, "is_modal": boolean, "inputs": *} source

ToolOp definition.

An example:

static tooldef() {
return {
uiname   : "Tool Name",
toolpath : "logical_module.tool", //logical_module need not match up to a real module
icon     : -1, //tool's icon, or -1 if there is none
description : "tooltip",
is_modal : false, //tool is interactive and takes control of events
hotkey   : undefined,
undoflag : 0, //see UndoFlags
flag     : 0,
inputs   : ToolOp.inherit({
f32val : new Float32Property(1.0),
path   : new StringProperty("./path");
}),
outputs  : {}
}
}

Override:

ToolOp#tooldef

Return:

{"uiname": string, "toolpath": string, "icon": *, "flag": *, "is_modal": boolean, "inputs": *}

Public Constructors

public constructor() source

Main ToolOp constructor. It reads the inputs/outputs properteis from this.constructor.tooldef() and copies them to build this.inputs and this.outputs. If inputs or outputs are wrapped in ToolOp.inherit(), it will walk up the class chain to fetch parent class properties.

Default input values are loaded from SavedToolDefaults. If initialized (buildToolSysAPI has been called) SavedToolDefaults will have a copy of all the default property values of all registered ToolOps.

Override:

ToolOp#constructor

Public Members

public hadError: boolean source

public propType: * source

Private Members

private __ctx: * source

private _undo: * source

Public Methods

public exec(ctx: *) source

Override:

ToolOp#exec

Params:

NameTypeAttributeDescription
ctx *

public hash(massSetPath: *, dataPath: *, prop: *, id: *): * source

Params:

NameTypeAttributeDescription
massSetPath *
dataPath *
prop *
id *

Return:

*

public hashThis(): * source

Return:

*

public modalStart(ctx: *) source

returns promise to be executed on modalEnd

Override:

ToolOp#modalStart

Params:

NameTypeAttributeDescription
ctx *

public setValue(ctx: *, val: *, object: *) source

Params:

NameTypeAttributeDescription
ctx *
val *
object *

public undo(ctx: *): * source

Override:

ToolOp#undo

Params:

NameTypeAttributeDescription
ctx *

Return:

*

public undoPre(ctx: *): * source

Override:

ToolOp#undoPre

Params:

NameTypeAttributeDescription
ctx *

Return:

*