none
Javascript callback functions

Answers

  • The control has several callbacks you can set after creation:

     

    hdv = new hdvHost("hdvControl", "hdvDiv", "100%", "100%", top.location.href, args);

    hdv.setProperty("onRotate", onRotateEvent);

    hdv.setProperty("onTranslate", onTranslateEvent);

    hdv.setProperty("onPanMode", onPanModeEvent);

    hdv.setProperty("onToneMode", onToneModeEvent);

    hdv.setProperty("onProjMode", onProjModeEvent);

     

    And here's an example of using the callback parameters:

     

    function onRotateEvent(f,y,p)

    {

    var ViewForm = document.getElementById("ViewForm");

    ViewForm.FOVBox.value = Math.round(f);

    ViewForm.YawBox.value = Math.round(y);

    ViewForm.PitchBox.value = Math.round(p);

    }

    function onTranslateEvent(z,x,y)

    {

    var ViewForm = document.getElementById("ViewForm");

    ViewForm.ZoomBox.value = Math.round(z * 100) / 100;

    ViewForm.XCtrBox.value = Math.round(x * 100) / 100;

    ViewForm.YCtrBox.value = Math.round(y * 100) / 100;

    }

    function onPanModeEvent(n)

    {

    var ViewForm = document.getElementById("ViewForm");

    ViewForm.PanModeBox.value = n;

    }

    function onToneModeEvent(n)

    {

    var ViewForm = document.getElementById("ViewForm");

    ViewForm.ToneModeBox.value = n;

    }

    function onProjModeEvent(n)

    {

    var ViewForm = document.getElementById("ViewForm");

    ViewForm.ProjModeBox.value = n;

    }

     

    Thursday, October 09, 2008 5:36 AM

All replies

  • The control has several callbacks you can set after creation:

     

    hdv = new hdvHost("hdvControl", "hdvDiv", "100%", "100%", top.location.href, args);

    hdv.setProperty("onRotate", onRotateEvent);

    hdv.setProperty("onTranslate", onTranslateEvent);

    hdv.setProperty("onPanMode", onPanModeEvent);

    hdv.setProperty("onToneMode", onToneModeEvent);

    hdv.setProperty("onProjMode", onProjModeEvent);

     

    And here's an example of using the callback parameters:

     

    function onRotateEvent(f,y,p)

    {

    var ViewForm = document.getElementById("ViewForm");

    ViewForm.FOVBox.value = Math.round(f);

    ViewForm.YawBox.value = Math.round(y);

    ViewForm.PitchBox.value = Math.round(p);

    }

    function onTranslateEvent(z,x,y)

    {

    var ViewForm = document.getElementById("ViewForm");

    ViewForm.ZoomBox.value = Math.round(z * 100) / 100;

    ViewForm.XCtrBox.value = Math.round(x * 100) / 100;

    ViewForm.YCtrBox.value = Math.round(y * 100) / 100;

    }

    function onPanModeEvent(n)

    {

    var ViewForm = document.getElementById("ViewForm");

    ViewForm.PanModeBox.value = n;

    }

    function onToneModeEvent(n)

    {

    var ViewForm = document.getElementById("ViewForm");

    ViewForm.ToneModeBox.value = n;

    }

    function onProjModeEvent(n)

    {

    var ViewForm = document.getElementById("ViewForm");

    ViewForm.ProjModeBox.value = n;

    }

     

    Thursday, October 09, 2008 5:36 AM
  • onTranslateEvent(z,x,y)
    Called ....... every time the translation is changed by the UI.

    what mmens translation?
    can you explain please
    Thursday, October 09, 2008 11:21 AM