Skip to main content

SculptorTool

This tool allows modifying the contour data for planar freehand by sculpting it externally using another shape to push the contour in one direction or the other.

Hierarchy

Index

Constructors

constructor

Properties

publicconfiguration

configuration: Record<string, any>

publicmode

mode: ToolModes

Tool Mode - Active/Passive/Enabled/Disabled/

registeredShapes

registeredShapes: Map<any, any> = ...

publicsupportedInteractionTypes

supportedInteractionTypes: InteractionTypes[]

Supported Interaction Types - currently only Mouse

publictoolGroupId

toolGroupId: string

ToolGroup ID the tool instance belongs to

statictoolName

toolName: string

Methods

publicapplyActiveStrategy

  • applyActiveStrategy(enabledElement: IEnabledElement, operationData: unknown): any
  • Applies the active strategy function to the enabled element with the specified operation data.


    Parameters

    • enabledElement: IEnabledElement

      The element that is being operated on.

    • operationData: unknown

      The data that needs to be passed to the strategy.

    Returns any

    The result of the strategy.

publicapplyActiveStrategyCallback

  • applyActiveStrategyCallback(enabledElement: IEnabledElement, operationData: unknown, callbackType: string): any
  • Applies the active strategy, with a given event type being applied. The event type function is found by indexing it on the active strategy function.


    Parameters

    • enabledElement: IEnabledElement

      The element that is being operated on.

    • operationData: unknown

      The data that needs to be passed to the strategy.

    • callbackType: string

      the type of the callback

    Returns any

    The result of the strategy.

publicgetToolName

  • getToolName(): string
  • Returns the name of the tool


    Returns string

    The name of the tool.

mouseMoveCallback

  • mouseMoveCallback(evt: InteractionEventType): void
  • Parameters

    • evt: InteractionEventType

    Returns void

preMouseDownCallback

  • preMouseDownCallback(evt: InteractionEventType): boolean
  • Parameters

    • evt: InteractionEventType

    Returns boolean

registerShapes

  • registerShapes<T>(shapeName: string, shapeClass: new () => T): void
  • Register different tool shapes for sculptor tool


    Type parameters

    Parameters

    • shapeName: string

      name of shape

    • shapeClass: new () => T

      shape class

    Returns void

renderAnnotation

  • Renders the cursor annotation on screen so that the user can choose the annotation size.


    Parameters

    Returns void

publicsetActiveStrategy

  • setActiveStrategy(strategyName: string): void
  • Sets the active strategy for a tool. Strategies are multiple implementations of tool behavior that can be switched by tool configuration.


    Parameters

    • strategyName: string

      name of the strategy to be set as active

    Returns void

publicsetConfiguration

  • setConfiguration(newConfiguration: Record<string, any>): void
  • merges the new configuration with the tool configuration


    Parameters

    • newConfiguration: Record<string, any>

    Returns void

publicsetToolShape

  • setToolShape(toolShape: string): void
  • Sets the tool shape to the specified tool


    Parameters

    • toolShape: string

    Returns void