繁体   English   中英

3D PDF acrobat javascript

[英]3D PDF acrobat javascript

我正在使用acrobat js更改3D注释上的默认鼠标行为。 我已经定义了六个主要视图,并且我希望用户仅从这些视图中查看模型。 应该禁用使用鼠标进行模型的默认翻滚。 我希望用户仍然能够使用3D注释工具栏提供的其他功能。

我想停止传播鼠标事件,所以这是我尝试过的

myAnnotsQ13D = getAnnots3D(0)[0];
if(myAnnotsQ13D.activated){

  c3D = myAnnotsQ13D.context3D;
  mouseEventHandler = c3D.MouseEventHandler();
  mouseEventHandler.onMouseDown = true;
  mouseEventHandler.onMouseMove = true;
  mouseEventHandler.onMouseUp = true;

  mouseEventHandler.onEvent = function(event){
    event.stopAllDispatch = true;
  }
  c3D.runtime.addEventHandler( mouseEventHandler );
}

该代码似乎没有任何作用。 我仍然可以使用鼠标旋转模型。 有什么建议么?

得到了linkedin 3DPDF论坛的答案,像个魅力

myAnnotsQ13D = getAnnots3D(0)[0];
if(myAnnotsQ13D.activated){

  c3D = myAnnotsQ13D.context3D;
  c3D.runtime.overrideRotateTool = true; // add these two lines to disable mouse tumbling
  c3D.runtime.overrideSpinTool   = true;

  mouseEventHandler = c3D.MouseEventHandler();
  mouseEventHandler.onMouseDown = false;
  mouseEventHandler.onMouseMove = false;
  mouseEventHandler.onMouseUp   = true

  mouseEventHandler.onEvent = function(event){
     var field = getField("NoOfClicksIM");
     field.value = ++noOfClicksIM;
  }
  c3D.runtime.addEventHandler( mouseEventHandler );
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM