Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get Object data of Selected Shape #954

Closed
spadavec opened this issue Jan 3, 2023 · 1 comment
Closed

Get Object data of Selected Shape #954

spadavec opened this issue Jan 3, 2023 · 1 comment

Comments

@spadavec
Copy link

spadavec commented Jan 3, 2023

I have a stage with a protein and a number of shapes in it. I would like to be able to select the shapes and change their representation (e.g. wireframe --> solid, or something similar) on click.

I've tried the following:

stage.mouseObserver.signals.clicked.add(function (pickingProxy) {
 console.log(pickingProxy)
});

This only seems to return the x/y coordinates of the canvas selection point. How would I select a shape in the viewer and get the underlying object data?

@spadavec spadavec changed the title Get Object ID of Selected Shape Get Object data of Selected Shape Jan 3, 2023
@spadavec
Copy link
Author

spadavec commented Jan 3, 2023

Ok, so it appears that

        stage.signals.clicked.add(function (proxy_function) {
          console.log(proxy_function);
        });

Returns an object that contains pid, which lord as my witness, is the index of the array of objects in the canvas/viewer, which can be retrieved via pid.

@spadavec spadavec closed this as completed Jan 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant