Request

Response

    Core

    Autodesk.Viewing.ToolController

    new ToolController(viewerImpl,viewerApi,autocam,utilities,defaultHandler)

    Core interface to add and remove canvas interactions to the viewer.

    This class is created internally by the Viewer api and is available via the “toolController” property of the Viewer3D api object. Client implementations should not normally instantiate this class directly.

    Parameters

    viewerImpl*
    Object
    The viewer implementation object.
    viewerApi*
    Object
    The viewer api object.
    autocam*
    Object
    The Autocam interface object.
    utilities*
    Object
    The ViewingUtilities object.
    defaultHandler*
    Object
    The default event handling tool.
    * Required

    Methods

    activateTool(toolName)

    Activates the tool registered under the given name. Activation implies pushing the tool on a stack of “active” tools, each of which (starting from the top of the stack) is given the opportunity to handle incoming events. Tools may “consume” events by returning true from their event handling methods, or they may allow events to be passed down to the next tool on the stack by returning false from the handling methods. Upon activation the tools “activate” method is called with the name under which it has been activated. Activation is not allowed while the controller is in a “locked” state (see the methods “setIsLocked” and “getIsLocked”). Tools must be registered prior to activation (see the methods “registerTool” and “deregisterTool”).

    Parameters

    toolName*
    string
    The name of the tool to be activated.
    * Required

    Returns

    TypeDescription
    boolean True if activation was successful.

    deactivateTool(toolName)

    The first tool found on the active stack with the given name is removed and its “deactivate” method is called. Once deactivated the tool will no longer receive events via its handler methods. Deactivation is not allowed while the controller is in a “locked” state (see the methods “setIsLocked” and “getIsLocked”).

    Parameters

    toolName*
    string
    The name of the tool to be deactivated.
    * Required

    Returns

    TypeDescription
    boolean True if deactivation was successful.

    deregisterTool(tool)

    This method deregisters an event handling tool with the controller afterwhich it will no longer be available for activation and deactivation. All names that the tool is registered under will be deregistered. If any tool is active at the time of deregistration will first be deactivated and it’s “deactivate” method will be called.

    Parameters

    tool*
    object
    The tool to be deregistered.
    * Required

    getActiveTool()

    This method returns the name of the topmost tool on the tool stack. If no tools are active the name of the default tool is returned (which is “default”).

    Returns

    TypeDescription
    string The tool name to look up.

    getActiveToolName()

    This method returns the name of the topmost tool on the tool stack. If no tools are active the name of the default tool is returned (which is “default”).

    Returns

    TypeDescription
    string The tool name to look up.

    getDefaultTool()

    Get the tool which handle events if no other active tool handles them.

    Returns

    TypeDescription
    object The tool to be registered as the default.

    getIsLocked()

    Get the current state of the controller lock.

    Returns

    TypeDescription
    boolean The state of the lock.

    getTool(name)

    This method returns the tool registered under the given name.

    Parameters

    name*
    string
    The tool name to look up.
    * Required

    Returns

    TypeDescription
    object The tool registered under the given name or undefined if not found.

    getToolNames()

    Obtain a list of all the currently registered tool names.

    Returns

    TypeDescription
    array List of all registered tool names.

    registerTool(tool)

    This method registers an event handling tool with the controller. This makes the tool available for activation and deactivation. Tools are registered under one or more names which must be provided via their “getNames” method. The tools “getNames” method must return an array of one or more names. Typically a tool will only have one name but if it wishes to operate in different modes it can use different names to activate the modes. Registered tools have the properties named “utilities” and “controller” added to them which refer to the ViewingUtilities object and this controller respectively. Tools may not use the name “default” which is reserved.

    Parameters

    tool*
    object
    The tool to be registered.
    * Required

    setDefaultTool(tool)

    Set the tool which will be requested to handle events if no other active tool handles them.

    Parameters

    tool*
    object
    The tool to be registered as the default.
    * Required

    setIsLocked(state)

    Set the controller into a locked or unlocked state. While locked, tool activation and deactivation is not allowed. Locking the controller is sometimes necessary to force an interaction to remain active until it is fully completed.

    Parameters

    state*
    boolean
    The state of the controller lock.
    * Required

    Returns

    TypeDescription
    boolean The previous state of the lock (this may be used to restore the lock to it’s previous state).

    setMouseWheelInputEnabled(isEnabled)

    Whether mouse scroll wheel (and/or two-finger vertical swipe) will trigger a camera zoom operation.

    Parameters

    isEnabled*
    boolean
    * Required
     
    ______
    icon-svg-close-thick

    Cookie preferences

    Your privacy is important to us and so is an optimal experience. To help us customize information and build applications, we collect data about your use of this site.

    May we collect and use your data?

    Learn more about the Third Party Services we use and our Privacy Statement.

    Strictly necessary – required for our site to work and to provide services to you

    These cookies allow us to record your preferences or login information, respond to your requests or fulfill items in your shopping cart.

    Improve your experience – allows us to show you what is relevant to you

    These cookies enable us to provide enhanced functionality and personalization. They may be set by us or by third party providers whose services we use to deliver information and experiences tailored to you. If you do not allow these cookies, some or all of these services may not be available for you.

    Customize your advertising – permits us to offer targeted advertising to you

    These cookies collect data about you based on your activities and interests in order to show you relevant ads and to track effectiveness. By collecting this data, the ads you see will be more tailored to your interests. If you do not allow these cookies, you will experience less targeted advertising.

    icon-svg-close-thick

    THIRD PARTY SERVICES

    Learn more about the Third-Party Services we use in each category, and how we use the data we collect from you online.

    icon-svg-hide-thick

    icon-svg-show-thick

    Strictly necessary – required for our site to work and to provide services to you

    Qualtrics
    W
    Akamai mPulse
    W
    Digital River
    W
    Dynatrace
    W
    Khoros
    W
    Launch Darkly
    W
    New Relic
    W
    Salesforce Live Agent
    W
    Wistia
    W
    Tealium
    W
    Upsellit
    W
    CJ Affiliates
    W
    Commission Factory
    W
    Google Analytics (Strictly Necessary)
    W
    Typepad Stats
    W
    Geo Targetly
    W
    SpeedCurve
    W
    Qualified
    #

    icon-svg-hide-thick

    icon-svg-show-thick

    Improve your experience – allows us to show you what is relevant to you

    Google Optimize
    W
    ClickTale
    W
    OneSignal
    W
    Optimizely
    W
    Amplitude
    W
    Snowplow
    W
    UserVoice
    W
    Clearbit
    #
    YouTube
    #

    icon-svg-hide-thick

    icon-svg-show-thick

    Customize your advertising – permits us to offer targeted advertising to you

    Adobe Analytics
    W
    Google Analytics (Web Analytics)
    W
    AdWords
    W
    Marketo
    W
    Doubleclick
    W
    HubSpot
    W
    Twitter
    W
    Facebook
    W
    LinkedIn
    W
    Yahoo! Japan
    W
    Naver
    W
    Quantcast
    W
    Call Tracking
    W
    Wunderkind
    W
    ADC Media
    W
    AgrantSEM
    W
    Bidtellect
    W
    Bing
    W
    G2Crowd
    W
    NMPI Display
    W
    VK
    W
    Adobe Target
    W
    Google Analytics (Advertising)
    W
    Trendkite
    W
    Hotjar
    W
    6 Sense
    W
    Terminus
    W
    StackAdapt
    W
    The Trade Desk
    W
    RollWorks
    W

    Are you sure you want a less customized experience?

    We can access your data only if you select "yes" for the categories on the previous screen. This lets us tailor our marketing so that it's more relevant for you. You can change your settings at any time by visiting our privacy statement

    Your experience. Your choice.

    We care about your privacy. The data we collect helps us understand how you use our products, what information you might be interested in, and what we can improve to make your engagement with Autodesk more rewarding.

    May we collect and use your data to tailor your experience?

    Explore the benefits of a customized experience by managing your privacy settings for this site or visit our Privacy Statement to learn more about your options.
    Version 5