Request

Response

    Core

    Autodesk.Viewing.ToolInterface

    new ToolInterface()

    Base class for new interaction tools.

    Can also be used simply as a template for creating a new tool.


    Methods

    activate(name,viewerApi)

    The activate method is called by the ToolController when it adds this tool to the list of those to receive event handling calls. Once activated, a tool’s “handle*” methods may be called if no other higher priority tool handles the given event. Each active tool’s “update” method also gets called once during each redraw loop.

    Parameters

    name*
    string
    The name under which the tool has been activated.
    viewerApi*Viewer instance.
    * Required

    deactivate(name)

    The deactivate method is called by the ToolController when it removes this tool from the list of those to receive event handling calls. Once deactivated, a tool’s “handle*” methods and “update” method will no longer be called.

    Parameters

    name*
    string
    The name under which the tool has been deactivated.
    * Required

    deregister()

    This method is called by deregisterTool. Use this to clean up your tool.

    getName()

    This is an optional convenience method to obtain the first name of this tool.

    Returns

    TypeDescription
    string The tools default name.

    getNames()

    This method should return an array containing the names of all tools implemented by this class. Often this would be a single name but it is possible to support multiple interactions with a single tool. When this tool is registered with the ToolController each name gets registered as an available tool.

    Returns

    TypeDescription
    array Array of strings. Should not be empty.

    handleBlur(event)

    This method is called when the canvas area loses focus.

    Parameters

    event*
    FocusEvent
    The event object that triggered this call.
    * Required

    Returns

    TypeDescription
    boolean True if this tool wishes to consume the event and false to continue to pass the event to lower priority active tools.

    handleButtonDown(event,button)

    This method is called when a mouse button is depressed.

    Parameters

    event*
    MouseEvent
    The event object that triggered this call.
    button*
    Number
    The button number that was depressed (0, 1, 2 for Left, Middle, Right respectively). Note that the button parameter value may be different that the button value indicated in the event object due to button re-mapping preferences that may be applied. This value should be respected over the value in the event object.
    * Required

    Returns

    TypeDescription
    boolean True if this tool wishes to consume the event and false to continue to pass the event to lower priority active tools.

    handleButtonUp(event,button)

    This method is called when a mouse button is released.

    Parameters

    event*
    MouseEvent
    The event object that triggered this call.
    button*
    number
    The button number that was released (0, 1, 2 for Left, Middle, Right respectively). Note that the button parameter value may be different that the button value indicated in the event object due to button re-mapping preferences that may be applied. This value should be respected over the value in the event object.
    * Required

    Returns

    TypeDescription
    boolean True if this tool wishes to consume the event and false to continue to pass the event to lower priority active tools.

    handleDoubleClick(event,button)

    This method is called when a double mouse button click occurs.

    Parameters

    event*
    MouseEvent
    The event object that triggered this call.
    button*
    number
    The button number that was clicked (0, 1, 2 for Left, Middle, Right respectively). Note that the button parameter value may be different that the button value indicated in the event object due to button re-mapping preferences that may be applied. This value should be respected over the value in the event object.
    * Required

    Returns

    TypeDescription
    boolean True if this tool wishes to consume the event and false to continue to pass the event to lower priority active tools.

    handleDoubleTap(event)

    This method is called when a double tap on a touch device occurs.

    Parameters

    event*
    Event
    The triggering event. For tap events the canvasX, canvasY properties contain the canvas relative device coordinates of the tap and the normalizedX, normalizedY properties contain the tap coordinates in the normalized [-1, 1] range. The event.pointers array will contain either one or two touch events depending on whether the tap used one or two fingers.
    * Required

    Returns

    TypeDescription
    boolean True if this tool wishes to consume the event and false to continue to pass the event to lower priority active tools.

    handleGesture(event)

    This method is called when a touch gesture event occurs.

    Parameters

    event*
    Event
    The event object that triggered this call. The event.type attribute will indicate the gesture event type. This will be one of: dragstart, dragmove, dragend, panstart, panmove, panend, pinchstart, pinchmove, pinchend, rotatestart, rotatemove, rotateend, drag3start, drag3move, drag3end. The event.canvas[XY] attributes will contain the coresponding touch position. The event.scale and event.rotation attributes contain pinch scaling and two finger rotation quantities respectively. The deltaX and deltaY attributes will contain drag offsets.
    * Required

    Returns

    TypeDescription
    boolean True if this tool wishes to consume the event and false to continue to pass the event to lower priority active tools.

    handleKeyDown(event,keyCode)

    This method is called when a keyboard button is depressed.

    Parameters

    event*
    KeyboardEvent
    The event object that triggered this call.
    keyCode*
    number
    The numerical key code identifying the key that was depressed. Note that the keyCode parameter value may be different that the value indicated in the event object due to key re-mapping preferences that may be applied. This value should be respected over the value in the event object.
    * Required

    Returns

    TypeDescription
    boolean True if this tool wishes to consume the event and false to continue to pass the event to lower priority active tools.

    handleKeyUp(event,keyCode)

    This method is called when a keyboard button is released.

    Parameters

    event*
    KeyboardEvent
    The event object that triggered this call.
    keyCode*
    number
    The numerical key code identifying the key that was released. Note that the keyCode parameter value may be different that the value indicated in the event object due to key re-mapping preferences that may be applied. This value should be respected over the value in the event object.
    * Required

    Returns

    TypeDescription
    boolean True if this tool wishes to consume the event and false to continue to pass the event to lower priority active tools.

    handleMouseMove(event)

    This method is called when a mouse motion event occurs.

    Parameters

    event*
    MouseEvent
    The event object that triggered this call.
    * Required

    Returns

    TypeDescription
    boolean True if this tool wishes to consume the event and false to continue to pass the event to lower priority active tools.

    handleResize()

    This method is called on every active tool whenever the screen area changes. The new canvas area can be obtained from the Navigation interface via the getScreenViewport method.

    See

    handleSingleClick(event,button)

    This method is called when a single mouse button click occurs.

    Parameters

    event*
    MouseEvent
    The event object that triggered this call.
    button*
    number
    The button number that was clicked (0, 1, 2 for Left, Middle, Right respectively). Note that the button parameter value may be different that the button value indicated in the event object due to button re-mapping preferences that may be applied. This value should be respected over the value in the event object.
    * Required

    Returns

    TypeDescription
    boolean True if this tool wishes to consume the event and false to continue to pass the event to lower priority active tools.

    handleSingleTap(event)

    This method is called when a single tap on a touch device occurs.

    Parameters

    event*
    Event
    The triggering event. For tap events the canvasX, canvasY properties contain the canvas relative device coordinates of the tap and the normalizedX, normalizedY properties contain the tap coordinates in the normalized [-1, 1] range. The event.pointers array will contain either one or two touch events depending on whether the tap used one or two fingers.
    * Required

    Returns

    TypeDescription
    boolean True if this tool wishes to consume the event and false to continue to pass the event to lower priority active tools.

    handleWheelInput(delta)

    This method is called when a mouse wheel event occurs.

    Parameters

    delta*
    number
    A numerical value indicating the amount of wheel motion applied. Note that this value may be modified from the orignal event values so as to provide consistent results across browser families.
    * Required

    Returns

    TypeDescription
    boolean True if this tool wishes to consume the event and false to continue to pass the event to lower priority active tools.

    register()

    This method is called by registerTool. Use this for initialization.

    update(highResTimestamp)

    The update method is called by the ToolController once per frame and provides each tool with the oportunity to make modifications to the scene or the view.

    Parameters

    highResTimestamp*
    number
    The process timestamp passed to requestAnimationFrame by the web browser.
    * Required

    Returns

    TypeDescription
    boolean A state value indicating whether the tool has modified the view or the scene and a full refresh is 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 2