# Missing (not found) function/object

**URL:** https://discourse.vtk.org/t/missing-not-found-function-object/5022
**Category:** Support
**Created:** [January 15, 2021, 10:10pm UTC](https://discourse.vtk.org/t/missing-not-found-function-object/5022 "2021-01-15T22:10:00Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Luis\_Carlos\_Carneiro](https://discourse.vtk.org/user_avatar/discourse.vtk.org/luis_carlos_carneiro/32/1360_2.png) [@Luis\_Carlos\_Carneiro](https://discourse.vtk.org/u/Luis_Carlos_Carneiro)
#### Post date: [January 15, 2021, 10:10pm UTC](https://discourse.vtk.org/t/missing-not-found-function-object/5022/1 "2021-01-15T22:10:00Z")

</div>

Dear All,

Where is defined “onRemoteMouseEvent” in

model.interactorStyle.onRemoteMouseEvent((e) =\> {

in

…node\_modules\vtk.js\Sources\Rendering\Misc\RemoteView\index.js

Thanks,

Luís Gonçalves

---

<div class="post-metadata">

### Author: ![Sebastien\_Jourdain](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sebastien_jourdain/32/100_2.png) [@Sebastien\_Jourdain](https://discourse.vtk.org/u/Sebastien_Jourdain)
#### Post date: [January 16, 2021, 12:24am UTC](https://discourse.vtk.org/t/missing-not-found-function-object/5022/2 "2021-01-16T00:24:00Z")

</div>

```auto
const remoteView = vtkRemoteView.newInstance();
const interactorStyle = remoteView.getInteractorStyle();
interactorStyle.onRemoteMouseEvent((e) => {
   console.log('event', e);
});

```

But if you are wondering where the method gets created, it is happening [here](https://github.com/Kitware/vtk-js/blob/master/Sources/Interaction/Style/InteractorStyleRemoteMouse/index.js#L309)

---

<div class="post-metadata">

### Author: ![Luis\_Carlos\_Carneiro](https://discourse.vtk.org/user_avatar/discourse.vtk.org/luis_carlos_carneiro/32/1360_2.png) [@Luis\_Carlos\_Carneiro](https://discourse.vtk.org/u/Luis_Carlos_Carneiro)
#### Post date: [January 16, 2021, 1:13pm UTC](https://discourse.vtk.org/t/missing-not-found-function-object/5022/3 "2021-01-16T13:13:59Z")

</div>

Perhaps I am too green in Javascript.

Result of the following command in Windows:  
findstr /s onRemote _._ \>\> …\lu99.txt

* * *

Sources/Rendering/Misc/RemoteView/index.js: model.interactorStyle.onRemoteMouseEvent((e) =\> {  
Sources/Rendering/Misc/RemoteView/index.js: model.interactorStyle.onRemoteWheelEvent((e) =\> {  
Sources/Rendering/Misc/RemoteView/index.js: model.interactorStyle.onRemoteGestureEvent((e) =\> {  
dist/vtk-lite.js: …  
dist/vtk-lite.js.map: …  
dist/vtk.js: …  
dist/vtk.js.map: …

I suppose that vtk-lite.js and vtk.js are the transpilation from the sources. I renamed vtk-lite.js and vtk.js and noticed that them are not needed for the example.

Usually, there is needed, at least, two instances of onRemoteMouseEvent in the sources. Is onRemoteMouseEvent part of Javascript and not VTK?

---

<div class="post-metadata">

### Author: ![Sebastien\_Jourdain](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sebastien_jourdain/32/100_2.png) [@Sebastien\_Jourdain](https://discourse.vtk.org/u/Sebastien_Jourdain)
#### Post date: [January 17, 2021, 5:11pm UTC](https://discourse.vtk.org/t/missing-not-found-function-object/5022/4 "2021-01-17T17:11:06Z")

</div>

The example use the Sources rather than the transpiled version. In general, you should use those object by calling methods on them rather that changing the source code to change the defaults to match your needs. Especially since all that tuning can be achieved by method call inside your own code.

---

<div class="post-metadata">

### Author: ![Luis\_Carlos\_Carneiro](https://discourse.vtk.org/user_avatar/discourse.vtk.org/luis_carlos_carneiro/32/1360_2.png) [@Luis\_Carlos\_Carneiro](https://discourse.vtk.org/u/Luis_Carlos_Carneiro)
#### Post date: [January 17, 2021, 6:14pm UTC](https://discourse.vtk.org/t/missing-not-found-function-object/5022/5 "2021-01-17T18:14:02Z")

</div>

I achieved good results and I had to create a new rpc and then I had to change the Sources.

How to create a new rpc without changing the Sources? Perhaps in JavaScript in the code extending the Object.

You had used one for the wheel of the mouse but it was already created in the Sources. Initialized to “null” in the Sources.

Thanks,

Luís Gonçalves

---

<div class="post-metadata">

### Author: ![Sebastien\_Jourdain](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sebastien_jourdain/32/100_2.png) [@Sebastien\_Jourdain](https://discourse.vtk.org/u/Sebastien_Jourdain)
#### Post date: [January 18, 2021, 4:29pm UTC](https://discourse.vtk.org/t/missing-not-found-function-object/5022/6 "2021-01-18T16:29:35Z")

</div>

just use the same rpc name as the one used in the source and don’t register the default mouse handler.

---

<div class="post-metadata">

### Author: ![Sebastien\_Jourdain](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sebastien_jourdain/32/100_2.png) [@Sebastien\_Jourdain](https://discourse.vtk.org/u/Sebastien_Jourdain)
#### Post date: [January 18, 2021, 4:36pm UTC](https://discourse.vtk.org/t/missing-not-found-function-object/5022/7 "2021-01-18T16:36:55Z")

</div>

Or just call some method on the JS side to rename that rpc to match your name. Either way is fine, and won’t require you to change vtk.js source code.

---

<div class="post-metadata">

### Author: ![Luis\_Carlos\_Carneiro](https://discourse.vtk.org/user_avatar/discourse.vtk.org/luis_carlos_carneiro/32/1360_2.png) [@Luis\_Carlos\_Carneiro](https://discourse.vtk.org/u/Luis_Carlos_Carneiro)
#### Post date: [January 19, 2021, 6:08pm UTC](https://discourse.vtk.org/t/missing-not-found-function-object/5022/8 "2021-01-19T18:08:40Z")

</div>

Good evening (here),

I have this code in a handler in vtk\_protocol.py. picker.Pick(x, y, 0, renderer) is returning non zero (Ok).  
But “p” and “n” have empty values. 0\<x\<1 and 0\<y\<1.  
How I put working this Picking inside a “rpc” handler? What is wrong in the code below.

```
        global picker
        picker = vtk.vtkVolumePicker()
        picker.EnableOn()
        picker.SetTolerance(1e-6)
        picker.SetVolumeOpacityIsovalue(0.1)
        x=event["x"]
        y=event["y"]
        picker.Pick(x, y, 0, renderer)
        self.p = picker.GetPickPosition()
        self.n = picker.GetPickNormal()

```

Thanks,

Luís Gonçalves

---

<div class="post-metadata">

### Author: ![Sebastien\_Jourdain](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sebastien_jourdain/32/100_2.png) [@Sebastien\_Jourdain](https://discourse.vtk.org/u/Sebastien_Jourdain)
#### Post date: [January 19, 2021, 7:27pm UTC](https://discourse.vtk.org/t/missing-not-found-function-object/5022/10 "2021-01-19T19:27:35Z")

</div>

I bet the event[‘x’] (+y) are normalized and should be expanded like we do in the event handling method.

---

<div class="post-metadata">

### Author: ![Luis\_Carlos\_Carneiro](https://discourse.vtk.org/user_avatar/discourse.vtk.org/luis_carlos_carneiro/32/1360_2.png) [@Luis\_Carlos\_Carneiro](https://discourse.vtk.org/u/Luis_Carlos_Carneiro)
#### Post date: [January 19, 2021, 7:31pm UTC](https://discourse.vtk.org/t/missing-not-found-function-object/5022/11 "2021-01-19T19:31:56Z")

</div>

I already put (900x900 display window)

```
    x=event["x"]*900.0
    y=event["y"]*900.0

```

and GePickPosition stills do not return nothing.

---

<div class="post-metadata">

### Author: ![Sebastien\_Jourdain](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sebastien_jourdain/32/100_2.png) [@Sebastien\_Jourdain](https://discourse.vtk.org/u/Sebastien_Jourdain)
#### Post date: [January 19, 2021, 7:32pm UTC](https://discourse.vtk.org/t/missing-not-found-function-object/5022/12 "2021-01-19T19:32:38Z")

</div>

I don’t know then?

---

<div class="post-metadata">

### Author: ![Luis\_Carlos\_Carneiro](https://discourse.vtk.org/user_avatar/discourse.vtk.org/luis_carlos_carneiro/32/1360_2.png) [@Luis\_Carlos\_Carneiro](https://discourse.vtk.org/u/Luis_Carlos_Carneiro)
#### Post date: [January 22, 2021, 2:44pm UTC](https://discourse.vtk.org/t/missing-not-found-function-object/5022/13 "2021-01-22T14:44:15Z")

</div>

The code above still not works (with the Pick). Must be some Interactor active? I do not use any interactor in the handler.

---

<div class="post-metadata">

### Author: ![Sebastien\_Jourdain](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sebastien_jourdain/32/100_2.png) [@Sebastien\_Jourdain](https://discourse.vtk.org/u/Sebastien_Jourdain)
#### Post date: [January 22, 2021, 4:22pm UTC](https://discourse.vtk.org/t/missing-not-found-function-object/5022/14 "2021-01-22T16:22:31Z")

</div>

Without more information I can not help.

---

<div class="post-metadata">

### Author: ![Sebastien\_Jourdain](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sebastien_jourdain/32/100_2.png) [@Sebastien\_Jourdain](https://discourse.vtk.org/u/Sebastien_Jourdain)
#### Post date: [January 22, 2021, 5:04pm UTC](https://discourse.vtk.org/t/missing-not-found-function-object/5022/15 "2021-01-22T17:04:09Z")

</div>

Even with your code, I still don’t know.

---

<div class="post-metadata">

### Author: ![Sebastien\_Jourdain](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sebastien_jourdain/32/100_2.png) [@Sebastien\_Jourdain](https://discourse.vtk.org/u/Sebastien_Jourdain)
#### Post date: [January 22, 2021, 5:36pm UTC](https://discourse.vtk.org/t/missing-not-found-function-object/5022/16 "2021-01-22T17:36:01Z")

</div>

Get a working C++ or Python VTK code and then, move it to the web. It seems that you don’t have that part working.  
The web does not seems to be in fault so far even if the path you took to get the event to the server side is sub-optimal, it is still working…

---

<div class="post-metadata">

### Author: ![Luis\_Carlos\_Carneiro](https://discourse.vtk.org/user_avatar/discourse.vtk.org/luis_carlos_carneiro/32/1360_2.png) [@Luis\_Carlos\_Carneiro](https://discourse.vtk.org/u/Luis_Carlos_Carneiro)
#### Post date: [January 26, 2021, 12:29pm UTC](https://discourse.vtk.org/t/missing-not-found-function-object/5022/17 "2021-01-26T12:29:43Z")

</div>

How can I disable the mouse cursor?

I tried HideCursor in the server side (all the places) without success and I do not find any place in client side to do that. I tried in “style.css” files of the examples with “cursor: none;”.  
Must I change “vtk.js” code?

---

<div class="post-metadata">

### Author: ![Sebastien\_Jourdain](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sebastien_jourdain/32/100_2.png) [@Sebastien\_Jourdain](https://discourse.vtk.org/u/Sebastien_Jourdain)
#### Post date: [January 26, 2021, 3:31pm UTC](https://discourse.vtk.org/t/missing-not-found-function-object/5022/18 "2021-01-26T15:31:42Z")

</div>

You don’t need to change anything in vtk.js (even for what you already did).  
You can indeed use `cursor: none` in a css but you need to apply it correctly and to the correct DOM element.

---

<div class="post-metadata">

### Author: ![Luis\_Carlos\_Carneiro](https://discourse.vtk.org/user_avatar/discourse.vtk.org/luis_carlos_carneiro/32/1360_2.png) [@Luis\_Carlos\_Carneiro](https://discourse.vtk.org/u/Luis_Carlos_Carneiro)
#### Post date: [February 2, 2021, 4:13pm UTC](https://discourse.vtk.org/t/missing-not-found-function-object/5022/19 "2021-02-02T16:13:54Z")

</div>

Dear All,

I managed to make a successful handler for the key pressed like is done for the mouse. I had to copy createRemoteEvent() function to createRemoteEvent2() and code.

But I have the following problem. Appears the following message in the console of the Firefox when I start “localhost:1234” and not when I press a key.

 ![image](https://discourse.vtk.org/uploads/default/original/2X/3/3e96f78759f51d52fd131ca9a759bd0a7e0643da.png)

How can I solve this problem?

Thanks,

Luís Gonçalves

---

<div class="post-metadata">

### Author: ![Sebastien\_Jourdain](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sebastien_jourdain/32/100_2.png) [@Sebastien\_Jourdain](https://discourse.vtk.org/u/Sebastien_Jourdain)
#### Post date: [February 2, 2021, 4:21pm UTC](https://discourse.vtk.org/t/missing-not-found-function-object/5022/20 "2021-02-02T16:21:05Z")

</div>

This is an expected error when not using a launcher.

---

<div class="post-metadata">

### Author: ![Luis\_Carlos\_Carneiro](https://discourse.vtk.org/user_avatar/discourse.vtk.org/luis_carlos_carneiro/32/1360_2.png) [@Luis\_Carlos\_Carneiro](https://discourse.vtk.org/u/Luis_Carlos_Carneiro)
#### Post date: [February 2, 2021, 4:22pm UTC](https://discourse.vtk.org/t/missing-not-found-function-object/5022/21 "2021-02-02T16:22:42Z")

</div>

Are you saying that it is normal?

Can you please explain in more detail?

[Next page](https://discourse.vtk.org/t/missing-not-found-function-object/5022.md?page=2)
